Commit graph

5476 commits

Author SHA1 Message Date
Gunnar Beutner
f589acaac9 AudioServer: Put the m_zero_filled_buffer variable into the .bss segment
This way we don't have to allocate this at runtime. I'm intentionally
not using static constexpr here because that would put the variable
into the .rodata segment and would therefore increase the binary by
4kB.

The old code also failed to free() the buffer in the destructor, however
that wasn't much of an issue because the Mixer object exists throughout
the program's entire lifetime.
2021-06-16 20:07:37 +02:00
Timon Kruiper
3e73cfc08c Help: When opening a page, make sure it is selected in the tree view
This has to be called with a `deferred_invoke`, since on startup the
tree view contains no data yet.
2021-06-16 16:30:54 +04:30
Timon Kruiper
a5ecac5494 Help: Make sure the home page is actually shown when opening the app
Previously `open_page` was called multiple times when opening the
application, once for the actual page, but also in
`tree_view.on_selection_change`. At startup there is no valid selection
yet, which caused an empty page to be loaded. Prevent this by early
returning if the `path` is null.
2021-06-16 16:30:54 +04:30
sin-ack
74d76528d6 LibRegex: Display correct position for Compare in REGEX_DEBUG
When REGEX_DEBUG is enabled, LibRegex dumps a table of information
regarding the state of the regex bytecode execution. The Compare opcode
manipulates state.string_position directly, so the string_position value
cannot be used to display where the comparison started; therefore, this
patch introduces a new variable to keep track of where we were before
the comparison happened.
2021-06-16 16:30:12 +04:30
sin-ack
6b2e264093 LibRegex: Fix incorrect case-sensitive comparisons
A tiny typo was introduced in bc8d16ad which caused all case insensitive
comparisons to fail.
2021-06-16 16:30:12 +04:30
Idan Horowitz
9127d83927 LibJS: Rename Value::{is_integer => is_integral_number}
The implementation matches the specification, so lets match the name
as well. :^)
2021-06-16 12:57:55 +01:00
Idan Horowitz
07992c8da6 LibJS: Throw when delete-ing a non-configurable property in strict mode 2021-06-16 12:57:48 +01:00
Idan Horowitz
c619ad4fec LibJS: Allow no-op define property calls on non-configurable objects
This brings us slightly closer to the specification's 10.1.6.3
ValidateAndApplyPropertyDescriptor.
2021-06-16 12:57:48 +01:00
Andreas Kling
0c8dce60a2 PixelPaint: Don't open new images in background tabs
When opening/creating a new image, let's make it the foreground tab.
2021-06-16 12:12:39 +02:00
Andreas Kling
abc40af809 PixelPaint: Make images keep track of their path & title
The title is either "Untitled" (default), or the basename of the
image after we've opened or saved it.
2021-06-16 12:12:39 +02:00
Andreas Kling
35456f035c PixelPaint: Make ImageEditor::image() return a reference (Image&)
In the new tabbed world, every ImageEditor always has an associated
Image, so this simplifies a bunch of things. :^)
2021-06-16 12:12:39 +02:00
Andreas Kling
c6dd3377ee PixelPaint: Make the main UI tabbed and allow multiple open images :^)
This patch adds a GUI::TabWidget to the main UI and allows having
multiple images open at the same time.

Some of the changes here are a bit hackish and mechanical and there's
still code around that needs more work to fit better in the new world.

One nice side-effect of this change is that ImageEditor now always
has one Image associated with it, and it never changes.
2021-06-16 12:12:39 +02:00
Andreas Kling
8763492e34 PixelPaint: Make main window a little bit taller by default 2021-06-16 12:12:39 +02:00
Idan Horowitz
2299be474b LibJS: Add the String.fromCodePoint() method 2021-06-16 10:29:10 +01:00
Apoorv Mishra
89855d0b8c HexEditor: Use Yes/No/Cancel prompts for message boxes
Use Yes/No/Cancel prompts in message box for saving changes
on closing a file with unsaved changes.

Fixes #7169
2021-06-16 10:52:23 +02:00
Brian Gianforcaro
6c114ecaef LibCpp: Remove InlineLinkedList from the list of known types 2021-06-16 10:40:01 +02:00
Brian Gianforcaro
8063ca881d Shell: Remove unused InlineLinkedList header include 2021-06-16 10:40:01 +02:00
Brian Gianforcaro
8f1e7c5a72 WindowServer: Remove unused AK::InlineLinkedList header includes 2021-06-16 10:40:01 +02:00
stelar7
63b1296821 LibCore: Allow TCPServer to be blocking 2021-06-16 09:10:48 +02:00
Idan Horowitz
e1b0719435 LibJS: Add all of the FinalizationRegistry.prototype methods
More specifically: cleanupSome, register & unregister.

