Commit Graph

46524 Commits

Author SHA1 Message Date
Lucas CHOLLET
40f9cf2de6 TextEditor: Port to Core::Stream 2023-02-03 19:58:41 +01:00
Lucas CHOLLET
36e66502c9 grep: Port to Core::Stream
It also adds support for `ErrorOr` in one lambda.
2023-02-03 19:43:41 +01:00
Liav A
f354b52099 SystemServer: Propagate errors properly in the main code
To do this properly, we also create Strings with formatting of device
nodes' names, taking into consideration errors when doing that.
Also, we use LibCore System mknod method instead of raw LibC functions
to be able to propagate errors from these calls too.
2023-02-03 19:38:23 +01:00
Staubfinger
da1023fcc5 AK: Add thresholds to quickselect_inline and Statistics::Median
I did a bit of Profiling and made the quickselect and median algorithms
use the best of option for the respective input size.
2023-02-03 19:04:15 +01:00
Staubfinger
6b9344e86c AK: Use AK:quickselect_inline to compute AK::Statistics::median
Quick select is an algorithm that is able to find the median
of a Vector without fully sorting it.
This replaces the old very naive implementation
for `AK::Statistics::median()` with `AK::quickselect_inline`
2023-02-03 19:04:15 +01:00
Staubfinger
becd6d106f AK: Testing for AK::quickselect_inline
The testing code found here is mainly derived from the Tests for
`AK::quick_sort`.
2023-02-03 19:04:15 +01:00
Staubfinger
607441de56 AK: Implement the quick select algorithm as AK::quickselect_inplace
This adds the quick select algorithm that finds
the kth smallest element for any collection.
Whilst doing so it also partially sorts the collection.
I have also included the option to use different pivoting functions
including median of medians which makes the quick select have
a truely linear time complexity at the costs of enormous overhead,
so this that only really useful for really large datasets.
The same was chosen to reflect the fact that it modifies
the collection in place during the selection process.
2023-02-03 19:04:15 +01:00
Itamar
8fce807b10 Kernel: Fix usermode verification in ptrace with PT_SETREGS
When doing PT_SETREGS, we want to verify that the debugged thread is
executing in usermode.

b2f7ccf refactored things and flipped the relevant check around, which
broke things that use PT_SETREGS (for example, stepping over
breakpoints with sdb).
2023-02-03 17:39:13 +01:00
Cubic Love
85ca19ffd5 Base: Add British English Apple Macintosh keymap
Full support for EN-GB Mac Laptop and Magic Keyboards
2023-02-03 12:50:42 +00:00
Aliaksandr Kalenik
ab99e95549 LibWeb: Parse font-stretch CSS property 2023-02-03 12:49:13 +00:00
Sam Atkins
968481c7cd Settings: Change initial window size to fit the current content
Previously, it would open with a scrollbar visible which felt a little
silly. :^)
2023-02-03 12:44:04 +00:00
Sam Atkins
7d0529b89c AK: Remove JsonObject::get_deprecated() and ::get_ptr() :^) 2023-02-03 07:19:52 -05:00
Sam Atkins
d48e632696 Utilities/w: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
8c4abf0ed8 Utilities/route: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
f1f02b33e6 Utilities/pmap: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
39f3a15022 Utilities/netstat: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
f14a1da633 Utilities/mount: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
c1d3f39cc4 Utilities/lsusb: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
e8ebbcdbc5 Utilities/lsof: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
5d8a87bf1f Utilities/lsjails: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
a04ca015bf Utilities/lsirq: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
7ce32cb82a Utilities/lscpu: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
8647743504 Utilities/json: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
f63eaee20c Utilities/ifconfig: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
08c26e988a Utilities/fortune: Replace uses of JsonObject::get_deprecated()/get_ptr 2023-02-03 07:19:52 -05:00
Sam Atkins
609a123c43 Utilities/df: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Sam Atkins
d4f0cfec7f Utilities/arp: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-02-03 07:19:52 -05:00
Federico Guerinoni
9f4bf1b04e Ladybird: Set fixed height for Settings 2023-02-03 05:10:51 -07:00
Federico Guerinoni
17e9db4fa1 Ladybird: Add setting for page to open on new tab 2023-02-03 05:10:51 -07:00
Federico Guerinoni
80da16e54a Ladybird: Design settings layout in horizontal 2023-02-03 05:10:51 -07:00
Zaggy1024
0f45153bbb LibVideo/VP9: Use proper indices for updating inter_mode probabilities
I previously changed it to use the absolute inter-prediction mode
values instead of the ones relative to NearestMv. That caused the
probability adaption to take invalid indices from the counts and broke
certain videos.

