Commit Graph

10072 Commits

Author SHA1 Message Date
Augustin Cavalier 6b99b20692 telnet: Synchronize with FreeBSD 13.3. 2024-05-28 16:23:27 -04:00
Trung Nguyen 1834e12564 headers/bsd: Remove Haiku-specific include deps
Remove the `ByteOrder.h` and `SupportDefs.h` Haiku-specific headers
from `bsd/endian.h` on GCC >= 4 and replace them with compiler builtins.

This prevents some unwanted symbols like `type_code` causing name
clashes in ported applications.

Change-Id: Id88791ea5954c260f4e7f5e82a564f3ae6bafe69
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7642
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-05-27 22:05:09 +00:00
Daniel Martin 370dde2255 CPUID returns CPU Features in EDX and extended features in ECX
No functional changes

Change-Id: I98a9e5c9658a5464ba6fa71bc5d2c5d646a57ab1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7672
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-05-17 17:25:26 +00:00
Murai Takashi ddbb992956 file_systems/QueryParser.h: Fix -Werror=maybe-uninitialized
Fix fPosition and fTerm not being initialized when expr is NULL
at line 1162.
Pointed out by GCC14.

Change-Id: If883ac0cc32e3418d0e3b49b42012efd861d65f4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7641
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-05-08 16:08:05 +00:00
PulkoMandy 7d5b913b51 BCatalog: declare GetString as format_printf function
This tells the compiler that this function takes a format string as a
parameter, and returns a "similar" string with the same formatting
operations. This allows the format string to "propagate" to prinf-file
functions (including BString::SetToFormat) and the format string to be
actually checked with the arguments passed to that function.

Without this, all translated strings were not checked to match with
their arguments.

Change-Id: I5c3c5cbfe7dfede9a6f45cad47a7524f9138fac0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7663
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-05-03 16:38:23 +00:00
Jérôme Duval f758e73fe6 libbsd: add pthread_sigqueue()
* like sigqueue() but for threads. was added recently to FreeBSD, long before to glibc.
* also include features.h in gnu/pthread.h

Change-Id: I73bca666e2c67d7ff05f341bf85d71df9ccccbe5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7659
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-05-02 18:07:23 +00:00
Augustin Cavalier bb83316a58 L2CAP: Major refactor of the whole component.
(And surrounding portions of the "btCoreData" module.)

 * Rewrote the main "l2cap.h" header representing protocol constants
   and structures. Now conforms to general Haiku naming conventions
   rather than BSD ones. Some more constants added/removed based
   on the most recent Bluetooth specification.

 * Rewrote all code derived from the BSDs to match Haiku conventions
   and structures in the driver.

 * Dropped the "channel" and "frame" structures from "btCoreData".
   Channels are now managed by L2capEndpoints, and "frames" are
   now just plain net_buffers without surrounding structures.
   This also makes state management much simpler.

 * Made it so that actual net_buffers are passed through to the
   l2cap_receive function rather than another data structure.
   A fake interface address is used to communicate connection
   information. (This probably ought to be changed, though.)

 * Get rid of l2cap_lower and l2cap_upper abstractions.
   Everything related to channel/endpoint management is now
   done in L2capEndpoint, while buffer reception is handled
   directly in l2cap_receive and elsewhere, same as other drivers.

 * Wire up more hooks and fix module flags (needed to be able to
   get the module loaded and opening sockets at all.)

 * Implement an actual locking strategy in L2capEndpoint
   and HciConnection. There's still problems with lifetime
   management, but at least thread-safety is mostly handled.

 * Create an L2capEndpointManager and use it to manage
   the endpoints, rather than having a single (unsafe)
   linked-list.

And plenty of other refactorings and cleanups besides.
There's still more to be done for Bluetooth overall, though:

 * The "btCoreData" and "hci" modules also badly need a major
   overhaul, and should be merged into a single "bluetooth"
   bus_manager. They also shouldn't be passing around pointers
   to other modules like this.

 * There's a number of TODOs/FIXMEs in the L2CAP module, most
   notably around timeouts (especially command timeouts) and
   parameter validation/specification.

