Exemplo n.º 1
0
void * s_window_loop_event (void *arg)
{
	s_event_t *event;
	s_window_t *window;

	window = (s_window_t *) arg;

	while (window->running > 0) {
		if (s_eventq_wait(window, &event) != 0) {
			continue;
		}
        	if (window->atevent != NULL) {
			window->atevent(window, event);
		}
		switch (event->type & EVENT_TYPE_MASK) {
//			case EVENT_TYPE_QUIT:   window->running = 0;                      break;
			case EVENT_TYPE_QUIT:
				 s_socket_request(window, SOC_DATA_CLOSE);
				 s_event_uninit(event);
				 return NULL;
				 break;
			case EVENT_TYPE_MOUSE:    s_event_parse_mouse(window, event);  break;
			case EVENT_TYPE_KEYBOARD: s_event_parse_keybd(window, event);  break;
			case EVENT_TYPE_EXPOSE:   s_event_parse_expos(window, event);  break;
			case EVENT_TYPE_CONFIG:   s_event_parse_config(window, event); break;
			case EVENT_TYPE_TIMER:    s_event_parse_timer(window, event);  break;
			case EVENT_TYPE_FOCUS:                                         break;
			case EVENT_TYPE_MAP:                                           break;
			case EVENT_TYPE_DESKTOP:				       break;
		}
		s_event_uninit(event);
	}

	return NULL;
}
Exemplo n.º 2
0
void * s_window_loop_event (void *arg)
{
    s_event_t *event;
    s_window_t *window;

    window = (s_window_t *) arg;

    while (window->running > 0) {
        if (s_eventq_wait(window, &event) != 0) {
            continue;
        }

        if (window->atevent != NULL) {
            window->atevent(window, event);
        }

        switch (event->type & EVENT_MASK) {
        case QUIT_EVENT:
            s_socket_request(window, SOC_DATA_CLOSE);
            s_event_uninit(event);
            return NULL;
            break;
        case MOUSE_EVENT:
            s_event_parse_mouse(window, event);
            break;
        case KEYBD_EVENT:
            s_event_parse_keybd(window, event);
            break;
        case EXPOSE_EVENT:
            s_event_parse_expos(window, event);
            break;
        case CONFIG_EVENT:
            s_event_parse_config(window, event);
            break;
        case TIMER_EVENT:
            s_event_parse_timer(window, event);
            break;
        case FOCUS_EVENT:
            break;
        case DESKTOP_EVENT:
            break;
        }
        s_event_uninit(event);
    }

    return NULL;
}