Commit graph

15325 commits

Author SHA1 Message Date
Srimanta Barua
0e9fb803c8 LibGfx: Finally render simple TTF outlines. 2020-12-30 20:40:30 +01:00
Srimanta Barua
b70c1fe181 LibGfx: Rasterize simple TTF glyphs. 2020-12-30 20:40:30 +01:00
Srimanta Barua
e3b5d2afeb LibGfx: Load glyph definition from "glyf" table for TTF fonts.
CFF fonts don't have "glyf" or "loca", so this code will need to be
extended to handle them.
2020-12-30 20:40:30 +01:00
Srimanta Barua
675237180f LibGfx: Get glyph ID for codepoint, from the CMAP table. 2020-12-30 20:40:30 +01:00
Srimanta Barua
be1586850d LibGfx: Started working on TTF font parser.
I'm planning to make this a minimal-allocation TTF parser. This will
speed up start-up time for applications, but have some overhead for
rasterizing glyphs. Which should be okay, since rasterized glyph bitmaps
should be cached anyway.

This commit just adds the loading of the HEAD table.
2020-12-30 20:40:30 +01:00
Andreas Kling
6cec7a2da6 TextEditor: Switch to using GUI::FontPicker for picking editor font :^) 2020-12-30 20:37:51 +01:00
Andreas Kling
8fe1643c4b LibGUI: Make FontPicker correctly select the current font when opened 2020-12-30 20:37:51 +01:00
Andreas Kling
34ae570928 Terminal: Switch to using GUI::FontPicker for choosing terminal font 2020-12-30 20:37:51 +01:00
Andreas Kling
7e40c7cf99 LibGUI: Allow GUI::FilePicker to show only fixed-width fonts
This is useful when you really only want something monospaced. :^)
2020-12-30 20:37:51 +01:00
Andreas Kling
ddaa526769 LibGUI: Add a GUI::FontPicker dialog class :^)
This allows you to pick & choose a font by selecting the family, weight
and size you want. It shows you a nice preview sentence and everything.
2020-12-30 20:37:51 +01:00
Andreas Kling
aacab897e8 LibGUI: Add widget registration for GUI::ListView 2020-12-30 20:37:51 +01:00
AnotherTest
6422a04cda AK+ProtocolServer: Properly close download stream fd's
This makes the issue of running out of openable pipes in the
ProtocolServer process much less likely (but still possible).
2020-12-30 20:37:41 +01:00
AnotherTest
bdd4b99d72 LibIPC: Add an on_destruction hook to IPC::Message
Any cleanup of resources needed (up until the message is sent) can be
done here.
Currently, the only such resource is an IPC::File.
2020-12-30 20:37:41 +01:00
AnotherTest
b03e8a6d06 LibWeb: Re-enable favicons after forgotten if-0 2020-12-30 20:37:41 +01:00
asynts
7e62ffbc6e AK+Format: Remove TypeErasedFormatParams& from format function. 2020-12-30 20:33:53 +01:00
Luke
865f5ed4f6 Kernel: Prevent sign bit extension when creating a PDPTE
When doing the cast to u64 on the page directory physical address,
the sign bit was being extended. This only beomes an issue when
crossing the 2 GiB boundary. At >= 2 GiB, the physical address
has the sign bit set. For example, 0x80000000.

This set all the reserved bits in the PDPTE, causing a GPF
when loading the PDPT pointer into CR3. The reserved bits are
presumably there to stop you writing out a physical address that
the CPU physically cannot handle, as the size of the reserved bits
is determined by the physical address width of the CPU.

This fixes this by casting to FlatPtr instead. I believe the sign
extension only happens when casting to a bigger type. I'm also using
FlatPtr because it's a pointer we're writing into the PDPTE.
sizeof(FlatPtr) will always be the same size as sizeof(void*).

This also now asserts that the physical address in the PDPTE is
within the max physical address the CPU supports. This is better
than getting a GPF, because CPU::handle_crash tries to do the same
operation that caused the GPF in the first place. That would cause
an infinite loop of GPFs until the stack was exhausted, causing a
triple fault.

