20 #ifndef MIR_TEST_CLIENT_EVENT_MATCHERS_H_ 21 #define MIR_TEST_CLIENT_EVENT_MATCHERS_H_ 27 #include <xkbcommon/xkbcommon.h> 28 #include <xkbcommon/xkbcommon-keysyms.h> 30 #include <gmock/gmock.h> 188 if (expected ==
nullptr || actual ==
nullptr)
202 if (expected ==
nullptr || actual ==
nullptr)
209 for (
unsigned i = 0; i != tc; i++)
246 bool check_action =
true,
bool check_buttons =
true,
bool check_axes =
true)
422 auto const error = 0.00001f;
425 if (std::abs(expect_dx - actual_dx) > error)
429 if (std::abs(expect_dy - actual_dy) > error)
434 MATCHER_P2(PointerEnterEventWithDiff, expect_dx, expect_dy,
"")
441 auto const error = 0.00001f;
444 if (std::abs(expect_dx - actual_dx) > error)
448 if (std::abs(expect_dy - actual_dy) > error)
472 float dot_product = dx1 * dx2 + dy1 * dy2;
476 return dot_product > 0.0f;
510 if (window_attrib != attrib)
546 #pragma GCC diagnostic push 547 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 555 #pragma GCC diagnostic pop 572 index != count; ++index)
575 auto it_keys = begin(keys);
576 auto end_keys = end(keys);
577 decltype(key_count) num_required_keys = distance(it_keys, end_keys);
578 if (num_required_keys != key_count)
581 std::vector<uint32_t> pressed_keys;
582 for (uint32_t i = 0; i < key_count; i++)
584 pressed_keys.push_back(
588 if (!std::equal(it_keys, end_keys, std::begin(pressed_keys)))
607 return arg == rectangles;
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
MATCHER(KeyDownEvent, "")
Definition: event_matchers.h:97
MirKeyboardEvent const * maybe_key_event(MirEvent const *event)
Definition: event_matchers.h:64
void PrintTo(MirEvent const &event, std::ostream *os)
MATCHER_P(DisplayConfigMatches, config, "")
Definition: display_config_matchers.h:119
MirPointerEvent const * maybe_pointer_event(MirEvent const *event)
Definition: event_matchers.h:84
MATCHER_P3(ButtonsDown, x, y, buttons, "")
Definition: event_matchers.h:289
MirEvent const & to_ref(MirEvent const *event)
Definition: event_matchers.h:54
MirEvent const * to_address(MirEvent const *event)
Definition: event_matchers.h:44
bool button_event_matches(MirPointerEvent const *pev, float x, float y, MirPointerAction action, MirPointerButtons button_state, bool check_action=true, bool check_buttons=true, bool check_axes=true)
Definition: event_matchers.h:245
MATCHER_P2(ButtonDownEvent, x, y, "")
Definition: event_matchers.h:261
MirTouchEvent const * maybe_touch_event(MirEvent const *event)
Definition: event_matchers.h:74
MATCHER_P4(TouchContact, slot, action, x, y, "")
Definition: event_matchers.h:346