Commit Graph

24449 Commits

Author SHA1 Message Date
Andreas Kling
3f9e018d9a CrashDaemon: Remove BACKTRACE_DEBUG debugging code
This thing seems to work fine, no need to hang on to old debug code.
2021-07-22 23:34:33 +02:00
Andreas Kling
cdae397e6a DynamicLoader: Don't truncate dynamic section address on x86_64 2021-07-22 23:34:33 +02:00
Andreas Kling
e44a41d0bf Kernel: Convert Region to east-const style 2021-07-22 23:34:33 +02:00
Peter Elliott
bf16591c07 Assistant: Only open one Assistant at once
I found myself accidentally opening two assistants at once with the
Window+Space shortcut. Since only one assistant window is usable at the
same time, I made assistant only spawn 1 instance at most.
2021-07-22 23:34:15 +02:00
Peter Elliott
fdcfd2816e LibCore: Add LockFile, a filesystem based mutex
This API wraps flock(2) and also handles the file creation and deletion
when the LockFile goes out of scope.
2021-07-22 23:34:15 +02:00
Hendiadyoin1
7da12f0faf UserspaceEmulator: Move to using the new SoftFPU 2021-07-22 23:33:21 +02:00
Hendiadyoin1
45d0f84a27 UserspaceEmulator: Implement SoftFPU instructions
This implements almost all instructions related to the FPU, including
all MMX instructions as well.
A lot of these were copied and adjusted from the SoftCPU implementation.

The next big milestone would be QNan detection and ShadowValue handling.
2021-07-22 23:33:21 +02:00
Hendiadyoin1
09a1a0b319 UserspaceEmulator: Sketch out a SoftFPU interface 2021-07-22 23:33:21 +02:00
Hendiadyoin1
1d74742c29 AK: Add char SIMD types
These are used in intrinsics, which do not recognize any signed version
of the char type
2021-07-22 23:33:21 +02:00
Hendiadyoin1
eb6af29421 LibX86: Add missing MovD and MovQ instructions
These are placeholders for now
2021-07-22 23:33:21 +02:00
Hendiadyoin1
efa42c4d45 LibX86: Use names closer to the spec for the Modrm
This gets rid of a lot of magic number shifts and ands.
2021-07-22 23:33:21 +02:00
Sam Atkins
68193c365f LibWeb: Resolve CSS text-decoration from value list
This detects and resolves these in the text-decoration property, in any
order:

- text-decoration-color
- text-decoration-line
- text-decoration-style

Only the solid underline renders, but all three sub-properties are
assigned correctly.
2021-07-22 23:09:01 +02:00
Sam Atkins
29b61123a4 LibWeb: Resolve background properties from ValueListStyleValue
As before, there are several sub-properties that we do not support, and
we ignore anything after the first comma.
2021-07-22 23:09:01 +02:00
Sam Atkins
6e08b200d4 LibWeb: Implement ImageStyleValue parsing
Later we will want to make a distinction between URL and Image values,
but this works for now.
2021-07-22 23:09:01 +02:00
Sam Atkins
82f3228dd2 LibWeb: Resolve CSS font property from value list
The font property now resolves into its various parts:

- font-family
- font-weight
- font-size
- font-style
- line-height

The font-variant and font-stretch parts are left unparsed since LibWeb
doesn't know how to render those.

Added `fonts.html` as a test for various forms of `font` declarations,
based on the examples in the spec.
2021-07-22 23:09:01 +02:00
Sam Atkins
a44d7670ab LibWeb: Resolve CSS list-style from value list
This resolves the three sub-properties, appearing in any order:

- list-style-image
- list-style-position
- list-style-type

Added `list-style-position` values to support this, though they are not
yet used in rendering.
2021-07-22 23:09:01 +02:00
Sam Atkins
b693a22c2d LibWeb: Resolve CSS flex/flex-flow from value list
Also moved the 'flex' code in StyleResolver to be next to
the 'flex-flow' code, because that seemed more reasonable.
2021-07-22 23:09:01 +02:00
Sam Atkins
7abfb18656 LibWeb: Implement CSS color parsing from Tokens
This was broken when we switched away from using StringStyleValues.
While I was at it, I have implemented hsl/a() and the percentage
syntax for rgb/a().

As a bonus, added `colors.html` as a test page for the various CSS
color syntaxes, since nothing was testing rgb() or rgba() before.

