Commit graph

128 commits

Author SHA1 Message Date
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
c9cd5f153c
os/process: disallow copying / moving 2025-06-16 19:42:14 +02:00
57ab2a867d
tests: fix matrix test on 32b archs
fixes #55
2025-06-13 15:05:19 +02:00
Friday
e36db00dfb
nix: use gcc15 (#54)
updated nixpkgs in flake.lock for gcc15 to be available
2025-06-05 15:55:56 +01:00
Sergei Trofimovich
f1d0879444
sharedPtr: include missing <cstdint> (#52)
Without the change the build on upcoming gcc-16 fails as:

    [ 12%] Building CXX object CMakeFiles/hyprutils.dir/src/signal/Listener.cpp.o
    In file included from /build/source/./include/hyprutils/signal/Listener.hpp:5,
                     from /build/source/src/signal/Listener.cpp:1:
    /build/source/./include/hyprutils/memory/SharedPtr.hpp: In member function 'bool Hyprutils::Memory::CSharedPointer<T>::operator()(const Hyprutils::Memory::CSharedPointer<T>&, const Hyprutils::Memory::CSharedPointer<T>&) const':
    /build/source/./include/hyprutils/memory/SharedPtr.hpp:116:41: error: 'uintptr_t' does not name a type [-Wtemplate-body]
      116 |                 return reinterpret_cast<uintptr_t>(lhs.impl_) < reinterpret_cast<uintptr_t>(rhs.impl_);
          |                                         ^~~~~~~~~
2025-05-31 14:07:05 +01:00
674ea57373
version: bump to 0.7.1 2025-05-07 17:27:05 +01:00
7f00411949
string: add ConstVarList 2025-05-07 17:26:37 +01:00
05878d9470
version: bump to 0.7.0 2025-04-30 02:16:55 +01:00
5f51dcea4a
os/process: add exitCode() 2025-04-30 02:16:30 +01:00
f2dc70e448 version: bump to 0.6.0 2025-04-06 15:38:07 +01:00
966d0c0b6a os/process: add fd control for async 2025-04-06 15:34:33 +01:00
Sergey Fedorov
7248194a2c
animations: minor follow-up fix for std::string (#49) 2025-03-26 11:17:49 +01:00
fbd02eb032 animation: avoid using constexpr std::string
fixes #48
2025-03-26 01:13:40 +00:00
dd1f720cbc version: bump to 0.5.2 2025-03-09 15:38:08 +00:00
Lee Bousfield
6b0154b183
memory: Add shared pointer reinterpretPointerCast function (#47)
* memory: Add force reinterpret constructor to shared pointer

* memory: Change constructor to reinterpretPointerCast function

* memory: Add reinterpretPointerCast test
2025-03-04 22:26:24 +01:00
61a5382f4b version: bump to 0.5.1 2025-02-18 15:12:08 +00:00
77d7ea3498 os/process: populate pid when ran sync 2025-02-18 14:14:20 +00:00
e4e018a2ca
CI: remove deprecated magic-nix-cache-action 2025-02-08 23:08:53 +02:00
Honkazel
3d9ae75886
core: reenable wreorder (#46)
* cmake: re-enable wreorder

* implbase: fix wreorder

This fixes all reorder warnings... uh...
2025-02-03 20:44:09 +01:00
Honkazel
9aad80acd4
core: clang, clang-tidy fixes and comp options (#45)
* clang-tidy/clang fixes and comp options

* clang-format

* cmake: silence reorder for now

27 of them... Damn
2025-02-02 20:36:28 +01:00
Maximilian Seidler
dd790b90d7
animation: fix end callbacks readding the animation var (#43)
* animation: fix end callbacks readding the animation var

* include fix
2025-02-02 18:33:44 +01:00
6a8bc9d2a4 version: bump to 0.5.0 2025-01-27 11:45:43 +00:00
Maximilian Seidler
de58286a21
animation: fix crashes and cleanup of active vars (#42)
Minor stuff

---------

Co-authored-by: Vaxry <vaxry@vaxry.net>
2025-01-27 12:45:01 +01:00