Commit graph

15311 commits

Author SHA1 Message Date
Linus Groh 8ec1da2fca LibCoreDump: CoreDumpReader => CoreDump::Reader
As mentioned in 2d39da5 the usual pattern is that LibFoo provides a Foo
namespace - LibCoreDump doesn't, so this renames CoreDumpReader to
Reader and puts it in the CoreDump namespace. :^)
2020-12-29 15:42:30 +01:00
Linus Groh 1ed72cc580 AK: Add HashMap(std::initializer_list<Entry>) constructor
This allows us to construct a HashMap from an initializer list like so:

    HashMap<K, V> hash_map = { { K, V }, { K, V } { K, V } };
2020-12-29 15:22:15 +01:00
Egor Ananyin 1dbd264239 LibJS: Uncomment the tests that pass now 2020-12-29 13:43:16 +01:00
Egor Ananyin 92c6ae57fc LibM: Reimplement some functions using FPU 2020-12-29 13:43:16 +01:00
Linus Groh f1b596e75e Inspector: unveil("/bin", "r") so it can show app icons 2020-12-29 13:42:21 +01:00
Brendan Coles 2b3837a908 Userland: Add readelf utility 2020-12-29 11:24:23 +01:00
Andreas Kling 5c99296b92 LibELF: Don't try to call mremap() on macOS
There is no mremap() on macOS. I'm just #ifdef'ing out the call here
since I don't think the dynamic loader code matters on macOS anyway.
2020-12-29 10:56:43 +01:00
AnotherTest d0363bca01 LibJS: `save_state()' before creating a RulePosition
Fixes #4617.
2020-12-29 10:51:33 +01:00
asynts 620b73b3d5 AK+Format: Accept unsigned long in replacement fields.
I ran into this exact but at least twenty times in Serenity alone. The
C++ Standard dictates that 'unsigned long' and 'unsigned long long' are
distinct types even though on most platforms they are usually both 64
bit integers.

Also it wasn't possible to evaluate IsIntegral<T> for types that were
not integers since it used MakeUnsigned<T> internally.
2020-12-29 02:36:32 +01:00
AnotherTest cbe0a8b403 AK: Allow trailing '*'s in a glob pattern to match nothing
Fixes part of #4607.
2020-12-29 02:35:52 +01:00
Brendan Coles 2ad5bfd78e Themes: Sunshine: Tweak window-close 16x16 icon 2020-12-29 02:32:06 +01:00
Andreas Kling 572d3bb0b8 DynamicLoader: Only remap text segments private if there are textrels
We now map most shared library text segments shared, read+exec only.
This reduces our memory footprint at system startup by 16 MB which is
pretty neat! :^)
2020-12-29 02:28:36 +01:00
Andreas Kling 30dbe9c78a Kernel+LibC: Add a very limited sys$mremap() implementation
This syscall can currently only remap a shared file-backed mapping into
a private file-backed mapping.
2020-12-29 02:20:43 +01:00
Brendan Coles c1360ef22e Themes: Add Sunshine theme 16x16 window icons 2020-12-29 02:20:37 +01:00
Luke b980782343 Kernel/VM: Make local_offset in PhysicalRegion::find_one_free_page unsigned
An extension to #4613, as I didn't notice that it also happens here.
2020-12-29 02:20:26 +01:00
Luke eb38fe4a82 Kernel/VM: Make local_offset in PhysicalRegion::free_page_at unsigned
Anything above or equal to the 2 GB mark has the left most bit set
(0x8000...), which was falsely interpreted as negative due to
local_offset being signed.

This makes it unsigned by using FlatPtr. To check for underflow as
was intended, lets use Checked instead.

Fixes #4585
2020-12-29 01:41:16 +01:00
Brendan Coles c006952aeb Base: Add pape man page documentation 2020-12-29 01:02:01 +01:00
AnotherTest f606e78556 Spreadsheet: Show a small inline doc window for the "current" function
If the user is typing in the cell editor and has the cursor in a
function call, try to show a tip for the arguments of that function:
(cursor denoted by `|`)
```
sum(|
```
should show:
```
sum(cell names)
```
in a tooltip-like window below the editor.
2020-12-29 00:58:43 +01:00
AnotherTest aa5b43a2bc Spreadsheet: Highlight the source causing an exception in red
This commit makes the cell editor highlight the likely source of the
exception in red.
2020-12-29 00:58:43 +01:00
AnotherTest b34b681811 LibJS: Track source positions all the way down to exceptions
This makes exceptions have a trace of source positions too, which could
probably be helpful in making fancier error tracebacks.
2020-12-29 00:58:43 +01:00
AnotherTest f17874ecd2 Spreadsheet: Add a 'contents' getter/setter to Position
This makes it possible to change the cells' contents programmatically!
2020-12-29 00:58:43 +01:00
Andreas Kling cdf87d2204 LibWeb: Fill OOPWV with the palette base color until we have pixels
We were painting unfinished pixels while waiting for the WebContent
process to render the page. This caused OOPWV to flicker black
sometimes, which looked pretty bad.

This way we still flicker, but at least we flicker with the correct
palette color. :^)
2020-12-29 00:47:30 +01:00
Andreas Kling f06b240ce0 LibGUI: Enforce the SelectionMode in AbstractView::set_cursor() 2020-12-29 00:43:50 +01:00
Andreas Kling 66c0374fd7 LibGUI: Make FilePicker a little smaller by default 2020-12-29 00:30:25 +01:00
Andreas Kling 461c0afc25 LibGUI: Tweak FilePicker's default titles 2020-12-29 00:27:57 +01:00
Andreas Kling 43d9fe15f9 Revert "Kernel: Convert read_block method to get a reference instead of pointer"
This reverts commit 092a13211a.

Fixes #4611.
2020-12-29 00:06:52 +01:00
Andreas Kling 13594b7146 LibGfx+AK: Make text elision work with multi-byte characters
This was causing WindowServer and Taskbar to crash sometimes when the
stars aligned and we tried cutting off a string ending with "..." right
on top of an emoji. :^)
2020-12-28 23:54:10 +01:00
Andreas Kling 9af33e2e4b LibGfx: Make Painter::draw_text() interpret StringView as UTF-8 2020-12-28 23:54:10 +01:00
Lukasz Maciejewski 7e5199a394 LibTextCodec: Fix minor errors in Latin2 decoder 2020-12-28 23:31:12 +01:00
Andreas Kling 7e79563bb9 LibGUI: Show tooltip after a small delay
It always felt a bit jarring that tooltips would pop in right away when
you hover over a toolbar button. This patch adds a 700ms delay before
they appear, and a 50ms delay before they disappear.

Once a tooltip is up, moving the cursor between two widgets that both
have tooltips will leave the tooltip on screen without delays.
2020-12-28 21:28:40 +01:00
Andreas Kling 3717e5dbae WindowServer: Add a GetGlobalCursorPosition IPC request
This tells you where the mouse cursor is in screen coordinates.
2020-12-28 21:28:40 +01:00
Andreas Kling add01b304b LibCore: Make Core::Timer::create_single_shot() create a stopped timer
None of the code using this actually expected the timer to fire right
away, but they would instead call start() on it once they were ready to
accept a timer fire.

Let's make the API behave the way its clients believed it did. :^)
2020-12-28 21:28:40 +01:00
Andreas Kling f7116bba43 LibGUI: Refactor AbstractView "multi select" mode into "selection mode"
There are three possible selection modes for a GUI::AbstractView.

- NoSelection
- SingleSelection
- MultiSelection

We don't enforce these modes fully yet, this patch mostly adds them in
place of the old "multi select" flag.
2020-12-28 21:28:40 +01:00
Andrew Kaster 207ecf454a CI: Prevent MacOS Lagom test failures from failing the build.
Also, switch to macos-10.15 runners. They are not as experimental, and
seem to spin up much faster than the Big Sur ones.
2020-12-28 19:35:32 +01:00
Andrew Kaster 8ce7df73fb AK: Enable AK::SharedBuffer for all platforms
A future patch could do some MacOS specific things for
set_volatile/set_nonvolatile. For now, swap out the defined(__linux__)
branches for simple not __serenity__ branches.
2020-12-28 19:35:32 +01:00
Andrew Kaster 02fcf3974e AK/Userland: Use AK/Endian.h for portable byte swapping in ntpquery
Create macros for the byte swap operations one would expect to be in
endian.h or byteswap.h in AK/Endian.h. It's likely a similar/different
change will be needed for BSDs, but there's no github action for those
added to the project yet.
2020-12-28 19:35:32 +01:00
Andrew Kaster 42323d769a Meta: Disable rpath generation for MacOS 2020-12-28 19:35:32 +01:00
Andrew Kaster 1219c65249 AK: Add CLOCK_*_COARSE aliases for darwin and BSD variants
The coarse clocks in time.h are a linux extension that we've adopted.
MacOS and the BSDs don't have it, so we need an alias in a platform
header for Lagom builds.
2020-12-28 19:35:32 +01:00
Luke 3bdaba0b28 Meta: Add macOS workflow to CI
A good number of contributors use macOS. However, we have a bit of
a tendency of breaking the macOS build without realising it.

Luckily, GitHub Actions does actually supply macOS environments,
so let's use it.
2020-12-28 19:35:32 +01:00
Idan Horowitz b4bb2b141c FileManager: Implement the cut file operation
This exploits the comment lines in the text/uri-list specification:
https://tools.ietf.org/rfc/rfc2483.txt (page 11), which might be a bit
hackish, but the specification suggests doing the same for other uses,
so it should be fine.
2020-12-28 19:13:45 +01:00
Idan Horowitz 7450f20b81 FileManager: Add a delete_path helper for singular paths
This is just the syscalls and error handling that was done for each
file in delete_paths.

This will be used to prevent the unneeded construction of vectors
when performing cut operations
2020-12-28 19:13:45 +01:00
Egor Ananyin f30d4f22ef LibJS: Add tests for new Math functions 2020-12-28 19:03:11 +01:00
Egor Ananyin 7c9c3a10d3 LibJS: Add almost all Math functions 2020-12-28 19:03:11 +01:00
Andreas Kling a35693915e LibGUI: Make syntax highlighter communicate boldness instead of font
Now that fonts know their own weight, we no longer need highlighters to
tell us which font to use. Instead, they can just say "this should be
bold" and we'll find the right font ourselves.
2020-12-28 15:53:10 +01:00
Andreas Kling 105eb8e1bc LibGfx: Add FontDatabase::get(family, size, weight)
This function allows you to look up a font by its exact parameters.
2020-12-28 15:53:10 +01:00
Andreas Kling cd9ad6a05e LibGUI: Tweak AbstractButton and subclass constructors
Taking a "const StringView&" for the initial text does not achieve
anything useful. Just take a "String" and move it into storage.
2020-12-28 15:53:10 +01:00
Peter Nelson 476911e1f9 LibGfx: fix OOB access in LZW decoder on bad input
This fixes an issue where a corrupted LZW code can result in the first
element of an empty buffer being accessed.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27863
2020-12-28 15:12:29 +01:00
Luke be30dc2b18 LibJS: Implement Object.prototype.isPrototypeOf
Spec: https://tc39.es/ecma262/#sec-object.prototype.isprototypeof
2020-12-28 13:10:07 +01:00
AnotherTest ee1d9217aa LibRegex: Fail early if eof seen after '(?'
Fixes #4583.
2020-12-28 13:09:22 +01:00
Andreas Kling 92c073a9d1 LIbGUI+LibGfx: Paint focused push buttons with a heavier look
Draw a heavy shadow frame around focused push buttons for emphasis.
For now I've used the ThreedShadow2 color role as it feels dark enough.
2020-12-28 12:41:26 +01:00