Much of the parsing code in LibGFX/Color.h seems to be centered
around CSS color values, but this is not used by the new Parser.
(And can't be used, because it requires a String value and we have
a list of Tokens of some kind instead.) Maybe that should be removed
from there when the new CSS parser is operational.
2021-07-22 23:09:01 +02:00
Sam Atkins
fabbd06de4 LibGfx: Implement Color::from_hsl/hsla()
This is required by CSS, and implemented based on the CSS standard's
algorithm.
2021-07-22 23:09:01 +02:00
Sam Atkins
4853c89c42 LibWeb: Handle ValueListStyleValues in StyleResolver
This implements a lot of cases, but not all of them. The following
need more infrastructure first:

- Flex
- FlexFlow
- Background
- BackgroundImage
- BackgroundRepeat
- ListStyle and parts
- Font

Also, colors are not parsed correctly. This will be handled next.
2021-07-22 23:09:01 +02:00
Sam Atkins
6e0376361a LibWeb: Expose StyleValue parsing method in CSS Parser
Now that StyleResolver is going to deal with StyleComponentValueRules,
it will need to be able to parse those into StyleValues, using
`parse_css_value()`.

Also added StyleValue::is_builtin_or_dynamic(), which returns true for
values that are valid anywhere - things like `initial` and `inherit`,
along with `var()`, `attr()` and `calc()` - which we want to test for
easily.
2021-07-22 23:09:01 +02:00
Sam Atkins
57d34f1966 LibWeb: Convert StyleResolver.{h,cpp} to east const 2021-07-22 23:09:01 +02:00
Sam Atkins
d72ce7b989 LibWeb: Generate a ValueListStyleValue when parsing CSS values
We skip whitespace tokens while doing this. As far as I can tell,
whitespace is not useful once we get to this point, and it legally
may or may not appear between any two tokens. By not including it
in the ValueListStyleValue, we make the "if it has 3 parts"-type
checks a lot more straightforward.
2021-07-22 23:09:01 +02:00
Sam Atkins
4a03279539 LibWeb: Add CSS ValueListStyleValue
As the new CSS parser tokenizes its input, we can no longer easily
rely on a StringStyleValue for multi-value properties. (eg, border)
ValueListStyleValue lets us wrap all of the ComponentValues that
the Parser produced for one declaration, as a single StyleValue, to
then be parsed into StyleValues by the StyleResolver.

Originally, I wanted it to be a list of StyleValues, but several
properties use syntax that makes use of non-StyleValue tokens, eg:
```css
/* Syntax using a / */
font: 12px/14px sans-serif;
/* Multiple values separated by commas */
background: url(catdog.png), url(another-image.jpg), blue;
```
Passing the ComponentValue tokens themselves means that all that
information is carried over. The alternative might be to create a
StyleValue subclass for each property and parse them fully inside
the Parser. (eg, `FontStyleValue`)