As far as I know and tested, I believe we can now use the full 32-bit
physical range without crashing.

Fixes #4584. See that issue for the full debugging story.
2020-12-30 20:33:15 +01:00
Peter Nelson
d014277973 Docs: Update WSL notes with some workarounds for known issues 2020-12-30 20:31:30 +01:00
Linus Groh
b3da5835f2 Toolchain: Fix incorrect use of ENV{SERENITY_ARCH} in CMakeToolchain.txt
This was setting CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to
"ENV{SERENITY_ARCH}-pc-serenity-...", causing some ports to not build
properly.
2020-12-30 20:30:43 +01:00
Linus Groh
45f00ce38d CrashReporter: Show assertion message in backtrace, if any 2020-12-30 16:28:27 +01:00
Linus Groh
efdbd778c2 LibC: Set "assertion" coredump metadata in __assertion_failed() 2020-12-30 16:28:27 +01:00
Linus Groh
d84b96bddc Kernel: Embed a Metadata notes entry in coredumps 2020-12-30 16:28:27 +01:00
Linus Groh
91332515a6 Kernel: Add sys$set_coredump_metadata() syscall
This can be used by applications to store information (key/value pairs)
likely useful for debugging, which will then be embedded in the coredump.
2020-12-30 16:28:27 +01:00
Linus Groh
7413a7c509 LibELF+LibCoreDump: Add a Metadata notes entry
This is a new NotesEntry type which will allow applications to embed
arbitrary metadata in crashdumps (stored as a JSON string). It will be
used to store an assertion message, for example.
2020-12-30 16:28:27 +01:00
Andreas Kling
aa941a31ed LibGUI: Make SpinBox up/down buttons look right when disabled 2020-12-30 16:13:38 +01:00
Andreas Kling
0c7f3296e3 WidgetGallery: Tweak UI layout for "Modals" tab 2020-12-30 16:13:38 +01:00
Andreas Kling
26abb691d8 LibGUI: Make disabled scrollbars have more disabled looking icons
Draw a threed drop highlight under the arrows on disabled scrollbars.
This makes it more visible that they are disabled.
2020-12-30 16:13:38 +01:00
Morc - Richard Gráčik
d32c845652 Terminal: Fix bell mode in Terminal Settings 2020-12-30 15:22:14 +01:00
Andreas Kling
9f5eb49407 WebContent: Pledge "recvfd" :^)
This is needed so we can receive file descriptors from ProtocolServer.

Fixes #4660.
2020-12-30 15:21:29 +01:00
Andreas Kling
1215d2a642 LibGUI: Make GUI::ScrollBar inherit from AbstractSlider 2020-12-30 15:20:47 +01:00
Andreas Kling
cb67264f61 LibGUI: Rename AbstractSlider::on_value_changed => on_change
This matches other similar hook names.
2020-12-30 15:20:47 +01:00
Andreas Kling
3b445bc66a LibGUI: Add page_step setting to AbstractSlider and use it in Slider
This makes clicking on the track of a GUI::Slider actually move the
knob more than 1 value unit (assuming page_step > 1)
2020-12-30 15:20:47 +01:00
Andreas Kling
fa836a4dda LibGUI: Add GUI::AbstractSlider and move generic parts of Slider there
This will allow us to share some code between Slider and ScrollBar.
2020-12-30 15:20:47 +01:00
Linus Groh
761169f5c0 CrashReporter: Show PID from coredump 2020-12-30 15:00:17 +01:00
Linus Groh
bde65ba7ca CrashReporter: Read executable path from coredump process info
We no longer have to look at the backtrace and guess the executable,
it's now embedded in the coredump's ProcessInfo notes entry directly.

Fixes #4645.
2020-12-30 15:00:17 +01:00
Linus Groh
6fe6e0a36a Kernel: Embed a ProcessInfo notes entry in coredumps 2020-12-30 15:00:17 +01:00
Linus Groh
a28954a882 LibELF+LibCoreDump: Add a ProcessInfo notes entry
This is a new NotesEntry type which contains information related to the
coredump's process:

