/* Initialize window system, set up root window, hook into touch driver. 
This function initializes the windowing system. Call this function before any other window system operations, as this initializes the root window, internal queues and other internals.  */
void win_init(void)
/* Initialize window system, set up root window, hook into touch driver. 
This function initializes the windowing system. Call this function before any other window system operations, as this initializes the root window, internal queues and other internals.  */
void win_init(void)
{
	win_root.attributes.area.size.x = gfx_get_width();
	win_root.attributes.area.size.y = gfx_get_height();
	win_root.attributes.background = &win_root_background;
	win_event_queue.free = WIN_EVENT_QUEUE_SIZE;
	win_event_queue.start = win_event_queue_buffer;
	win_event_queue.front = win_event_queue_buffer;
	win_event_queue.end = &win_event_queue_buffer[WIN_EVENT_QUEUE_SIZE - 1];
	win_event_queue.back
		= &win_event_queue_buffer[WIN_EVENT_QUEUE_SIZE - 1];
	win_keyboard_focus = &win_root;
	win_last_pointer_pos.x = gfx_get_width() / 2;
	win_last_pointer_pos.y = gfx_get_height() / 2;
}