diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-02-21 21:30:39 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-21 21:30:39 +0000 |
| commit | 723870337f299d4c80aa0048144f3a1ca1c885bd (patch) | |
| tree | ca3279ae5dbc841f676c64d2f58f895de13cd3bf /src/plugins/PluginAPI.hpp | |
| parent | 51f8849e541f0a8150ac3a43fa928c1e299daf18 (diff) | |
layout: rethonk layouts from the ground up (#12890)
Rewrites layouts to be much smaller, and deal with much less annoying
BS. Improves the overall architecture, unifies handling of pseudotiling,
and various other improvements.
Diffstat (limited to 'src/plugins/PluginAPI.hpp')
| -rw-r--r-- | src/plugins/PluginAPI.hpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/plugins/PluginAPI.hpp b/src/plugins/PluginAPI.hpp index 47a695db..568b2e0f 100644 --- a/src/plugins/PluginAPI.hpp +++ b/src/plugins/PluginAPI.hpp @@ -71,6 +71,11 @@ class IHyprLayout; class IHyprWindowDecoration; struct SConfigValue; +namespace Layout { + class ITiledAlgorithm; + class IFloatingAlgorithm; +}; + /* These methods are for the plugin to implement Methods marked with REQUIRED are required. @@ -172,15 +177,26 @@ namespace HyprlandAPI { Adds a layout to Hyprland. returns: true on success. False otherwise. + + deprecated: addTiledAlgo, addFloatingAlgo */ - APICALL bool addLayout(HANDLE handle, const std::string& name, IHyprLayout* layout); + APICALL [[deprecated]] bool addLayout(HANDLE handle, const std::string& name, IHyprLayout* layout); /* Removes an added layout from Hyprland. returns: true on success. False otherwise. + + deprecated: V2 removeAlgo + */ + APICALL [[deprecated]] bool removeLayout(HANDLE handle, IHyprLayout* layout); + + /* + Algorithm fns. Used for registering and removing. Return success. */ - APICALL bool removeLayout(HANDLE handle, IHyprLayout* layout); + APICALL bool addTiledAlgo(HANDLE handle, const std::string& name, const std::type_info* typeInfo, std::function<UP<Layout::ITiledAlgorithm>()>&& factory); + APICALL bool addFloatingAlgo(HANDLE handle, const std::string& name, const std::type_info* typeInfo, std::function<UP<Layout::IFloatingAlgorithm>()>&& factory); + APICALL bool removeAlgo(HANDLE handle, const std::string& name); /* Queues a config reload. Does not take effect immediately. |
