mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 11:18:03 +02:00
Add [[nodiscard]] annotations to API methods
This commit is contained in:
parent
8884b9e6ce
commit
f91d0397a0
5 changed files with 124 additions and 124 deletions
|
|
@ -92,88 +92,88 @@ class CCompositor {
|
|||
|
||||
//
|
||||
|
||||
PHLMONITOR getMonitorFromID(const MONITORID&);
|
||||
PHLMONITOR getMonitorFromName(const std::string&);
|
||||
PHLMONITOR getMonitorFromDesc(const std::string&);
|
||||
PHLMONITOR getMonitorFromCursor();
|
||||
PHLMONITOR getMonitorFromVector(const Vector2D&);
|
||||
void removeWindowFromVectorSafe(PHLWINDOW);
|
||||
bool monitorExists(PHLMONITOR);
|
||||
PHLWINDOW vectorToWindowUnified(const Vector2D&, uint16_t properties, PHLWINDOW pIgnoreWindow = nullptr);
|
||||
SP<CWLSurfaceResource> vectorToLayerSurface(const Vector2D&, std::vector<PHLLSREF>*, Vector2D*, PHLLS*, bool aboveLockscreen = false);
|
||||
SP<CWLSurfaceResource> vectorToLayerPopupSurface(const Vector2D&, PHLMONITOR monitor, Vector2D*, PHLLS*);
|
||||
SP<CWLSurfaceResource> vectorWindowToSurface(const Vector2D&, PHLWINDOW, Vector2D& sl);
|
||||
Vector2D vectorToSurfaceLocal(const Vector2D&, PHLWINDOW, SP<CWLSurfaceResource>);
|
||||
PHLMONITOR getMonitorFromOutput(SP<Aquamarine::IOutput>);
|
||||
PHLMONITOR getRealMonitorFromOutput(SP<Aquamarine::IOutput>);
|
||||
PHLWINDOW getWindowFromSurface(SP<CWLSurfaceResource>);
|
||||
PHLWINDOW getWindowFromHandle(uint32_t);
|
||||
PHLWORKSPACE getWorkspaceByID(const WORKSPACEID&);
|
||||
PHLWORKSPACE getWorkspaceByName(const std::string&);
|
||||
PHLWORKSPACE getWorkspaceByString(const std::string&);
|
||||
PHLWINDOW getUrgentWindow();
|
||||
bool isWindowActive(PHLWINDOW);
|
||||
void changeWindowZOrder(PHLWINDOW, bool);
|
||||
void cleanupFadingOut(const MONITORID& monid);
|
||||
PHLWINDOW getWindowInDirection(PHLWINDOW, Math::eDirection);
|
||||
PHLWINDOW getWindowInDirection(const CBox& box, PHLWORKSPACE pWorkspace, Math::eDirection dir, PHLWINDOW ignoreWindow = nullptr, bool useVectorAngles = false);
|
||||
PHLWINDOW getWindowCycle(PHLWINDOW cur, bool focusableOnly = false, std::optional<bool> floating = std::nullopt, bool visible = false, bool prev = false,
|
||||
bool allowFullscreenBlocked = false);
|
||||
PHLWINDOW getWindowCycleHist(PHLWINDOWREF cur, bool focusableOnly = false, std::optional<bool> floating = std::nullopt, bool visible = false, bool next = false,
|
||||
bool allowFullscreenBlocked = false);
|
||||
WORKSPACEID getNextAvailableNamedWorkspace();
|
||||
bool isPointOnAnyMonitor(const Vector2D&);
|
||||
bool isPointOnReservedArea(const Vector2D& point, const PHLMONITOR monitor = nullptr);
|
||||
std::optional<CBox> calculateX11WorkArea();
|
||||
PHLMONITOR getMonitorInDirection(Math::eDirection);
|
||||
PHLMONITOR getMonitorInDirection(PHLMONITOR, Math::eDirection);
|
||||
void updateAllWindowsAnimatedDecorationValues();
|
||||
MONITORID getNextAvailableMonitorID(std::string const& name);
|
||||
void moveWorkspaceToMonitor(PHLWORKSPACE, PHLMONITOR, bool noWarpCursor = false);
|
||||
void swapActiveWorkspaces(PHLMONITOR, PHLMONITOR);
|
||||
PHLMONITOR getMonitorFromString(const std::string&);
|
||||
bool workspaceIDOutOfBounds(const WORKSPACEID&);
|
||||
void setWindowFullscreenInternal(const PHLWINDOW PWINDOW, const eFullscreenMode MODE);
|
||||
void setWindowFullscreenClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE);
|
||||
void setWindowFullscreenState(const PHLWINDOW PWINDOW, const Desktop::View::SFullscreenState state);
|
||||
void changeWindowFullscreenModeClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE, const bool ON);
|
||||
PHLWINDOW getX11Parent(PHLWINDOW);
|
||||
void scheduleFrameForMonitor(PHLMONITOR, Aquamarine::IOutput::scheduleFrameReason reason = Aquamarine::IOutput::AQ_SCHEDULE_CLIENT_UNKNOWN);
|
||||
void addToFadingOutSafe(PHLLS);
|
||||
void removeFromFadingOutSafe(PHLLS);
|
||||
void addToFadingOutSafe(PHLWINDOW);
|
||||
PHLWINDOW getWindowByRegex(const std::string&);
|
||||
void warpCursorTo(const Vector2D&, bool force = false);
|
||||
PHLLS getLayerSurfaceFromSurface(SP<CWLSurfaceResource>);
|
||||
Vector2D parseWindowVectorArgsRelative(const std::string&, const Vector2D&);
|
||||
[[nodiscard]] PHLWORKSPACE createNewWorkspace(const WORKSPACEID&, const MONITORID&, const std::string& name = "",
|
||||
bool isEmpty = true); // will be deleted next frame if left empty and unfocused!
|
||||
bool isWorkspaceSpecial(const WORKSPACEID&);
|
||||
WORKSPACEID getNewSpecialID();
|
||||
void performUserChecks();
|
||||
void moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWorkspace);
|
||||
PHLWINDOW getForceFocus();
|
||||
void scheduleMonitorStateRecheck();
|
||||
void arrangeMonitors();
|
||||
void checkMonitorOverlaps();
|
||||
void enterUnsafeState();
|
||||
void leaveUnsafeState();
|
||||
void setPreferredScaleForSurface(SP<CWLSurfaceResource> pSurface, double scale);
|
||||
void setPreferredTransformForSurface(SP<CWLSurfaceResource> pSurface, wl_output_transform transform);
|
||||
void updateSuspendedStates();
|
||||
void onNewMonitor(SP<Aquamarine::IOutput> output);
|
||||
void ensurePersistentWorkspacesPresent(const std::vector<Config::CWorkspaceRule>& rules, PHLWORKSPACE pWorkspace = nullptr);
|
||||
void ensurePersistentWorkspacesPresent(PHLWORKSPACE pWorkspace = nullptr);
|
||||
void ensureWorkspacesOnAssignedMonitors();
|
||||
std::optional<unsigned int> getVTNr();
|
||||
bool isVRRActiveOnAnyMonitor() const;
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromID(const MONITORID&);
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromName(const std::string&);
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromDesc(const std::string&);
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromCursor();
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromVector(const Vector2D&);
|
||||
void removeWindowFromVectorSafe(PHLWINDOW);
|
||||
[[nodiscard]] bool monitorExists(PHLMONITOR);
|
||||
[[nodiscard]] PHLWINDOW vectorToWindowUnified(const Vector2D&, uint16_t properties, PHLWINDOW pIgnoreWindow = nullptr);
|
||||
[[nodiscard]] SP<CWLSurfaceResource> vectorToLayerSurface(const Vector2D&, std::vector<PHLLSREF>*, Vector2D*, PHLLS*, bool aboveLockscreen = false);
|
||||
[[nodiscard]] SP<CWLSurfaceResource> vectorToLayerPopupSurface(const Vector2D&, PHLMONITOR monitor, Vector2D*, PHLLS*);
|
||||
[[nodiscard]] SP<CWLSurfaceResource> vectorWindowToSurface(const Vector2D&, PHLWINDOW, Vector2D& sl);
|
||||
[[nodiscard]] Vector2D vectorToSurfaceLocal(const Vector2D&, PHLWINDOW, SP<CWLSurfaceResource>);
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromOutput(SP<Aquamarine::IOutput>);
|
||||
[[nodiscard]] PHLMONITOR getRealMonitorFromOutput(SP<Aquamarine::IOutput>);
|
||||
[[nodiscard]] PHLWINDOW getWindowFromSurface(SP<CWLSurfaceResource>);
|
||||
[[nodiscard]] PHLWINDOW getWindowFromHandle(uint32_t);
|
||||
[[nodiscard]] PHLWORKSPACE getWorkspaceByID(const WORKSPACEID&);
|
||||
[[nodiscard]] PHLWORKSPACE getWorkspaceByName(const std::string&);
|
||||
[[nodiscard]] PHLWORKSPACE getWorkspaceByString(const std::string&);
|
||||
[[nodiscard]] PHLWINDOW getUrgentWindow();
|
||||
[[nodiscard]] bool isWindowActive(PHLWINDOW);
|
||||
void changeWindowZOrder(PHLWINDOW, bool);
|
||||
void cleanupFadingOut(const MONITORID& monid);
|
||||
[[nodiscard]] PHLWINDOW getWindowInDirection(PHLWINDOW, Math::eDirection);
|
||||
[[nodiscard]] PHLWINDOW getWindowInDirection(const CBox& box, PHLWORKSPACE pWorkspace, Math::eDirection dir, PHLWINDOW ignoreWindow = nullptr, bool useVectorAngles = false);
|
||||
[[nodiscard]] PHLWINDOW getWindowCycle(PHLWINDOW cur, bool focusableOnly = false, std::optional<bool> floating = std::nullopt, bool visible = false, bool prev = false,
|
||||
bool allowFullscreenBlocked = false);
|
||||
[[nodiscard]] PHLWINDOW getWindowCycleHist(PHLWINDOWREF cur, bool focusableOnly = false, std::optional<bool> floating = std::nullopt, bool visible = false, bool next = false,
|
||||
bool allowFullscreenBlocked = false);
|
||||
[[nodiscard]] WORKSPACEID getNextAvailableNamedWorkspace();
|
||||
[[nodiscard]] bool isPointOnAnyMonitor(const Vector2D&);
|
||||
[[nodiscard]] bool isPointOnReservedArea(const Vector2D& point, const PHLMONITOR monitor = nullptr);
|
||||
[[nodiscard]] std::optional<CBox> calculateX11WorkArea();
|
||||
[[nodiscard]] PHLMONITOR getMonitorInDirection(Math::eDirection);
|
||||
[[nodiscard]] PHLMONITOR getMonitorInDirection(PHLMONITOR, Math::eDirection);
|
||||
void updateAllWindowsAnimatedDecorationValues();
|
||||
[[nodiscard]] MONITORID getNextAvailableMonitorID(std::string const& name);
|
||||
void moveWorkspaceToMonitor(PHLWORKSPACE, PHLMONITOR, bool noWarpCursor = false);
|
||||
void swapActiveWorkspaces(PHLMONITOR, PHLMONITOR);
|
||||
[[nodiscard]] PHLMONITOR getMonitorFromString(const std::string&);
|
||||
[[nodiscard]] bool workspaceIDOutOfBounds(const WORKSPACEID&);
|
||||
void setWindowFullscreenInternal(const PHLWINDOW PWINDOW, const eFullscreenMode MODE);
|
||||
void setWindowFullscreenClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE);
|
||||
void setWindowFullscreenState(const PHLWINDOW PWINDOW, const Desktop::View::SFullscreenState state);
|
||||
void changeWindowFullscreenModeClient(const PHLWINDOW PWINDOW, const eFullscreenMode MODE, const bool ON);
|
||||
[[nodiscard]] PHLWINDOW getX11Parent(PHLWINDOW);
|
||||
void scheduleFrameForMonitor(PHLMONITOR, Aquamarine::IOutput::scheduleFrameReason reason = Aquamarine::IOutput::AQ_SCHEDULE_CLIENT_UNKNOWN);
|
||||
void addToFadingOutSafe(PHLLS);
|
||||
void removeFromFadingOutSafe(PHLLS);
|
||||
void addToFadingOutSafe(PHLWINDOW);
|
||||
[[nodiscard]] PHLWINDOW getWindowByRegex(const std::string&);
|
||||
void warpCursorTo(const Vector2D&, bool force = false);
|
||||
[[nodiscard]] PHLLS getLayerSurfaceFromSurface(SP<CWLSurfaceResource>);
|
||||
[[nodiscard]] Vector2D parseWindowVectorArgsRelative(const std::string&, const Vector2D&);
|
||||
[[nodiscard]] PHLWORKSPACE createNewWorkspace(const WORKSPACEID&, const MONITORID&, const std::string& name = "",
|
||||
bool isEmpty = true); // will be deleted next frame if left empty and unfocused!
|
||||
[[nodiscard]] bool isWorkspaceSpecial(const WORKSPACEID&);
|
||||
[[nodiscard]] WORKSPACEID getNewSpecialID();
|
||||
void performUserChecks();
|
||||
void moveWindowToWorkspaceSafe(PHLWINDOW pWindow, PHLWORKSPACE pWorkspace);
|
||||
[[nodiscard]] PHLWINDOW getForceFocus();
|
||||
void scheduleMonitorStateRecheck();
|
||||
void arrangeMonitors();
|
||||
void checkMonitorOverlaps();
|
||||
void enterUnsafeState();
|
||||
void leaveUnsafeState();
|
||||
void setPreferredScaleForSurface(SP<CWLSurfaceResource> pSurface, double scale);
|
||||
void setPreferredTransformForSurface(SP<CWLSurfaceResource> pSurface, wl_output_transform transform);
|
||||
void updateSuspendedStates();
|
||||
void onNewMonitor(SP<Aquamarine::IOutput> output);
|
||||
void ensurePersistentWorkspacesPresent(const std::vector<Config::CWorkspaceRule>& rules, PHLWORKSPACE pWorkspace = nullptr);
|
||||
void ensurePersistentWorkspacesPresent(PHLWORKSPACE pWorkspace = nullptr);
|
||||
void ensureWorkspacesOnAssignedMonitors();
|
||||
[[nodiscard]] std::optional<unsigned int> getVTNr();
|
||||
[[nodiscard]] bool isVRRActiveOnAnyMonitor() const;
|
||||
|
||||
NColorManagement::PImageDescription getPreferredImageDescription();
|
||||
NColorManagement::PImageDescription getHDRImageDescription();
|
||||
bool shouldChangePreferredImageDescription();
|
||||
[[nodiscard]] NColorManagement::PImageDescription getPreferredImageDescription();
|
||||
[[nodiscard]] NColorManagement::PImageDescription getHDRImageDescription();
|
||||
bool shouldChangePreferredImageDescription();
|
||||
|
||||
bool supportsDrmSyncobjTimeline() const;
|
||||
std::string m_explicitConfigPath;
|
||||
[[nodiscard]] bool supportsDrmSyncobjTimeline() const;
|
||||
std::string m_explicitConfigPath;
|
||||
|
||||
private:
|
||||
void initAllSignals();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace Config::Lua {
|
|||
virtual std::expected<void, std::string> generateDefaultConfig(const std::filesystem::path&, bool safeMode) override;
|
||||
|
||||
virtual void handlePluginLoads() override;
|
||||
virtual bool configVerifPassed() override;
|
||||
[[nodiscard]] virtual bool configVerifPassed() override;
|
||||
|
||||
virtual std::expected<void, std::string> registerPluginValue(void* handle, SP<Config::Values::IValue> value) override;
|
||||
virtual void onPluginUnload(void* handle) override;
|
||||
|
|
@ -89,27 +89,27 @@ namespace Config::Lua {
|
|||
void callLuaFn(int ref);
|
||||
|
||||
// execute an arbitrary lua string on the current state.
|
||||
std::optional<std::string> eval(const std::string& code);
|
||||
[[nodiscard]] std::optional<std::string> eval(const std::string& code);
|
||||
|
||||
int guardedPCall(int nargs, int nresults, int errfunc, int timeoutMs, std::string_view context);
|
||||
int guardedPCall(int nargs, int nresults, int errfunc, int timeoutMs, std::string_view context);
|
||||
|
||||
static CConfigManager* fromLuaState(lua_State* L);
|
||||
static CConfigManager* fromLuaState(lua_State* L);
|
||||
|
||||
static constexpr int LUA_WATCHDOG_INSTRUCTION_INTERVAL = 10000;
|
||||
static constexpr int LUA_TIMEOUT_CONFIG_RELOAD_MS = 1500;
|
||||
static constexpr int LUA_TIMEOUT_EVENT_CALLBACK_MS = 50;
|
||||
static constexpr int LUA_TIMEOUT_KEYBIND_CALLBACK_MS = 100;
|
||||
static constexpr int LUA_TIMEOUT_TIMER_CALLBACK_MS = 50;
|
||||
static constexpr int LUA_TIMEOUT_EVAL_MS = 250;
|
||||
static constexpr int LUA_TIMEOUT_DISPATCH_MS = 100;
|
||||
static constexpr int LUA_WATCHDOG_INSTRUCTION_INTERVAL = 10000;
|
||||
static constexpr int LUA_TIMEOUT_CONFIG_RELOAD_MS = 1500;
|
||||
static constexpr int LUA_TIMEOUT_EVENT_CALLBACK_MS = 50;
|
||||
static constexpr int LUA_TIMEOUT_KEYBIND_CALLBACK_MS = 100;
|
||||
static constexpr int LUA_TIMEOUT_TIMER_CALLBACK_MS = 50;
|
||||
static constexpr int LUA_TIMEOUT_EVAL_MS = 250;
|
||||
static constexpr int LUA_TIMEOUT_DISPATCH_MS = 100;
|
||||
|
||||
bool isFirstLaunch() const;
|
||||
bool isDynamicParse() const;
|
||||
[[nodiscard]] bool isFirstLaunch() const;
|
||||
[[nodiscard]] bool isDynamicParse() const;
|
||||
|
||||
std::string m_currentSubmap;
|
||||
std::string m_currentSubmapReset;
|
||||
std::string m_currentSubmap;
|
||||
std::string m_currentSubmapReset;
|
||||
|
||||
UP<CLuaEventHandler> m_eventHandler;
|
||||
UP<CLuaEventHandler> m_eventHandler;
|
||||
|
||||
struct SLuaTimer {
|
||||
SP<CEventLoopTimer> timer;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ void CInputManager::onTouchDown(ITouch::SDownEvent e) {
|
|||
local = (TOUCH_COORDS - m_touchData.touchFocusWindow->m_realPosition->goal()) * m_touchData.touchFocusWindow->m_X11SurfaceScaledBy;
|
||||
m_touchData.touchSurfaceOrigin = m_touchData.touchFocusWindow->m_realPosition->goal();
|
||||
} else {
|
||||
g_pCompositor->vectorWindowToSurface(TOUCH_COORDS, m_touchData.touchFocusWindow.lock(), local);
|
||||
m_touchData.touchFocusSurface = g_pCompositor->vectorWindowToSurface(TOUCH_COORDS, m_touchData.touchFocusWindow.lock(), local);
|
||||
m_touchData.touchSurfaceOrigin = TOUCH_COORDS - local;
|
||||
}
|
||||
} else if (!m_touchData.touchFocusLS.expired()) {
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ namespace HyprlandAPI {
|
|||
|
||||
returns: the output (as in hyprctl)
|
||||
*/
|
||||
APICALL std::string invokeHyprctlCommand(const std::string& call, const std::string& args, const std::string& format = "");
|
||||
APICALL [[nodiscard]] std::string invokeHyprctlCommand(const std::string& call, const std::string& args, const std::string& format = "");
|
||||
|
||||
/*
|
||||
Adds a layout to Hyprland.
|
||||
|
|
@ -210,23 +210,23 @@ namespace HyprlandAPI {
|
|||
/*
|
||||
Algorithm fns. Used for registering and removing. Return success.
|
||||
*/
|
||||
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);
|
||||
APICALL [[nodiscard]] bool addTiledAlgo(HANDLE handle, const std::string& name, const std::type_info* typeInfo, std::function<UP<Layout::ITiledAlgorithm>()>&& factory);
|
||||
APICALL [[nodiscard]] bool addFloatingAlgo(HANDLE handle, const std::string& name, const std::type_info* typeInfo, std::function<UP<Layout::IFloatingAlgorithm>()>&& factory);
|
||||
APICALL [[nodiscard]] bool removeAlgo(HANDLE handle, const std::string& name);
|
||||
|
||||
/*
|
||||
Queues a config reload. Does not take effect immediately.
|
||||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool reloadConfig();
|
||||
APICALL [[nodiscard]] bool reloadConfig();
|
||||
|
||||
/*
|
||||
Adds a notification.
|
||||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool addNotification(HANDLE handle, const std::string& text, const CHyprColor& color, const float timeMs);
|
||||
APICALL [[nodiscard]] bool addNotification(HANDLE handle, const std::string& text, const CHyprColor& color, const float timeMs);
|
||||
|
||||
/*
|
||||
Creates a trampoline function hook to an internal hl func.
|
||||
|
|
@ -235,7 +235,7 @@ namespace HyprlandAPI {
|
|||
|
||||
!WARNING! Hooks are *not* guaranteed any API stability. Internal methods may be removed, added, or renamed. Consider preferring the API whenever possible.
|
||||
*/
|
||||
APICALL CFunctionHook* createFunctionHook(HANDLE handle, const void* source, const void* destination);
|
||||
APICALL [[nodiscard]] CFunctionHook* createFunctionHook(HANDLE handle, const void* source, const void* destination);
|
||||
|
||||
/*
|
||||
Removes a trampoline function hook. Will unhook if still hooked.
|
||||
|
|
@ -244,7 +244,7 @@ namespace HyprlandAPI {
|
|||
|
||||
!WARNING! Hooks are *not* guaranteed any API stability. Internal methods may be removed, added, or renamed. Consider preferring the API whenever possible.
|
||||
*/
|
||||
APICALL bool removeFunctionHook(HANDLE handle, CFunctionHook* hook);
|
||||
APICALL [[nodiscard]] bool removeFunctionHook(HANDLE handle, CFunctionHook* hook);
|
||||
|
||||
/*
|
||||
Gets a function address from a signature.
|
||||
|
|
@ -261,14 +261,14 @@ namespace HyprlandAPI {
|
|||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool addWindowDecoration(HANDLE handle, PHLWINDOW pWindow, UP<IHyprWindowDecoration> pDecoration);
|
||||
APICALL [[nodiscard]] bool addWindowDecoration(HANDLE handle, PHLWINDOW pWindow, UP<IHyprWindowDecoration> pDecoration);
|
||||
|
||||
/*
|
||||
Removes a window decoration
|
||||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool removeWindowDecoration(HANDLE handle, IHyprWindowDecoration* pDecoration);
|
||||
APICALL [[nodiscard]] bool removeWindowDecoration(HANDLE handle, IHyprWindowDecoration* pDecoration);
|
||||
|
||||
/*
|
||||
Adds a keybind dispatcher.
|
||||
|
|
@ -284,14 +284,14 @@ namespace HyprlandAPI {
|
|||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool addDispatcherV2(HANDLE handle, const std::string& name, std::function<SDispatchResult(std::string)> handler);
|
||||
APICALL [[nodiscard]] bool addDispatcherV2(HANDLE handle, const std::string& name, std::function<SDispatchResult(std::string)> handler);
|
||||
|
||||
/*
|
||||
Removes a keybind dispatcher.
|
||||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool removeDispatcher(HANDLE handle, const std::string& name);
|
||||
APICALL [[nodiscard]] bool removeDispatcher(HANDLE handle, const std::string& name);
|
||||
|
||||
/*
|
||||
Adds a notification.
|
||||
|
|
@ -306,7 +306,7 @@ namespace HyprlandAPI {
|
|||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool addNotificationV2(HANDLE handle, const std::unordered_map<std::string, std::any>& data);
|
||||
APICALL [[nodiscard]] bool addNotificationV2(HANDLE handle, const std::unordered_map<std::string, std::any>& data);
|
||||
|
||||
/*
|
||||
Returns a vector of found functions matching the provided name.
|
||||
|
|
@ -315,27 +315,27 @@ namespace HyprlandAPI {
|
|||
|
||||
Empty means either none found or handle was invalid
|
||||
*/
|
||||
APICALL std::vector<SFunctionMatch> findFunctionsByName(HANDLE handle, const std::string& name);
|
||||
APICALL [[nodiscard]] std::vector<SFunctionMatch> findFunctionsByName(HANDLE handle, const std::string& name);
|
||||
|
||||
/*
|
||||
Returns the hyprland version data. It's highly advised to not run plugins compiled
|
||||
for a different hash.
|
||||
*/
|
||||
APICALL SVersionInfo getHyprlandVersion(HANDLE handle);
|
||||
APICALL [[nodiscard]] SVersionInfo getHyprlandVersion(HANDLE handle);
|
||||
|
||||
/*
|
||||
Registers a hyprctl command
|
||||
|
||||
returns: Pointer. Nullptr on fail.
|
||||
*/
|
||||
APICALL SP<SHyprCtlCommand> registerHyprCtlCommand(HANDLE handle, SHyprCtlCommand cmd);
|
||||
APICALL [[nodiscard]] SP<SHyprCtlCommand> registerHyprCtlCommand(HANDLE handle, SHyprCtlCommand cmd);
|
||||
|
||||
/*
|
||||
Unregisters a hyprctl command
|
||||
|
||||
returns: true on success. False otherwise.
|
||||
*/
|
||||
APICALL bool unregisterHyprCtlCommand(HANDLE handle, SP<SHyprCtlCommand> cmd);
|
||||
APICALL [[nodiscard]] bool unregisterHyprCtlCommand(HANDLE handle, SP<SHyprCtlCommand> cmd);
|
||||
|
||||
/*
|
||||
Add a new config value. Keep the pointer, you can use it for retrieving the value.
|
||||
|
|
|
|||
|
|
@ -36,17 +36,17 @@ class CPluginSystem {
|
|||
public:
|
||||
CPluginSystem();
|
||||
|
||||
SP<CPromise<CPlugin*>> loadPlugin(const std::string& path, eSpecialPidTypes pidType = SPECIAL_PID_TYPE_NONE);
|
||||
void unloadPlugin(const CPlugin* plugin, bool eject = false);
|
||||
void unloadAllPlugins();
|
||||
void updateConfigPlugins(const std::vector<std::string>& plugins, bool& changed);
|
||||
CPlugin* getPluginByPath(const std::string& path);
|
||||
CPlugin* getPluginByHandle(HANDLE handle);
|
||||
std::vector<CPlugin*> getAllPlugins();
|
||||
size_t pluginCount();
|
||||
void sigGetPlugins(CPlugin** data, size_t len);
|
||||
SP<CPromise<CPlugin*>> loadPlugin(const std::string& path, eSpecialPidTypes pidType = SPECIAL_PID_TYPE_NONE);
|
||||
void unloadPlugin(const CPlugin* plugin, bool eject = false);
|
||||
void unloadAllPlugins();
|
||||
void updateConfigPlugins(const std::vector<std::string>& plugins, bool& changed);
|
||||
[[nodiscard]] CPlugin* getPluginByPath(const std::string& path);
|
||||
[[nodiscard]] CPlugin* getPluginByHandle(HANDLE handle);
|
||||
[[nodiscard]] std::vector<CPlugin*> getAllPlugins();
|
||||
[[nodiscard]] size_t pluginCount();
|
||||
void sigGetPlugins(CPlugin** data, size_t len);
|
||||
|
||||
bool m_allowConfigVars = false;
|
||||
bool m_allowConfigVars = false;
|
||||
|
||||
private:
|
||||
std::vector<UP<CPlugin>> m_loadedPlugins;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue