Commit graph

15222 commits

Author SHA1 Message Date
Linus Groh
e2e2b2c08e LibELF: Add MemoryRegionInfo::object_name()
We had multiple implementations of this function, and it's a small
helper related to MemoryRegionInfo's region_name, so let's move it
there.
2020-12-29 15:42:30 +01:00
Linus Groh
c39323401c LibGUI: Consider comment tokens in GMLParser
It was just ignoring them, so any GML containing a comment would fail
to parse with "Expected child, property, or }"!
2020-12-29 15:42:30 +01:00
Linus Groh
d161007e9e LibGUI: Register Label "text_alignment" property 2020-12-29 15:42:30 +01:00
Linus Groh
750a608441 LibGUI: Register TextEditor "mode" property
This makes it possible to construct a read-only (or display-only)
TextEditor in GML:

    @GUI::TextEditor {
        mode: "ReadOnly"
        text: "Well hello friends! :^)"
    }
2020-12-29 15:42:30 +01:00
Linus Groh
1e70986d19 LibCore: Add REGISTER_TEXT_ALIGNMENT_PROPERTY macro 2020-12-29 15:42:30 +01:00
Linus Groh
6c0fa6ad93 LibCore: Add REGISTER_ENUM_PROPERTY macro
This can be used to register a property that maps enum values to certain
strings, e.g.

    REGISTER_ENUM_PROPERTY(
        property_name, getter, setter, Enum,
        { Enum::Foo, "Foo" },
        { Enum::Bar, "Bar" });

Also use it for REGISTER_SIZE_POLICY_PROPERTY :^)
2020-12-29 15:42:30 +01:00
Linus Groh
c4991d969c LibGUI: Register the ImageWidget and LinkLabel widgets 2020-12-29 15:42:30 +01:00
Linus Groh
b8eb1baac8 LibGUI: Move REGISTER_WIDGET(GUI, TabWidget) to Widget.cpp
All the other (GUI) registrations happen here, so it's confusing to have
just one elsewhere ("wait... is TabWidget not registered?!").
2020-12-29 15:42:30 +01:00
Linus Groh
a514f2cbfd LibGUI: Set default value of LinkLabel text argument to a null string
The regular Label also does this, being able to call the constructor
with no arguments is required for REGISTER_WIDGET(GUI, LinkLabel).
2020-12-29 15:42:30 +01:00
Linus Groh
21bc8cfe8f LibCoreDump: Make for_each_thread_info() callback arg a reference
It's never nullptr, so it should be a reference.
2020-12-29 15:42:30 +01:00
Linus Groh
87f1f69dd2 LibCoreDump: Make for_each_memory_region_info() callback arg a reference
It's never nullptr, so it should be a reference.
2020-12-29 15:42:30 +01:00
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