use SManagerOptions

This commit is contained in:
ikalco 2024-05-16 15:04:53 -05:00
parent 685037d34b
commit 001b294f59
2 changed files with 18 additions and 4 deletions

View file

@ -47,6 +47,20 @@ namespace Hyprcursor {
eHyprcursorDataType type = HC_DATA_PNG;
};
/*!
struct for cursor manager options
*/
struct SManagerOptions {
/*!
The function used for logging by the cursor manager
*/
PHYPRCURSORLOGFUNC logFn = nullptr;
/*!
Allow fallback to env and first theme found
*/
bool allowDefaultFallback = true;
};
/*!
Basic Hyprcursor manager.
@ -68,7 +82,7 @@ namespace Hyprcursor {
\since 0.1.6
*/
CHyprcursorManager(const char* themeName, PHYPRCURSORLOGFUNC fn);
CHyprcursorManager(const char* themeName, PHYPRCURSORLOGFUNC fn, bool allowDefaultFallback);
CHyprcursorManager(const char* themeName, SManagerOptions options);
~CHyprcursorManager();
/*!

View file

@ -210,9 +210,9 @@ CHyprcursorManager::CHyprcursorManager(const char* themeName_, PHYPRCURSORLOGFUN
init(themeName_);
}
CHyprcursorManager::CHyprcursorManager(const char* themeName_, PHYPRCURSORLOGFUNC fn, bool allowDefaultFallback_) {
allowDefaultFallback = allowDefaultFallback_;
logFn = fn;
CHyprcursorManager::CHyprcursorManager(const char* themeName_, SManagerOptions options) {
logFn = options.logFn;
allowDefaultFallback = options.allowDefaultFallback;
init(themeName_);
}