Commit Graph

32829 Commits

Author SHA1 Message Date
Lady Gegga
c53486b9ce Meta: Add Xexxa's name to the contributors list 2022-01-13 13:56:00 +01:00
Timothy Flynn
4875ec26dd LibJS: Implement per-locale display of calendars and date-time fields 2022-01-13 13:43:57 +01:00
Timothy Flynn
adb762ee48 LibJS: Add FIXME regarding [[LanguageDisplay]] internal slot handling
This is supposed to work as follows (grabbed from SpiderMonkey):

    > opt = { type: "language", languageDisplay: "dialect" };
    > new Intl.DisplayNames([], opt).of("en-US");
    "American English"

    > opt = { type: "language", languageDisplay: "standard" };
    > new Intl.DisplayNames([], opt).of("en-US");
    "English (United States)"

We currently display the "dialect" variant. We will need to figure out
how to display the "standard" variant. I think the way it works is that
we take the display names of "en" (language) and "US" (region) and
format them according to this pattern in localeDisplayNames.json:

    "localeDisplayNames": {
        "localeDisplayPattern": {
            "localePattern": "{0} ({1})",
        },
    },

But I'd like to confirm this before implementing it.
2022-01-13 13:43:57 +01:00
Timothy Flynn
8126cb2545 LibJS+LibUnicode: Remove unnecessary locale currency mapping wrapper
Before LibUnicode generated methods were weakly linked, we had a public
method (get_locale_currency_mapping) for retrieving currency mappings.
That method invoked one of several style-specific methods that only
existed in the generated UnicodeLocale.

One caveat of weakly linked functions is that every such function must
have a public declaration. The result is that each of those styled
methods are declared publicly, which makes the wrapper redundant
because it is just as easy to invoke the method for the desired style.
2022-01-13 13:43:57 +01:00
Timothy Flynn
0d75949827 LibUnicode: Parse and generate locale display names for date fields 2022-01-13 13:43:57 +01:00
Timothy Flynn
7f162c471d LibUnicode: Parse and generate locale display names for calendars
Note there's a bit of an unfortunate duplication in the calendar enum
generated by UnicodeLocale and the existing enum generated by
UnicodeDateTimeFormat. The former contains every calendar known to the
CLDR, whereas the latter contains the calendars we've actually parsed
for DateTimeFormat (currently only Gregorian). The new enum generated
here can be removed once DateTimeFormat knows about all calendars.
2022-01-13 13:43:57 +01:00
Timothy Flynn
1a3e6e8a7b LibJS: Add [[LanguageDisplay]] to Intl.DisplayNames's resolvedOptions 2022-01-13 13:43:57 +01:00
Timothy Flynn
27c845eef2 js: Pretty-print the Intl.DisplayNames [[LanguageDisplay]] internal slot 2022-01-13 13:43:57 +01:00
Timothy Flynn
71f7e67a20 LibJS: Parse new Intl.DisplayNames "type" and "languageDisplay" options
Intl.DisplayNames v2 adds "calendar" and "dateTimeField" types, as well
as a "languageDisplay" option for the "language" type. This just adds
these options to the constructor.
2022-01-13 13:43:57 +01:00
Timothy Flynn
853ccab9af LibJS: Remove unnecessary braces in Intl.DisplayNames
Just caught my eye as I was modifying this code.
2022-01-13 13:43:57 +01:00
DavidLindbom
c6f3856d4f man.serenityos.org: Include Games section on index page 2022-01-13 13:43:51 +01:00
sin-ack
aedb013ee3 LibIMAP+Userland: Convert LibIMAP::Client to the Serenity Stream APIs
You now cannot get an unconnected LibIMAP::Client, but you can still
close it. This makes for a nicer API where we don't have a Client object
in a limbo state between being constructed and being connected.

This code still isn't as nice as it should be, as TLS::TLSv12 is still
not a Core::Stream::Socket subclass, which would allow for consolidating
most of the TLS/non-TLS code into a single implementation.
2022-01-13 15:16:12 +03:30
sin-ack
53e9d757fe test-imap: Convert test-imap to LibMain 2022-01-13 15:16:12 +03:30
sin-ack
5f645e84d8 LibCore: Use Error::from_errno in Stream APIs
This makes Stream APIs work with Lagom and is overall cleaner.
2022-01-13 15:16:12 +03:30
sin-ack
dbd25916a3 LibCore+Userland+Tests: Convert Stream APIs to construct on heap
As per previous discussion, it was decided that the Stream classes
should be constructed on the heap.

While I don't personally agree with this change, it does have the
benefit of avoiding Function object reconstructions due to the lambda
passed to Notifier pointing to a stale object reference. This also has
the benefit of not having to "box" objects for virtual usage, as the
objects come pre-boxed.

However, it means that we now hit the heap everytime we construct a
TCPSocket for instance, which might not be desirable.
2022-01-13 15:16:12 +03:30
sin-ack
eb389db92c LibCore: Remove the SocketError class
SocketError is a relic from the KResult days when we couldn't have a
string in the KResult type, only an errno. Now that we can use string
literals with Error, it's no longer necessary. gai_strerror is thread
safe, so we can use it here unlike strerror.
2022-01-13 15:16:12 +03:30
sin-ack
28063de488 AK: Add ByteBuffer::{must_,}get_bytes_for_writing()
This is useful for writing new data at the end of a ByteBuffer. For
instance, with the Stream API:

    auto pending_bytes = TRY(stream.pending_bytes());
    auto receive_buffer = TRY(buffer.get_bytes_for_writing(
        pending_bytes));
    TRY(stream.read(receive_buffer));
