Commit graph

45438 commits

Author SHA1 Message Date
Thomas Symalla
b8ec5c4470 Documentation: Fix typo in CLionConfiguration.md 2023-01-08 20:39:59 +01:00
Karol Kosek
01a786310d Ladybird: Add Qt's standard refresh key (F5) to reload shortcuts 2023-01-08 19:38:35 +01:00
Kenneth Myhra
a28aa8e6c1 chgrp: Use StringView instead of 'char const*'
This gets rid of a couple ad-hoc instances of DeprecatedString and makes
it more trivial to use the fallible function Core::System::getgrnam() in
place of LibC's getgrnam().
2023-01-08 19:02:50 +01:00
Kenneth Myhra
6b3cf21964 passwd: Use StringView instead of DeprecatedString
This can now be declared as a StringView, since commit 507cb411
Core::Account::from_name() takes a StringView as a input.

This removes one FIXME.
2023-01-08 17:10:53 +01:00
Kenneth Myhra
b6917bc886 blockdev: Use Core::System::open() instead of LibC open() 2023-01-08 15:19:59 +00:00
Kenneth Myhra
a7dafacced blockdev: Let fetch_ioctl() return ErrorOr<void> 2023-01-08 15:19:59 +00:00
kleines Filmröllchen
66a68a9523 Base: Move GUI application man pages into their own subsection
We do not want to move POSIX utilities into subsections since they have
standard names, but we can do whatever we want with Applications :^).
This is particularly advantageous as many applications contain several
images, which declutters the man1 directory.
2023-01-08 13:35:29 +01:00
kleines Filmröllchen
b89be9610d markdown-check: Check that binary links use the text "Open"
Binary links will only be allowed in these contexts, which is all that
we currently use them for anyways. This mainly gets rid of useless "not
checking local link" spam relating to binaries, and only a few local
links remain.
2023-01-08 13:35:29 +01:00
kleines Filmröllchen
f4b95835d1 markdown-check: Check that no old-style inter-manpage links are used
We've had quite some instances of people reintroducing these kinds of
links because they didn't know about the "new" help:// scheme. This
check should now prevent that from happening, though it might in rare
circumstances trigger a false positive.
2023-01-08 13:35:29 +01:00
kleines Filmröllchen
e430667923 Meta/build-manpages-website: Use absolute paths for all links
Previously, we had some broken cross-manpage links on the website after
the introduction of subsections. This is fixed by simply always using an
absolute path (leading '/') for links, making all images, icons and page
links work in all subsections.

Unfortunately, this change means that navigating the website build while
opening the files in the browser directly will no longer work. However,
a local static server such as `python -m http.server 8080` in the
output/ directory will work just fine for testing.
2023-01-08 13:35:29 +01:00
kleines Filmröllchen
76e601d758 Meta/build-manpages-website: Copy all manpage PNGs
This will allow using images in manpages elsewhere in the future without
adjusting the PNG copying command.

rsync unfortunately cannot place all files into the root folder when
receiving a list of files via --files-from=-.
2023-01-08 13:35:29 +01:00
Nico Weber
e5988b4a0d LibCore: Teach MimeData about ICC file extension and contents
See https://www.color.org/profile_embedding.xalter and
https://www.iana.org/assignments/media-types/application/vnd.iccprofile
for mime type and extensions.

See LibGfx/ICCProfile.cpp, parse_file_signature() for the magic number.
2023-01-08 13:25:15 +01:00
Ali Mohammad Pur
803ff81d4a LibXML+LibWeb: Avoid implicit cast from StringView{}->DeprecatedString
This produces a (truly) null DeprecatedString, which is not expected to
occur by CharacterData (where this string ends up).
Simply pass an "empty" DeprecatedString manually instead.
2023-01-08 12:15:46 +01:00
Timothy Flynn
356e58332c LibJS: Add and begin using a completion-compatible string formatter
The `deprecated_format` helper is a thin wrapper to map results from
AK::vformat to a throw completion. This will let us try to throw on OOM
conditions rather than just blowing up.

Note it's called `deprecated_format` as we will likely end up adding a
method named just `format` to return `ThrowCompletionOr<String>`, when
we begin the migration from DeprecatedString->String for LibJS.
2023-01-08 12:13:15 +01:00
Timothy Flynn
6e1a239a62 LibJS: Use fallible methods to handle OOM when resolving rope strings 2023-01-08 12:13:15 +01:00
Timothy Flynn
115baa7e32 LibJS+Everywhere: Make PrimitiveString and Utf16String fallible
This makes construction of Utf16String fallible in OOM conditions. The
immediate impact is that PrimitiveString must then be fallible as well,
as it may either transcode UTF-8 to UTF-16, or create a UTF-16 string
from ropes.

