Commit graph

46324 commits

Author SHA1 Message Date
Tim Schumacher
8464da1439 AK: Move Stream and SeekableStream from LibCore
`Stream` will be qualified as `AK::Stream` until we remove the
`Core::Stream` namespace. `IODevice` now reuses the `SeekMode` that is
defined by `SeekableStream`, since defining its own would require us to
qualify it with `AK::SeekMode` everywhere.
2023-01-29 19:16:44 -07:00
Tim Schumacher
5f2ea31816 AK: Move Handle from LibCore and name it MaybeOwned
The new name should make it abundantly clear what it does.
2023-01-29 19:16:44 -07:00
Tim Schumacher
5fa590de71 AK: Remove Buffered 2023-01-29 19:16:44 -07:00
Tim Schumacher
ae64b68717 AK: Deprecate the old AK::Stream
This also removes a few cases where the respective header wasn't
actually required to be included.
2023-01-29 19:16:44 -07:00
Andreas Kling
230cb3b0cb AK: Add DeprecatedString::from_utf8()
This will be used in Jakt to help transition off of DeprecatedString.
2023-01-29 23:41:42 +01:00
Andreas Kling
6b497b8710 AK: Add two helpers to DeprecatedStringCodePointIterator 2023-01-29 23:41:42 +01:00
Nico Weber
f4c1269d4c Tests: Modernize TestImageDecoder a bit
- Use MUST() instead of checking plugin_decoder_or_error.is_error()
- Use MappedFile::bytes()
- Don't use EXPECT_EQ when comparing to fixed bools

No intended behavior change.
2023-01-29 22:37:37 +00:00
Nico Weber
10ae570ac5 Tests: Make LibGfx tests not depend on LibGUI
As far as I can tell, that's not needed and never was.
2023-01-29 22:36:13 +00:00
Nico Weber
fef15becb2 LibGfx: Support ICCs in JPEGs that are split across several tags
Most jpegs that use multi-tag ICCs are in CMYK format, so running
`icc` on them still produces

    Runtime error: Unsupported number of components in SOF

but it no longer prints several

    jpg: Ignoring ICC profile spanning several chunks (1/9)

lines before that.