2022-01-13 15:16:12 +03:30
sin-ack
9569841589 AK: Use Error::from_errno in adopt_nonnull_own_or_enomem
This fails to build on Lagom otherwise.
2022-01-13 15:16:12 +03:30
David Lindbom
1e773256bf Snake: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
fff9547d9b Base: Add manual page for Snake 2022-01-13 03:45:17 -08:00
David Lindbom
3a197eea92 Pong: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
aa231a1580 Base: Add manual page for Pong 2022-01-13 03:45:17 -08:00
David Lindbom
ae6d326388 Minesweeper: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
535b0be7fe Base: Add manual page for Minesweeper 2022-01-13 03:45:17 -08:00
David Lindbom
7cb713e043 Hearts: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
d4aad127ed Base: Add manual page for Hearts 2022-01-13 03:45:17 -08:00
David Lindbom
2cb0a35dbe GameOfLife: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
ecdcf4f293 Base: Add manual page for GameOfLife 2022-01-13 03:45:17 -08:00
David Lindbom
570d63b601 FlappyBug: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
ef30e5832a Base: Add manual page for FlappyBug 2022-01-13 03:45:17 -08:00
David Lindbom
e5c6026a9a Chess: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
b15b87486d Base: Add manual page for Chess game 2022-01-13 03:45:17 -08:00
David Lindbom
f19a849f39 Breakout: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
d0d3c0c615 Base: Add manual page for Breakout 2022-01-13 03:45:17 -08:00
David Lindbom
357a36b622 2048: Add link to help pages in menu 2022-01-13 03:45:17 -08:00
David Lindbom
e59556d531 Base: Add manual page for 2048 2022-01-13 03:45:17 -08:00
Chris Frey
8f3759c04f Meta: Use fuse2fs if available to avoid root when building image
The fuse2fs tool that is part of e2fsprogs-1.46 has a 'fakeroot'
mount option.  This allows a non-root users to modify file ownership
and permissions without actually being root.  This package is
available in Debian bullseye and buster-backports.

If available, the script assumes the user wants to use it.
Otherwise, it falls back to the usual root requirements.

Now that root is not required, the root check in
build-root-filesystem.sh is not necessary.  Since
build-root-filesystem.sh has 'set -e' enabled, removing this check
will not cause a change in functionality.
2022-01-13 03:35:21 -08:00
Chris Frey
951f7becec Meta: Use consistent indents in build-image-qemu.sh
This is a whitespace only commit to avoid confusion with the
next feature commit.
2022-01-13 03:35:21 -08:00
Chris Frey
319cdf4ff3 Meta: Do not ignore error message with exec
When calling sub-programs from shell with exec, the useful || die
idiom does not actually do anything, since the first script is gone.
2022-01-13 03:35:21 -08:00
Jelle Raaijmakers
8e935ad3b1 LibGL+LibSoftGPU: Implement glColorMaterial and GL_COLOR_MATERIAL
When `GL_COLOR_MATERIAL` is enabled, specific material parameters can
be overwritten by the current color per-vertex during the lighting
calculations. Which parameter is controlled by `glColorMaterial`.

Also move the lighting calculations _before_ clipping, because the spec
says so. As a result, we interpolate the resulting vertex color instead
of the input color.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
9d4c2f6308 LibGL+LibSoftGPU: Calculate spotlight cutoff angle as degrees
We were storing the radians but never using that value in the GPU. We
now directly use the degrees value.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
8c28d167c9 LibGL: Report unsupported capabilities in glEnable and glDisable 2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
c03b21f0ea LibGL: Make MaterialFace a simple u8 enum
Now we don't need to use `to_underlying` everywhere.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
58e025ac08 LibSoftGPU: Change Material vectors to FloatVector4
Same type, but more consistent with the rest of LibSoftGPU and LibGL.
2022-01-13 12:13:58 +01:00
Jelle Raaijmakers
db1509c0de LibGL: Use C++ casts in glColor 2022-01-13 12:13:58 +01:00
Luke Wilde
1fc611877f LibGL: Implement glIsTexture
Required by Xash3D for the r_showtextures command, where it shows every
allocated texture on screen.

Description of glIsTexture from the spec:
"glIsTexture returns GL_TRUE if texture is currently the name of a
texture. If texture is zero, or is a non-zero value that is not
currently the name of a texture, or if an error occurs, glIsTexture
returns GL_FALSE.

A name returned by glGenTextures, but not yet associated with a texture
by calling glBindTexture, is not the name of a texture."

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
2022-01-13 12:13:40 +01:00
Andreas Kling
adfb0846d2 Meta: Add kleines Filmröllchen to the contributors list :^) 2022-01-13 12:10:08 +01:00
Andreas Kling
0b66702697 Meta: Add Xexxa to the contributors list :^) 2022-01-13 12:08:12 +01:00
Andreas Kling
cfc9ce66d9 Kernel: Skip unnecessary TLB flush when growing kmalloc heap
When adding entirely new page table mappings, we don't need to flush
the TLB since they were not present before.
2022-01-13 11:22:11 +01:00
Andreas Kling
de05223122 Kernel: Don't flush TLB after creating brand-new mappings
The CPU will not cache TLB entries for non-present mappings, so we
can simply skip flushing the TLB after creating entirely new mappings.
2022-01-13 11:22:11 +01:00