pax_global_header 0000666 0000000 0000000 00000000064 15175451365 0014526 g ustar 00root root 0000000 0000000 52 comment=795d06e76434a951855762104f2b0c8c3842e052
hyprwm-hyprtoolkit-795d06e/ 0000775 0000000 0000000 00000000000 15175451365 0016007 5 ustar 00root root 0000000 0000000 hyprwm-hyprtoolkit-795d06e/.clang-format 0000664 0000000 0000000 00000003416 15175451365 0020366 0 ustar 00root root 0000000 0000000 ---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: true
AlignEscapedNewlines: Right
AlignOperands: false
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
ColumnLimit: 180
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: false
IncludeBlocks: Preserve
IndentCaseLabels: true
IndentWidth: 4
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 4
UseTab: Never
AllowShortEnumsOnASingleLine: false
BraceWrapping:
AfterEnum: false
AlignConsecutiveDeclarations: AcrossEmptyLines
NamespaceIndentation: All
hyprwm-hyprtoolkit-795d06e/.clang-tidy 0000664 0000000 0000000 00000007207 15175451365 0020051 0 ustar 00root root 0000000 0000000 WarningsAsErrors: '*'
HeaderFilterRegex: '.*\.hpp'
FormatStyle: 'file'
Checks: >
-*,
bugprone-*,
-bugprone-easily-swappable-parameters,
-bugprone-forward-declaration-namespace,
-bugprone-forward-declaration-namespace,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-branch-clone,
-bugprone-assignment-in-if-condition,
concurrency-*,
-concurrency-mt-unsafe,
cppcoreguidelines-*,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-explicit-virtual-functions,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-pro-type-cstyle-cast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-pro-type-reinterpret-cast,
google-global-names-in-headers,
-google-readability-casting,
google-runtime-operator,
misc-*,
-misc-unused-parameters,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-include-cleaner,
-misc-use-anonymous-namespace,
-misc-const-correctness,
modernize-*,
-modernize-return-braced-init-list,
-modernize-use-trailing-return-type,
-modernize-use-using,
-modernize-use-override,
-modernize-avoid-c-arrays,
-modernize-macro-to-enum,
-modernize-loop-convert,
-modernize-use-nodiscard,
-modernize-pass-by-value,
-modernize-use-auto,
performance-*,
-performance-avoid-endl,
-performance-unnecessary-value-param,
portability-std-allocator-const,
readability-*,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-magic-numbers,
-readability-uppercase-literal-suffix,
-readability-braces-around-statements,
-readability-redundant-access-specifiers,
-readability-else-after-return,
-readability-container-data-pointer,
-readability-implicit-bool-conversion,
-readability-avoid-nested-conditional-operator,
-readability-redundant-member-init,
-readability-redundant-string-init,
-readability-avoid-const-params-in-decls,
-readability-named-parameter,
-readability-convert-member-functions-to-static,
-readability-qualified-auto,
-readability-make-member-function-const,
-readability-isolate-declaration,
-readability-inconsistent-declaration-parameter-name,
-clang-diagnostic-error,
CheckOptions:
performance-for-range-copy.WarnOnAllAutoCopies: true
performance-inefficient-string-concatenation.StrictMode: true
readability-braces-around-statements.ShortStatementLines: 0
readability-identifier-naming.ClassCase: CamelCase
readability-identifier-naming.ClassIgnoredRegexp: I.*
readability-identifier-naming.ClassPrefix: C # We can't use regex here?!?!?!?
readability-identifier-naming.EnumCase: CamelCase
readability-identifier-naming.EnumPrefix: e
readability-identifier-naming.EnumConstantCase: UPPER_CASE
readability-identifier-naming.FunctionCase: camelBack
readability-identifier-naming.NamespaceCase: CamelCase
readability-identifier-naming.StructPrefix: S
readability-identifier-naming.StructCase: CamelCase
hyprwm-hyprtoolkit-795d06e/.github/ 0000775 0000000 0000000 00000000000 15175451365 0017347 5 ustar 00root root 0000000 0000000 hyprwm-hyprtoolkit-795d06e/.github/workflows/ 0000775 0000000 0000000 00000000000 15175451365 0021404 5 ustar 00root root 0000000 0000000 hyprwm-hyprtoolkit-795d06e/.github/workflows/nix.yml 0000664 0000000 0000000 00000000662 15175451365 0022731 0 ustar 00root root 0000000 0000000 name: Build
on: [push, pull_request, workflow_dispatch]
jobs:
nix:
strategy:
matrix:
package:
- hyprtoolkit
- hyprtoolkit-with-tests
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork)
uses: hyprwm/actions/.github/workflows/nix.yml@main
secrets: inherit
with:
command: nix build .#${{ matrix.package }} --print-build-logs --keep-going
hyprwm-hyprtoolkit-795d06e/.gitignore 0000664 0000000 0000000 00000001237 15175451365 0020002 0 ustar 00root root 0000000 0000000 CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
CMakeUserPresets.json
# CLion
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#cmake-build-*
build/
.vscode/
.cache/
protocols/*.cpp
protocols/*.hpp
*.inc
src/renderer/gl/shaders/Shaders.hpp hyprwm-hyprtoolkit-795d06e/CMakeLists.txt 0000664 0000000 0000000 00000014470 15175451365 0020555 0 ustar 00root root 0000000 0000000 cmake_minimum_required(VERSION 3.19)
file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)
string(STRIP ${VER_RAW} HYPRTOOLKIT_VERSION)
add_compile_definitions(HYPRTOOLKIT_VERSION="${HYPRTOOLKIT_VERSION}")
project(
hyprtoolkit
VERSION ${HYPRTOOLKIT_VERSION}
DESCRIPTION "A modern C++ Wayland-native GUI toolkit")
include(CTest)
include(CheckIncludeFile)
include(GNUInstallDirs)
set(PREFIX ${CMAKE_INSTALL_PREFIX})
set(INCLUDE ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set(LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR})
find_package(PkgConfig REQUIRED)
find_package(OpenGL REQUIRED COMPONENTS "GLES3")
find_package(hyprwayland-scanner 0.4.0 REQUIRED)
pkg_check_modules(
deps
REQUIRED
IMPORTED_TARGET
wayland-client
wayland-protocols
egl
hyprutils>=0.11.0
hyprlang>=0.6.0
pixman-1
libdrm
gbm
xkbcommon
pango
cairo
pangocairo
iniparser
hyprgraphics>=0.3.0
aquamarine>=0.10.0)
configure_file(hyprtoolkit.pc.in hyprtoolkit.pc @ONLY)
set(CMAKE_CXX_STANDARD 23)
add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-unused-value
-Wno-missing-field-initializers -Wpedantic)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
message(STATUS "Configuring hyprtoolkit in Debug")
add_compile_definitions(HYPRTOOLKIT_DEBUG)
set(BUILD_TESTING ON)
else()
add_compile_options(-O3)
message(STATUS "Configuring hyprtoolkit in Release")
set(BUILD_TESTING OFF)
endif()
add_compile_definitions(HT_HIDDEN=public)
file(GLOB_RECURSE SRCFILES CONFIGURE_DEPENDS "src/*.cpp" "include/*.hpp")
file(GLOB_RECURSE PUBLIC_HEADERS CONFIGURE_DEPENDS "include/*.hpp")
execute_process(COMMAND ./scripts/generateShaderIncludes.sh
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_library(hyprtoolkit SHARED ${SRCFILES})
target_include_directories(
hyprtoolkit
PUBLIC "./include"
PRIVATE "./src" "./src/include" "./protocols" "${CMAKE_BINARY_DIR}")
set_target_properties(hyprtoolkit PROPERTIES VERSION ${HYPRTOOLKIT_VERSION}
SOVERSION 5)
target_link_libraries(hyprtoolkit PUBLIC OpenGL::EGL OpenGL::OpenGL
PkgConfig::deps)
check_include_file("sys/timerfd.h" HAS_TIMERFD)
pkg_check_modules(epoll IMPORTED_TARGET epoll-shim)
if(NOT HAS_TIMERFD AND epoll_FOUND)
target_link_libraries(hyprtoolkit PUBLIC PkgConfig::epoll)
endif()
check_include_file("sys/inotify.h" HAS_INOTIFY)
pkg_check_modules(inotify IMPORTED_TARGET libinotify)
if(NOT HAS_INOTIFY AND inotify_FOUND)
target_link_libraries(hyprtoolkit PUBLIC PkgConfig::inotify)
endif()
# Protocols
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}")
pkg_get_variable(WAYLAND_SCANNER_PKGDATA_DIR wayland-scanner pkgdatadir)
message(
STATUS "Found wayland-scanner pkgdatadir at ${WAYLAND_SCANNER_PKGDATA_DIR}")
function(protocolNew protoPath protoName external)
if(external)
set(path ${CMAKE_SOURCE_DIR}/${protoPath})
else()
set(path ${WAYLAND_PROTOCOLS_DIR}/${protoPath})
endif()
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/protocols/${protoName}.cpp
${CMAKE_SOURCE_DIR}/protocols/${protoName}.hpp
COMMAND hyprwayland-scanner --client ${path}/${protoName}.xml
${CMAKE_SOURCE_DIR}/protocols/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(hyprtoolkit PRIVATE protocols/${protoName}.cpp
protocols/${protoName}.hpp)
endfunction()
function(protocolWayland)
add_custom_command(
OUTPUT ${CMAKE_SOURCE_DIR}/protocols/wayland.cpp
${CMAKE_SOURCE_DIR}/protocols/wayland.hpp
COMMAND
hyprwayland-scanner --wayland-enums --client
${WAYLAND_SCANNER_PKGDATA_DIR}/wayland.xml ${CMAKE_SOURCE_DIR}/protocols/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_sources(hyprtoolkit PRIVATE protocols/wayland.cpp
protocols/wayland.hpp)
endfunction()
protocolwayland()
protocolnew("stable/xdg-shell" "xdg-shell" false)
protocolnew("stable/linux-dmabuf" "linux-dmabuf-v1" false)
protocolnew("staging/fractional-scale" "fractional-scale-v1" false)
protocolnew("stable/viewporter" "viewporter" false)
protocolnew("staging/cursor-shape" "cursor-shape-v1" false)
protocolnew("staging/ext-session-lock" "ext-session-lock-v1" false)
protocolnew("stable/tablet" "tablet-v2" false)
protocolnew("unstable/text-input" "text-input-unstable-v3" false)
protocolnew("staging/linux-drm-syncobj" "linux-drm-syncobj-v1" false)
protocolnew("protocols" "wlr-layer-shell-unstable-v1" true)
# Tests
if(BUILD_TESTING)
enable_testing()
# test apps
add_custom_target(tests)
add_executable(simpleWindow "tests/SimpleWindow.cpp")
target_link_libraries(simpleWindow PRIVATE PkgConfig::deps hyprtoolkit)
add_dependencies(tests simpleWindow)
add_executable(dialog "tests/Dialog.cpp")
target_link_libraries(dialog PRIVATE PkgConfig::deps hyprtoolkit)
add_dependencies(tests dialog)
add_executable(controls "tests/Controls.cpp")
target_link_libraries(controls PRIVATE PkgConfig::deps hyprtoolkit)
add_dependencies(tests controls)
add_executable(simpleSessionLock "tests/SimpleSessionLock.cpp")
target_link_libraries(simpleSessionLock PRIVATE PkgConfig::deps hyprtoolkit)
add_dependencies(tests simpleSessionLock)
# GTest
find_package(GTest CONFIG REQUIRED)
include(GoogleTest)
file(GLOB_RECURSE TESTFILES CONFIGURE_DEPENDS "tests/unit/*.cpp")
add_executable(hyprtoolkit_tests ${TESTFILES})
target_compile_options(hyprtoolkit_tests PRIVATE --coverage)
target_link_options(hyprtoolkit_tests PRIVATE --coverage)
target_include_directories(
hyprtoolkit_tests
PUBLIC "./include"
PRIVATE "./src" "./src/include" "./protocols" "${CMAKE_BINARY_DIR}")
target_link_libraries(
hyprtoolkit_tests PRIVATE hyprtoolkit GTest::gtest_main OpenGL::EGL
OpenGL::OpenGL PkgConfig::deps)
gtest_discover_tests(hyprtoolkit_tests)
# Add coverage to hyprtoolkit
target_compile_options(hyprtoolkit PRIVATE --coverage)
target_link_options(hyprtoolkit PRIVATE --coverage)
endif()
# Installation
install(TARGETS hyprtoolkit)
install(DIRECTORY "include/hyprtoolkit" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${CMAKE_BINARY_DIR}/hyprtoolkit.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
hyprwm-hyprtoolkit-795d06e/LICENSE 0000664 0000000 0000000 00000002737 15175451365 0017025 0 ustar 00root root 0000000 0000000 BSD 3-Clause License
Copyright (c) 2025, Hypr Development
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hyprwm-hyprtoolkit-795d06e/README.md 0000664 0000000 0000000 00000001242 15175451365 0017265 0 ustar 00root root 0000000 0000000 ## hyprtoolkit
A modern C++ Wayland-native GUI toolkit

## What Hyprtoolkit is
Hyprtoolkit is designed to be a small, simple, and modern C++ toolkit for making wayland GUI apps, with
a few goals:
- Simple C++ API for making a GUI app
- Smooth animations
- Easy usage
- Simple system theming
## Building
Standard CMake build:
```sh
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf NPROCESSORS_CONF`
```
### What Hyprtoolkit is not
Hyprtoolkit is not:
- cross-platform
- packed with crazy features
hyprwm-hyprtoolkit-795d06e/VERSION 0000664 0000000 0000000 00000000005 15175451365 0017052 0 ustar 00root root 0000000 0000000 0.5.4 hyprwm-hyprtoolkit-795d06e/assets/ 0000775 0000000 0000000 00000000000 15175451365 0017311 5 ustar 00root root 0000000 0000000 hyprwm-hyprtoolkit-795d06e/assets/preview.png 0000664 0000000 0000000 00001613776 15175451365 0021525 0 ustar 00root root 0000000 0000000 PNG
IHDR 8 pHYs nu> iTXtXML:com.adobe.xmp Оv IDATx[ɱ
-7JW>;w_g·gtgԆޔ{}3pkMR,2~At('B=aaaa$00Qhu:ÓDʼn:jṹׯOLL|>{ttd*Jjz%=OXFcT_YYY[[YeffLMMyXD=xfFnjn2ի`||/ׯQ
ߐDQV%h^Tի(Ib(Q(n۷gggyAN.CgD#Q՝;wpCkPQEs(*p̭[\f UL) f<4C|ZqZ0s
O000000z
vuKr<
trH$&[Nd2mLJlTvPZv]^l8jrQ@pJXLT[RAt G[
QQVZ-?`Th#c}S:N0\ {00000001C>+v^Z-03&h4|>JvwwDRtxfY,jRX,-.ȡ6
jPj#ZSPlp
f[BT$8N6'j)Jݠ.Q t:4,st(ɰ@C|n=0]3000000@xj)&F1J"YT*t:DP@1vzZ#jT4ՒV]Ptǹ(In%Mғ2RID5Xx(^)E C!shh@Ct.32c0=3000000Ǡxrt%VZ-76EO)L&NgY