Commit Graph

26460 Commits

Author SHA1 Message Date
Tobias Christiansen
dcf06a4f40 AK: Add Statistics helper
This patch adds a helper to AK which allows for basic statistical
analysis of values.
The median algorithm is very naive and slow, but it works.
2021-08-31 16:38:22 +02:00
Ali Mohammad Pur
60d43d6969 AK: Don't perform the shift when it's too large when decoding LEB128
Prior to this, we calculated whether the shift was too large for the
result, and then did the shift regardless.
Found by OSS-Fuzz: https://oss-fuzz.com/testcase-detail/6046441716973568
2021-08-31 16:37:49 +02:00
Ali Mohammad Pur
98624fe03f LibRegex: Implement min/max repetition using the Repeat bytecode
This makes repetitions with large max bounds work correctly.
Also fixes an OOM issue found by OSS-Fuzz:
https://oss-fuzz.com/testcase?key=4725721980338176
2021-08-31 16:37:49 +02:00
Ali Mohammad Pur
b64d6bb3a3 LibWasm: Limit the number of function locals
It's possible for the module to request too many locals, we now reject
such modules instead of trying to allocate space for them.
The value itself is chosen arbitrarily, so future tweaks _might_ be
necessary.
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4755809098661888
2021-08-31 16:37:49 +02:00
Ali Mohammad Pur
05c65f9b5d LibRegex: Limit the number of nested capture groups allowed in BRE
Found by OSS-Fuzz: https://oss-fuzz.com/testcase?key=4869334212673536
2021-08-31 16:37:49 +02:00
Linus Groh
c171aa40a8 LibJS: Implement Temporal.Instant.prototype.toJSON() 2021-08-31 16:35:51 +02:00
Linus Groh
463eb361ad LibJS: Implement Temporal.Instant.prototype.toLocaleString() 2021-08-31 16:35:51 +02:00
Linus Groh
576be0f8e7 LibJS: Implement Temporal.Instant.prototype.toString() 2021-08-31 16:35:51 +02:00
Karol Kosek
1c65ee6edf LibAudio: Implement decoding verbatim blocks in FLAC
They're mostly used in literal random data, so it isn't like
there is a high demand for it, but it's cool to have more complete
implementation anyway. :^)
2021-08-31 16:35:37 +02:00
sin-ack
a086be993b LibGUI: Bias text towards bottom when tabs at top have uneven spacing
This makes the text on inactive tabs in Browser look a lil' bit nicer.
:^)
2021-08-31 16:34:55 +02:00
sin-ack
4959fa4f1e LibGUI: Adjust content area and focus rect of tab buttons
This improves the look of tabs and their focus rects. In particular, the
concept of a "text rect" is removed, and whatever tab content area is
left over after the icon and close button are added is used as the area
to draw the text into. This approach is simpler than having a separate
text rect.
2021-08-31 16:34:55 +02:00
Owen Smith
22ec21bd61 Kernel: Don't VERIFY_NOT_REACHED in LocalSocket::has_attached_peer()
Invoking sendmsg on a listening socket triggers this assertion as
sendto calls has_attached_peer before checking the result of
send_buffer_for.
2021-08-31 16:00:53 +02:00
kleines Filmröllchen
0dc6fe9102 Piano: Use LibDSP to implement delay
This is the first step in transitioning Piano to a full LibDSP backend.
For now, the delay effect is replaced with a (mostly identical)
implementation in LibDSP.

