Commit Graph

16 Commits

Author SHA1 Message Date
Ali Mohammad Pur
5e1499d104 Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte
string.
As the null state has already been removed, there are no other
particularly hairy blockers in repurposing this type as a byte string
(what it _really_ is).

This commit is auto-generated:
  $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \
    Meta Ports Ladybird Tests Kernel)
  $ perl -pie 's/\bDeprecatedString\b/ByteString/g;
    s/deprecated_string/byte_string/g' $xs
  $ clang-format --style=file -i \
    $(git diff --name-only | grep \.cpp\|\.h)
  $ gn format $(git ls-files '*.gn' '*.gni')
2023-12-17 18:25:10 +03:30
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Jelle Raaijmakers
54108263d6 LibGfx: Add IntVector2/3/4 types
The type `Vector<N, int>` is used often enough that it warrants its own
dedicated type.
2022-05-05 20:50:46 +02:00
Lenny Maiorani
d144da3a62 LibGfx: Refactor Vector[2,3,4] to VectorN with specializations
`Gfx::Vector[2,3,4]` are nearly identical implementations. This code
redundancy does not follow the DRY (Don't Repeat Yourself) principle
leading to possible out-of-sync errors between the classes.

Combining these classes into a class template which can be specialized
for each needed size makes the differences obvious through
`constexpr-if` blocks and `requires` clauses.
2022-03-04 12:56:05 +01:00
Jesse Buhagiar
38fc7361ca LibGfx: Add ::xyz() swizzle operator to Vector4 2022-01-18 01:48:51 +02:00
Jesse Buhagiar
53ed93d909 LibGfx: Add unary operator-() to Vector2/3/4 2022-01-18 01:48:51 +02:00
Stephan Unverwerth
b07bb85700 LibGfx: Allow Vector{2,3,4} operators to accept different argument types
This is needed to e.g. multiply a Vector4<f32x4> by a float.
2022-01-09 16:21:13 +03:30
Andreas Kling
216e21a1fa AK: Convert AK::Format formatting helpers to returning ErrorOr<void>
This isn't a complete conversion to ErrorOr<void>, but a good chunk.
The end goal here is to propagate buffer allocation failures to the
caller, and allow the use of TRY() with formatting functions.
2021-11-17 00:21:13 +01:00
Hendiadyoin1
ed46d52252 Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one.
We avoid mixed usage for now though.

Also clean up some stale math includes and improper floatingpoint usage.
2021-07-19 16:34:21 +04:30
Daniel Bertalan
e364845456 LibGfx: Don't constexpr functions returning Strings
Since strings don't have a constexpr constructor, these won't have any
effect anyways. Furthermore, this is explicitly disallowed by the
standard, and makes Clang tools freak out.
2021-06-24 17:35:49 +04:30
Stephan Unverwerth
10ceeb092f Everywhere: Use s.unverwerth@serenityos.org :^) 2021-05-29 12:30:08 +01:00
Jelle Raaijmakers
5864aab87a LibGfx/Vector*: Implement Formatters 2021-05-15 00:41:30 +01:00
Stephan Unverwerth
077c340ea2 LibGfx: Add component wise * and / operators to Vector3 and Vector4 2021-05-13 08:34:26 +02:00
Hendiadyoin1
1424c4651f LibGfx: Constexpr Matrices and Vectors 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
09f850728a LibGfx: Add some missing operators to Vector3 Vector4 and Matrix4x4 2021-05-08 10:13:22 +02:00
Stephan Unverwerth
0c5d61ae88 LibGfx: Add Vector4 class 2021-05-08 10:13:22 +02:00