Tested by myself with kallisti5's help. Incoming connections
(on the PSM for SDP) get all the way to the latter half
of the Configuration step before hanging.
2024-05-01 00:25:43 -04:00
Augustin Cavalier fd38d7d4c3 btDebug: Fix duplicate "bt: " in CALLED entries. 2024-04-26 16:21:19 -04:00
Augustin Cavalier b9209765f9 NetBufferUtilities: Add NetBufferDeleter.
As the name implies, it's an AutoDeleter for NetBuffers.
2024-04-26 16:21:19 -04:00
Augustin Cavalier d3192e1006 kernel/util: Adjust includes of VectorMap.
This way it can be included even if "util" isn't in the header search
path.
2024-04-26 16:21:19 -04:00
PulkoMandy fe640d9339 pcmcia: fix compilation warnings and errors
Needed for the echo indigo soundcard driver build.

IRQ is used as a field name in pmcia/cs.h. The IRQ() macro should only
be used with parameters. So we can avoid the use of IRQ in cs.h being
accidentally replaced by the macro.

Change-Id: Ib10f3c5148cfb7c87a0b258a95a590778b6e5cb4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7608
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-04-15 16:02:49 +00:00
Alexander von Gluck c237c4ce59 finddir: Add SYSTEM_DESKBAR_DIRECTORY
* Resolves #18883

Change-Id: Ib971272319d55b37fa06d6874f257c8080bdab8f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7611
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: nephele nephele <nep-git@packageloss.eu>
Reviewed-by: Alexander von Gluck <alex@terarocket.io>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-04-13 14:03:35 +00:00
Augustin Cavalier 979a0bc487 Appearance: Hide most colors by default and compute them automatically.
In the new "automatic" mode, the number of displayed colors
is just 3, as opposed to the full 38. Much more manageable!

The HSL routines added in this commit were derived from
https://gist.github.com/ciembor/1494530 which is itself derived
from the Wikipedia page describing HSL/HSV.

Part of #15543 and #11636.

