Commit graph

37313 commits

Author SHA1 Message Date
Sam Atkins 3b1e063d30 LibCore+Everywhere: Make Core::Stream::read() return Bytes
A mistake I've repeatedly made is along these lines:
```c++
auto nread = TRY(source_file->read(buffer));
TRY(destination_file->write(buffer));
```

It's a little clunky to have to create a Bytes or StringView from the
buffer's data pointer and the nread, and easy to forget and just use
the buffer. So, this patch changes the read() function to return a
Bytes of the data that were just read.

The other read_foo() methods will be modified in the same way in
subsequent commits.

Fixes #13687
2022-04-16 13:27:51 -04:00
Timothy Flynn 6654efcd82 LibJS: Remove cloneConstructor parameter from CloneArrayBuffer
This is a normative change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/e7979fd

Note that this implements a FIXME in InitializeTypedArrayFromTypedArray,
now that shared array buffers are no longer a concern there. We already
have test coverage for the now-handled case.
2022-04-16 16:49:52 +01:00
Timothy Flynn 39b308ba52 LibJS: Factor out TypedArrayElement{Size,Type} abstract operations
This is an editorial change in the ECMA-262 spec. See:
https://github.com/tc39/ecma262/commit/a90670d5

This also adds missing spec comments to the following prototypes which
were affected by this change:
    Atomics.load
    Atomics.store
    %TypedArray%.prototype.slice
    %TypedArray%.prototype.subarray
2022-04-16 16:49:52 +01:00
Timothy Flynn 0174993bea LibJS: Add explicit ErrorType values for TypedArray prototype exceptions 2022-04-16 16:49:52 +01:00
Timothy Flynn c20e8cea19 LibJS: Define AllocateTypedArrayBuffer AO out of line
Not only is it easier to compare to the spec when defined out of line,
but this AO was implemented inside other AOs twice.
2022-04-16 16:49:52 +01:00
Timothy Flynn c076b363ce LibJS: Define SetTypedArrayFrom{TypedArray,ArrayLike} AOs out of line
%TypedArray%.prototype.set was a bit hard to read / compare to the spec
with these AOs defined inside it.
2022-04-16 16:49:52 +01:00
Maciej 1c80b377b2 Base: Add various Miscellaneous Symbols and Pictograms glyphs
1f5c0,1f5c1,1f5cb,1f5cc,1f5cd,1f5ce,1f5cf,1f5e4,1f5e5,1f5e6,1f5e7,
1f5f6,1f5f7
2022-04-15 22:01:31 +01:00
djwisdom 25e4dbb8f4 Base: Update CsillaRegular12 add Cyrillic glyps
CsillaRegular12
Cyrillic
0400-046B
2022-04-15 21:59:58 +01:00
djwisdom dc9dd30e9b Base: Update CsillaBold12 add Cyrillic glyphs
CsillaBold12
Cyrillic
0400-046B
2022-04-15 21:59:45 +01:00
Tom 49de4d5f33 LibDNS: Remove the 'DNS' prefix from the various type and class names
Since all types and class names live in the DNS namespace, we don't
need to spell it out twice each time.
2022-04-15 16:34:26 +01:00
Tom a3a1fe833b LibDNS: Add IPC encoder/decoder for the DNSAnswer class 2022-04-15 16:34:26 +01:00
Tom f3af82585d LibDNS: Implement Traits for DNSAnswer class
This enables DNSAnswer instances being used e.g. in a HashTable for
caching purposes.
2022-04-15 16:34:26 +01:00
Tom be4a4144f2 LookupServer: Move DNS related code into new LibDNS library
This allows other code to use the DNSPacket class, e.g. when sent
over IPC.
2022-04-15 16:34:26 +01:00
cflip 0a92dbd390 ClockSettings: Add 'show seconds' toggle to time format settings 2022-04-15 08:24:20 -04:00
cflip b2ef7ee531 LibC+LibCore: Change a.m./p.m. to AM/PM 2022-04-15 08:24:20 -04:00
cflip 0500d49acb LibC+LibCore: Properly format 12-hour formatted hours
This fixes a small formatting issue where midnight and noon would
display as 00 when they should display as 12.
2022-04-15 08:24:20 -04:00
Damien Firmenich 31ca48ebb2 Shell: Complete for current path when the text is empty
For example, when typing `cd <tab>`, the shell will show a list of
files in the current directory. This behavior is similar to typing `cd
./<tab>`.

