Added focusmonitor

This commit is contained in:
vaxerski 2022-05-05 12:50:25 +02:00
parent c7fd3d46fd
commit 8bb908a8da
6 changed files with 114 additions and 2 deletions

View file

@ -1,5 +1,6 @@
#include "MiscFunctions.hpp"
#include "../defines.hpp"
#include <algorithm>
void addWLSignal(wl_signal* pSignal, wl_listener* pListener, void* pOwner, std::string ownerString) {
ASSERT(pSignal);
@ -111,4 +112,12 @@ float getPlusMinusKeywordResult(std::string source, float relative) {
}
return result;
}
bool isNumber(const std::string& str) {
return std::ranges::all_of(str.begin(), str.end(), [](char c) { return isdigit(c) != 0; });
}
bool isDirection(const std::string& arg) {
return arg == "l" || arg == "r" || arg == "u" || arg == "d" || arg == "t" || arg == "b";
}

View file

@ -7,5 +7,7 @@ void wlr_signal_emit_safe(struct wl_signal *signal, void *data);
std::string getFormat(const char *fmt, ...); // Basically Debug::log to a string
void scaleBox(wlr_box*, float);
std::string removeBeginEndSpacesTabs(std::string);
bool isNumber(const std::string&);
bool isDirection(const std::string&);
float getPlusMinusKeywordResult(std::string in, float relative);