Change-Id: I230a358d18c379fb0673162e0b3cbdb8d1b8d84e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7479
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-04-11 17:38:45 +00:00
Diego Roux 96e8469863 [GSoC '24]: wip: virtio_audio: initial basic driver.
This commit in no form is intended to provide a working/functional
driver, but rather as a starting base and minimal code contribution
for GSoC.

This driver can only identify if the current device is a Sound
VirtIO device.

Change-Id: I718bb87c768dd84ff2be77a14e839f94955671fc
Signed-off-by: Diego Roux <diegoroux04@protonmail.com>
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7557
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-04-05 09:04:51 +00:00
Emir SARI 058be77bec BColumnListView: use automatic formatting for i18n
Use BDateTimeFormat, BDateFormat, and BNumberFormat for
various date, time, decimal, and percent formatting.

Change-Id: I994563d207db8bd28342ca6543b69a356ced38af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7505
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-03-31 08:33:21 +00:00
David Karoly 92d226c2a9 headers/os: Bump max gcc to 14.x
Change-Id: Ia5601dae1c2d70f148df5dfde97bbba841af0b17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7561
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2024-03-30 15:01:16 +00:00
X512 8b5f785b6a kits/package: allow to set BPackageResolvable to parsed string
Change-Id: I8ebb46b12a8af229d05994eb3cdd2d8180edc903
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7555
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-03-28 14:37:49 +00:00
Augustin Cavalier 97dc7e3bb2 AutoDeleter: Add assertion in SetTo that the object is not the one already set.
Otherwise we could cause leaks.

Most of the time this check should be optimized out,
as most uses of AutoDeleter don't invoke SetTo. But
it would have caught some bugs in the VFS refactors
(which wound up being cancelled out by later commits
anyway, but this would've exposed them.)

Just invoke debugger(), which calls the kernel
debugger when compiled in kernel mode. And define
debugger() inline in this header if OS.h is not
included to avoid namespace pollution.
2024-03-21 13:49:45 -04:00
Augustin Cavalier 776d091d8a WeakReferenceable: Return NULL in GetReference if the pointer is gone.
Fixes a major API footgun that caused #18759.
2024-03-14 17:15:59 -04:00
milek7 6034ee94a2 arm64: Use WFI for idling
Change-Id: I00f17c1db7c032879da59d17c67c13c24e0b9ef8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7519
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: David Karoly <karolyd577@gmail.com>
2024-03-12 20:44: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 <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-03-10 09:18:45 +00:00
Jérôme Duval 142723d197 libbsd: fix timespeccmp()
Change-Id: I5c1b1e5c4c583c0758b9f1b6eee67cb83053461d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7514
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-03-07 21:40:05 +00:00
milek7 51edf9322c arm64: Save/restore TPIDR_EL0 in _arch_context_swap
It's not used for anything by the OS but userspace might want
to use it for its own purposes.

Change-Id: Icda4bcd6de9d68596555e81293c8bd075f80a2a4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7511
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-03-07 15:53:37 +00:00
milek7 06fae14eb9 arm64: Save/restore FPU state when handling IRQ or syscall
Change-Id: I8b2a36d57f410c0d06ca5ce90d1b997494072c94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7510
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-03-07 13:28:27 +00:00
X512 02463fb461 kernel/int: consolidate interrupt vector number to `int32`
This is no-op for 32 bit platforms because `int32` is defined as `long` there.

Change interrupt vector number from 64 bits to 32 bits for 64 bit platforms.

Change-Id: I52d1ad616cab16488804e9733c7afaf772a670ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7507
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2024-03-06 16:03: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 <jerome.duval@gmail.com>
Reviewed-by: Máximo Castañeda <antiswen@yahoo.es>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-03-01 18:04:33 +00:00
X512 629f071bb9 pci: extend MSI interrupt vector number to 32 bits
Also increase MSI message data size to 32 bits according to PCIe spec.

Remove 0xff check for MSI interrupts because it is potentially valid
interrupt vector number. Reject 0xff only for legacy pin interrupts.

- MSI-X supports up to 2048 interrupts per device that do not fit to
`uint8`.

- Non-x86 systems may use separate interrupt vector ranges for
hard-wired interrupts and MSI interrupts so `uint8` is not enough to
represent all of them.

Change-Id: Iaf9ffb197ec23db0f97ffe3ea756d28d7bfc8705
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7433
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-02-28 23:17:42 +00:00
Emir SARI e523bfeb06 NumberFormat: add floating-point precision support
- Simplify code in AboutSystem
- Make error string translatable in Locale preflet

Change-Id: I3b967ee04d764ec1bcf0fa40e40dae8da4a35c20
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7373
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-02-27 19:27:56 +00:00
PulkoMandy 8cc8ec9ef9 BSpinner: do not redefine fValue
BSpinner had its own fValue defined instead of using the one from
BControl. This results in the be:value in the message sent when the
control is invoked to always be 0.

Change-Id: I1cff5f30adbf5b1dede57a14377cd4e1db7a30d3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7428
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-02-27 15:47:10 +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 <waddlesplash@gmail.com>
2024-02-26 20:24:25 +00:00
Jérôme Duval 3bf4cdb73b network/ping: update to freebsd-current
* our ip modules don't support connect()/send(). Just use sendto().
* ping6 disappears, ping supports -4 or -6 to force IPv4 or IPv6

Change-Id: I1e982e354cc75d3a314c5bbbfffa0373e8f4d9af
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7427
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-02-26 14:06:29 +00:00
Jérôme Duval 01dc1ea4cf libbsd: add strtonum(), nitems(), timespec operation functions from FreeBSD
Change-Id: I56b677b382d17a27d243b615de19bec10f3a2810
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7426
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-02-26 14:06:29 +00:00
Dan Gohman b8caef6915 Change `AT_FDCWD` from -1 to -100.
Change the value of `AT_FDCWD` from -1 to -100. Either value should work,
since the Haiku implementation currently interprets any negative value as
`AT_FDCWD`, however -100 is preferable to -1 since -1 is used for error
return values.

fixes #18809

Change-Id: I53f273dd595c39ea9e4576b90adbbf7f555107cf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7423
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-02-26 14:04:27 +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 <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
2024-02-04 08:13:53 +00:00
Jérôme Duval 4a6a465c80 intel_extreme: for DDI, map the ddc pin to the GPIO
add port G for Gen12

Change-Id: I70bba2d6d2ec0fbad8bdbec14412ea982690d563
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5626
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-01-31 18:32:58 +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 <pulkomandy@pulkomandy.tk>
2024-01-29 18:58:03 +00:00
Trung Nguyen ba9a9ce167 headers/os: Add missing Interface Kit includes
Adds headers that have not been directly or indirectly included by
the "InterfaceKit.h" master include.

Change-Id: Id163e0e8db54bc553593819801e0e854cde78fa3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7376
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-01-28 20:36:07 +00:00
Jérôme Duval 591a1d179a AdapterIO: add FlushBefore() to strip the beginning of the MallocIO object
by default, AdapterIO is initialized with a BMallocIO object, which will
be extended indefinitely. Flushing regularly is necessary to avoid
excessive memory usage. Tested in StreamRadio.

Change-Id: I9f3142c0a2300ad44dc54ccf6932d41c9526320b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7302
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-01-23 09:49:17 +00:00
Jérôme Duval 0b733c9c80 virtio_gpu: initial driver
sample for qemu: -device virtio-vga,edid=on,xres=1024,yres=768 -display sdl
display mode can be set in the Screen preferences.

Change-Id: If1d6aeecb208ce7c62c42eea1a95c71237c4375a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7038
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2024-01-18 17:44:40 +00:00
Augustin Cavalier fabb71cc0e PCI: Support more than 6 PCI memory ranges.
Also use the standard kernel-wide constants for IO or memory space
rather than defining new ones, as well as the PCI constants for
address types.

Change-Id: Iad03f7666ad5121a5c9a398339aa1a191339a1d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7336
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2024-01-15 20:18:57 +00:00
Jérôme Duval 96bad7685b PowerStatus: add state "Not charging"
some laptops decide to not charge a fast full battery to not consume a cycle.
In this discharging state, the current rate is zero, thus no time left can be computed.
We add a state "Not charging" to clearly differentiate and avoid user confusion.
PowerStatus was triggering low battery notifications, this is also fixed.

Change-Id: I4745c78eb0863ab01fe34cb065707d068cff0f0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7300
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-01-09 04:07:05 +00:00
Augustin Cavalier fa766875af kernel: Rename DescriptorPutter to FileDescriptorPutter.
For consistency. No functional change.
2024-01-08 14:11:30 -05:00
Adrien Destugues 8d27b645e7 features.h: fix build when BSD headers are not in include path
In our C library we try to provide a "clean" POSIX/ISO-C set of include
files that strictly conforming applications can use. However, we also
want to provide some extensions that are commonly available in BSD or
GNU systems.

These are normally provided in a separate directory
(headers/compatibility/bsd) and additionally guarded by compiler defines
that can either be explicitly set, or enabled by default if the language
standard (selected from the compiler command line) is one with GNU
extensions (this is the default for GCC). This is controlled by a header
file called features.h.

However, for some headers it is not so simple to split the GNU
extensions apart from the other parts of the file, because it's not just
extra functions, but additional flags and defines.

So, we need the "features.h" mechanism to be available even in the base
set of headers, but not enable anything if the BSD headers are not in
the search path. The simplest way to achieve this is to have an empty
features.h in the base set of headers, that can then be overriden by the
one in headers/compatibility/bsd if needed.

Fixes #18732

Change-Id: Ia54d1206c2fba378ae276ed4232aee8443180afb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7287
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2024-01-03 17:11:56 +00:00
PulkoMandy dbe86e4638 regex.h: use _DEFAULT_SOURCE
This file was imported from glibx and uses __USE_GNU as defined by
glibc(s features.h. Our implementation of features.h is simpler, just
defining _DEFAULT_SOURCE directly and that's what we use in other
headers.

As a result, using GNU extensions to regex.h required defining __USE_GNU
directly in applications (for example in TraX).

Fixes #11818

Change-Id: I11e4cf2e88c330cf58083852c4b33aedb8a3a9ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7238
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-30 18:09:57 +00:00
X512 0bb43cbf5a poke: map area into client team in `POKE_MAP_MEMORY` ioctl
After this change `POKE_UNMAP_MEMORY` ioctl will became redurant and
an alias for `delete_area()`. Areas will be automatically deleted
on team exit.

Change-Id: I336b49c2281abf064e1bf28d908c7b2c5afd4df0
2023-12-23 22:26:26 -05: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 <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2023-12-24 02:45:59 +00:00
Jérôme Duval e2f1a42ea9 acpi: add device tree attributes from _CLS if available
means B_DEVICE_TYPE, B_DEVICE_SUB_TYPE, B_DEVICE_INTERFACE.
_CLS is rare, it means I don't own devices with this attribute.

from the spec: _CLS:
Class Code – supplies OSPM with the PCI-defined class, subclass and programming interface for a device. Optional.

Change-Id: I4f7b7ed66cbe6b4ff4511cb13df2af218350a5d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7210
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2023-12-19 05:40:16 +00:00
François Revol 71522c937e net: Rename IFT_TUN to IFT_TUNNEL as on BSD
We already use their value, let's use the name too.

Change-Id: I5afbd69923ae3b5e702dfb935a709c3069de5365
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7146
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: François Revol <revol@free.fr>
2023-12-10 19:50:48 +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 <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
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 <pulkomandy@pulkomandy.tk>
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2023-12-05 22:10:10 +00:00