It makes it easier to `cd` into directories without having to list them
first.
2022-04-15 13:08:41 +04:30
djwisdom 9dbcda7eef Base: Update CsillaRegular12 add Latin Extended-A
CsillaRegular12
Latin Extended-A
0100-017E
2022-04-15 00:26:55 +02:00
djwisdom d69df87728 Base: Update CsillaBold12 font add Latin Extended-A
CsillaBold12
Latin Extended-A
0100-017E
2022-04-15 00:26:55 +02:00
fanzidanzhidi 06ebdf82f7 Base: Add su(1) manpage
Base: Add su(1) manpage

Base: Add su(1) manpage
2022-04-15 00:22:37 +02:00
Marco Cutecchia ccc3da4ee1 HackStudio: Remember if the user wants to see dotfiles between sessions 2022-04-15 00:15:04 +02:00
Marco Cutecchia a7ba8677cd HackStudio: Add a "Project Configuration" button in the Edit menu 2022-04-15 00:15:04 +02:00
Marco Cutecchia 9096da19f1 HackStudio: Allow customizing the actions of the Build & Run buttons
This commit introduces per-project settings that can be customized
through a JSON file placed in '.hackstudio/config.json' in the
project's root
2022-04-15 00:15:04 +02:00
Martin Frederic 3e6c083754 Pong: Explicitly clear held keys in Game::reset()
The paddle's movement is determined by the currently held keys. A key
is no longer considered held when a matching keyup_event() fires.
However, the event does not fire when the timer has stopped (e.g. due to
a game over condition), which can result in the paddle keeping its
former direction and moving on its own -- even after the player started
a new game. Therefore, any held keys will be cleared explicitly.
2022-04-15 00:13:09 +02:00
Martin Frederic 02d2a300e7 Pong: Restart timer if necessary
When the player runs into a game over condition, Game's timer is
stopped. In order for reset() to work properly, the timer has to be
started again. The condition is tracked via a new member variable,
`m_game_over`. To prevent confusion, game_over() has been renamed to
show_game_over_message().
2022-04-15 00:13:09 +02:00
Martin Frederic 0abdeb474f Pong: Extend Game::reset()
Previously, the method reset the ball and the paddles. Now, it will
also reset and redraw the scores and update the ball's rect.
2022-04-15 00:13:09 +02:00
Martin Frederic 740beea5ce Pong: Add 'New Game' action
This declares Game::reset() public and lets the menu action invoke it.
2022-04-15 00:13:09 +02:00
Marco Rebhan a4639fced9 LibGUI: Don't try to get link target value if read_link failed 2022-04-14 23:44:09 +02:00
Sam Atkins 7c91fda088 LibWeb: Allow multiple text-decoration-lines
The spec grammar for `text-decoration-line` is:

`none | [ underline || overline || line-through || blink ]`

Which means that it's either `none`, or any combination of the other
values. This patch makes that parse for `text-decoration-line` and
`text-decoration`, stores the results as a Vector, and adjusts
`paint_text_decoration()` to run as a loop over all the values that are
provided.

As noted, storing a Vector of values is a bit wasteful, as they could be
stored as flags in a single `u8`. But I was getting too confused trying
to do that in a nice way.
2022-04-14 21:54:10 +02:00
Aatos Majava 85da8cbb07 TelnetServer: Ignore null and \n when parsing
This fixes issues with carriage return sequences.

Before, using <CR><NUL> as the return sequence wouldn't work at all,
and when using <CR><LF> there was an extra newline after every newline.

