Пример #1
0
int
  main(int argc, char *argv[])
{
	win_t win;
	GdiplusStartupInput gdiplusStartupInput;
	ULONG_PTR gdiplusToken;

	GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);

	win.dpy = XOpenDisplay(0);

	if (win.dpy == NULL) {
		fprintf(stderr, "Failed to open display\n");
		return 1;
	}

	win_init(&win);

	win_draw(&win);

	win_handle_events(&win);

	win_deinit(&win);

	XCloseDisplay(win.dpy);

	GdiplusShutdown(gdiplusToken);
	return 0;
}
Пример #2
0
int _zbar_processor_input_wait (zbar_processor_t *proc,
                                zbar_event_t *event,
                                int timeout)
{
    int n = (event) ? 1 : 0;
    int rc = MsgWaitForMultipleObjects(n, event, 0, timeout, QS_ALLINPUT);

    if(rc == n) {
        if(win_handle_events(proc) < 0)
            return(-1);
        return(1);
    }
    if(!rc)
        return(1);
    if(rc == WAIT_TIMEOUT)
        return(0);
    return(-1);
}