Commit Graph

21779 Commits

Author SHA1 Message Date
Tim Schumacher
da1706d697 LibC: Remove the stub iconv header
This was added in 2019 to trick GCC into accepting a newlib build, but
now this no longer seems to be required to build the toolchain.
2023-01-19 11:51:58 +01:00
Tim Schumacher
4dcc26e940 LibAudio: Skip MP3 frames if not enough historic data is available 2023-01-19 11:42:32 +01:00
Tim Schumacher
4ad9fbc6a5 LibAudio: Clear the MP3 bit stream when seeking 2023-01-19 11:42:32 +01:00
Tim Schumacher
9bf9702842 SoundPlayer: Translate device samples to source samples before seeking 2023-01-19 11:42:32 +01:00
Tim Schumacher
dfc57c0dd9 SoundPlayer: Don't offset the seek bar with the last seek value
The audio loader plugins already do this internally, if we do this a
second time the seek bar will just end up getting rendered at the wrong
place.
2023-01-19 11:42:32 +01:00
Tim Schumacher
daf181caa8 LibCore: Let offset-related Stream functions return an unsigned value
A negative return value doesn't make sense for any of those functions.
The return types were inherited from POSIX, where they also need to have
an indicator for an error (negative values).
2023-01-19 11:41:56 +01:00
Tim Schumacher
1ca62de558 LibCore: Return EBADF on unsupported stream operations 2023-01-19 11:41:56 +01:00
Tim Schumacher
e65767c2e7 LibDebug: Identify embedded resources with a preceding dot 2023-01-19 11:29:29 +01:00
Tim Schumacher
edd4913573 LibDebug: Factor out the "looks like embedded resource" condition 2023-01-19 11:29:29 +01:00
Linus Groh
afc055c088 LibWeb: Convert the Location object to IDL
This includes:

- Moving it from Bindings/ to HTML/
- Renaming it from LocationObject to Location
- Removing the manual definitions of the constructor and prototype
- Removing special handling of the Location interface from the bindings
  generator
- Converting the JS_DEFINE_NATIVE_FUNCTIONs to regular functions
  returning DeprecatedString instead of PrimitiveString
- Adding missing (no-op) setters for the various attributes, which are
  expected to exist by the bindings generator
2023-01-18 17:36:39 -05:00
Liav A
649f78d0a4 LibGfx+Ladybird+Userland: Don't sniff for TGA images with only raw bytes
Because TGA images don't have magic bytes as a signature to be detected,
instead assume a sequence of ReadonlyBytes is a possible TGA image only
if we are given a path so we could check the extension of the file and
see if it's a TGA image.

When we know the path of the file being loaded, we will try to first
check its extension, and only if there's no match to a known decoder,
based on simple extension lookup, then we would probe for other formats
as usual with the normal sniffing method.
2023-01-18 21:48:35 +01:00
Cameron Youell
c6df488a1f LibWeb: Fix FrameLoader::load_error_page
We weren't properly creating a `LoadRequest` which resulted in `m_page`
not having a value in certain situations inside
`ResourceLoader::load(LoadRequest&)`
2023-01-18 14:46:13 +00:00
Cameron Youell
ce1b7e63c9 LibWeb: Fix error page icon outside of serenity 2023-01-18 14:46:13 +00:00
Timothy Flynn
537fcaf59e AK+LibUnicode: Provide Unicode-aware caseless String matching
The Unicode spec defines much more complicated caseless matching
algorithms in its Collation spec. This implements the "basic" case
folding comparison.
2023-01-18 14:43:40 +00:00
Timothy Flynn
8f2589b3b0 LibUnicode: Parse and generate case folding code point data
Case folding rules have a similar mapping style as special casing rules,
where one code point may map to zero or more case folding rules. These
will be used for case-insensitive string comparisons. To see how case
folding can differ from other casing rules, consider "ß" (U+00DF):

    >>> "ß".lower()
    'ß'

    >>> "ß".upper()
    'SS'

    >>> "ß".title()
    'Ss'

    >>> "ß".casefold()
    'ss'
