Commit graph

49008 commits

Author SHA1 Message Date
Matthew Olsson ae2d67c28b LibWeb: Implement WritableStream.getWriter() 2023-04-09 21:45:39 +02:00
Matthew Olsson f358ae1b13 LibWeb: Remove duplicate declaration in Streams/AbstractOperations.h 2023-04-09 21:45:39 +02:00
Aliaksandr Kalenik 47f03c3a9a LibWeb/Fetch: Use a basic filtered response for redirect navigations
Match following change in the spec:
8f109835dc
2023-04-09 19:10:45 +02:00
Ben Wiederhake c94924691d Ports: Make libksba/libassuan/ntbtls use Serenity's gpg-error-config
This is likely because we usually used the host's version of the file.
I happen to use a newer libgpg-error (which is relevant because that
particular executable has been renamed, so my system no longer contains
a file of the name gpg-error-config), which revealed this latent bug.
2023-04-09 18:57:49 +02:00
Liav A 5a94e8dfd0 Kernel: Ensure jailed processes can be reaped by a jailed parent process
We were detaching from the jail process list too early. To ensure we
detach properly, leverage the remove_from_secondary_lists method
so the possibly jailed parent process can still see the dying process
and therefore clean it properly.
2023-04-09 18:49:01 +02:00
MacDue 67aceb6c67 Base: Add canvas clip path test page 2023-04-09 18:42:45 +02:00
MacDue 20e9213cc4 LibWeb: Add initial implementation of CRC2D.clip()
This allows clipping your drawing by any path you like! To do this
all painting has been wrapped around a new draw_clipped() helper
method, which handles the clipping before/after painting.

Note: This clipping is currently missing support for intersecting
clip paths.
2023-04-09 18:42:45 +02:00
MacDue 92d9b6edb8 LibWeb: Add simple canvas path clipper
This adds CanvasPathClipper and ScopedCanvasPathClip. These allow
clipping the canvas by some arbitrary path.

This initial implementation is fairly naive, with a good few
allocations, though this can probably be improved in future.
2023-04-09 18:42:45 +02:00
MacDue ef58062f71 LibGfx: Floor draw origin in fill path implementation
This is done to be consistent with enclosing_int_rect() which is
used elsewhere to work out offsets in PaintStyles. Without this, you
can get an off-by-one in painting.
2023-04-09 18:42:45 +02:00
MacDue 78aad28dba LibGfx: Add Point::to_floored<T>() 2023-04-09 18:42:45 +02:00
MacDue 26e56bdd08 LibGfx: Fix crash due to vector resize in close_all_subpaths()
Since close_all_subpaths() appends while iterating, the vector can
end up being resized and the iterator invalidated. Previously, this
led to a crash/UAF in some cases.
2023-04-09 18:42:45 +02:00
MacDue 064ca625df LibGfx: Add BitmapPaintStyle
This is a simple paint style for filling a path with a bitmap.
2023-04-09 18:42:45 +02:00
Matthew Olsson 5faa0014f2 LibWeb: Implement WritableStream.close() 2023-04-09 18:37:34 +02:00
Tim Schumacher d4e48db1e1 Tests: Convert LZMA and XZ tests to TRY_OR_FAIL
This is very useful for tracking down a breakage without having to add
temporary dbgln manually.
2023-04-09 18:27:06 +02:00
Tim Schumacher 5f806ec53a LibTest: Add a TRY_OR_FAIL macro
This macro has the usual `TRY` semantics, but instead of returning the
error, it will let the test fail with the formatted error as the fail
message.
2023-04-09 18:27:06 +02:00
Liav A bfffe88de5 Kernel/HID: Untie the PS2 protocol, i8042 hardware and generic devices
For a very long time, the kernel had only support for basic PS/2 devices
such as the PS2 AT keyboard and regular PS2 mouse (with a scroll wheel).

To adapt to this, we had very simple abstractions in place, essentially,
the PS2 devices were registered as IRQ handlers (IRQ 1 and 12), and when
an interrupt was triggered, we simply had to tell the I8042Controller to
fetch a byte for us, then send it back to the appropriate device for
further processing and queueing of either a key event, or a mouse packet
so userspace can do something meaningful about it.

When we added the VMWare mouse integration feature it was easily adapted
to this paradigm, requiring small changes across the handling code for
these devices.

