| 454 | } |
| 455 | |
| 456 | std::tuple<bool, wf::point_t> view_action_interface_t::_validate_ws( |
| 457 | const std::vector<variant_t>& args) |
| 458 | { |
| 459 | if (!this->_view->get_output()) |
| 460 | { |
| 461 | return {false, {}}; |
| 462 | } |
| 463 | |
| 464 | if (args.size() != 2) |
| 465 | { |
| 466 | LOGE("Invalid workspace identifier, expected <x> <y>"); |
| 467 | } |
| 468 | |
| 469 | auto [ok1, x] = _expect_int(args, 0); |
| 470 | auto [ok2, y] = _expect_int(args, 1); |
| 471 | if (!ok1 || !ok2) |
| 472 | { |
| 473 | LOGE("Workspace coordinates should be integers!"); |
| 474 | return {false, {}}; |
| 475 | } |
| 476 | |
| 477 | auto wsize = _view->get_output()->wset()->get_workspace_grid_size(); |
| 478 | if (((0 <= x) && (x < wsize.width)) && ((0 <= y) && (y < wsize.height))) |
| 479 | { |
| 480 | return {true, {x, y}}; |
| 481 | } |
| 482 | |
| 483 | LOGE("Workspace coordinates out of bounds!"); |
| 484 | return {false, {}}; |
| 485 | } |
| 486 | |
| 487 | wf::geometry_t view_action_interface_t::_get_workspace_grid_geometry( |
| 488 | wf::output_t *output) const |
nothing calls this directly
no test coverage detected