예제 #1
0
파일: gui.c 프로젝트: bkeepers/cheribsd
static void framebuffer_poll(bool active)
{
	nsfb_event_t event;
	int timeout; /* timeout in miliseconds */

	/* run the scheduler and discover how long to wait for the next event */
	timeout = schedule_run();

	/* if active do not wait for event, return immediately */
	if (active)
		timeout = 0;

	/* if redraws are pending do not wait for event, return immediately */
	if (fbtk_get_redraw_pending(fbtk))
		timeout = 0;

	if (fbtk_event(fbtk, &event, timeout)) {
		if ((event.type == NSFB_EVENT_CONTROL) &&
		    (event.value.controlcode ==  NSFB_CONTROL_QUIT))
			netsurf_quit = true;
	}

	fbtk_redraw(fbtk);

}
예제 #2
0
void
gui_poll(bool active)
{
	LOG(("GUI poll in"));

	nsfb_event_t event;
	int timeout; /* timeout in miliseconds */

LOG(("schedule run"));
	/* run the scheduler and discover how long to wait for the next event */
	timeout = schedule_run();

	/* if active do not wait for event, return immediately */
	if (active)
		timeout = 0;

LOG(("redraw pending"));
	/* if redraws are pending do not wait for event, return immediately */
	if (fbtk_get_redraw_pending(fbtk))
		timeout = 0;

LOG(("fbtk event"));
	if (fbtk_event(fbtk, &event, timeout)) {
		if ((event.type == NSFB_EVENT_CONTROL) &&
		    (event.value.controlcode ==  NSFB_CONTROL_QUIT))
			netsurf_quit = true;
	}

LOG(("fbtk redraw"));
	fbtk_redraw(fbtk);

LOG(("GUI poll out success"));
}