#ifndef SWIFT_WINDOW_WINDOW_H
#define SWIFT_WINDOW_WINDOW_H
#include <swift/window/glad.h>
#include <swift/data.h>
#include <swift/maths.h>
#include <swift/stdlib.h>
#include <swift/window/api.h>

typedef struct swift_window_t swift_window_t;

struct swift_window_t {
	void *screen, *user_data, *callbacks;
	swift_vec4f_t screen_box, sprite_box;
	swift_mat4f_t proj_mat;
	swift_list_t children, node;
	swift_window_t *parent;
};

SWIFT_WINDOW_API void swift_set_current_window(swift_window_t *window);
SWIFT_WINDOW_API bool swift_init_windows(bool init_tex_cache, const char *path);
SWIFT_WINDOW_API void swift_term_windows(void);
SWIFT_WINDOW_API swift_window_t *swift_create_window(swift_window_t *parent,
	swift_vec2f_t hw, swift_vec2f_t pos, const char *title, bool decorated,
		void *user_data);
SWIFT_WINDOW_API void swift_destroy_window(swift_window_t *window);
SWIFT_WINDOW_API void swift_handle_window_resize(swift_window_t *window,
	int width, int height);
SWIFT_WINDOW_API void swift_set_windows_title(swift_window_t *window,
	const char *title);
SWIFT_WINDOW_API swift_vec2f_t swift_get_window_pos(swift_window_t *window);
SWIFT_WINDOW_API void swift_set_window_pos(swift_window_t *window,
	swift_vec2f_t pos);
SWIFT_WINDOW_API swift_vec2f_t swift_get_window_size(swift_window_t *window);
SWIFT_WINDOW_API void swift_set_window_size(swift_window_t *window,
	swift_vec2f_t size);
SWIFT_WINDOW_API void swift_iconify(swift_window_t *window);
SWIFT_WINDOW_API void swift_restore(swift_window_t *window);
SWIFT_WINDOW_API void swift_show_window(swift_window_t *window);
SWIFT_WINDOW_API void swift_hide_window(swift_window_t *window);
SWIFT_WINDOW_API void swift_set_user_data(swift_window_t *window, void *data);
SWIFT_WINDOW_API void *swift_get_user_data(swift_window_t *window);
SWIFT_WINDOW_API void swift_poll_events(void);
SWIFT_WINDOW_API void swift_post_empty_event(void);
SWIFT_WINDOW_API void swift_event_wait(void);
SWIFT_WINDOW_API int swift_get_input_mode(swift_window_t* window, int mode);
SWIFT_WINDOW_API void swift_set_input_mode(swift_window_t* window, int mode,
	int value);
SWIFT_WINDOW_API int swift_get_key(swift_window_t* window, int key);
SWIFT_WINDOW_API int swift_get_mouse_button(swift_window_t* window, int button);
SWIFT_WINDOW_API swift_vec2f_t swift_get_cursor_pos(swift_window_t *window);
SWIFT_WINDOW_API void swift_setcursor_pos(swift_window_t *window,
	swift_vec2f_t pos);
SWIFT_WINDOW_API void swift_swap_buffers(swift_window_t *window);
SWIFT_WINDOW_API void swift_swap_intervals(swift_window_t *window,
	int interval);
SWIFT_WINDOW_API bool swift_is_window_open(swift_window_t *window);
SWIFT_WINDOW_API void swift_should_close_window(swift_window_t *window,
	bool close);
SWIFT_WINDOW_API swift_vec2f_t swift_get_screen_size(void);
SWIFT_WINDOW_API void swift_center_window(swift_window_t *window);
#endif /* SWIFT_WINDOW_WINDOW_H */
