void A3::step(int64_t timeNow) { GOTO_LAST_YIELD; PRINTF("A3.1\n"); YIELD_UNTIL(NOW() + 1*SECONDS); PRINTF("A3.2\n"); YIELD_UNTIL(NOW() + 1*SECONDS); PRINTF("A3.3\n"); YIELD_UNTIL(NOW() + 1*SECONDS); PRINTF("A3.4\n"); GOTO_LAST_YIELD_END; }
void A4::step(int64_t timeNow) { GOTO_LAST_YIELD; PRINTF("A4 Initialisation\n"); while(1) { PRINTF("A4.1\n"); YIELD_UNTIL(NOW() + 500*MILLISECONDS); PRINTF("A4.2\n"); YIELD_UNTIL(NOW() + 500*MILLISECONDS); PRINTF("A4.3\n"); YIELD_UNTIL(NOW() + 500*MILLISECONDS); } GOTO_LAST_YIELD_END; }
void checkButton(const uint32_t button, const uint32_t state) { YIELD_UNTIL( pointer_.button() == button and pointer_.buttonState() == state); }
void checkPointer(const uint32_t x, const uint32_t y) { YIELD_UNTIL(pointer_.x() == x and pointer_.y() == y); }
void checkFocus(const bool focus) { YIELD_UNTIL(pointer_.hasFocus(&surface_) == focus); }
/** * The assumption is that window fullscreening is honored by the window * manager/compositor and fills the entire screen size when fullscreened. * When unfullscreened, the window should restore to its initial size * and position. */ void test() { gint width, height; GdkScreen *screen(gtk_window_get_screen(*this)); Geometry fullscreen( 0, 0, gdk_screen_get_width(screen), gdk_screen_get_height(screen) ); const Geometry initial(getSurfaceGeometry(*this)); std::cout << "...initial server geometry " << initial << std::endl; gtk_window_get_size(*this, &width, &height); std::cout << "...checking server size == client size" << std::endl; FAIL_UNLESS_EQUAL(width, initial.width); FAIL_UNLESS_EQUAL(height, initial.height); std::cout << "...checking client size != fullscreen size" << std::endl; FAIL_IF_EQUAL(width, fullscreen.width); FAIL_IF_EQUAL(height, fullscreen.height); isConfigured_ = false; std::cout << "...fullscreening client" << std::endl; gtk_window_fullscreen(*this); std::cout << "...checking for fullscreen state event" << std::endl; YIELD_UNTIL(isFullscreen_); std::cout << "...checking for configure event" << std::endl; YIELD_UNTIL(isConfigured_); std::cout << "...checking client size == fullscreen size" << std::endl; gtk_window_get_size(*this, &width, &height); FAIL_UNLESS_EQUAL(width, fullscreen.width); FAIL_UNLESS_EQUAL(height, fullscreen.height); std::cout << "...checking server geometry == fullscreen geometry" << std::endl; YIELD_UNTIL(isServerGeometry(fullscreen)); isConfigured_ = false; std::cout << "...unfullscreening client" << std::endl; gtk_window_unfullscreen(*this); std::cout << "...checking for fullscreen state event" << std::endl; YIELD_UNTIL(not isFullscreen_); std::cout << "...checking for configure event" << std::endl; YIELD_UNTIL(isConfigured_); gtk_window_get_size(*this, &width, &height); std::cout << "...checking client size == initial size" << std::endl; FAIL_UNLESS_EQUAL(width, initial.width); FAIL_UNLESS_EQUAL(height, initial.height); std::cout << "...checking server geometry == initial geometry" << std::endl; YIELD_UNTIL(isServerGeometry(initial)); }