Now it will just convert to the PredictionMode enum when returning from
parse_inter_mode, which allows us to still use it the same as before.
2023-02-03 09:10:14 +01:00
Zaggy1024
7b92eff4a6 LibVideo/VP9: Use u32 to store the parsed value counts
There were rare cases in which u8 was not large enough for the total
count of values read, and increasing this to u32 should have no real
effect on performance (hopefully).
2023-02-03 09:10:14 +01:00
Zaggy1024
69e9f9ff63 LibVideo/VP9: Prevent negation overflow in BitStream::read_s 2023-02-03 09:10:14 +01:00
Zaggy1024
f58c5ff569 LibVideo/VP9: Correct the mode/partition probability adaption counts 2023-02-03 09:10:14 +01:00
Zaggy1024
4224f253af LibVideo/VP9: Increase the size of summed boolean counts in merge_probs
This fixes an issue where probabilities that sum to greater than 255
would wrap and cause the maximum probability adaption to take effect.
2023-02-03 09:10:14 +01:00
Timothy Flynn
7c1fe32af3 WebContent: Remove pending file requests before invoking their callbacks
It's currently possible for the callback of a file request to request
more file objects. This could cause the hash map storing these requests
to be rehashed while one of its callbacks is being invoked. AK::Function
explicitly forbids this with an assertion.

Instead, remove the callback from the hash map before invoking the
callback function.
2023-02-02 19:14:00 +00:00
Timothy Flynn
2af7447dfd AK: Define HashMap::take to find and remove a value from the map 2023-02-02 19:14:00 +00:00
Timothy Flynn
f31bd190b0 AK: Ensure string types are actually considered hash-compatible
The AnyString concept is currently broken because it checks whether a
StringView is constructible from a type T. The StringView constructors,
however, only accept constant rvalue references - i.e. `T const&`.

This also adds a test to ensure this continues to work.
2023-02-02 19:14:00 +00:00
Timothy Flynn
2f67f2ba3d AK: Return a constant reference from HashMap's constant get() override
We cannot return a mutable reference from a constant function.
2023-02-02 19:14:00 +00:00
Tim Schumacher
ef7f343e95 CMake: Set DWARF version before the debug information level
Setting the DWARF version after having selected which level of debug
information to generate apparently undoes some settings again.

Doing the reverse apparently keeps both the version and the debug level
setting, resulting in a significantly smaller disk image size.
2023-02-02 16:31:09 +01:00
Sam Atkins
3fbebe73a8 Chess: Replace 'Style' menu with a link to GamesSettings
GamesSettings provides a nicer way of editing these, rather than having
them crammed into a menu.
2023-02-02 14:52:21 +01:00
Sam Atkins
89d7d29d68 Chess: Automatically update and repaint when the config changes 2023-02-02 14:52:21 +01:00
Sam Atkins
05913b853a GamesSettings: Add chess settings :^)
This adds a tab for configuring the appearance of Chess, along with a
preview.
2023-02-02 14:52:21 +01:00
Sam Atkins
64c9c7a4da Chess: Paint pieces using BilinearBlend instead of NearestNeighbor
This makes the pieces look a lot nicer when the window isn't the exactly
ideal size. Vector images might be worth pursuing later.
2023-02-02 14:52:21 +01:00
Sam Atkins
e9eeaedc24 Chess: Stop hiding the frame border
This `fill_rect()` call was covering the nice border that we just
painted a few lines earlier.
2023-02-02 14:52:21 +01:00
Sam Atkins
3d38b7a127 Chess: Move configuration values into the "Games" domain
Chess is a game, after all. This makes more sense once we have chess
settings in GamesSettings. :^)
2023-02-02 14:52:21 +01:00
Sam Atkins
1cb6494852 Chess: Stop trying to read non-existent window-size config value
Nobody ever sets this, and it doesn't seem especially useful, so let's
remove it.
2023-02-02 14:52:21 +01:00
Sam Atkins
d3953c6b73 GamesSettings: Make CardSettingsWidget creation fallible 2023-02-02 14:52:21 +01:00
Sam Atkins
66f2f4d647 GamesSettings: Rename Preview -> CardGamePreview 2023-02-02 14:52:21 +01:00
Rodrigo Tobar
286e3e6872 LibPDF: Simplify Encoding to align with simple font requirements
All "Simple Fonts" in PDF (all but Type0 fonts) have the property that
glyphs are selected with single byte character codes. This means that
the Encoding objects should use u8 for representing these character
codes. Moreover, and as mentioned in a previous commit, there is no need
to store the unicode code point associated with a character (which was
in turn wrongly associated to a glyph).

This commit greatly simplifies the Encoding class. Namely it:

 * Removes the unnecessary CharDescriptor class.
 * Changes the internal maps to be u8 -> FlyString and vice-versa,
   effectively providing two-way lookups.
 * Adds a new method to set a two-way u8 -> FlyString mapping and uses
   it in all possible places.
 * Simplified the creation of Encoding objects.
 * Changes how the WinAnsi special treatment for bullet points is
   implemented.
2023-02-02 14:50:38 +01:00