Update to spice2x-25-04-25 (pre-apply)

> broken commit
This commit is contained in:
[ ]
2025-05-07 00:25:31 +09:00
parent 04dee88276
commit c94de456b5
543 changed files with 78491 additions and 91698 deletions
+44
View File
@@ -79,6 +79,23 @@ static inline void strreplace(std::string &s, const std::string &search, const s
}
}
static inline std::string strtrim(const std::string& input) {
std::string output = input;
// trim spaces
output.erase(0, output.find_first_not_of("\t\n\v\f\r "));
output.erase(output.find_last_not_of("\t\n\v\f\r ") + 1);
return output;
}
static inline std::string strtolower(const std::string& input) {
std::string output = strtrim(input);
// replace with lower case
std::transform(
output.begin(), output.end(), output.begin(),
[](unsigned char c){ return std::tolower(c); });
return output;
}
static inline int _hex2bin_helper(char input) {
if (input >= '0' && input <= '9') {
return input - '0';
@@ -267,3 +284,30 @@ static inline std::string guid2s(const GUID guid) {
guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3],
guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
}
bool acquire_shutdown_privs();
void generate_ea_card(char card[17]);
static inline int get_async_primary_mouse() {
int vk = GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON;
return GetAsyncKeyState(vk);
}
static inline int get_async_secondary_mouse() {
int vk = GetSystemMetrics(SM_SWAPBUTTON) ? VK_LBUTTON : VK_RBUTTON;
return GetAsyncKeyState(vk);
}
static inline bool parse_width_height(const std::string wh, std::pair<uint32_t, uint32_t> &result) {
std::string s = wh;
uint32_t w, h;
const auto remove_spaces = [](const char& c) { return c == ' '; };
s.erase(std::remove_if(s.begin(), s.end(), remove_spaces), s.end());
if (sscanf(s.c_str(), "%u,%u", &w, &h) == 2) {
result = std::pair(w, h);
return true;
} else {
return false;
}
}