summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-13AK: Rename Stream::{read,write} to Stream::{read_some,write_some}Tim Schumacher
Similar to POSIX read, the basic read and write functions of AK::Stream do not have a lower limit of how much data they read or write (apart from "none at all"). Rename the functions to "read some [data]" and "write some [data]" (with "data" being omitted, since everything here is reading and writing data) to make them sufficiently distinct from the functions that ensure to use the entire buffer (which should be the go-to function for most usages). No functional changes, just a lot of new FIXMEs.
2023-03-13AK: Compute UTF-8 code point lengths using only leading bytesTimothy Flynn
We don't need to decode the entire code point to know its length. This reduces the runtime of decoding a string containing 5 million instances of U+10FFFF from over 4 seconds to 0.9 seconds.
2023-03-13image: Add an argument to choose to write PPMs in binary or in ASCIILucas CHOLLET
2023-03-13image: Support writing to PPM filesLucas CHOLLET
2023-03-13LibGfx/PortableFormat: Add `PortableFormatWriter`Lucas CHOLLET
Currently, the encoder only output ppm files, but it can easily be extended to support both PBM and PGM.
2023-03-13Documentation: Add query-driver to clangd arguments in NvimConfigurationAndrew Kaster
2023-03-13Documentation: Update VS Code docs for tone, add query-driver directionsAndrew Kaster
2023-03-13LibAudio+Piano: Correct header stylekleines FilmrΓΆllchen
2023-03-13Ports: Add lrzip portFabian Dellwing
2023-03-13Ladybird: Remove the mode to dump the layout treeTimothy Flynn
This use case is now handled by headless-browser.
2023-03-13LibWeb: Run LibWeb layout tests using headless-browserTimothy Flynn
2023-03-13headless-browser: Add a mode to dump the layout tree after load finishTimothy Flynn
2023-03-13headless-browser: Support loading local file:// URLsTimothy Flynn
2023-03-13headless-browser: Massage URLs a bit before loadingTimothy Flynn
This is to mimic what Ladybird and Browser do before trying to load the URL.
2023-03-13LibAudio: Use symbolic constants for MP3 frame and granule sizekleines FilmrΓΆllchen
2023-03-13LibAudio: Move audio stream buffering into the loaderkleines FilmrΓΆllchen
Before, some loader plugins implemented their own buffering (FLAC&MP3), some didn't require any (WAV), and some didn't buffer at all (QOA). This meant that in practice, while you could load arbitrary amounts of samples from some loader plugins, you couldn't do that with some others. Also, it was ill-defined how many samples you would actually get back from a get_more_samples call. This commit fixes that by introducing a layer of abstraction between the loader and its plugins (because that's the whole point of having the extra class!). The plugins now only implement a load_chunks() function, which is much simpler to implement and allows plugins to play fast and loose with what they actually return. Basically, they can return many chunks of samples, where one chunk is simply a convenient block of samples to load. In fact, some loaders such as FLAC and QOA have separate internal functions for loading exactly one chunk. The loaders *should* load as many chunks as necessary for the sample count to be reached or surpassed (the latter simplifies loading loops in the implementations, since you don't need to know how large your next chunk is going to be; a problem for e.g. FLAC). If a plugin has no problems returning data of arbitrary size (currently WAV), it can return a single chunk that exactly (or roughly) matches the requested sample count. If a plugin is at the stream end, it can also return less samples than was requested! The loader can handle all of these cases and may call into load_chunk multiple times. If the plugin returns an empty chunk list (or only empty chunks; again, they can play fast and loose), the loader takes that as a stream end signal. Otherwise, the loader will always return exactly as many samples as the user requested. Buffering is handled by the loader, allowing any underlying plugin to deal with any weird sample count requirement the user throws at it (looking at you, SoundPlayer!). This (not accidentally!) makes QOA work in SoundPlayer.
2023-03-13LibGUI: Make thumbnail generation resilient between FileSystemModelskleines FilmrΓΆllchen
With the new canceled background actions, some thumbnail generation callbacks are not executed if the user closes the window with a FileSystemModel quickly enough. Therefore, we remember which thumbnails we started to generate and consider the associated promises if we're looking up a thumbnail. Since the thumbnail generation itself continues running and the cache is application-global, instead of never displaying thumbnails for images that were "interrupted" generating thumbnails the first time, we can now fetch their images immediately and reliably.
2023-03-13LibThreading: Register BackgroundAction with EventLoopkleines FilmrΓΆllchen
BackgroundActions are now added as a job to the event loop, therefore they get canceled when the loop exits and their on_complete action never runs. This fixes all UAF bugs related to BackgroundAction's use of EventLoops, as seen with e.g. thumbnail generation.
2023-03-13LibCore+Userland: Make Promise's on_resolve falliblekleines FilmrΓΆllchen
This will be primarily necessary for BackgroundAction integration, but it already allows us to add proper error handling in LibIMAP :^)
2023-03-13LibCore: Add a constructor that sets the parent objectkleines FilmrΓΆllchen
2023-03-13LibCore: Allow EventLoop to manage and cancel promiseskleines FilmrΓΆllchen
In this context, the promises are considered "jobs", and such jobs depend in some way on the event loop. Therefore, they can be added to the event loop, and the event loop will cancel all of its pending jobs when it ends.
2023-03-13LibCore+Userland: Allow canceling promiseskleines FilmrΓΆllchen
To make EventLoop cancel its managed Promises, we need the ability to cancel them in the first place.
2023-03-13LibCore: Add Promise to the forward declare headerkleines FilmrΓΆllchen
2023-03-13Base: Add missing options to sort man pageTim Ledbetter
2023-03-13sort: Add an option to sort in reverse orderTim Ledbetter
Lines can now be sorted in reverse order by specifying the `-r` option.
2023-03-13LibWeb: Escape HTML text fragments with multi-byte code point awarenessTimothy Flynn
The UTF-8 encoding of U+00A0 (NBSP) is the bytes 0xc2 0xa0. By looping over the string to escape byte-by-byte, we replace the second byte with " ", but leave the first byte in the resulting text. This creates an invalid UTF-8 string, with a lone leading byte.
2023-03-13Ports: Add port of backward-cpp, a pretty backtrace libraryAndrew Kaster
2023-03-13Ports: Install libiberty from binutils portAndrew Kaster
Normally this is supposed to be installed from gdb or gcc. If a port wants to link against libbfd though, we need to make sure libiberty is actually available in the root filesytem without requiring the port to depend on those larger packages.
2023-03-13Kernel: Don't include Kernel/Arch/RegisterState from userspaceAndrew Kaster
Any userspace cpp file that included <syscall.h> would end up with a large glob of Kernel headers included, all the way down to Kernel/Arch/x86_64/CPU.h and friends. Only the kernel needs RegisterState, so hide it from userspace.
2023-03-13headless-browser: Re-implement headless-browser using an OOPWVTimothy Flynn
headless-browser currently uses its own PageClient to load web pages in-process. Due to this, it also needs to set up a whole bunch of other objects needed to run LibWeb, e.g. image decoders, request servers, etc. This changes headless-browser to instead implement a WebView to launch WebContent out-of-process. This implementation is almost entirely empty, but can be filled in as-needed. For example, we may want to print JavaScript console messages.
2023-03-13Ladybird+LibWebView: Move WebContent process launcher to LibWebViewTimothy Flynn
This is to allow headless-browser to reuse this code. We have a similar helper for launching SQLServer from Ladybird.
2023-03-13Base: Make keyboard keys in the BrickGame manual and Help page stand outKarol Baraniecki
by making them `monospace` in the Help page, and bold in the manual. This helps to quickly find out where the keyboard controls are in the manual when skimming its contents.
2023-03-13Base: Document Escape and P pausing/unpausing BrickGameKarol Baraniecki
2023-03-13BrickGame: Add a "Pause" option to the Game menuKarol Baraniecki
This is how the menu looks like after this commit: β”Œβ”€β”€β”€β”€β” β”‚Gameβ”‚ Help β”œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ New game F2 β”‚ β”‚ Toggle pause P β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Quit Alt+F4 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
2023-03-13BrickGame: Show a box with "Paused" in it when the game is pausedKarol Baraniecki
Looks a bit like this: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Paused β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
2023-03-13BrickGame: Disallow manual piece movement while pausedKarol Baraniecki
This make the pause feature feel much better.
2023-03-13BrickGame: Stop bricks from falling when pausedKarol Baraniecki
Allows for pausing with either the `P` or `Escape` keys. In this commit you can still rotate pieces when paused - which makes for an interesting "stop-time" cheat mechanic, but probably isn't yet what we want.
2023-03-13LibCompress: Make DeflateCompressor::write() use loop, not recursionNico Weber
This is performance-neutral, but Instruments.app had a hard time visualizing the very deeply nested stack frames here. No behavior change.
2023-03-12SpiceAgent: Remove unused BMPWriter.h includeNico Weber
2023-03-12Base: Add Batak to font Katica Regular 10Xexxa
1BC0-1BF3, 1BFC-1BFF https://www.unicode.org/charts/PDF/U1BC0.pdf
2023-03-12LibC: Correctly reset the getopt state on `optind = 1`Tim Schumacher
The Linux `getopt_long` manpage tells users to reset `optind` to 1 when scanning the same argument vector or a new argument vector again. This makes sense, since `optind` denotes the _next_ option to be processed. The behavior of setting `optind` to 0 doesn't seem to be specified anywhere, so let's also remove that comment from `unistd.h`.
2023-03-12PixelPaint: Display color information on mousemove with the PickerToolLucas CHOLLET
Per-channel values of the pixel color are now displayed in the status bar when the PickerTool is selected. This information obviously updates on mousemove.
2023-03-12LibGfx: Make BMPWriter::dump() return ErrorOrNico Weber
...and use TRY() consistently in BMPWriter.cpp
2023-03-12LibGfx: Make BMPWriter::dump() not take a RefPtrNico Weber
2023-03-12LibGfx: Remove a redundant copy of all data when writing a BMPNico Weber
2023-03-12LibGfx: Change BMPWriter API to be consistent with other image writersNico Weber
2023-03-12LibGfx: Change second argument of BMPWriter::dump() to Options structNico Weber
This makes it more economical to add more options here, and makes it possible to use similar API surface for the other image writers. (It looks like nothing currently uses this optional parameter, but having a way to pass options to image writers seems like something we generally want.)
2023-03-12LibGfx: Remove unused BMPWriter::set_compression()Nico Weber
This has always been unused, and after #8440 BMPWriter::dump() unconditionally writes to m_compression, meaning even if this method was called, it would have no effect.
2023-03-12LibWeb: Resolve percentage line-height values before CSS inheritanceAndreas Kling
Percentage line-height values are relative to 1em (i.e the font-size of the element). We have to resolve their computed values before proceeding with inheritance.
2023-03-12LibWeb: Actually incorporate style from imported style sheetsAndreas Kling