There are a couple of places where it is very non-trivial to propagate
the error further. A FIXME has been added to those locations.
2023-01-08 12:13:15 +01:00
Timothy Flynn
d793262beb AK+Everywhere: Make UTF-16 to UTF-8 converter fallible
This could fail to allocate the underlying storage needed to store the
UTF-8 data. Propagate this error.
2023-01-08 12:13:15 +01:00
Timothy Flynn
1edb96376b AK+Everywhere: Make UTF-8 and UTF-32 to UTF-16 converters fallible
These could fail to allocate the underlying storage needed to store the
UTF-16 data. Propagate these errors.
2023-01-08 12:13:15 +01:00
Timothy Flynn
d8044c5358 LibJS+LibWeb: Move the macro to convert ENOMEM to an exception to LibJS
Move the macro to LibJS and change it to return a throw completion
instead of a WebIDL exception. This will let us use this macro within
LibJS to handle OOM conditions.
2023-01-08 12:13:15 +01:00
Timothy Flynn
ba97f6a0d3 LibJS: Move the "other" optional completion in the move constructor
Otherwise, we invoke a non-trival copy. Caught by clangd.
2023-01-08 12:13:15 +01:00
Timothy Flynn
49b24b0968 LibJS: Let Utf16String be forward-declared in Value.h
It's only used as a template parameter, so let it be forward-declared.
Otherwise, we aren't able to include Completion.h in Utf16String.h, as
there would be a Utf16String -> Completion -> Value -> Utf16String
include cycle.
2023-01-08 12:13:15 +01:00
Timothy Flynn
425c168ded AK+LibJS+LibRegex: Define an alias for UTF-16 string data storage
Instead of writing out "Vector<u16, 1>" everywhere, let's have a name
for it.
2023-01-08 12:13:15 +01:00
Timothy Flynn
39bda0073e AK: Make StringBuilder::try_append_code_point actually fallible
It currently uses the non-fallible `append` method to append each UTF-8
encoded byte of the code point.
2023-01-08 12:13:15 +01:00
Nico Weber
aee7c44064 LibGfx+icc: Print primary platform
There's a small, old-timey list of platforms in the spec, but as far
as I can tell nobody is using additional platforms on Linux or Android
or what. So let's try going with an enum class instead of the FourCC
machinery for now.
2023-01-08 09:56:07 +00:00
Nico Weber
6d70b6a3a7 LibGfx: Put parse_device_attributes() in spec order 2023-01-08 09:56:07 +00:00
implicitfield
ebcd07ff33 LibArchive: Use read_entire_buffer for reading extended headers
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53913
2023-01-08 09:54:08 +00:00
implicitfield
28c99e7a1f LibArchive+Utilities: Stop using DeprecatedString
This also slightly improves error propagation in tar, unzip and zip.
2023-01-08 09:54:08 +00:00
Lucas CHOLLET
8377adfde0 ThemeEditor: Port to Core::Stream 2023-01-08 08:12:50 +00:00
Lucas CHOLLET
a5d5b970ff Chess: Port to Core::Stream 2023-01-07 20:05:24 +00:00
Cody Hein
9a05175a88 WindowServer: Do not add existing menu items (by ptr) to m_menus
This resolves a fixme requesting that we do not add duplicate menus
2023-01-07 19:57:57 +00:00
Lucas CHOLLET
8a87aa85ae GMLPlayground: Port to Core::Stream 2023-01-07 19:53:35 +00:00
Lucas CHOLLET
cf1eea27d3 LibGUI: Add TextEditor::write_to_file(Core::Stream::File&)
This overload use the `Core::Stream` API instead of the now deprecated
one `Core::File`.
2023-01-07 19:53:35 +00:00
Liav A
72b144e9e9 Kernel/Graphics: Introduce a new mechanism to initialize a PCI device
Instead of using a clunky switch-case paradigm, we now have all drivers
being declaring two methods for their adapter class - create and probe.
These methods are linked in each PCIGraphicsDriverInitializer structure,
in a new s_initializers static list of them.
Then, when we probe for a PCI device, we use each probe method and if
there's a match, then the corresponding create method is called.

As a result of this change, it's much more easy to add more drivers and
the initialization code is more readable.
2023-01-07 11:51:13 -07:00
Liav A
7625f7db73 Kernel/Graphics: Allocate 16 MiB framebuffer if failed allocating larger
We try our best to ensure a DisplayConnector initialization succeeds,
and this makes the Intel driver to work again, because if we can't
allocate a Region for the whole PCI BAR mapped region, then we will try
to allocate a Region with 16 MiB window size, so it doesn't eat the
entire Kernel-allocated virtual memory space.
2023-01-07 11:45:08 -07:00
Liav A
25bb293629 Kernel: Make Device::after_inserting to return ErrorOr<void>
Instead of just returning nothing, let's return Error or nothing.
This would help later on with error propagation in case of failure
during this method.