2023-01-18 14:43:40 +00:00
Timothy Flynn
8d9fb898d7 LibUnicode: Update out-of-date spec links
And remove links that aren't adding much value but will often get out of
date (i.e. links to UCD files, which are already all listed in
unicode_data.cmake).
2023-01-18 14:43:40 +00:00
Timothy Flynn
142abc0b2e LibCore+ConfigServer: Add FileWatcherFlags to replace InodeWatcherFlags
InodeWatcherFlags is an enumeration from the Kernel. To avoid using it
outside of Serenity, add a FileWatcherFlags for FileWatcher, much like
we already have FileWatcherEvent::Type.
2023-01-18 09:37:11 -05:00
Timothy Flynn
98e6dbf50a Userland: Add missing limits.h header includes
This is currently being implicitly including by InodeWatcherEvent.h by
way of FileWatcher.h. The former will soon be removed from the latter,
which would otherwise cause a compile error in these files.
2023-01-18 09:37:11 -05:00
Timothy Flynn
8ca528217c LibCore: Implement FileWatcher for Linux
This implements FileWatcher using inotify filesystem events. Serenity's
InodeWatcher is remarkably similar to inotify, so this is almost an
identical implementation.

The existing TestLibCoreFileWatcher test is added to Lagom (currently
just for Linux).

This does not implement BlockingFileWatcher as that is currently not
used anywhere but on Serenity.
2023-01-18 06:46:12 -05:00
Timothy Flynn
91cbdc67de LibCore: Default-initialize the FileWatcher event mask 2023-01-18 06:46:12 -05:00
Timothy Flynn
8419ca8b78 LibCore: Handle multiple events in the FileWatcher event mask formatter 2023-01-18 06:46:12 -05:00
Timothy Flynn
5bfc9daba1 LibCore: Move FileWatcher implementations into separate files
Rather than one big file with (eventually) all implementations for each
OS, let's keep OS-specific implementations in their own files.
2023-01-18 06:46:12 -05:00
Cameron Youell
204257526c LibWeb: Define window.isSecureContext 2023-01-18 09:52:47 +00:00
Arda Cinar
f7fe9e3355 SoundPlayer: Log loader errors and otherwise ignore them for now
Playback can resume after encountering loader errors (though not
always). Ideally, these should be visible to the user and the loader
state should be reset after encountering such errors. This patch
also has the side effect of not crashing on seek when playing MP3 files
(However, it still does not seek to the correct location) :^)
2023-01-18 10:44:19 +01:00
Sam Atkins
1dd6b7f5b7 AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-17 19:52:52 -05:00
Jelle Raaijmakers
6d93947212 LibGfx: Use ALWAYS_INLINE for inline Bitmap methods
`Bitmap::scanline_u8` started popping up in profiles. We can't be having
that of course.
2023-01-17 19:34:54 -05:00
Jelle Raaijmakers
78926c182f Presenter: Increase the minimum widget size
The previous 100x100 size was a bit too small for comfort :^)
2023-01-17 19:30:51 -05:00
Jelle Raaijmakers
677d27d36a Presenter: Restructure menu to be more consistent with other apps
Add a "Quit" action and create a separate "Help" menu.
2023-01-17 19:30:51 -05:00
Tim Schumacher
0a563f4943 LibCore: Remove Stream::write_or_error
This was there for compatibility purposes and now it's no longer
needed.
2023-01-17 23:55:34 +01:00
Tim Schumacher
9f92e1bf11 LibProtocol: Remove Request::stream_into(OutputStream&) 2023-01-17 23:55:34 +01:00
Tim Schumacher
2313460b3e pro: Use Core::Stream for writing contents to the output
We also have to do a little dance with file descriptor numbers, since we
can't just `freopen` a `FILE` struct anymore to redirect to the correct
file.
2023-01-17 23:55:34 +01:00
Tim Schumacher
5320ed0fd6 LibProtocol: Use AllocatingMemoryStream to buffer requests 2023-01-17 23:55:34 +01:00
Arda Cinar
8f4c67672c LibGfxDemo: Draw diagonal dotted and dashed lines 2023-01-17 22:54:18 +01:00
Arda Cinar
9418586990 LibGfx: Remove an unnecessary FIXME
Clipping in diagonal line drawing has already been implemented a long
time ago.
2023-01-17 22:54:18 +01:00
Arda Cinar
c8d7bf5449 LibGfx: Implement drawing dotted/dashed diagonal Lines
The implementation simply tracks the number of pixels we have drawn so
far and draws pixels in an on-and-off pattern
2023-01-17 22:54:18 +01:00
Tim Schumacher
add2e2c076 LibCore: Do short forward seeks by discarding bytes from the buffer
This saves us an actual seek and rereading already stored buffer data in
cases where the seek is entirely covered by the currently buffered data.
This is especially important since we implement `discard` using `seek`
for seekable streams.
2023-01-17 21:56:56 +01:00
Tim Schumacher
bdf991fe76 LibCore: Calculate the correct seek offset for buffered streams 2023-01-17 21:56:56 +01:00
Tim Schumacher
caeb772894 SoundPlayer: Specify the total sample count in playback device samples
The current sample count is already reported like that, so this fixes a
mismatch between current and total. In the future, we should look into
abstracting this away properly instead of requiring the user to think of
converting it manually everywhere.
2023-01-17 21:54:23 +01:00
Tim Ledbetter
9c7f4bafdf Assistant: Debounce text input on_change event
This prevents unnecessary queries being executed when pasting text
or typing very quickly. The debounce timeout is 5ms, which is half the
rate at which the UI is updated. Therefore, there should be no
noticable impact on user experience.
2023-01-17 21:52:21 +01:00
Tim Ledbetter
d9aa7eacc6 Assistant: Cache results for each query by provider
Previously, results were cached for each query in a single list.
The majority of CPU time was spent determining which items in the
cache had been seen previously. This commit removes the need to
check previous results by holding a separate list of results for each
provider type.

