Commit graph

65 commits

Author SHA1 Message Date
96df6f6535
cli/logger: add redirection of connections 2025-11-23 18:30:59 +00:00
Vaxry
b311dc90dc
cli: add logger (#90)
Adds a Logger to the CLI namespace
2025-11-23 15:45:14 +00:00
Vaxry
16a7fe760d
cli: add CArgumentParser (#89) 2025-11-23 00:20:24 +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
Maximilian Seidler
feaaf44d59
memory: make SP/ASP control blocks type agnostic (#79) 2025-10-04 20:35:48 +02: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
Ikalco
bc193efa4b
os/process: add setStdinFD (#74) 2025-08-25 12:04:44 +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
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
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
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
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
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
c9cd5f153c
os/process: disallow copying / moving 2025-06-16 19:42:14 +02: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
7f00411949
string: add ConstVarList 2025-05-07 17:26:37 +01:00
5f51dcea4a
os/process: add exitCode() 2025-04-30 02:16:30 +01:00
966d0c0b6a os/process: add fd control for async 2025-04-06 15:34:33 +01: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
77d7ea3498 os/process: populate pid when ran sync 2025-02-18 14:14:20 +00: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
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
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
nyx
fb0c2d1de3
memory/weak: add missing nullptr comparison operators (#41) 2025-01-24 14:31:48 +01:00
3411e5b42d memory: add WP == UP comparison fn 2025-01-24 01:31:47 +00:00
Maximilian Seidler
ca1253c626
animation: add virtual dtor to AnimationManager (#31) 2025-01-23 11:38:09 +00:00
423c69d697 memory: implement a unique pointer
this unique pointer differs from the STL, because it allows weak pointers to it, which cannot be lock()ed.

under the hood, it's just a SP that cannot be referenced.
2025-01-23 11:34:35 +00:00
Maximilian Seidler
72dfbf5296
animations: fix adding/removing vars during ::tick (#35) 2025-01-11 16:37:12 +00:00
Jan Beich
fb9a816cb9
animation: add missing header for libc++ after 6a26d08bac (#30)
In file included from src/animation/AnimatedVariable.cpp:1:
In file included from ./include/hyprutils/animation/AnimatedVariable.hpp:3:
./include/hyprutils/animation/AnimationConfig.hpp:17:60: error: implicit instantiation of undefined template 'std::basic_string<char>'
   17 |             std::string                                    internalBezier  = "";
      |                                                            ^
/usr/include/c++/v1/__fwd/string.h:43:28: note: template is declared here
   43 | class _LIBCPP_TEMPLATE_VIS basic_string;
      |                            ^
In file included from src/animation/AnimatedVariable.cpp:1:
In file included from ./include/hyprutils/animation/AnimatedVariable.hpp:3:
./include/hyprutils/animation/AnimationConfig.hpp:18:60: error: implicit instantiation of undefined template 'std::basic_string<char>'
   18 |             std::string                                    internalStyle   = "";
      |                                                            ^
/usr/include/c++/v1/__fwd/string.h:43:28: note: template is declared here
   43 | class _LIBCPP_TEMPLATE_VIS basic_string;
      |                            ^
2025-01-03 22:47:04 +00:00
Maximilian Seidler
6a26d08bac
animation: add CAnimationConfigTree (#29)
Co-authored-by: Maximilian Seidler <paideia_dilemma@losfuzzys.net>
2025-01-02 14:02:21 +00:00
Maximilian Seidler
8af7e4b9de
animation: add BezierCurve, AnimationManager and AnimatedVariable (#27) 2024-12-29 19:26:01 +00:00
8f15d45b12 region: Revert "fix header path"
This reverts commit 104117aed6.

Fixes #28
2024-12-27 17:23:03 +01:00
nyx
9be03a8562
misc: fix some compile warnings (#25)
- Cleans up compile warnings
- Formats code
- Cleans up unused vars
- etc
2024-12-25 19:10:14 +00:00
c3331116eb os/process: add pid() 2024-12-21 15:47:53 +00:00
104117aed6 region: fix header path 2024-12-06 16:24:01 +00:00
Tom Englund
2e21319c8e
os: implent a new FileDescriptor class (#21)
makes you able to RAII the filedescriptor making it somewhat easier to
not leak.
2024-11-21 15:26:34 +00:00
e74177e025 os: add setEnv to process 2024-11-15 20:28:59 +00:00
fd4be8b9ca os: Add process 2024-10-14 22:27:36 +01:00
db956287d3 mat3x3: fix comment 2024-09-25 00:05:20 +01:00