(And if I manually comment out that error message, the profile
is printed fine. But we can't decode the actual pixel data yet.)
2023-01-29 19:17:35 +00:00
Timothy Flynn
78def34c5e LibSQL: Use kill to exit forked SQLServer processes to avoid Qt issues
In order to daemonize the SQLServer process for Ladybird, we double-fork
and exit the first child process to ensure the grandchild process is in
a detached state to become SQLServer. After commit c05fcd5, this happens
after Ladybird's QApplication is created. QApplication seems to hook up
some `exit` handling that makes the call to `exit(0)` here not actually
exit the child process.

Instead, using `kill` with SIGTERM will actually terminate the child
process.
2023-01-29 18:32:21 +00:00
thankyouverycool
4b8bae8151 Welcome: Rename m_initial_tip_index=>m_tip_index 2023-01-29 18:27:34 +00:00
thankyouverycool
883abffa25 Welcome: Load banner font in a fallible manner
And simplify painting logic by using the banner widget's relative
rect and tray_text() ColorRole.
2023-01-29 18:27:34 +00:00
thankyouverycool
08456be9dc LibGUI+LibGfx: Add Tray ColorRole helpers to Palette 2023-01-29 18:27:34 +00:00
thankyouverycool
bfc08bc84b Welcome: Replace instances of DeprecatedString with String 2023-01-29 18:27:34 +00:00
thankyouverycool
c216d71b6c Welcome: Use fallible try_create() 2023-01-29 18:27:34 +00:00
Tim Schumacher
89a4a9c7a7 LibDebug: Correct a (un-)signed mixup in the DWARF abbreviations map
I accidentally replaced this with `read_unsigned` in
908b88db34, now it's correct again.
2023-01-29 18:21:11 +00:00
MacDue
d11baf48ae LibGfx: Fix constructor initialisation style in GradientPainting 2023-01-29 13:49:35 +00:00
MacDue
285bd7a37a LibGfx: Stop passing color stop spans by const reference
No idea why I did this, possibly because these were once vectors?
Anyway, the const reference is pointless here.
2023-01-29 13:49:35 +00:00
MacDue
a75f9273b4 PixelPaint: Increase default window height by 10px
This stops the clone and gradient tools from being cut off the side
bar.
2023-01-29 13:38:27 +01:00
Jan200101
141e5d6f20 Ports: Use absolute path of port_include
This ensures that .port_include will always import other scripts from
the correct location.
2023-01-29 13:11:22 +01:00
Jan200101
4eae5de499 Ports: Document how to declare external port directories 2023-01-29 13:11:22 +01:00
Jan200101
9b7e217dda Ports: Support multiple port directories
This allows Ports unfit for the main repository to be put elsewhere.
2023-01-29 13:11:22 +01:00
Liav A
722ae35329 Kernel/FileSystem: Simplify the ProcFS inode code
This is done by merging all scattered pieces of derived classes from the
ProcFSInode class into that one class, so we don't use inheritance but
rather simplistic checks to determine the proper code for each ProcFS
inode with its specific characteristics.
2023-01-29 12:59:30 +01:00
Nico Weber
e9dcc49f9c LibGfx: Validate tag types of AToBNTag, BToANTag, gamutTag, previewNTag
Also rewrite a few of the existing tag type checks using a new helper.
2023-01-29 11:40:14 +00:00
Nico Weber
bd4078ad45 LibGfx: Make ICC EMatrix3x3::operator[] a bit less silly 2023-01-29 11:35:37 +00:00
Nico Weber
1329799d20 LibGfx: Rename EMatrix to EMatrix3x3 in ICC code
There will be an EMatrix3x4 in a future change.
2023-01-29 11:35:37 +00:00
Nico Weber
f63ec8de68 LibGfx: Use auto more in ICC code 2023-01-29 11:35:37 +00:00
Aliaksandr Kalenik
78b503946c Tests: Add LibWeb layout tests 2023-01-29 11:33:33 +00:00
Aliaksandr Kalenik
c05fcd54bb Ladybird: Do not connect SQL server in layout dump output mode 2023-01-29 11:33:33 +00:00
Aliaksandr Kalenik
0c6b942ca9 Ladybird: Flush stdout before exit in layout dump output mode 2023-01-29 11:33:33 +00:00
MacDue
489fe49321 LibWeb: Fix parsing/to_string for "switch" ARIA role
I accidentally regressed this in 890b4d7, this role needs to be
handled specially due to the clash with the C++ 'switch' keyword.
2023-01-29 00:57:41 +00:00
Linus Groh
476d4b4963 LibWeb: Remove no longer needed DeprecatedFlyString.h includes
ARIA roles no longer use DeprecatedFlyString, replace them with the
forwarding header, and StringView.h in one case, for other things from
AK used in those headers.
2023-01-29 00:02:55 +00:00
Linus Groh
8556d47240 LibWeb: Move ARIA-related code into the Web::ARIA namespace
ARIA has its own spec and is not part of the DOM spec, which is what the
Web::DOM namespace is for (https://www.w3.org/TR/wai-aria-1.2/).

This allows us to stay closer to the spec with function names and don't
have to add the word "ARIA" to identifiers constantly - the namespace
now provides that clarity.
2023-01-29 00:02:55 +00:00
Timothy Flynn
8414734a2d LibJS: Propagate the OOM error from setting the String length property 2023-01-29 00:02:45 +00:00
Timothy Flynn
b75b7f0c0d LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate
Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
2023-01-29 00:02:45 +00:00
Timothy Flynn
109b190a19 LibJS: Fully qualify the use of AK::is in MUST_OR_THROW_OOM
This is to allow using this macro in contexts that have defined `is`
already. For example, in ObjectConstructor, there is a native function
`is` which would trip up the compiler without this change.
2023-01-29 00:02:45 +00:00
Timothy Flynn
2b5054c903 LibJS: Add a method to ThrowCompletionOr to drop allocation errors
This should solely be used to ignore completions from Heap::allocate in
currently-infallible contexts. It's mostly meant to let us both ignore
these errors and mark them with a FIXME in one go.
2023-01-29 00:02:45 +00:00
Timothy Flynn
2692db8699 LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors
Note that as of this commit, there aren't any such throwers, and the
call site in Heap::allocate will drop exceptions on the floor. This
commit only serves to change the declaration of the overrides, make sure
they return an empty value, and to propagate OOM errors frm their base
initialize invocations.
2023-01-29 00:02:45 +00:00
Timothy Flynn
1c1b902a6a LibJS+LibWeb: Move headers around to allow including Value from Cell
The goal here is to allow Cell::initialize to return a ThrowCompletion,
to handle OOM for example. Cell.h will then need to include Completion.h
which must include Value.h. This currently can't happen because Value.h
includes BigInt.h, which in turn includes Cell.h. So we would have an
include cycle.

This removes BigInt.h from Value.h, as it is forward-declarable (it is
only referred to with a reference or pointer). Then the Value overload
for Cell::Visitor::visit is moved to Cell.h, and missing BigInt.h
includes as peppered as needed.
2023-01-29 00:02:45 +00:00
Timothy Flynn
b0a4df76de LibJS: Define Date constants such that translation units don't copy them
Variables that are constexpr must be delcared inline in the global
namespace to prevent copying them.

The static keyword is meaningless on variables in headers in the global
namespace. Declare the static bigint as extern and define it out-of-line
instead.
2023-01-29 00:02:45 +00:00
Linus Groh
e4158d8555 LibJS: Replace some deprecated_string() with utf8_string() in Temporal
The remaining ones are needed for PropertyKey, which is not yet String
compatible.
2023-01-28 22:58:03 +00:00
Linus Groh
b41e7b7e86 LibJS: Replace to_deprecated_string() with to_string() in Temporal
Turns out all of these can already be replaced with no further changes!
2023-01-28 22:54:44 +00:00
MacDue
890b4d7980 LibWeb: Replace ARIA role static FlyStrings with an enum
This replaces the FlyStrings for ARIA roles that were constructed in
a [[gnu::constructor]] with a single enum. I came across this as the
DOM inspector was crashing due to a null FlyString for an ARIA role.

After fixing that, I was confused as to why these roles were not an
enum. Looking at the spec there's a fixed list of roles and switching
from references to static strings to an enum was pretty much an
exercise in find and replace :).

No functional changes (outside of fixing the mentioned crash).
2023-01-28 22:09:18 +00:00
Karol Kosek
f23eba1ba8 ImageDecoder: Actually set is_animated and loop_count variables
Before 649f78d0a4, the is_animated and
loop_count objects were set directly when making a return object.

That commit moved the decode logic to a separate function but forgot to
assign `is_animated` and `loop_count`. The compiler didn't throw an
error about unused variables because we were also VERIFY()ing that these
variables were zero-initialized at the beginning of the function.
2023-01-28 21:49:23 +00:00
Linus Groh
3a9225608a LibAudio: Remove try_ prefix from fallible LoaderPlugin methods 2023-01-28 22:41:36 +01:00
Linus Groh
ee0297d9ec LibAudio: Remove try_ prefix from fallible LoaderPlugin methods 2023-01-28 22:41:36 +01:00
Linus Groh
108ea2b921 LibCore: Remove try_ prefix from fallible SharedCircularQueue methods 2023-01-28 22:41:36 +01:00
Linus Groh
65fa7db2b5 PixelPaint: Remove try_ prefix from fallible ProjectLoader methods 2023-01-28 22:41:36 +01:00
Linus Groh
86f28ceace PixelPaint: Remove try_ prefix from fallible IconBag methods 2023-01-28 22:41:36 +01:00
Linus Groh
8a884b2581 PixelPaint: Remove try_ prefix from fallible Image methods 2023-01-28 22:41:36 +01:00