summaryrefslogtreecommitdiff
path: root/src/plugins/PluginAPI.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-02-22 23:30:10 +0000
committerGitHub <noreply@github.com>2026-02-22 23:30:10 +0000
commitb88813c7efa4b7b0c5fe01471c5fa5b67a61dc7e (patch)
tree4454e82bc033d7e28a23ee372d0e3f48341d0aaa /src/plugins/PluginAPI.hpp
parentb4ee4674f9a74e3d602c7fb17bc09f79d221583c (diff)
event: refactor HookSystem into a typed event bus (#13333)
Refactors the old HookSystem into a typed event bus with clear separation, discovery and types.
Diffstat (limited to 'src/plugins/PluginAPI.hpp')
-rw-r--r--src/plugins/PluginAPI.hpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/PluginAPI.hpp b/src/plugins/PluginAPI.hpp
index 568b2e0f..77bb9926 100644
--- a/src/plugins/PluginAPI.hpp
+++ b/src/plugins/PluginAPI.hpp
@@ -70,12 +70,15 @@ struct SVersionInfo {
class IHyprLayout;
class IHyprWindowDecoration;
struct SConfigValue;
+class Hypr_dummyClass {};
namespace Layout {
class ITiledAlgorithm;
class IFloatingAlgorithm;
};
+using HOOK_CALLBACK_FN = Hypr_dummyClass;
+
/*
These methods are for the plugin to implement
Methods marked with REQUIRED are required.
@@ -148,6 +151,8 @@ namespace HyprlandAPI {
APICALL Hyprlang::CConfigValue* getConfigValue(HANDLE handle, const std::string& name);
/*
+ Deprecated: doesn't do anything anymore, use Event::bus()
+
Register a dynamic (function) callback to a selected event.
Pointer will be free'd by Hyprland on unregisterCallback().
@@ -155,7 +160,7 @@ namespace HyprlandAPI {
WARNING: Losing this pointer will unregister the callback!
*/
- APICALL [[nodiscard]] SP<HOOK_CALLBACK_FN> registerCallbackDynamic(HANDLE handle, const std::string& event, HOOK_CALLBACK_FN fn);
+ APICALL [[deprecated]] [[nodiscard]] SP<HOOK_CALLBACK_FN> registerCallbackDynamic(HANDLE handle, const std::string& event, HOOK_CALLBACK_FN fn);
/*
Unregisters a callback. If the callback was dynamic, frees the memory.