| 185 | } |
| 186 | |
| 187 | SDispatchResult dispatchMagnify(std::string in) { |
| 188 | Hyprutils::String::CVarList args = in; |
| 189 | |
| 190 | SDispatchResult result; |
| 191 | |
| 192 | std::optional<int> duration; |
| 193 | std::optional<float> size; |
| 194 | |
| 195 | try { |
| 196 | auto it = args.begin(); |
| 197 | if (it != args.end() && *it != "") { |
| 198 | duration = std::stoi(*it); |
| 199 | |
| 200 | it++; |
| 201 | if (it != args.end()) |
| 202 | size = std::stof(*it); |
| 203 | } |
| 204 | } catch (...) { |
| 205 | result.error = "invalid types for arguments"; |
| 206 | Log::logger->log(Log::ERR, "[dynamic-cursors] dispatcher `magnify` received invalid args: {}", in); |
| 207 | } |
| 208 | |
| 209 | g_pDynamicCursors->dispatchMagnify(duration, size); |
| 210 | |
| 211 | return result; |
| 212 | } |
| 213 | |
| 214 | int luaMagnifyDispatcher(lua_State* L) { |
| 215 | if (!lua_istable(L, 1)) |
nothing calls this directly
no test coverage detected