The new ProcessorParameterSlider attaches to a LibDSP::Processor's
range parameter (LibDSP::ProcessorRangeParameter) and changes it
automatically. It also has the ability to update an external GUI::Label.
This is used for the three delay parameters and it will become useful
for auto-generating UI for Processors.
2021-08-31 17:03:55 +04:30
kleines Filmröllchen
a749b16674 Libraries: Add LibDSP
LibDSP is a library for digital signal processing, and is primarily
intended to support the future DAW version of Piano.
2021-08-31 17:03:55 +04:30
kleines Filmröllchen
8f4b577405 AK: Make SinglyLinkedList::remove() public
This is a nice API to have outside of the class, and it is convenient
for LibDSP.
2021-08-31 17:03:55 +04:30
kleines Filmröllchen
ad6a332268 Piano: Add velocity and pitch support
As Piano will later move to the RollNote defintions of LibDSP, it's a
good idea to already insert velocity and pitch support, even though it's
currently not used.
2021-08-31 17:03:55 +04:30
Hediadyoin1
fdef6e5f76 AK: Add FixedPoint arithmetic helper
Co-authored-by: Hendiadyoin1 <leon2002.la@gmail.com>
Co-authored-by: kleines Filmröllchen <malu.bertsch@gmail.com>
2021-08-31 17:03:55 +04:30
Brian Gianforcaro
beb8c48f26 Meta: Don't allow overlap in sonar cube file classification
Test files were getting analyzed twice, which the tool does
not like, and causes it to exit with a fatal error.

Also make the workflow run in PRs anytime the file is edited,
so that we can get immediate feedback without waiting till the
next day.
2021-08-31 12:41:18 +02:00
Nicholas Hollett
0d98bba167 Profiler: Add a flamegraph view for the stack
The flamegraph makes it easier to quickly spot expensive functions,
based on the width of their bar.
2021-08-31 12:40:51 +02:00
Nicholas Hollett
4fe380f6da LibGfx: Add color helper for getting shades and tints
Shades are colors darker than the color, tints are colors lighter.
This is helpful in places where we need a bunch of similar colors
with some small differences.
2021-08-31 12:40:51 +02:00
Andrew Kaster
60e27dea9c Meta: Require unzip and tar explicitly in CMakeLists
This should help stem the tide of people hopping in the build problems
channel on discord because they don't have unzip installed.
2021-08-31 12:39:46 +02:00
Karol Kosek
6caedc71c1 Base: Fix outline in the 32x32 filetype-font icon
The outline was already black in general, besides one dark blue pixel
on the right side of the picture.
2021-08-31 12:38:40 +02:00
Karol Kosek
3238654ae8 Base: Remove half-transparent pixels in filetype-spreadsheet icons
Some pixels weren't fully transparent in the top-right corner, which
was pretty visible on file selection in File Manager on default theme.

The files has been also compressed using the Zopfli algorithm, since
they would have been rewritten here anyway.
2021-08-31 12:38:40 +02:00
Andreas Kling
a5992a4ef8 FileManager: Tweak layout spacing in file properties window
There wasn't enough vertical spacing between the TabWidget and the three
(Ok/Cancel/Apply) buttons at the bottom.
2021-08-31 02:43:50 +02:00
Andreas Kling
ea7e5be85a Base: Redraw the basic 16x16 arrow icons
This time with a consistent light source (top left) and a color scheme
closer to the SerenityOS default colors. :^)
2021-08-31 02:31:27 +02:00
Andreas Kling
7c9e01e4f5 Base: Tweak 16x16 open-parent-directory icon
Make the bottom left corner of this icon rounded, to match all the other
directory icons in the system.
2021-08-31 02:29:32 +02:00
Andreas Kling
af9d4281eb LibC: Run clang-format on setjmp.h 2021-08-31 01:37:30 +02:00
Andreas Kling
6cb536daa8 FileManager: Hide the Inode and Symlink Target columns in TableView
These are not generally interesting, so let's hide them by default.
The user can re-enable them if they want.
2021-08-31 01:35:09 +02:00
Andreas Kling
887ab3cc9a LibGUI: Rename FileSystemModel's "Owner" column to "User"
A file is owned by a User+Group, not an Owner+Group.
2021-08-31 01:35:08 +02:00
Andreas Kling
34f186e1e6 LibGUI: Tweak scrollbar arrows
Remove the base, leaving only the pointy triangle part. :^)
2021-08-31 01:35:08 +02:00
Andreas Kling
b8416df173 LibGUI+LibGfx: Make scrollbar buttons a little bit thicker
The common thin-cap button look (1px highlight, 2px shadow) looks nice
on regular buttons, but the scrollbar didn't feel quite right.
This patch adds 1px of offset to the highlight, giving it a thick-cap
look (which I have named Gfx::ButtonStyle::ThickCap) :^)
2021-08-31 01:35:08 +02:00
Andreas Kling
087bd7f767 Userland: Use Rect::centered_within() where useful 2021-08-31 01:35:08 +02:00
Andreas Kling
43220568b0 LibGfx: Add Rect::centered_within(Rect)
I've wanted this API a number of times but never added it.
2021-08-31 01:35:08 +02:00
Dimenus
de0861581e Userland: Guard set_jmp.h static_assert check to cpp impls only 2021-08-31 00:47:18 +02:00
Karol Kosek
1700b6d113 FileManager: Remove tree_view_directory_context_menu
It isn't used anywhere and the tree view shows only directories
(and that is covered by the tree_view_directory_context_menu).
2021-08-31 00:46:43 +02:00
Karol Kosek
7d6308523a FileManager: Add 'Open in Terminal' action for selected dirs on desktop
This is to be more similar to the context menu from the windowed
instance of File Manager.
2021-08-31 00:46:43 +02:00
Karol Kosek
dd75ed0c5e FileManager: Add default 'Open' action in context menu for directories
This makes the directory context menu more similar to the file context
menu.
2021-08-31 00:46:43 +02:00
Karol Kosek
7cf5904124 FileManager: Place mkdir and touch actions below openings in tree view
This way, the Properties action will always be everywhere on bottom.
2021-08-31 00:46:43 +02:00
Karol Kosek
d184e5327a FileManager: Put file launch actions first
The default action (shown in bold) indicates what would you get
by double-clicking on file.  Since it's a default option, I think it
deserves to be on top (together with alternative launch options). :^)

