Commit Graph

47699 Commits

Author SHA1 Message Date
Sam Atkins
9f9ea8ccb5 LibCMake+LibSyntax: Add a CMake syntax highlighter 2023-03-04 05:43:43 -07:00
Sam Atkins
3d8cc2257f LibCMake: Introduce a CMake lexer 2023-03-04 05:43:43 -07:00
Sam Atkins
ca4cc03269 AK: Format Debug.h.in
Indented #cmakedefine01 is supported since CMake 3.10:
https://cmake.org/cmake/help/latest/release/3.10.html#commands

We're on 3.16, and the minimum required for Serenity itself is 3.25, so
this should be fine. And it makes CLion's auto-formatter much happier!
2023-03-04 05:43:43 -07:00
Ryan Liptak
72e23cfa6d Base: Add 6 new emojis
🦶 U+1F9B6 - Foot
👺 U+1F47A - Goblin
🤛 U+1F91B - Left-Facing Fist
🤜 U+1F91C - Right-Facing Fist
👹 U+1F479 - Ogre
🪩 U+1FAA9 - Mirror Ball
2023-03-04 07:43:12 +00:00
Xexxa
a829160d55 Base: Add more emoji
🏻 - U+1F3FB LIGHT SKIN TONE
🏼 - U+1F3FC MEDIUM-LIGHT SKIN TONE
🏽 - U+1F3FD MEDIUM SKIN TONE
🏾 - U+1F3FE MEDIUM-DARK SKIN TONE
🏿 - U+1F3FF DARK SKIN TONE
2023-03-04 00:16:30 +00:00
Andreas Kling
3ad498f2e0 CharacterMap: Tweak layout & style of "find character" window 2023-03-04 00:29:38 +01:00
Andreas Kling
bb4b747424 LibGUI: Make Button height adapt to the current font size 2023-03-04 00:29:38 +01:00
Andreas Kling
5979ce8316 Applets/Keymap: Repaint applet on demand only
Instead of poking into the the applet window backing store whenever
the keymap changes, we now drive the GUI updates properly via
update() and paint_event().

This fixes an issue where changing the system font would cause a
"ghosting" effect in the keymap applet.
2023-03-04 00:29:38 +01:00
Andreas Kling
66c04b98f1 Documentation: Add HIG document about writing UI text
This first cut only deals with capitalization.
2023-03-04 00:29:38 +01:00
Andreas Kling
508fb7e1e9 Userland: Use Font::pixel_size_rounded_up() in more places 2023-03-04 00:29:38 +01:00
Andreas Kling
2e2c717e89 LibGfx: Remove Font::glyph_height() virtual
The override on BitmapFont remains, as that is actually used within
the FontEditor program.
2023-03-04 00:29:38 +01:00
Andreas Kling
b71c7a6e44 Userland: Use Font::pixel_size_rounded_up() instead of glyph_height()
The only remaining clients of this API are specific to bitmap fonts and
editing thereof.
2023-03-04 00:29:38 +01:00
Andreas Kling
93c9344e35 LibGfx: Add Font::pixel_size_rounded_up()
This returns the font's size (distance between ascender and descender)
in pixels, rounded up to the nearest integer.

This is the number we want to use in a lot of UI code, so let's have
a friendly API for it instead of ceil'ing the pixel_size() in a million
random places.
2023-03-04 00:29:38 +01:00
Andreas Kling
6c8e9fa1b3 LibGUI: Paint the GroupBox title with left alignment
This fixes an issue where the title would shift around at the subpixel
level when appended to. (Only matters for vector fonts.)
2023-03-04 00:29:38 +01:00
Luke Wilde
7b635998a8 LibWeb: Make Window.screen a replaceable attribute
Required by Shadertoy.
2023-03-03 22:27:49 +00:00
Timothy Flynn
4463de3d10 LibGUI: Compute syntax-highlighted visual text spans using float rects
For vector fonts in particular, we need to take care to compute offsets
using floating point math. For example, with Berkeley Mono at font size
16, with syntax highlighting enabled, we are currently truncating these
offsets to integers. This results in a leftward-drift when we paint the
text.

