Commit Graph

32078 Commits

Author SHA1 Message Date
mjz19910
f705f57d9a yes: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
e9a15995fd uname: Port to LibMain 2022-01-04 07:33:23 +00:00
mjz19910
91f5fc796b LibCore: Add an ErrorOr wrapper for uname 2022-01-04 07:33:23 +00:00
mjz19910
35cd7c9a91 uniq: Port to LibMain 2022-01-04 07:33:23 +00:00
Maciej
28ea412251 PixelPaint: Make paste action create new image if no editor is opened
This matches GIMP behaviour.
2022-01-04 07:29:50 +00:00
Maciej
41d02bd5e6 PixelPaint: Add a way to quickly create an image from clipboard
Ctrl+Shift+V, like in GIMP.
2022-01-04 07:29:50 +00:00
Jesse Buhagiar
eefad5ccd7 LibC: Include strings.h in string.h
Certain C Libraries have (unfortunately) included strings.h as a
part of string.h, which violates the POSIX spec for that specific
header. Some applications rely on this being the case, so let's
include it in our string.h
2022-01-04 07:27:04 +00:00
Tom
857c8850f3 WindowServer: Fix loading MainScreen setting from configuration 2022-01-04 06:31:59 +00:00
circl
69c757e92f tar: Implement -C option
This allows specifying which directory to extract to or create
from.

I would have used the *at variants of the functions, but some
weren't implemented yet.
2022-01-04 06:22:34 +00:00
B0IIZZ
6124050187 AK: Fix UFixedBigInt comparison operators
Instead of using the specified type U like we want,
we were using the type T all along when comparing with
smaller integers. This is now fixed.
2022-01-04 06:01:22 +00:00
Linus Groh
143465b23a LibJS: Propagate errors from TypedArray for_each_item{,_from_last} calls
Another mistake uncovered by moving away from manual exception checks
and relying on correct completion types instead :^)
2022-01-03 22:11:35 +01:00
Jean-Paul Balabanian
913511249b Toolchain: Add support for Clang on MacOS
This commit adds Darwin as a possible host for building the toolchain
with Clang.
2022-01-04 00:40:11 +03:30
Linus Groh
044c70fb46 LibJS: Add a ton of spec comments to AST.cpp 2022-01-03 21:50:50 +01:00
Linus Groh
da856d7742 LibJS: Update AST to use completions :^)
This is another major milestone on our journey towards removing global
VM exception state :^)
Does pretty much exactly what it says on the tin: updating
ASTNode::execute() to return a Completion instead of a plain value. This
will *also* allow us to eventually remove the non-standard unwinding
mechanism and purely rely on the various completion types.
2022-01-03 21:50:50 +01:00
Linus Groh
95acb1ce88 LibJS: Don't assume non-empty [[Value]] in Completion TRY() helpers 2022-01-03 21:50:50 +01:00
Linus Groh
032e6a2d28 LibJS: Remove redundant abrupt completion check
A throw completion is always an abrupt completion, no need to check :^)
2022-01-03 21:50:50 +01:00
Linus Groh
85f0fc2b83 LibJS: Return Optional<T> from Completion::{value,target}(), not T
In the end this is a nicer API than having separate has_{value,target}()
and having to check those first, and then making another Optional from
the unwrapped value:

    completion.has_value() ? completion.value() : Optional<Value> {}
    //                       ^^^^^^^^^^^^^^^^^^
    //         Implicit creation of non-empty Optional<Value>

This way we need to unwrap the optional ourselves, but can easily pass
it to something else as well.

This is in anticipation of the AST using completions :^)
2022-01-03 21:50:50 +01:00
martinfalisse
b39aede8fe Spreadsheet: Background fill color after reaching vertical end
When selecting a cell in the spreadsheet that was added
automatically as per the InfinitelyScrollableTableView
implementation, the background color is now filled correctly.