I decided against `ListStyleValue` as a name, to avoid confusion
with list styles. It's not ideal, but names are hard.
2021-07-22 23:09:01 +02:00
Karol Kosek
8c2be4b3dc LibAudio: Implement loaded_samples() in the FLAC Loader
This makes aplay show current playback position.
2021-07-22 22:57:05 +02:00
Karol Kosek
01e1e2c2c5 LibAudio: Read custom block sizes and sample rates as big endian
This fixes stucking in a loop at the end of the file, as
(a) custom block sizes are usually placed there, as the remaining
size might not be simply calculated as a power of two, and
(b) the number of bytes to read was incorrect (the program said
the block size was 32525, where flac -a said it's actually 3200).

Unfortunately, I couldn't trigger the bug for the sample rates,
so it may be not true, but I'd doubt it, giving the fact that flac
almost everywhere uses big endian numbers.
2021-07-22 22:57:05 +02:00
Karol Kosek
69c7b66f06 LibAudio: Don't read too much bytes in FLAC
This fixes crash when reading the end of the file.

The logic is mostly borrowed from WavLoader.
2021-07-22 22:57:05 +02:00
Ali Mohammad Pur
73fc2b3748 AK: Rewrite {AnyOf,AllOf,Find}.h to use the IteratorPairWith concept
This makes it so these algorithms are usable with arbitrary iterators,
as opposed to just instances of AK::SimpleIterator.
This commit also makes the requirement of ::index() in find_index()
explicit, as previously it was accepting any iterator.
2021-07-22 22:56:20 +02:00
Ali Mohammad Pur
2dc31c503e AK: Convert AnyOf/AllOf to east-const style 2021-07-22 22:56:20 +02:00
Ali Mohammad Pur
d40d10aae7 AK: Implement {any,all}_of(IterableContainer&&, Predicate)
This is a generally nicer-to-use version of the existing {any,all}_of()
that doesn't require the user to explicitly provide two iterators.
As a bonus, it also allows arbitrary iterators (as opposed to the hard
requirement of providing SimpleIterators in the iterator version).
2021-07-22 22:56:20 +02:00
Ali Mohammad Pur
f879e04133 AK: Add a concept for iterable containers
This concept describes a type with a begin()/end() pair that can
function as an iterator, given the following criteria:
- The return type of begin() is comparable with the return type of
  end(), and the comparison (with operator!=) yields a bool
- The object returned from begin() can be pre-incremented
- The iterator has an operator*() implementation
2021-07-22 22:56:20 +02:00
Ali Mohammad Pur
2891dca0cd AK: Add a deduction guide to Vector
Note that this does not generate a vector with inline capacity.
2021-07-22 22:56:20 +02:00
Ali Mohammad Pur
6c9ef20010 AK: Add a CommonType<Ts...> type trait
Also adds a simple-ish test for CommonType.
2021-07-22 22:56:20 +02:00
Timothy
ccd19d464e LibGUI: Handle multiple lines of text in MessageBox
The total height of text is calculated from the glyph height, the number
of lines, and a padding modifier.
2021-07-22 22:38:25 +02:00
Kenneth Myhra
cc45ccbd9b Ports: Add ScummVM game Soltys 2021-07-22 22:30:55 +02:00
Kenneth Myhra
d84102de99 Ports: Add ScummVM game Sfinx 2021-07-22 22:30:55 +02:00
Kenneth Myhra
caca5b0b3e Ports: Add ScummVM game Nippon Safes Inc 2021-07-22 22:30:55 +02:00
Kenneth Myhra
924930f357 Ports: Add ScummVM game Lure of the Temptress 2021-07-22 22:30:55 +02:00
Kenneth Myhra
8853d94032 Ports: Add ScummVM game DreamWeb 2021-07-22 22:30:55 +02:00
Kenneth Myhra
59e303cc54 Ports: Add ScummVM game Dráscula: The Vampire Strikes Back 2021-07-22 22:30:55 +02:00
Kenneth Myhra
281cff7845 Ports: Add ScummVM game Hi-Res Adventure #1: Mystery House 2021-07-22 22:30:55 +02:00
Kenneth Myhra
bcd96df2ac Ports: Add ScummVM game The Griffon Legend 2021-07-22 22:30:55 +02:00
Kenneth Myhra
f11fc28351 Ports: Add ScummVM game Flight of the Amazon Queen
This adds the ScummVM game Flight of the Amazon Queen.

Since all files are on the root of the zip file we utilize 'pre_fetch'
to create the directory 'workdir'. In 'post_fetch' we move all the files
into 'workdir' except for the zip file and 'package.sh'. Doing this lets
us use the 'clean' command without any modifications.
2021-07-22 22:30:55 +02:00
Kenneth Myhra
f7161b03ca Ports: Add overridable pre_fetch method in .port_include.sh
This adds an overridable pre_fetch method which is called from the fetch
method at the very beginning.

The pre_fetch method can be overridden in your package.sh script so that
you can do any necessary preparations before the fetch method is called.
2021-07-22 22:30:55 +02:00
Gunnar Beutner
f2be1f9326 Kernel: Fix the variable declaration for some linker script symbols
Despite what the declaration would have us believe these are not "u8*".
If they were we wouldn't have to use the & operator to get the address
of them and then cast them to "u8*"/FlatPtr afterwards.
2021-07-22 22:27:11 +02:00
Linus Groh
40580696a6 js: Implement pretty-printing of Temporal.PlainDateTime objects 2021-07-22 21:19:40 +01:00
Linus Groh
93e52f6ad8 js: Implement pretty-printing of Temporal.PlainDate objects 2021-07-22 21:19:40 +01:00
Linus Groh
38645347a7 LibJS/Tests: Fix this value error test description in a PlainDate test 2021-07-22 21:19:40 +01:00
Linus Groh
2c46a0fa6c LibJS/Tests: Replace snake_case with pascalCase in two PlainDate tests 2021-07-22 21:19:40 +01:00
Linus Groh
8b6865b128 LibJS: Add missing step number in PlainDatePrototype 2021-07-22 21:19:40 +01:00