This changes the rect in which we paint syntax-highlighted text spans to
a float rect. As we traverse the spans, we now no longer truncate any of
the text offsets, and we draw the text in the correct positions.

This is likely not a complete solution. TextEditor blindly casts ints to
floats all over, and we will want to make all of these (hundred+) float-
aware. But this should be a step in the right direction and makes vector
fonts immediately more comfortable to use.
2023-03-03 22:49:12 +01:00
Sam Atkins
c7736ef410 LibWeb: Add some folding regions to HTML syntax highlighter
This adds the regions generated from embedded CSS and JS, and also for
HTML block comments.

The glaring omission is that we don't add them for start/end tags. HTML
allows start and end tags to not always match up, and I believe that's
going to require some variation on the adoption-agency algorithm to
make it work correctly.
2023-03-03 21:56:42 +01:00
Sam Atkins
e239e1ccbc LibSyntax: Expose folding regions from ProxyHighlighterClient 2023-03-03 21:56:42 +01:00
Sam Atkins
cdf80f20e6 LibWeb: Add folding regions to CSS syntax highlighter 2023-03-03 21:56:42 +01:00
Sam Atkins
947855c23b LibCpp: Add folding regions to syntax highlighters
This just looks at {} blocks. Unfortunately the two highlighters work
differently enough that the code has to be duplicated.
2023-03-03 21:56:42 +01:00
Sam Atkins
1c0c59eabe LibGUI: Add folding regions to INI syntax highlighter
This lets you fold sections into a single line. We attempt to keep 1
blank line after the folded section if possible.
2023-03-03 21:56:42 +01:00
Dan Klishch
4536b80a62 AK+readelf: Issue error when using ARCH(arch) with nonexistent arch
This disallows erroneous `#if ARCH(x86_64)` (note lowercase x).
2023-03-03 21:53:41 +01:00
Linus Groh
11b40dbcf5 LibWeb/WebIDL: Store SimpleException message as a String{,View} variant 2023-03-03 19:50:36 +00:00
Linus Groh
1032ac2453 LibWeb/Fetch: Store Response error message as a String{,View} variant
The majority of error strings are StringView literals, and it seems
silly to require heap-allocating strings for these.

This idea is stolen from a recent change in fd1fbad :^)
2023-03-03 19:50:36 +00:00
Timothy Flynn
03f32bdf86 LibUnicode: Validate that all emoji images in /res/emoji actually exist
This will raise a compile error if an emoji image was neglected to be
added to e.g. emoji-serenity.txt, or if the code points are not correct.
2023-03-03 17:09:58 +00:00
Timothy Flynn
360e7d22fc Base: Remove emoji image for U+1F408 U+2B1B (BLACK CAT)
This was added in d1de7f7782, but these are not the right code points
(missing U+200D), and we already have a BLACK CAT emoji with the right
code points.
2023-03-03 17:09:58 +00:00
Timothy Flynn
b52d6c2539 Base: Add Norwegian NO-23 Trøndelag flag to emoji-serenity.txt
This was missed in 2f7873d427.
2023-03-03 17:09:58 +00:00
Timothy Flynn
da0d000909 AK: Ensure short String instances are valid UTF-8
We are currently only validating long strings.
2023-03-03 11:46:42 -05:00
Timothy Flynn
434ca78425 AK: Protect Utf8View against inclusion in the Kernel
It will soon be included in the Kernel by way of String.h. Utf8View
includes DeprecatedString, which is not allowed in the Kernel.
2023-03-03 11:46:42 -05:00
Timothy Flynn
c4d78c29a2 AK: Invalidate overlong UTF-8 code point encodings
For example, the code point U+002F could be encoded as UTF-8 with the
bytes 0x80 0xAF. This trick has historically been used to bypass
security checks.
2023-03-03 11:46:42 -05:00
Timothy Flynn
796a615bc1 AK: Replace UTF-8 string validation with a constexpr implementation
This will allow validating UTF-8 strings at compile time, such as from
String::from_utf8_short_string.
2023-03-03 11:46:42 -05:00
Andreas Kling
f6f62d7ff6 TerminalSettings: Move scrollback settings from "Terminal" to "View"
The scrollback is really a property of the view, not the terminal.
2023-03-03 15:38:59 +01:00
Andreas Kling
3823f77d20 TerminalSettings: Spruce up the "Terminal" tab a bit
- Use sentence style capitalization for CheckBox and GroupBox titles
- Remove excessive explanation of bell mode.
- Put a "lines" label after the scrollback history length input instead
  of saying "(Lines)" in the GroupBox title.