This also makes us more paranoid about failure in this method, so when
initializing a DisplayConnector we safely tear down the internal members
of the object. This applies the same for a StorageDevice object, but its
after_inserting method is much smaller compared to the DisplayConnector
overriden method.
2023-01-07 11:45:08 -07:00
Andreas Kling
15c0efede9 LibWeb: Take used width into account in flex item intrinsic cross sizing
When calculating intrinsic heights of flex items, we should use the used
width if available.

This primarily matters for item cross sizing, since that happens after
we've determined the item's main size.
2023-01-07 19:41:21 +01:00
Andreas Kling
ab2f105344 LibWeb: Store flex item used sizes as Optional<CSSPixels>
This will allow us to tell whether values have been assigned by the flex
layout algorithm yet.
2023-01-07 19:41:21 +01:00
Andreas Kling
dbbc75f8fd LibWeb: Improve hypothetical flex item "auto" cross sizes
Take the used main size of the item into account (as available size)
when doing inner or intrinsic layout to determine the cross size.
2023-01-07 19:41:21 +01:00
Andreas Kling
244d4e19fa LibWeb: Run more of flex layout algorithm for intrinsic sizing
We were trying to take a shortcut by avoiding much of the flex layout
algorithm during intrinsic sizing. Unfortunately, this isn't good enough
since we may end up needing some of the flex item metrics for intrinsic
contribution calculations.

This means we do a bit more work for flexboxes, but intrinsic sizes are
correct in more cases.
2023-01-07 19:41:21 +01:00
Liav A
c1d3c1e0cb Documentation: Remove references to the removed RTL8139 driver 2023-01-07 11:37:57 -07:00
Liav A
5c97c6d874 Kernel: Remove the RTL8139 PCI network adapter driver
Nobody tests this network card, and the driver has bugs (see the issue
https://github.com/SerenityOS/serenity/issues/10198 for more details),
so it's almost certain that this happened due to code being rotting when
there's simply no testing of it.

Essentially this has been determined to be dead-code so this is the most
important reason to drop this code. Another good reason to do so is
because the RTL8139 only supports Fast Ethernet connections (10/100
Megabits per second), and is considered obsolete even for bare metal
setups.
2023-01-07 11:37:57 -07:00
Ben Wiederhake
3281050359 Everywhere: Remove "LibC/" includes, add lint-rule against it 2023-01-07 10:01:37 -07:00
Ben Wiederhake
d575cfda61 AK: Restrict include of LibC header 2023-01-07 10:01:37 -07:00
Ben Wiederhake
d1c397ad6e Tests: Remove already-completed fixme 2023-01-07 10:01:37 -07:00
Aliaksandr Kalenik
a913410730 LibWeb: Consider span in table column width calculation
Implemention of following parts in CSS Tables 3 spec:
https://www.w3.org/TR/css-tables-3/#min-content-width-of-a-column-based-on-cells-of-span-up-to-n-n--1
https://www.w3.org/TR/css-tables-3/#max-content-width-of-a-column-based-on-cells-of-span-up-to-n-n--1
2023-01-07 14:59:56 +01:00
Andrew Kaster
64a242261e AK: Reimplement DistinctNumeric comparison operators using operator<=>
Unlike what the class comment says, it's actually valid to return int
from this operator and treat it like a "normal" C-like compare method.
2023-01-07 14:51:04 +01:00
Andrew Kaster
a8fcd39b88 AK: Reimplement comparisons on AK::Time using operator<=>
This allows us to make all comparision operators on the class constexpr
without pulling in a bunch of boilerplate. We don't use the `<compare>`
header because it doesn't compile in the main serenity cross-build due
to the include paths to LibC being incompatible with how libc++ expects
them to be for clang builds.
2023-01-07 14:51:04 +01:00
Andrew Kaster
83ad5bfba0 AK: Remove global free function comparison operators for timespec
No code was using these, so let's just delete them. They pollute the
lookup for every single comparison operator in the project.
2023-01-07 14:51:04 +01:00
Andrew Kaster
a492e2018d Userland: Silence warnings from ElapsedTimer::elapsed() type change
We changed elapsed() to return i64 instead of int as that's what
AK::Time::to_milliseconds() returns, causing a bunch of implicit lossy
conversions in callers. Clean those up with a mix of type changes and
casts.
2023-01-07 14:51:04 +01:00
Andrew Kaster
48bf0b1408 Utilities: Store per-benchmark timeout in AK::Time rather than integer
Integer seconds are cool, but the comparison is a lot easier to
understand when stored as an AK::Time, and converted from_seconds()
after parsing the timeout from the command line.
2023-01-07 14:51:04 +01:00