Previously, when navigating horizontally in a spreadsheet, after
a certain point the cells would not have the same background fill
color as the user would have experienced in the previous column
ranges (A-Z).
2022-01-03 22:30:04 +03:30
Samuel Bowman
4711d789c9 CrashReporter: Move progressbar into main window
Previously we would create a temporary progress window to show a
progressbar while the coredump is processed. Since we're only waiting
on backtraces and CPU register states, we can move the progressbar
into the main window and show everything else immediately while the
slow parts are generated in a BackgroundAction.
2022-01-03 16:19:47 +01:00
creator1creeper1
74d1eb6502 Applets/ResourceGraph: Propagate errors in JSON decoding 2022-01-03 16:01:42 +01:00
creator1creeper1
e46f08ff33 Applets/Network: Propagate errors using custom try_create
We now move-construct the bitmaps into the NetworkWidget.
2022-01-03 16:01:42 +01:00
creator1creeper1
f125d52622 Applets/Network: Propagate errors with try_set_main_widget
Use try_set_main_widget instead of set_main_widget.
2022-01-03 16:01:42 +01:00
creator1creeper1
43ecf1d429 Applets/Audio: Propagate errors using custom try_create
We now move-construct the bitmaps into the AudioWidget.
2022-01-03 16:01:42 +01:00
creator1creeper1
a550c20c35 Applets/Audio: Propagate errors with try_set_main_widget
Use try_set_main_widget instead of set_main_widget.
2022-01-03 16:01:42 +01:00
bugreport0
99e0b69c0c WindowServer: Tighten pledged promises 2022-01-03 15:56:41 +01:00
bugreport0
764f455d21 Taskbar: Tighten pledged promises, remove incorrect comment 2022-01-03 15:56:41 +01:00
bugreport0
0d78693b6a RequestServer: Tighten pledged promises 2022-01-03 15:56:41 +01:00
bugreport0
1d6ed50dd0 ChessEngine: Remove unused 'rpath' promise 2022-01-03 15:56:41 +01:00
Corey Williamson
79805a3f80 Keymaps: Add colemak-caps-backspace mapping
This patch adds the colemak keymap with caps lock remapped to backspace
(as is the default for colemak)
2022-01-03 15:54:32 +01:00
Corey Williamson
f51834d610 Kernel: Allow backspace '\b' to be remapped
Previously, one could put '\b' in a keymap, but in non-Terminal
applications, it would just insert a literal '\b' character instead of
behaving like backspace. This patch modifes
`visible_code_point_to_key_code` to include backspace, as well as
renaming it to `code_point_to_key_code` since '\b' is not a visible
character. Additionally, `KeyboardDevice::key_state_changed` has been
rearranged to apply the user's keymap before checking for things like
caps lock.
2022-01-03 15:54:32 +01:00
martinfalisse
452150c632 LibGUI: Bring entire cell into view after auto scroll into view
On account of row and column headers, when a user navigates to
a cell (for example in the spreadsheet application) that is
outside of the view, the cell is not properly aligned and so
is partially cut-off. This fix takes into account the row and
column headers when calculating the Rect to pass to the
scroll_into_view function.
2022-01-03 15:49:07 +01:00
Maciej
e824a2da90 WebServer: Make ErrorOr unwrapping more idiomatic
This still not propagates errors properly, but is at least (more)
consistent with the codebase.
2022-01-03 15:44:56 +01:00
Timothy Flynn
022b416570 LibJS: Implement the Extend TimeZoneName Option Proposal
This is a stage 4 proposal that was recently merged into the main
ECMA-402 spec. See:

https://github.com/tc39/ecma402/commit/1ba5ee7
2022-01-03 15:11:59 +01:00
Timothy Flynn
126a3fe180 LibUnicode: Add minimal support for generic & offset-based time zones
ECMA-402 now supports short-offset, long-offset, short-generic, and
long-generic time zone name formatting. For example, in the en-US locale
the America/Eastern time zone would be formatted as:

    short-offset: GMT-5
    long-offset: GMT-05:00
    short-generic: ET
    long-generic: Eastern Time

We currently only support the UTC time zone, however. Therefore, this
very minimal implementation does not consider GMT offset or generic
display names. Instead, the CLDR defines specific strings for UTC.
2022-01-03 15:11:59 +01:00
Brian Gianforcaro
d2ac40bcd7 Kernel: Enumerate PCI devices a single time in StorageManagement
Previously we were enumerating multiple times for each storage type.
We can easily enumerate once instead.
2022-01-03 13:26:12 +01:00
Andrew Kaster
eb672aef31 Toolchain: Add CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME to Platform
This property tells CMake that if a library is missing a SONAME field,
the link editor(s) we use will insert the full path to the library into
the binary. This is the behaivor of GNU ld compatible linkers, so let's
avoid that possiblity by telling CMake that it really doesn't want to
let the linker embed the full path to the lib. This is especially
important when cross-compiling things for ports and such, as the full
path to the lib will have absolutely nothing to do with the runtime path
2022-01-03 11:08:45 +00:00
Andrew Kaster
4dc538da0e Ports: Remove build-crt patch from llvm
This patch has been integrated into the toolchain.patch file.
2022-01-03 11:08:45 +00:00
Andrew Kaster
c5898806d2 Toolchain: Use Platform/SerenityOS.cmake in LLVM toolchain build
By setting CMAKE_MODULE_PATH in the LLVM initial cache scripts, we can
make the "SerenityOS" CMAKE_SYSTEM_NAME usable in the builds of
compiler-rt, libunwind, libcxxabi and libcxx.