FinalizationRegistery.prototype.cleanupSome is actually still a stage 2
proposal, but since test262 test cases already exist for it, i decided
to go for it :)
2021-06-15 23:59:21 +01:00
Idan Horowitz
de9fa6622a LibJS: Add the FinalizationRegistry built-in object
As well as the needed functionality in VM to enqueue and run cleanup
jobs for the FinalizationRegistry instances.
2021-06-15 23:59:21 +01:00
Idan Horowitz
8c7fe8d6c8 AK: Add support for removing SinglyLinkedList nodes during iteration
This commit also fixes the now-broken usage of SinglyLinkedList::remove
in the Piano application.
2021-06-15 23:59:21 +01:00
Idan Horowitz
08ff148bc3 LibJS: Use OrderedHashTable instead of HashTable in the Set built-in
This ensures insertion-order iteration.
2021-06-15 23:51:20 +01:00
Idan Horowitz
a27fbfd45f LibJS: Use OrderedHashMap instead of HashMap in the Map built-in
This ensures insertion-order iteration.
2021-06-15 23:51:20 +01:00
Valtteri Koskivuori
c69ea44397 Userland: Teach the file utility that empty files also exist
Previously, empty files with no identifiable file type extension would
show up as `text/plain`. This fixes it up to show empty files as what
they really are - full of nothing.
2021-06-15 21:30:55 +02:00
Ali Mohammad Pur
1414c7b049 LibJS: Add a basic pass manager and add some basic passes
This commit adds a bunch of passes, the most interesting of which is a
pass that merges blocks together, and a pass that places blocks that
flow into each other next to each other, and a very simply pass that
removes duplicate basic blocks.
Note that this does not remove the jump at the end of each block in that
pass to avoid scope creep in the passes.
2021-06-15 22:06:33 +04:30
Ali Mohammad Pur
e81fd7106b LibJS: Rename the overridden Instruction methods to foo_impl
These are pretty hairy if someone forgets to override one, as the
catchall function in Instruction will keep calling itself over and over
again, leading to really hard-to-debug situations.
2021-06-15 22:06:33 +04:30
Ali Mohammad Pur
4c7c7c38e2 LibJS: Make EnterUnwindContext a terminator op
Otherwise a basic block could have multiple outgoing edges without
having much reason to do so.
2021-06-15 22:06:33 +04:30
Ali Mohammad Pur
e73b142a97 LibJS: Make basic block size customizable
And keep the default 4 KiB for the code generator.
2021-06-15 22:06:33 +04:30
Idan Horowitz
dac971b4ae LibJS: Store and return undefined Symbol description
Instead of the current incorrect behaviour of just defaulting to an
empty string.
2021-06-15 18:31:52 +01:00
Mateusz Górzyński
4aff4249aa PixelPaint: Alternate selection outline between black and white 2021-06-15 16:15:09 +02:00
Aatos Majava
7597cca5c6 LibTextCodec: Add ISO-8859-15 (aka Latin-9) encoding 2021-06-15 15:12:09 +01:00
Andreas Kling
a1eadc755d LibGUI: Allow tweaking each edge of TabWidget's content margins
Instead of having a single uniform margin around the child content of
a TabWidget, use a GUI::Margins to allow individual per-edge margins.
2021-06-15 14:28:39 +02:00
Andreas Kling
46a7e1b372 LibGUI: Make a macro for registering a GUI::Margins object property
This will allow anyone to register a margins property without having
to duplicate the parsing logic.
2021-06-15 14:27:48 +02:00
Andreas Kling
f20c5e1872 LibJS: Use Optional<String> in StringPrototype 2021-06-15 13:54:41 +02:00
Andreas Kling
bbf653c425 LibWeb: Use Optional<String> more in WrapperGenerator 2021-06-15 13:38:43 +02:00
Andreas Kling
2052796947 PixelPaint: Clear selection when opening a new image 2021-06-15 13:38:43 +02:00
Andreas Kling
91100f2f94 PixelPaint: Display an error message if exporting to PNG/BMP fails 2021-06-15 13:38:43 +02:00
Idan Horowitz
ba807c2d44 LibJS: Call toString on the key, not on the argument in ToPropertyKey
As required by the specification:
https://tc39.es/ecma262/#sec-topropertykey
2021-06-15 12:15:18 +01:00
Idan Horowitz
9a0cbcc3d1 LibJS: Add the Object.fromEntries method 2021-06-15 12:15:18 +01:00
Idan Horowitz
2100b46d02 LibJS: Implement the IteratorClose abstract op and use it where needed 2021-06-15 12:15:12 +01:00
Andreas Kling
3e4b48f68e PixelPaint: Avoid unnecessary temporary layer bitmaps during PP load
When opening a PP file, we were creating a layer first with an empty
bitmap, and then replacing it with the loaded bitmap from the file.

This patch reorders things so we never create the empty bitmap in
between, saving time and avoiding a memory spike.
2021-06-15 10:05:50 +02:00
Andreas Kling
398bf045c6 PixelPaint: Increase default size of new images from 1x1 to 480x360 2021-06-15 10:05:16 +02:00
Andreas Kling
eb76b18ee3 PixelPaint: Don't allow creating empty layers or images 2021-06-15 10:05:16 +02:00
Andreas Kling
8731bc9ead PixelPaint: Display an error message if opening a file fails 2021-06-15 10:05:16 +02:00
Andreas Kling
c333aec9f3 PixelPaint: Display an error message if saving to PP file fails 2021-06-15 01:16:34 +02:00
Andreas Kling
fa7bb98b1e PixelPaint: No need to pass ImageEditor& to Selection::paint()
It already has a reference to the editor in m_editor.
2021-06-15 01:16:34 +02:00
LepkoQQ
e6f27cec39 PixelPaint: Add actions to swap colors or reset them to default values 2021-06-15 00:13:03 +02:00
LepkoQQ
db99e0917c PixelPaint: Add menu items for Select All and Clear Selection
We also need to update the image editor when clearing selection
otherwise the last state of the selection will be displayed until an
update happens.
2021-06-15 00:13:03 +02:00
Andreas Kling
068ca3a394 PixelPaint: Always animate marching ants during interactive selection
The Selection object now tracks whether there is an ongoing interactive
selection (originating from one of the selection tools). If so it makes
sure to pump the marching ants animation.
2021-06-14 18:25:17 +02:00