Commit graph

150 commits

Author SHA1 Message Date
0d5f7c1545
tests: move tests out of line 2025-11-21 16:22:40 +00:00
671792bcfe
i18n: fix error with localizing multi-var strings 2025-11-19 00:51:03 +00:00
0c6411851c
i18n/engine: optimize string generation 2025-11-16 20:02:11 +00:00
e3cae692f6
i18n/engine: fix pure stem matches 2025-11-15 22:21:40 +00:00
Constantin Piber
cb3e797fde
internal: fix missing headers (#86) 2025-11-10 22:02:48 +00:00
0a28f35c00
version: bump to 0.10.2 2025-11-10 13:00:04 +00:00
Vaxry
01afe9245b
tests: move to gtest (#85)
---------

Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
2025-11-09 18:05:01 +00:00
Vaxry
9a9745d7aa
string: add VarList2 (#84)
reworks how varList works, mixes best of both ConstVarList and regular VarList. Deprecates both.
2025-11-09 15:10:58 +00:00
Vaxry
968f881222
i18n: add i18n engine (#83)
Adds a translation engine
2025-11-09 14:18:33 +00:00
926689ddb9
version: bump to 0.10.1 2025-11-06 00:09:00 +00:00
9637961a55
string/constVarList: fix UAF 2025-11-05 15:04:02 +00:00
Freevatar
164a30b3d8
animation/bezier: Fix OOB in getYForPoint for non-monotonic 4-point curves (#81) 2025-11-03 22:25:56 +00:00
3df7bde01e
version: bump to 0.10.0 2025-10-05 00:12:03 +01:00
9ab64319e9
math/region: reinit region for scale()
Apparently on some setups directly modifying the rectangles is a no-go, see #78.

Pixman is another piece of undocumented shit. I hope whomever wrote this stubs their toe.

Note to self: drop pixman, rewrite region. Fucking idiots.
2025-10-04 21:22:03 +01:00
Maximilian Seidler
feaaf44d59
memory: make SP/ASP control blocks type agnostic (#79) 2025-10-04 20:35:48 +02:00
94cce79434
tests/math: add region scale test 2025-10-03 12:28:46 +01:00
c1f541256e
version: bump to 0.9.0 2025-10-03 12:16:41 +01:00
1f80045da1
bezier: fix with first point being non-0 2025-09-30 15:05:40 +01:00
a20932e200
bezier: add setup4 2025-09-30 13:56:37 +01:00
Tom Englund
64446e1a4c vector2d: make vector trivial
while profiling vector showed up as a marginal waster because it wasnt a
trivial class, a few if(m_someVector != Vector()) was causing a lot of
churn because of not being trivial and doing a lot of allocaitons and
destructions. make it trivial by defaulting constructor, and destructor,
and while we are at it make it constexpr friendly on constructors and
operators.
2025-09-28 00:01:31 +02:00
Tom Englund
05f0fb2774 memory: fix clangd warnings
modernize validHierarchy and isConstructible, mark move operator
noexcept, use default destructor instead of {}, __deleter is a reserved
name, remove a underscore.

as per clangd docs.
The C standard additionally reserves names beginning with a double underscore,
while the C++ standard strengthens this to reserve names with a double underscore occurring anywhere.
2025-09-27 01:01:56 +02:00
Tom Englund
427332a7ca memory: use initializer list in constructors
for trivial types this is optimized away, non trivial it default
constructs and then assigns it upon construction, minor waste. so lets
use initializer list for these custom types.
2025-09-27 01:01:56 +02:00
61e295340d
region: avoid tons of allocations for scale()
pixman_region32_rectangles returns the actual rects, so we shouldnt waste cycles when scaling em
2025-09-26 23:17:45 +01:00
b2ae320484
version: bump to 0.8.4 2025-08-25 12:23:08 +02:00
Ikalco
bc193efa4b
os/process: add setStdinFD (#74) 2025-08-25 12:04:44 +02:00
b364dcb739
nix: make mold optional 2025-08-21 20:05:54 +03:00
e631ea36dd version: bump to 0.8.3 2025-08-17 09:35:20 +02:00
Lukas
69efb6291c
memory: smart pointer factories should not be static (#72) 2025-08-14 16:16:28 +01:00
Kamikadze
df6b8820c4
memory: Add C++ cast aliases; replace existing casts and remove redundant casts (#71)
* Add and use c++ cast aliases

* wrap cast aliases in namespace

* remove redundant pragma once
2025-08-06 14:00:50 +02:00
c65d41d4f4
version: bump to 0.8.2 2025-07-29 16:49:27 +02:00
Tom Englund
8dd20c73e0
mat3x3: check for finite in toString (#70)
if values are NaN or inf it will crash std::format, safeguard it.
2025-07-23 12:14:37 +02:00
Maximilian Seidler
18fbac5a98
memory: add missing lock (#69) 2025-07-22 16:58:12 +02:00
Maximilian Seidler
b074d4abc7
memory: fix CAtomicSharedPointer mutex unlock and lifetime issues (#68) 2025-07-21 21:09:54 +02:00
Tom Englund
bcabcbada9 signal: reserve vector size to avoid reallocations
reserve the vector size to avoid reallocations.
2025-07-11 18:45:10 +02:00
Tom Englund
86905e2590 mat3x3: use float versions of sin/cos reduce dereferencing
use the sinf, cosf versions instead of casting the double one to float.
reduce the derefencing in multiply by pointing to the data directly.
2025-07-11 18:45:10 +02:00
Tom Englund
e21b18ff8f
region: introduce foreach and cleanup clangd warnings (#65)
* CRegion: introduce forEachRect

makes us able to directly call a function on each rect instead of using
getRects() allocating a vector every single time, especially when its
used in hot paths like the renderer.

* CRegion: cleanup CRegion of clangd warnings

overload pixman() with const, remove const_cast, mark move as noexcept.
ensure self assignment doesnt occur.
2025-07-10 11:12:26 +02:00
a8229739cf
version: bump to 0.8.1 2025-07-07 13:34:25 +02:00
FrancisTheCat
e89269578a
math/vector: Added transform method to Vector2D class (#64) 2025-07-05 23:18:58 +02:00
boundlessvoid0
4737241eaf
animation/beziercurve: add getter for control points (hyprwm/Hyprland#10413) (#63)
Signed-off-by: boundlessvoid <boundlessvoid0@gmail.com>
2025-06-28 00:04:42 +02:00
Brahmajit Das
1eb6759ae7
internal: fix missing cstdint include for GCC 16 (#62)
Without cstdint, building with GCC 16 fails with error

In file included from /tmp/hyprutils/tests/memory.cpp:1:
/tmp/hyprutils/./include/hyprutils/memory/UniquePtr.hpp: In member function ‘bool Hyprutils::Memory::CUniquePointer<T>::operator()(const Hyprutils:
:Memory::CUniquePointer<T>&, const Hyprutils::Memory::CUniquePointer<T>&) const’:
/tmp/hyprutils/./include/hyprutils/memory/UniquePtr.hpp:77:41: error: ‘uintptr_t’ does not name a type [-Wtemplate-body]
   77 |                 return reinterpret_cast<uintptr_t>(lhs.impl_) < reinterpret_cast<uintptr_t>(rhs.impl_);
      |                                         ^~~~~~~~~
/tmp/hyprutils/./include/hyprutils/memory/UniquePtr.hpp:4:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; this is probably fixable by adding
 ‘#include <cstdint>’
    3 | #include "ImplBase.hpp"
  +++ |+#include <cstdint>
    4 |
/tmp/hyprutils/./include/hyprutils/memory/UniquePtr.hpp:77:82: error: ‘uintptr_t’ does not name a type [-Wtemplate-body]
   77 |                 return reinterpret_cast<uintptr_t>(lhs.impl_) < reinterpret_cast<uintptr_t>(rhs.impl_);
      |                                                                                  ^~~~~~~~~
/tmp/hyprutils/./include/hyprutils/memory/UniquePtr.hpp:77:82: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; this is probably fixable by addi
ng ‘#include <cstdint>’

Downstream-bug: https://bugs.gentoo.org/957409

Signed-off-by: Brahmajit Das <listout@listout.xyz>
2025-06-26 21:29:11 +02:00
d844a08d83
signal: don't mark signal as C++ deprecated 2025-06-26 19:49:52 +02:00
2cd5e4fcd5
version: bump to 0.8.0 2025-06-26 18:23:47 +02:00
376d0209c8
signal: don't spam logs 2025-06-26 18:23:27 +02:00
93246269d4
signal: Typed signals (part 2) (#60)
* signals: make CSignalT API compatible with CSignal

Also fixes emitting reference types

* signals: add a lot of tests

* animation: use CSignalT

* signals: automatically const-ref non arithmetic value types

* signals: allow listeners to ignore args

* signals: add forward()
2025-06-26 12:27:31 +02:00
6ee59e4eb8
core: add editorconfig (#61) 2025-06-26 11:44:09 +02:00
Maximilian Seidler
925f26633f
memory: add CAtomicSharedPointer and CAtomicWeakPointer (#57) 2025-06-25 19:41:24 +02:00
1b8090e5d8
signals: add typed signals with CSignalT<> (#58)
Also more tests
2025-06-23 22:51:38 +02:00
d46bd32da5
os/process: add env to async calls too 2025-06-23 20:25:26 +02:00
38f3a21165
CI/Nix: add cache-nix-action
Use nixbuild/nix-quick-install-action which pairs well with
nix-community/cache-nix-action.

Should help with build times by reducing the number of packages needing
to be re-downloaded on each run.

Parameters are taken from https://github.com/nix-community/cache-nix-action
and may be tweaked later.
2025-06-20 01:11:36 +03:00
15df5e39af
Nix: move overlays to nix/ and add debug package 2025-06-20 01:11:34 +03:00