- Tweak bell mode titles to make them self explanatory.
- Tweak language for exit confirmation.
2023-03-03 15:38:59 +01:00
Andreas Kling
880504e51d TerminalSettings: Spruce up the "View" tab a bit
- Use sentence style capitalization for CheckBox and GroupBox titles.
- Move the terminal font to the top.
- Split the cursor settings into two GroupBoxes (one for the shape,
  and one for the blinking behavior).
2023-03-03 15:38:59 +01:00
Andreas Kling
df0bf51441 TerminalSettings: Adjust layouts
Remove assymmetric vertical padding in various places.
2023-03-03 15:38:59 +01:00
Andreas Kling
165b077815 TerminalSettings: Change tab order
Let's put the "View" tab first, since the most common reason to open
TerminalSettings is to adjust something about the appearance.
2023-03-03 15:38:59 +01:00
Andreas Kling
460303b2fe LibGfx: Draw checkbox check in the center of the checkbox rect
This looks better at larger checkbox sizes than just drawing it in the
top left corner. Ideally we'd have a scalable checkmark, of course.
2023-03-03 15:38:59 +01:00
Andreas Kling
ee001cc417 LibGUI: Make CheckBox height adapt to the current font size 2023-03-03 15:38:59 +01:00
Andreas Kling
fdcdc14fce LibGUI: Make RadioButton height adapt to the current font size 2023-03-03 15:23:47 +01:00
Andreas Kling
f1e0eb8a25 LibGUI: Round up font sizes in various widget size calculations 2023-03-03 15:23:47 +01:00
Andreas Kling
c44bc58aaa HackStudio: Don't hard-code a default code font
If no HackStudio specific code font is set, we fall back to the system
default fixed-width font.
2023-03-03 15:23:47 +01:00
Andreas Kling
d0977ac566 LibCore+LibGUI+About: Use String in Core::Version and GUI::AboutDialog
The Core::Version API now returns ErrorOr<String>, and the
GUI::AboutDialog API was adjusted to accommodate this.
2023-03-03 15:23:47 +01:00
Linus Groh
ad4b4046f4 LibWeb/Fetch: Propagate OOM errors from HeaderList::extract_mime_type() 2023-03-03 11:02:21 +00:00
Linus Groh
2d7ce38ee2 LibWeb/MimeSniff: Port MimeType to new String 2023-03-03 11:02:21 +00:00
Linus Groh
fabea2a6a7 LibWeb/MimeSniff: Rename MimeType::from_string() to MimeType::parse()
This matches the spec's "parse a MIME type".
2023-03-03 11:02:21 +00:00
Linus Groh
65ab6d3b6f LibWeb/XHR: Fix blob type in XMLHttpRequest::response()
The type attribute of a blob is supposed to be a complete mime type of
the form "type/subtype", not just the determined mime type's type.
2023-03-03 11:02:21 +00:00
Linus Groh
45dc3d8a3e AK: Add String::ends_with{,_bytes}() 2023-03-03 11:02:21 +00:00
Linus Groh
bfdbb4b6ed AK: Add missing const qualifier to HashCompatible HashMap::contains() 2023-03-03 11:02:21 +00:00
Linus Groh
11023a3c53 LibWeb/Fetch: Port infrastructure to new String 2023-03-03 09:25:34 +00:00
Linus Groh
7f9ddcf420 LibWeb/Fetch: Port JS interfaces to new String
Since BodyInit and Headers are tightly coupled to both Request and
Response, I chose to do all of them at once instead of introducing a
bunch of temporary conversion glue code.
2023-03-03 09:25:34 +00:00