From 723870337f299d4c80aa0048144f3a1ca1c885bd Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 21 Feb 2026 21:30:39 +0000 Subject: 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. --- src/plugins/PluginAPI.hpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/plugins/PluginAPI.hpp') 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()>&& factory); + APICALL bool addFloatingAlgo(HANDLE handle, const std::string& name, const std::type_info* typeInfo, std::function()>&& factory); + APICALL bool removeAlgo(HANDLE handle, const std::string& name); /* Queues a config reload. Does not take effect immediately. -- cgit v1.2.3