- PID
- executable path

Having these in the coredump explicitly avoids having to parse them from
the coredump filename and backtrace, respectively.
2020-12-30 15:00:17 +01:00
Andreas Kling
9227e66bb4 LibGUI: Use Window::center_within() in GUI::Dialog 2020-12-30 13:44:58 +01:00
Andreas Kling
2c9147154c Terminal+LibVT: Add settings window to the terminal context menu 2020-12-30 13:42:16 +01:00
Andreas Kling
04e3bcfa75 LibGUI: Add Window::center_within(Window)
This allows you to easily center one window within another window.
2020-12-30 13:41:53 +01:00
AnotherTest
4a2da10e38 ProtocolServer: Stream the downloaded data if possible
This patchset makes ProtocolServer stream the downloads to its client
(LibProtocol), and as such changes the download API; a possible
download lifecycle could be as such:
notation = client->server:'>', server->client:'<', pipe activity:'*'
```
> StartDownload(GET, url, headers, {})
< Response(0, fd 8)
* {data, 1024b}
< HeadersBecameAvailable(0, response_headers, 200)
< DownloadProgress(0, 4K, 1024)
* {data, 1024b}
* {data, 1024b}
< DownloadProgress(0, 4K, 2048)
* {data, 1024b}
< DownloadProgress(0, 4K, 1024)
< DownloadFinished(0, true, 4K)
```

Since managing the received file descriptor is a pain, LibProtocol
implements `Download::stream_into(OutputStream)`, which can be used to
stream the download into any given output stream (be it a file, or
memory, or writing stuff with a delay, etc.).
Also, as some of the users of this API require all the downloaded data
upfront, LibProtocol also implements `set_should_buffer_all_input()`,
which causes the download instance to buffer all the data until the
download is complete, and to call the `on_buffered_download_finish`
hook.
2020-12-30 13:31:55 +01:00
AnotherTest
36d642ee75 pro: Add support for sending POST requests and custom headers 2020-12-30 13:31:55 +01:00
AnotherTest
4e203f7e2d AK: Add {Input,Output}FileStream
Unlike the ones in LibCore, these only wrap an stdio FILE* (or an fd,
which they close when destroyed).
2020-12-30 13:31:55 +01:00
AnotherTest
bf7cda414f AK: Add a ByteBuffer::copy(ReadonlyBytes) overload 2020-12-30 13:31:55 +01:00
AnotherTest
e7e5a5e677 Base: Add Amazon's intermediate root certificate (Server CA 1B) 2020-12-30 13:31:55 +01:00
Andrew Kaster
7d49ea9836 AK: Replace some SFINAE with requires clauses, clean up existing ones
Add requires clauses to constraints on InputStream and OutputStream
operator<< / operator>>. Make the constraint on String::number a
requires clause instead of SFINAE. Also, fix some unecessary IsSame in
Trie where specialized traits exist for the given use cases.
2020-12-30 13:28:49 +01:00
Tom
49a76164c8 Kernel: Consolidate the various BlockCondition::unblock variants
The unblock_all variant used to ASSERT if a blocker didn't unblock,
but it wasn't clear from the name that it would do that. Because
the BlockCondition already asserts that no blockers are left at
destruction time, it would still catch blockers that haven't been
unblocked for whatever reason.

Fixes #4496
2020-12-30 13:23:17 +01:00
Andreas Kling
94e4aa94b5 Terminal: Tweak height of settings window 2020-12-30 13:15:23 +01:00
Andreas Kling
db086ef9cc Terminal: Make the find shortcut Ctrl+Shift+F
Let's leave all the Ctrl+Letter shortcuts for the TTY itself.
2020-12-30 12:53:50 +01:00
Andreas Kling
5e46a911ae Base: Remove some low-quality color themes 2020-12-30 12:53:50 +01:00
AnotherTest
7d30692ac2 Playground: Add autocomplete 2020-12-30 12:53:39 +01:00