Full rewrite

This commit is contained in:
ItsDrike 2023-10-02 22:27:13 +02:00
parent e5661c4a37
commit 3505d4aa5b
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
6 changed files with 302 additions and 160 deletions

9
include/func_finder.hpp Normal file
View file

@ -0,0 +1,9 @@
#include "globals.hpp"
/* Find function pointer from the Hyprland binary by it's name and demangledName
*
* \param[in] name Simple name of the function (i.e. createGroup)
* \param[in] demangledName Demangled name of the function (i.e. CWindow::createGroup())
* \return Raw pointer to the found function
*/
void* findHyprlandFunction(const std::string& name, const std::string& demangledName);

View file

@ -1,5 +1,19 @@
#pragma once
#include <hyprland/src/layout/DwindleLayout.hpp>
#include <hyprland/src/plugins/HookSystem.hpp>
#include <hyprland/src/plugins/PluginAPI.hpp>
const CColor s_notifyColor = {0x61 / 255.0f, 0xAF / 255.0f, 0xEF / 255.0f, 1.0f}; // RGBA
const PLUGIN_DESCRIPTION_INFO s_pluginDescription = {"dwindle-autogroup", "Dwindle Autogroup", "ItsDrike", "1.0"};
inline HANDLE PHANDLE = nullptr;
typedef void* (*createGroupFuncT)(CWindow*);
inline CFunctionHook* g_pCreateGroupHook = nullptr;
typedef void* (*destroyGroupFuncT)(CWindow*);
inline CFunctionHook* g_pDestroyGroupHook = nullptr;
typedef SDwindleNodeData* (*nodeFromWindowFuncT)(void*, CWindow*);
inline nodeFromWindowFuncT g_pNodeFromWindow = nullptr;

9
include/plugin.hpp Normal file
View file

@ -0,0 +1,9 @@
#include "globals.hpp"
/* New custom function replacing the original CWindow::createGroup function
*/
void newCreateGroup(CWindow*);
/* New custom function replacing the original CWindow::createGroup function
*/
void newDestroyGroup(CWindow*);