Also they're not task actions like "Extract .zip here" or "Add to
bookmarks".
2021-08-31 00:46:43 +02:00
Linus Groh
e3254bf4c5 LibJS: Implement Temporal.Calendar.prototype.dateAdd() 2021-08-30 22:33:10 +01:00
Ali Mohammad Pur
f492e98f19 LibWasm: Make the Truncate operator trap on undefined results 2021-08-30 22:47:02 +02:00
Ali Mohammad Pur
1465b11b58 Meta: Implement support for the "unlinkable" Wasm spectest assertion 2021-08-30 22:47:02 +02:00
Ali Mohammad Pur
30a1a25daa Tests/LibWasm: Handle all stream errors in parse_webassembly_module 2021-08-30 22:47:02 +02:00
Ali Mohammad Pur
2c7e2e351a LibWasm: Implement fx.nearest using nearbyint() instead of round()
This instruction wants RoundingMode::ToEven, so let's use the correct
function.
2021-08-30 22:47:02 +02:00
Ali Mohammad Pur
e93c740df5 Meta: Generate bigints for i64 values in LibWasm test suite files 2021-08-30 22:47:02 +02:00
Ali Mohammad Pur
99199b9bfd Tests/LibWasm: Add support for javascript bigint values
Some i64 values will not fit in normal doubles, and these values _are_
tested by the test suite, this makes the test runtime capable of
handling them correctly.
2021-08-30 22:47:02 +02:00
LepkoQQ
25f76ed771 Kernel: Fix shift sometimes staying pressed after releasing the key
Previous implementation sometimes didn't release the key after pressing
and holding shift due to repeating key updates when holding keys. This
meant repeating updates would set/unset `m_both_shift_keys_pressed`
repeatedly, sometimes resulting in shift still being considered pressed
even after you released it.

Simplify left and right shift key pressed logic by tracking both key
states separately and always updating modifiers based on them.
2021-08-30 22:35:51 +02:00
Andreas Kling
57ac8ff1fd Meta: Update lint-ports.py for the SerenityPorts move 2021-08-30 20:49:37 +02:00
Timothy Flynn
a2f0eeff7a LibJS: Canonicalize Unicode locale extension attributes and keywords 2021-08-30 19:42:40 +01:00
Timothy Flynn
94e66f500c LibJS: Reject structurally invalid Unicode locale extensions 2021-08-30 19:42:40 +01:00