After this patch, the behaviour should be closer to the Telnet RFC.
2022-04-14 16:12:16 +02:00
Sam Atkins e941f07931 LibWeb: Make StyleProperties::property() always return a value
By the time that property() gets called, we've already given every
single property a value, so we can just return it. This simplifies a
lot of places that were manually handling a lack of value
unnecessarily.
2022-04-14 14:54:06 +02:00
Sam Atkins a20188cd91 LibWeb: Use generated enum code for property value validation
This has the nice benefit of removing a lot of duplicated lists of
values from Properties.json. :^)
2022-04-14 14:54:06 +02:00
Sam Atkins a797a92990 LibWeb: Stop including StyleValue.h in a few places
I don't know how much this will actually help compile times, but it's
something!
2022-04-14 14:54:06 +02:00
Sam Atkins c66da0f2cb LibWeb: Assign an underlying type to generated CSS enums
I'm *pretty* sure that even a u32 would be overkill but you never know
with CSS specs.
2022-04-14 14:54:06 +02:00
Sam Atkins c50661067d LibWeb: Generate and use to_string(css_enum) functions
The only one that's actually used is for Repeat, but it's easy to
generate them so might as well. :^)
2022-04-14 14:54:06 +02:00
Sam Atkins ae40e9a66c LibWeb: Use generated to_value_id() functions 2022-04-14 14:54:06 +02:00
Sam Atkins 9bf511caa3 LibWeb: Generate to_value_id() functions 2022-04-14 14:54:06 +02:00
Sam Atkins 3cc6cba4fe LibWeb: Use generated value_id_to_foo() functions 2022-04-14 14:54:06 +02:00
Sam Atkins 4d42885327 LibWeb: Return Optional from StyleProperties::box_sizing()
This function was written as if it returned `Optional<CSS::BoxSizing>`
but actually returned a plain `CSS::BoxSizing`, meaning if the property
was not set or was invalid, it would return whichever enum value was
first. This wasn't visible because we don't yet pay any attention to
the `box-sizing` property.
2022-04-14 14:54:06 +02:00
Sam Atkins 3f61f869c8 LibWeb: Generate ValueID-to-enum conversion functions 2022-04-14 14:54:06 +02:00
Sam Atkins 823d67bfc1 LibWeb: Use the generated enums instead of defining them in StyleValue.h
The remaining enums here are special cases that don't directly
correspond to a list of identifiers. But the majority can go. :^)
2022-04-14 14:54:06 +02:00
Sam Atkins a97944e483 LibWeb: Add a new code generator for CSS enums
Alias values are represented by "alias-name=real-name".

We have a lot of repetitive code for converting between ValueID and
property-specific enums. Let's see if we can generate it. :^)

This first step just produces the enums, from a JSON file. The values in
there are a duplication of what's in Properties.json, but eventually
those will go away.
2022-04-14 14:54:06 +02:00
Tim Schumacher 66170ff632 Tests: Add a test for printf truncation 2022-04-14 03:12:56 +04:30
Tim Schumacher 3651da6a96 LibC: Define correct limits for long on x86_64 2022-04-14 03:12:56 +04:30
Tim Schumacher d6ccee4089 AK: Differ between long and long long formats 2022-04-14 03:12:56 +04:30
Tim Schumacher fbfa378e74 AK: Deduplicate formatting hexadecimal values
Both calls essentially only differ in one boolean, which dictates
whether to print the value in uppercase or lowercase.

Move the long function call into a new function and pass in the
"uppercase" boolean seperately to avoid having to write everything
twice.
2022-04-14 03:12:56 +04:30
Tim Schumacher 0d5098fdc0 AK: Merge print_i64 into print_signed_number
Those functions only differ by the input type of `number`. No other
wrapper does this, as they rely on adjusting the type of the argument on
the caller side instead.

Avoid specializing too much by just doing the same for signed numbers.
2022-04-14 03:12:56 +04:30
SimonFJ20 399202f1d3 LibGUI: Make class final and seperate from GML Playground 2022-04-13 21:24:48 +02:00
SimonFJ20 791e881892 LibGUI: Rename function to make intention clearer 2022-04-13 21:24:48 +02:00
SimonFJ20 50ca1b3d87 LibGUI+GMLPlayground: Reset cursor to end of text after replace 2022-04-13 21:24:48 +02:00