Commit graph

47730 commits

Author SHA1 Message Date
nipos
1dbc9bcc0b LibWeb: Add Solaris/SunOS platform string to ResourceLoader 2023-03-04 21:34:54 -07:00
nipos
d6fd97e8fb Meta: Link to libnsl and libsocket on Solaris in Lagom CMakeLists 2023-03-04 21:34:54 -07:00
nipos
72accd3a24 LibCore: Don't use execvpe on Solaris 2023-03-04 21:34:54 -07:00
nipos
dcb95dba17 LibCore: Refer to type utsname as struct on Solaris 2023-03-04 21:34:54 -07:00
nipos
8687dae0ca LibCore: Use non-const char * for sethostname on Solaris 2023-03-04 21:34:54 -07:00
nipos
cdd1c8d0d9 LibCore: Implement socket credentials for Solaris 2023-03-04 21:34:54 -07:00
nipos
9139515aed LibCore: Include sys/filio.h for file-related ioctls on Solaris 2023-03-04 21:34:54 -07:00
nipos
50e663f561 LibCore: Use SIG_TYP instead of sig_t for signals on Solaris 2023-03-04 21:34:54 -07:00
nipos
d65c912c09 AK: Add Solaris to platform detection 2023-03-04 21:34:54 -07:00
Lucas CHOLLET
7ddf9e9177 Tests: Replace test image with my own creation 2023-03-04 23:39:41 +00:00
Lucas CHOLLET
68cd6f5614 Tests: Add a test for SOF2 images with only spectral selection
You can generate one by using `cjpeg` with the -scan argument.

This image has been generated with the following scan file:
0 1 2: 0 0 0 0;
0: 1 9 0 0;
2: 1 63 0 0 ;
1: 1 63 0 0 ;
0: 10 63 0 0;
2023-03-04 23:39:41 +00:00
Lucas CHOLLET
89e8f4692d LibGfx: Don't reject SOF2 JPEGs that don't use spectral approximation
Precisely, we now accept every SOF2 image but error on scans that has a
spectral approximation parameter different of 0.
2023-03-04 23:39:41 +00:00
Lucas CHOLLET
342c94c4d7 LibGfx/JPEG: Check for element presence in HashMaps before dereferencing
This patch replaces vague checks with more precise ones and uses `get`
instead of `find` to retrieve an element of a hashmap.
2023-03-04 23:39:41 +00:00
Lucas CHOLLET
18064fdb92 LibGfx/JPEG: Don't call add_ac if not necessary
Calling it was harmless as add_ac iterates over the spectral selection,
hence it won't do anything if not needed. However, this patch remains
useful as it prevents dereferencing the iterator returned by find, in
case the AC table isn't defined yet. This case happens with SOF2 images
and is (pretty harmless as read only but still) undefined behavior.
2023-03-04 23:39:41 +00:00
Lucas CHOLLET
1926a86336 LibGfx/JPEG: Support End-Of-Bands run
This patch brings support for SOF2 JPEGs that only use spectral
selection :^)

We still don't have achieved full support for SOF2 images, but as an
example, we decode progressive JPEG from Cloudinary.
2023-03-04 23:39:41 +00:00
Lucas CHOLLET
e5385cdf24 LibGfx/JPEG: Link the actual chapter instead of the summary section 2023-03-04 23:39:41 +00:00
Lucas CHOLLET
6b8b45c8a3 LibGfx/JPEG: Replace magic numbers with their specified name 2023-03-04 23:39:41 +00:00
Linus Groh
bfe0df5677 LibWeb/HTML: Add missing SecurityError checks to Location 2023-03-04 23:27:08 +00:00
Linus Groh
0b8ebfb618 LibWeb/HTML: Replace ThrowCompletionOr with ExceptionOr in Location
The former should not be used in LibWeb unless required due to
overriding a JS::Object virtual method, for example.
2023-03-04 23:27:08 +00:00
Linus Groh
7d50be0b09 LibWeb/HTML: Port Location to new String 2023-03-04 23:27:08 +00:00
Linus Groh
7800276c0f LibWeb/Infra: Port serialize_javascript_value_to_json_string() to String 2023-03-04 23:27:08 +00:00
Linus Groh
93ed1b59c8 LibWeb/Infra: Port strip_and_collapse_whitespace() to new String 2023-03-04 23:27:08 +00:00
Linus Groh
f65cbeef5c LibWeb/Infra: Rename to_ascii_{{lower,upper}_case => {lower,upper}case} 2023-03-04 22:42:42 +00:00
Nico Weber
85507b34d7 icc: Introduce --name flag to load a built-in profile by name
...instead of from a file.

For now, `--name=sRGB` is the only valid value, but more will
probably follow in the future.

Just `icc --name=sRGB` prints the built-in sRGB profile.

`icc --name=sRGB --reencode-to=file.icc` writes it to file.icc.
2023-03-04 21:38:47 +00:00
Nico Weber
0ba532e14e LibGfx: Add a function to create an in-memory sRGB profile
This might be useful for converting data from arbitrary profiles to
sRGB.

For now, this only encodes the transfer function and puts in zero values
for chromaticities, whitepoint, and chromatic adaptation matrix.
This makes the profile unusable for now. But I've spent a very long time
reading things and need to check in some code, and it's some progress.

The encoded transfer function exactly matches the one in GIMP's built-in
sRGB ICC profile (but not the Compact-ICC-Profiles v4 one or the
RawTherapee v4 one -- I'll add a comment about why later.)
2023-03-04 21:38:47 +00:00
Nico Weber
8f415e7b21 LibGfx: Introduce ICC::Profile::create
This can be used to programmatically create ICC::Profile objects.
2023-03-04 21:38:47 +00:00
Ryan Liptak
130a84d830 Base: Add 14 new emojis
🏈 U+1F3C8 - American Football
🏉 U+1F3C9 - Rugby Football
🗿 U+1F5FF - Moai
🦵 U+1F9B5 - Leg
🧺 U+1F9FA - Basket
🤞 U+1F91E - Crossed Fingers
🤟 U+1F91F - Love-You Gesture
🖖 U+1F596 - Vulcan Salute
🫦 U+1FAE6 - Biting Lip
🫰 U+1FAF0 - Hand with Index Finger and Thumb Crossed
🫵 U+1FAF5 - Index Pointing at the Viewer
 U+26BD - Soccer Ball
☝ U+261D - Index Pointing Up
2023-03-04 15:53:06 +00:00
Andrew Kaster
9fb781d7db Base+Meta: Remove invalid symlinks from Base for more and env
These symlinks' only purpose was to be copied into the rootfs along with
the rest of Base. Instead of storing symlinks to files that either
don't exist in the Base directory, or point to an absolute path outside
of the serenity folder, move these symlinks into the
build-root-filesystem.sh script.
2023-03-04 15:18:57 +01:00
Andrew Kaster
c1983244a2 AK: Add StackInfo implementation for Windows
This prevents a warning when compiling jakt that it's not implemented.
2023-03-04 13:59:04 +01:00
Sam Atkins
0d0ad22572 HackStudio: Enable CMake syntax highlighting 2023-03-04 05:43:43 -07:00
Sam Atkins
ac824677b8 TextEditor: Enable CMake syntax highlighting 2023-03-04 05:43:43 -07:00
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