This patch is a major cleanup for any future advancements in the HID
subsystem.
It ensures we do things in a much more sane manner:
- We stop using LockRefPtrs. Currently, after the initialization of the
  i8042 controller, we never have to change RefPtrs in that class, as we
  simply don't support PS2 hotplugging currently.
  Also, we remove the unnecessary getters for keyboard and mouse devices
  which also returned a LockRefPtr.
- There's a clear separation between PS2 devices and the actual device
  nodes that normally exist in /dev. PS2 devices are not polled, because
  when the user uses these devices, they will trigger an IRQ which when
  is handled, could produce either a MousePacket or KeyEvent, depending
  on the device state.
  The separation is crucial for buses that are polled, for example - USB
  is a polled bus and will not generate an IRQ for HID devices.
- There's a clear separation in roles of each structure. The PS2 devices
  which are attached to a I8042Controller object are managing the device
  state, while the generic MouseDevice and KeyboardDevice manage all
  related tasks of a CharacterDevice, as well as interpreting scan code
  events and mouse relative/absolute coordinates.
2023-04-09 18:11:37 +02:00
Liav A 3a261f5ee8 Kernel: Stop lock & unlock repeatedly while reading from a mouse device
This was a thing we needed to do in the days where we didn't have
safe_memcpy and some wrappers around it to handle possible page faults
safely.
2023-04-09 18:11:37 +02:00
Liav A d8cbda6950 Kernel: Move HIDDevice::enable_interrupts method to I8042Device class
It happens to be that only PS/2 devices that are connected via the i8042
controller can generate interrupt events, so it makes much more sense to
have those devices to implement the enable_interrupts method because of
the I8042Device class and not the HIDDevice class.
2023-04-09 18:11:37 +02:00
Liav A d76c08c9b0 Kernel: Introduce a new super class called HIDController
Use the new class in HID code, because all other HID device controllers
will be using this class as their parent class.

Hence, we no longer keep a reference to any PS/2 device in HIDManagement
and rely on HIDController derived classes to do this for us.

It also means that we removed another instance of a LockRefPtr, which
is designated to be removed and is replaced by the better pattern of
SpinlockProtected<RefPtr<>> instead.
2023-04-09 18:11:37 +02:00
Liav A 6c4a47d916 Kernel: Remove redundant HID name from all associated files 2023-04-09 18:11:37 +02:00
Linus Groh b3cc320718 LibWeb/HTML: Use correct spec link for multipart/form-data encoding 2023-04-09 17:59:36 +02:00
Kenneth Myhra d39ac0a0ed LibWeb: Port fire_webgl_context_event() to new FlyString 2023-04-09 17:27:27 +02:00
Kenneth Myhra fb96966f1e LibWeb: Add WebGL::EventNames 2023-04-09 17:27:27 +02:00
Kenneth Myhra f9d50e6eca LibWeb: Port fire_keyboard_event() to new FlyString 2023-04-09 17:27:27 +02:00
Kenneth Myhra 8f4d7f2854 LibWeb: Port fire_a_synthetic_pointer_event() to new FlySring 2023-04-09 17:27:27 +02:00
Kenneth Myhra cbefab21be LibWeb: Port fire_a_page_transition_event() to new FlyString 2023-04-09 17:27:27 +02:00
Kenneth Myhra bf048da8cb LibWeb: Port fire_progress_event() + request_error_steps() to new String
This ports XHR's fire_progress_event() and request_error_steps() to new
FlyString.

Signature of fire_progress_event() parameter event_name  was changed
from 'String const&' to 'FlyString const&'.
2023-04-09 17:27:27 +02:00
Kenneth Myhra fdd33d818c LibWeb: Port DOMEventListener to new FlyString 2023-04-09 17:27:27 +02:00
Kenneth Myhra 2091a11488 LibWeb: Port EventTarget to new {Fly}String 2023-04-09 17:27:27 +02:00
Matthew Olsson 868cd95069 LibWeb: Add the WritableStreamDefaultController 2023-04-09 17:14:48 +02:00
Tim Schumacher 83701ec54b Meta+Toolchain: Redirect GDB error output to stdout before grepping 2023-04-09 16:51:11 +02:00
Tim Schumacher 022a55e825 Meta: Add a missing dash to the GDB detection code 2023-04-09 16:51:11 +02:00
Ben Wiederhake 86b83d5823 Ports: Repair the launcher icons of 'stpuzzles' 2023-04-09 16:50:35 +02:00
Nico Weber 1f0b54c857 LibGfx: Limit ICC-size-is-multiple-of-4 check to v4 files
The v2 spec doesn't require it, and it's not true in practice
(e.g. Compact-ICC-Profiles/profiles/sRGB-v2-nano.icc has size 410).
2023-04-09 16:49:49 +02:00
Nico Weber bed86fb578 LibGfx: Remove some of the noisier logging from webp lossless decoder
Prefix code decoding seems to work fairly well and produces a ton of
log output with `#define WEBP_DEBUG 1`, so remove the log lines.

