summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-01-23 21:55:41 +0100
committerGitHub <noreply@github.com>2025-01-23 21:55:41 +0100
commit0a1ae48a9fd6eb76baad27de98c00f653a55e4ac (patch)
tree007cd36eb83d343d2aba49cf0741028c5f554895 /src/plugins
parentae403e6a05452336abd97e61be2706f6a930d827 (diff)
core: move all shared_ptrs from the STL to hyprutils (#9143)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/HookSystem.cpp2
-rw-r--r--src/plugins/HookSystem.hpp8
-rw-r--r--src/plugins/PluginAPI.cpp2
-rw-r--r--src/plugins/PluginAPI.hpp2
-rw-r--r--src/plugins/PluginSystem.cpp4
-rw-r--r--src/plugins/PluginSystem.hpp6
6 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/HookSystem.cpp b/src/plugins/HookSystem.cpp
index c19f6f46..9fa61561 100644
--- a/src/plugins/HookSystem.cpp
+++ b/src/plugins/HookSystem.cpp
@@ -253,7 +253,7 @@ bool CFunctionHook::unhook() {
}
CFunctionHook* CHookSystem::initHook(HANDLE owner, void* source, void* destination) {
- return m_vHooks.emplace_back(std::make_unique<CFunctionHook>(owner, source, destination)).get();
+ return m_vHooks.emplace_back(makeUnique<CFunctionHook>(owner, source, destination)).get();
}
bool CHookSystem::removeHook(CFunctionHook* hook) {
diff --git a/src/plugins/HookSystem.hpp b/src/plugins/HookSystem.hpp
index f0a5a11d..93ca4ff5 100644
--- a/src/plugins/HookSystem.hpp
+++ b/src/plugins/HookSystem.hpp
@@ -2,7 +2,7 @@
#include <string>
#include <vector>
-#include <memory>
+#include "../helpers/memory/Memory.hpp"
#define HANDLE void*
#define HOOK_TRAMPOLINE_MAX_SIZE 64
@@ -60,9 +60,9 @@ class CHookSystem {
void removeAllHooksFrom(HANDLE handle);
private:
- std::vector<std::unique_ptr<CFunctionHook>> m_vHooks;
+ std::vector<UP<CFunctionHook>> m_vHooks;
- uint64_t getAddressForTrampo();
+ uint64_t getAddressForTrampo();
struct SAllocatedPage {
uint64_t addr = 0;
@@ -75,4 +75,4 @@ class CHookSystem {
friend class CFunctionHook;
};
-inline std::unique_ptr<CHookSystem> g_pFunctionHookSystem; \ No newline at end of file
+inline UP<CHookSystem> g_pFunctionHookSystem; \ No newline at end of file
diff --git a/src/plugins/PluginAPI.cpp b/src/plugins/PluginAPI.cpp
index fbb1ec1b..92f043fd 100644
--- a/src/plugins/PluginAPI.cpp
+++ b/src/plugins/PluginAPI.cpp
@@ -106,7 +106,7 @@ APICALL bool HyprlandAPI::removeFunctionHook(HANDLE handle, CFunctionHook* hook)
return g_pFunctionHookSystem->removeHook(hook);
}
-APICALL bool HyprlandAPI::addWindowDecoration(HANDLE handle, PHLWINDOW pWindow, std::unique_ptr<IHyprWindowDecoration> pDecoration) {
+APICALL bool HyprlandAPI::addWindowDecoration(HANDLE handle, PHLWINDOW pWindow, UP<IHyprWindowDecoration> pDecoration) {
auto* const PLUGIN = g_pPluginSystem->getPluginByHandle(handle);
if (!PLUGIN)
diff --git a/src/plugins/PluginAPI.hpp b/src/plugins/PluginAPI.hpp
index 96c32bf1..c8c9e563 100644
--- a/src/plugins/PluginAPI.hpp
+++ b/src/plugins/PluginAPI.hpp
@@ -223,7 +223,7 @@ namespace HyprlandAPI {
returns: true on success. False otherwise.
*/
- APICALL bool addWindowDecoration(HANDLE handle, PHLWINDOW pWindow, std::unique_ptr<IHyprWindowDecoration> pDecoration);
+ APICALL bool addWindowDecoration(HANDLE handle, PHLWINDOW pWindow, UP<IHyprWindowDecoration> pDecoration);
/*
Removes a window decoration
diff --git a/src/plugins/PluginSystem.cpp b/src/plugins/PluginSystem.cpp
index e849bf11..87b9e8ef 100644
--- a/src/plugins/PluginSystem.cpp
+++ b/src/plugins/PluginSystem.cpp
@@ -8,7 +8,7 @@
#include "../managers/eventLoop/EventLoopManager.hpp"
CPluginSystem::CPluginSystem() {
- g_pFunctionHookSystem = std::make_unique<CHookSystem>();
+ g_pFunctionHookSystem = makeUnique<CHookSystem>();
}
CPlugin* CPluginSystem::loadPlugin(const std::string& path) {
@@ -21,7 +21,7 @@ CPlugin* CPluginSystem::loadPlugin(const std::string& path) {
return nullptr;
}
- auto* const PLUGIN = m_vLoadedPlugins.emplace_back(std::make_unique<CPlugin>()).get();
+ auto* const PLUGIN = m_vLoadedPlugins.emplace_back(makeUnique<CPlugin>()).get();
PLUGIN->path = path;
diff --git a/src/plugins/PluginSystem.hpp b/src/plugins/PluginSystem.hpp
index 336c484d..95841bef 100644
--- a/src/plugins/PluginSystem.hpp
+++ b/src/plugins/PluginSystem.hpp
@@ -44,9 +44,9 @@ class CPluginSystem {
std::string m_szLastError = "";
private:
- std::vector<std::unique_ptr<CPlugin>> m_vLoadedPlugins;
+ std::vector<UP<CPlugin>> m_vLoadedPlugins;
- jmp_buf m_jbPluginFaultJumpBuf;
+ jmp_buf m_jbPluginFaultJumpBuf;
};
-inline std::unique_ptr<CPluginSystem> g_pPluginSystem;
+inline UP<CPluginSystem> g_pPluginSystem;