This simplifies some toolchain patches and brings the cross-compiler
patches closer to the Port's patches, and closer to something
upstreamable.
2022-01-03 11:08:45 +00:00
Jesse Buhagiar
af31253a16 Kernel: Use try_create not must_create in SysFSUSB::create
The function `KString::must_create()` can only be enforced
during early boot (that is, when `g_in_early_boot` is true), hence
the use of this function during runtime causes a `VERIFY` to assert,
leading to a Kernel Panic.
We should instead use `TRY()` along with `try_create()` to prevent
this from crashing whenever a USB device is inserted into the system,
and we don't have enough memory to allocate the device's KString.
2022-01-03 10:39:56 +02:00
Jamie Mansfield
1d7d7d39b7 Spider: Redraw completely when drawing cards
Spider was only updating the new bounding box area after drawing cards
from the deck - leaving behind a sliver of the old deck.

This was a regression, as the game previously used the old bounding
box, introduced by GH-11153.
2022-01-02 22:26:52 +01:00
Tom
2251733744 Kernel: Allow specifying partition index with NVMe devices
Since NVME devices end with a digit that indicates the node index we
cannot simply append a partition index. Instead, there will be a "p"
character as separator, e.g. /dev/nvme0n1p3 for the 3rd partition.
So, if the early device name ends in a digit we need to add this
separater before matching for the partition index.

If the partition index is omitted (as is the default) the root file
system is on a disk without any partition table (e.g. using QEMU).

This enables booting from the correct partition on an NVMe drive by
setting the command line variable root to e.g. root=/dev/nvme0n1p1
2022-01-02 22:26:36 +01:00
kleines Filmröllchen
c748c0726a SoundPlayer: Don't enqueue samples depending on the GUI loop
Previously, SoundPlayer would read and enqueue samples in the GUI loop
(through a Timer). Apart from general problems with doing audio on the
GUI thread, this is particularly bad as the audio would lag or drop out
when the GUI lags (e.g. window resizes and moves, changing the
visualizer). As Piano does, now SoundPlayer enqueues more audio once the
audio server signals that a buffer has finished playing. The GUI-
dependent decoding is still kept as a "backup" and to start the entire
cycle, but it's not solely depended on. A queue of buffer IDs is used to
keep track of playing buffers and how many there are. The buffer
overhead, i.e. how many buffers "too many" currently exist, is currently
set to its absolute minimum of 2.
2022-01-02 22:18:37 +01:00
kleines Filmröllchen
b48badc3b6 LibAudio: Remove frame-wise copys from FlacLoader
Previously, FlacLoader would read the data for each frame into a
separate vector, which are then combined via extend() in the end. This
incurs an avoidable copy per frame. By having the next_frame() function
write into a given Span, there's only one vector allocated per call to
get_more_samples().

This increases performance by at least 100% realtime, as measured by
abench, from about 1200%-1300% to (usually) 1400% on complex test files.
2022-01-02 22:18:37 +01:00
kleines Filmröllchen
30130904f5 LibAudio: Alow creating a Buffer from a FixedArray
A FixedArray, due to its non-allocation guarantee, is great for audio
programming, so it's natural to have it interface with Buffer.
2022-01-02 22:18:37 +01:00
kleines Filmröllchen
59601b67a0 SoundPlayer: Remove resolved FIXME
I already resolved this some time ago but apparently forgot about it :^)
2022-01-02 22:18:37 +01:00
Linus Groh
dc60774ac4 LibCore: Mark 'Read options' parameter [[maybe_unused]] in Account.cpp
This broke the macOS clang CI build.
2022-01-02 22:02:16 +01:00
Linus Groh
cbb7329d69 LibJS: Fix two typos in comments in AST.cpp 2022-01-02 21:44:19 +01:00
Linus Groh
7565b1fda8 LibJS: Let Completion::update_empty() take an Optional<Value>
It also needs to be able to take what the spec calls 'empty', which is
an Optional<Value> in this case (*not* an empty JS::Value). The common
use case is updating a completion with another completion, that may also
have an empty [[Value]] slot.
2022-01-02 20:48:38 +01:00
Linus Groh
13777d4886 LibJS: Move provided Optional<Value> argument in normal_completion() 2022-01-02 20:47:14 +01:00
Timothy Flynn
f16f3c4677 LibJS: Update ToRawPrecision / ToRawFixed AO spec comments
This is a normative change in the Intl spec:
https://github.com/tc39/ecma402/commit/f0f66cf

There are two main changes here:
1. Converting BigInt/Number objects to mathematical values.
2. A change in how ToRawPrecision computes its exponent and significant
   digits.

For (1), we do not yet support BigInt number formatting, thus already
have coerced Number objects to a double. When BigInt is supported, the
number passed into these methods will likely still be a Value, thus can
be coereced then.

For (2), our implementation already returns the expected edge-case
results pointed out on the spec PR.
2022-01-02 20:07:03 +01:00