(If needed it's always possible to just locally revert this commit.)

No behavior change, since WEBP_DEBUG isn't usually defined.
2023-04-09 16:49:38 +02:00
Ben Wiederhake 4107ae1dea Ports: Remove abandoned port 'fheroes2' which was never playable 2023-04-09 11:39:31 +01:00
Liav A 9f217222b7 Meta: Run the QEMU ISA-PC machine with a 64-bit capable CPU
When we had 32 bit support in the OS kernel and userland, the very bare
minimum CPU we supported was Pentium 3, but now the CPU is just required
to support x86-64 long mode to be supported, so the exact model is not
very important.

I chose the QEMU64 virtual CPU model, because the whole concept of the
QEMU ISA-PC machine is that it checks how the kernel handles arbitrarily
old hardware setup.
2023-04-09 10:25:20 +02:00
Idan Horowitz 01318d8f9b Kernel: Check flags for MAP_FIXED instead of prot in sys$mmap
We were accidentally not enforcing the map_fixed pledge
2023-04-09 11:10:37 +03:00
Idan Horowitz 6b08b18a9a Kernel: Crash process instead of panicking on KSYMS access
Also do the same for READONLY_AFTER_INIT and UNMAP_AFTER_INIT.
2023-04-09 11:10:37 +03:00
Idan Horowitz f412e73bba DynamicLoader: Remove the unused load_regions vector 2023-04-09 11:10:37 +03:00
Brian Gianforcaro e891f13c84 Kernel: Fix compilation of aarch64/RPi/Framebuffer.cpp
The definitions were being defined already by `BootInfo.h` and that was
being included here via transitive includes. The extern definitions of
the variables do not have the `READONLY_AFTER_INIT` attribute in
`BootInfo.h`. This causes conflicting definitions of the same variable.

The `READONLY_AFTER_INIT` specifier is not needed for extern variables
as it only effects their linkage, not their actual use, so just use the
versions in `BootInfo.h` instead of re-declaring.
2023-04-08 19:16:35 -07:00
Tim Schumacher 56fdbf81dc Ports: Reapply the SDL2_sound patch 2023-04-09 01:53:33 +02:00
Karol Baraniecki f532f9d279 BrickGame: Remember the "Show Shadow Piece" setting between executions
by using the ConfigServer.
2023-04-09 00:44:45 +02:00
Karol Baraniecki 439076df8a BrickGame: Add a menu option to disable the shadow drop hint 2023-04-09 00:44:45 +02:00
Karol Baraniecki f3f14a7ef1 BrickGame: Show where a piece would end up when after a fast drop
To show it to the player, draw a faint outline of where the piece would
end up.
2023-04-09 00:44:45 +02:00
Karol Baraniecki 652a19b232 BrickGame: Use title case in menu items consistently
by fixing the "Toggle pause" option
2023-04-09 00:44:45 +02:00
Karol Baraniecki bd12a72546 BrickGame: Add a missing [[nodiscard]] for consistency
Every other function there returning a RenderRequest has one, so might
as well.

Don't add it to check_and_remove_full_rows(), because it's only used
inside other functions returning a RenderRequest, when it's already
clear a render will happen.
2023-04-09 00:44:45 +02:00
Karol Baraniecki 962d39cc05 BrickGame: Port from DeprecatedStrings to Strings 2023-04-09 00:44:45 +02:00
Ben Wiederhake 2344666725 Documentation+Ports: Be upfront about dependencies
Yes, these can be 'discovered' incrementally, but it's usually nicer to
be upfront instead of making the user play trial-and-error.
2023-04-08 15:20:33 -07:00
Tim Schumacher 381da77ffb LibCompress: Mark some XZ-related variables and functions as const 2023-04-08 15:18:59 -07:00