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> 32 #include <gmock/gmock.h> 195 if (expected ==
nullptr || actual ==
nullptr)
209 if (expected ==
nullptr || actual ==
nullptr)
216 for (
unsigned i = 0; i != tc; i++)
253 bool check_action =
true,
bool check_buttons =
true,
bool check_axes =
true)
429 auto const error = 0.00001f;
432 if (std::abs(expect_dx - actual_dx) > error)
436 if (std::abs(expect_dy - actual_dy) > error)
441 MATCHER_P2(PointerEnterEventWithDiff, expect_dx, expect_dy,
"")
448 auto const error = 0.00001f;
451 if (std::abs(expect_dx - actual_dx) > error)
455 if (std::abs(expect_dy - actual_dy) > error)
479 float dot_product = dx1 * dx2 + dy1 * dy2;
483 return dot_product > 0.0f;
517 if (window_attrib != attrib)
553 #pragma GCC diagnostic push 554 #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 562 #pragma GCC diagnostic pop 579 index != count; ++index)
582 auto it_keys = begin(keys);
583 auto end_keys = end(keys);
584 decltype(key_count) num_required_keys = distance(it_keys, end_keys);
585 if (num_required_keys != key_count)
588 std::vector<uint32_t> pressed_keys;
589 for (uint32_t i = 0; i < key_count; i++)
591 pressed_keys.push_back(
595 if (!std::equal(it_keys, end_keys, std::begin(pressed_keys)))
614 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:104
MirKeyboardEvent const * maybe_key_event(MirEvent const *event)
Definition: event_matchers.h:71
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:91
MATCHER_P3(ButtonsDown, x, y, buttons, "")
Definition: event_matchers.h:296
MirEvent const & to_ref(MirEvent const *event)
Definition: event_matchers.h:61
MirEvent const * to_address(MirEvent const *event)
Definition: event_matchers.h:46
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:252
MATCHER_P2(ButtonDownEvent, x, y, "")
Definition: event_matchers.h:268
MirTouchEvent const * maybe_touch_event(MirEvent const *event)
Definition: event_matchers.h:81
MATCHER_P4(TouchContact, slot, action, x, y, "")
Definition: event_matchers.h:353