Andreas Kling
70d7fb6a03
LibCpp: Make C++ AST (mostly) const-correct
...
I cheated and used const_cast to avoid dealing with the strange pattern
where we sometimes do a delayed reparenting of an AST node.
2023-02-21 00:54:04 +01:00
Andreas Kling
eb4a69c377
LibImageDecoderClient: Fix minor const-correctness issue
...
By taking ownership of the bitmaps after decoding them, we avoid having
to call an API that would give us a const Bitmap.
2023-02-21 00:54:04 +01:00
Andreas Kling
456f12c5c8
LibPartition: Make Kernel parts const-correct re: StorageDevice&
...
We can't do I/O with a const StorageDevice&, so it has to be non-const.
2023-02-21 00:54:04 +01:00
Andreas Kling
c837e7bbf3
LibGL: Fix minor const-correctness issues
2023-02-21 00:54:04 +01:00
Andreas Kling
ca44b26b2a
LibGfx: Make Gfx::Path const-correct internally (segment list)
2023-02-21 00:54:04 +01:00
Andreas Kling
485958bb6f
LibTest: Fix minor const-correctness issue in TestSuite::find_cases()
2023-02-21 00:54:04 +01:00
Andreas Kling
08a90455ac
LibCards: Make find_card_stack_to_drop_on() non-const
...
This function returns a card stack that we might want to drop a card on,
so intuitively it should be a mutating function.
2023-02-21 00:54:04 +01:00
Andreas Kling
65710bf3f7
LibSQL: Fix minor const-correctness issues
2023-02-21 00:54:04 +01:00
Andreas Kling
2530b301db
LibGfx: Add const hack in Bitmap::to_bitmap_backed_by_anonymous_buffer()
2023-02-21 00:54:04 +01:00
Andreas Kling
4b3e229157
LibGfx: Replace Bitmap::invert() with Bitmap::inverted()
...
The new function return a new bitmap instead of mutating the current
one in place.
2023-02-21 00:54:04 +01:00
Andreas Kling
1f907a834f
LibGfx: Make Bitmap::scaled(1) return a clone
...
While returning the same image is a cute optimization, it violates the
expectation that the returned Bitmap is a new bitmap, not shared with
anyone else.
2023-02-21 00:54:04 +01:00
Andreas Kling
bd5d8e9d35
LibJS: Make RefPtr and NonnullRefPtr usage const-correct
...
This mainly affected the AST, which is now const throughout.
2023-02-21 00:54:04 +01:00
Niklas Poslovski
13f6767637
LibSQL: Don't use fchmod for socket on any BSD
2023-02-20 18:47:09 +01:00
nipos
f700d553ab
LibCore: Add support for NetBSD in anon_create
2023-02-20 18:46:51 +01:00
nipos
9a77934e23
LibCore: Enable file descriptor passing on all BSDs
2023-02-20 18:46:36 +01:00
nipos
b3aa36d7bd
LibCore: All BSDs need sig_t instead of sighandler_t
2023-02-20 18:42:54 +01:00
nipos
d710da108c
LibCore: Implement socket credentials for NetBSD
2023-02-20 18:42:29 +01:00
Sam Atkins
e54a03d497
LibGUI: Use Gfx::Font::bold_variant() instead of a manual lookup
...
This has the nice side-effect of being cached in the Font, instead of
being repeatedly looked up in the FontDatabase.
2023-02-20 18:41:47 +01:00
Sam Atkins
efd56cda6a
LibGUI: Use a while loop for iterating text spans
2023-02-20 18:41:47 +01:00
Sam Atkins
04deb81f71
LibGUI: Validate TextDocument spans when merging them, not when painting
...
TextDocument::merge_span_collections() automatically makes sure that the
spans are valid, move forwards, are in order, and do not overlap. This
means we don't have to check these things every time TextEditor paints
the document.
merge_span_collections() now does these checks instead. I am not certain
they are still useful, but someone in the past certainly did. I have
modified them to take advantage of the operator overloads and Formatter
that we now have.
2023-02-20 18:41:47 +01:00
Sam Atkins
54d45d4ac6
LibGUI: Add and use TextEditor::fixed_elements_width()
...
We were manually adding together the gutter and ruler widths in several
places. Soon we'll have a third section that needs to be included in
this width, so let's abstract it now.
2023-02-20 18:41:47 +01:00
Sam Atkins
1a5159df73
LibGUI+HackStudio: Simplify TextEditor gutter & ruler calculations
...
- Make gutter/ruler_content_rect() return rectangles relative to the
TextEditor widget.
- Re-order painting code to translate the Painter after the gutter/ruler
has been painted, to use those coordinates.
- Consistently put gutter before ruler in code, because that's the order
they physically appear.
2023-02-20 18:41:47 +01:00
MacDue
3676f5085e
LibWeb: Replace RefPtr
with ValueComparingRefPtr
in StyleValue
...
Like the name suggests this pointer type compares its pointees by value
rather than just by the pointer. This is needed for the defaulted
struct Properties equality operator.
This commit also contains a few changes to StyleValue such as replacing
the operator==()s with a .equals() again. This is done to avoid the new
reversed operator==()s ambiguity in C++20.
2023-02-20 10:50:20 +01:00
Nico Weber
1d124af66f
LibGfx: Implement serialization of Lut16TagData and Lut8TagData
2023-02-19 23:46:36 +01:00
Nico Weber
4bafdaba3f
LibGfx: Make Lut16TagData and Lut8TagData ctors verify table sizes
...
The from_bytes() methods error out on invalid table sizes,
but let's make sure other potential future callers get it right too.
2023-02-19 23:46:36 +01:00
Nico Weber
51be964884
LibGfx: Fix 7-bit ASCII checks in textDescriptionType and textType
...
This used to check the empty, moved-from parameter instead of
the member variable (-‸ლ)
2023-02-19 23:46:36 +01:00
Nico Weber
8f181e0e94
LibGfx: Implement serialization of NamedColor2TagData
2023-02-19 23:46:36 +01:00
Nico Weber
eac9941766
LibGfx: Make NamedColor2TagData verify inputs are 32-byte 7-bit ASCII
...
NamedColor2TagData::from_bytes() errors out if that isn't the case,
but let's make sure other potential future callers get it right too.
2023-02-19 23:46:36 +01:00
Nico Weber
7ad11fa59a
LibGfx: Mark a few ICC:NamedColor2TagData methods as const
2023-02-19 23:46:36 +01:00
Nico Weber
47cfcf5dca
LibGfx: Move NamedColorHeader to BinaryFormat.h
2023-02-19 23:46:36 +01:00
Nico Weber
937d018fc6
LibGfx: Use ICC::Profile::try_for_each_tag in encode_tag_datas()
2023-02-19 23:46:36 +01:00
Nico Weber
8179327068
LibGfx: Add fallible ICC::Profile::try_for_each_tag
...
Similar to 13b18a1
or d0f3f3d
.
2023-02-19 23:46:36 +01:00
Nico Weber
0f0694edb1
LibGfx: Remove an ICC writing FIXME, and a comment
2023-02-19 23:46:36 +01:00
Lucas CHOLLET
fa24f13452
LibGfx: Bring variables names closer to spec
...
Rename "reset_marker" to "restart_marker" as described by the spec. It
also concerns disambiguate the situation as the DRI was also called a
reset marker.
2023-02-19 23:39:59 +01:00
Lucas CHOLLET
51000961f2
LibGfx: Add a spec reference for JPEG constants definitions
2023-02-19 23:39:59 +01:00
Lucas CHOLLET
acc5161535
LibGfx: Add a spec link for the JPEG decoder
2023-02-19 23:39:59 +01:00
Lucas CHOLLET
71afef6466
LibGfx: Remove some magic variables in JPEGLoader
2023-02-19 23:39:59 +01:00
Lucas CHOLLET
c8213c24dd
LibGfx: Rename is_valid_marker()
to is_supported_marker()
2023-02-19 23:39:59 +01:00
Nico Weber
e2dde64628
LibGfx: Use static_cast in ICC writing code
...
It's what project leadership wants.
2023-02-19 22:31:41 +01:00
Nico Weber
0e66a5c3ed
LibGfx: Write multiLocalizedUnicodeType with multiple strings correctly
...
Found by reencoding Tests/LibGfx/test-inputs/icc-v2.png, the 'dscm' tag.
2023-02-19 22:31:41 +01:00
Nico Weber
07bf2d944c
LibGfx: Add a FIXME to ICC encode_tag_data()
2023-02-19 22:31:41 +01:00
Nico Weber
7e769c7217
LibGfx: Partially implement serialization of TextDescriptionTagData
...
It only implements serialization of the 7-bit ASCII string, not yet
serialization of the UCS-2 and Macintosh ScriptCode strings.
With this, matrix-based v2 profiles can be reencoded :^)
2023-02-19 22:31:41 +01:00
Nico Weber
b2cf773d85
LibGfx: Make TextDescriptionTagData verify input is 7-bit ASCII
...
TextDescriptionTagData::from_bytes() errors out if that isn't the case,
but let's make sure other potential future callers get it right too.
2023-02-19 22:31:41 +01:00
Nico Weber
e76f1caf79
LibGfx: Re-alphabetize TagData classes
...
This moves TextDescriptionTagData below SignatureTagData.
It just moves code around and doesn't change anything.
2023-02-19 22:31:41 +01:00
Nico Weber
4d972ab975
LibGfx: Add spec comment to ICC encode_tag_table()
2023-02-19 22:31:41 +01:00
Jonah
30ec59f163
WebDriver: Add computedlabel endpoint
2023-02-19 13:28:01 -05:00
MacDue
bb8c8a67dc
LibGfx: Fix a slight mistake in AA ellipse error calculation
...
The initial signs were wrong for the deltas of f(x), the ellipse
equation. This seemed to be fine for larger circles/ellipses but
broke things at a small scale, this was previously fixed with a
horrible "error = error / 4" hack. With this change, all ellipses
look a little better :^)
This also fixed a signed integer overflow Andreas found with UBSAN,
which happened for circles with a 1px radius.
2023-02-19 18:40:15 +01:00
Sam Atkins
2db168acc1
LibTextCodec+Everywhere: Port Decoders to new Strings
2023-02-19 17:15:47 +01:00
Sam Atkins
3c5090e172
LibTextCodec: Return Optional<Decoder&> from bom_sniff_to_decoder()
2023-02-19 17:15:47 +01:00
Sam Atkins
f2a9426885
LibTextCodec+Everywhere: Return Optional<Decoder&> from decoder_for()
2023-02-19 17:15:47 +01:00