This makes Assistant feel much more responsive to user input,
especially when the filesystem has a lot of files.
2023-01-17 21:52:21 +01:00
Jelle Raaijmakers
634d1e0197 LibGUI+WindowServer: Improve window resizing performance
The old `GUI::Window` resizing behavior created a new backing store for
each resize event (i.e. every visible window size). This caused a lot of
trashing and on my machine, caused up to 25% of CPU time spent in
creating new backing stores.

The new behavior is a bit more sensible:

  * If the window size is shrinking, the backing store is already large
    enough to contain the entire window - so we don't create a new one.

  * If the window size is growing, as soon as the backing store can no
    longer contain the window, it is inflated with a large margin (of an
    arbitrary chosen 64 pixels) in both directions to accommodate some
    leeway in resizing before an even larger backing store is required.

  * When the user stops resizing the window, the backing store is
    resized to the exact dimensions of the window.

For me, this brings the CPU time for creating backing stores down to 0%.
2023-01-17 18:16:02 +01:00
Aliaksandr Kalenik
45e85d20b6 LibWeb: Output display type inline-table in layout dump 2023-01-17 10:18:33 +01:00
Aliaksandr Kalenik
276a77f02d LibWeb: Support display inline-table
Add support for inline-table display type with corrresponding changes in
tree builder to generate inline anonymous wrapper around inline table
boxes.
2023-01-17 10:18:33 +01:00
Jonah
569b56e2ad WebDriver: Add computedrole endpoint 2023-01-16 20:32:21 -05:00
Tim Ledbetter
3fb4d50982 PixelPaint: Preserve layer location when copying layers
Location metadata is now included when copying a layer to the
clipboard. This allows a pasted layer to be placed in the location it
was copied from.
2023-01-17 00:36:01 +01:00
Tim Ledbetter
112035d5c3 LibGUI: Allow extra metadata when copying bitmaps to the clipboard 2023-01-17 00:36:01 +01:00
Timothy Flynn
d6ddca0c0f AK+LibUnicode: Provide Unicode-aware String titlecase transformation 2023-01-16 18:33:44 -05:00
Timothy Flynn
bc51017a03 LibUnicode: Support full case folding for titlecasing a string
Unicode declares that to titlecase a string, the first cased code point
after each word boundary should be transformed to its titlecase mapping.
All other codepoints are transformed to their lowercase mapping.
2023-01-16 18:33:44 -05:00
Timothy Flynn
b562348d31 LibUnicode: Generate simple case folding mappings for titlecase
Note we already generate the special case foldings for titlecase.
2023-01-16 18:33:44 -05:00
Timothy Flynn
6d710eeb43 LibUnicode: Add an overload of word segmentation for UTF-8 strings 2023-01-16 18:33:44 -05:00