#ifndef SWIFT_WINDOW_CALLBACKS_H
#define SWIFT_WINDOW_CALLBACKS_H
#include <swift/stdlib.h>
#include <swift/window/api.h>
#include <swift/window/window.h>
typedef void (* swift_win_pos_fn_t)(swift_window_t*, int, int);
typedef void (* swift_win_resize_fn_t)(swift_window_t*, int, int);
typedef void (* swift_win_close_fn_t)(swift_window_t*);
typedef void (* swift_win_refresh_fn_t)(swift_window_t*);
typedef void (* swift_win_focus_fn_t)(swift_window_t*, int);
typedef void (* swift_iconify_fn_t)(swift_window_t*, int);
typedef void (* swift_buf_resize_fn_t)(swift_window_t*, int, int);
typedef void (* swift_mouse_btn_fn_t)(swift_window_t*, int, int, int);
typedef void (* swift_cur_pos_fn_t)(swift_window_t*, double, double);
typedef void (* swift_cur_enter_fn_t)(swift_window_t*, int);
typedef void (* swift_scroll_fn_t)(swift_window_t*, double, double);
typedef void (* swift_key_fn_t)(swift_window_t*, int, int, int, int);
typedef void (* swift_char_fn_t)(swift_window_t*, unsigned int);
typedef void (* swift_mods_fn_t)(swift_window_t*, unsigned int, int);
typedef void (* swift_drop_fn_t)(swift_window_t*, int, const char**);

typedef enum swift_key_mods_t swift_key_mods_t;
typedef enum swift_mouse_btn_t swift_mouse_btn_t;
typedef enum swift_keys_t swift_keys_t;
typedef enum swift_joystick_t swift_joystick_t;
typedef enum swift_button_event_t swift_button_event_t;

enum swift_keys_t
{
	SWIFT_KEY_UNKNOWN = -1,
	SWIFT_KEY_SPACE = 32,
	SWIFT_KEY_APOSTROPHE = 39,
	SWIFT_KEY_COMMA = 44,
	SWIFT_KEY_MINUS = 45,
	SWIFT_KEY_PERIOD = 46,
	SWIFT_KEY_SLASH = 47,
	SWIFT_KEY_0 = 48,
	SWIFT_KEY_1 = 49,
	SWIFT_KEY_2 = 50,
	SWIFT_KEY_3 = 51,
	SWIFT_KEY_4 = 52,
	SWIFT_KEY_5 = 53,
	SWIFT_KEY_6 = 54,
	SWIFT_KEY_7 = 55,
	SWIFT_KEY_8 = 56,
	SWIFT_KEY_9 = 57,
	SWIFT_KEY_SEMICOLON = 59,
	SWIFT_KEY_EQUAL = 61,
	SWIFT_KEY_A = 65,
	SWIFT_KEY_B = 66,
	SWIFT_KEY_C = 67,
	SWIFT_KEY_D = 68,
	SWIFT_KEY_E = 69,
	SWIFT_KEY_F = 70,
	SWIFT_KEY_G = 71,
	SWIFT_KEY_H = 72,
	SWIFT_KEY_I = 73,
	SWIFT_KEY_J = 74,
	SWIFT_KEY_K = 75,
	SWIFT_KEY_L = 76,
	SWIFT_KEY_M = 77,
	SWIFT_KEY_N = 78,
	SWIFT_KEY_O = 79,
	SWIFT_KEY_P = 80,
	SWIFT_KEY_Q = 81,
	SWIFT_KEY_R = 82,
	SWIFT_KEY_S = 83,
	SWIFT_KEY_T = 84,
	SWIFT_KEY_U = 85,
	SWIFT_KEY_V = 86,
	SWIFT_KEY_W = 87,
	SWIFT_KEY_X = 88,
	SWIFT_KEY_Y = 89,
	SWIFT_KEY_Z = 90,
	SWIFT_KEY_LEFT_BRACKET = 91,
	SWIFT_KEY_BACKSLASH = 92,
	SWIFT_KEY_RIGHT_BRACKET = 93,
	SWIFT_KEY_GRAVE_ACCENT = 96,
	SWIFT_KEY_WORLD_1 = 161,
	SWIFT_KEY_WORLD_2 = 162,
	SWIFT_KEY_ESCAPE = 256,
	SWIFT_KEY_ENTER = 257,
	SWIFT_KEY_TAB = 258,
	SWIFT_KEY_BACKSPACE = 259,
	SWIFT_KEY_INSERT = 260,
	SWIFT_KEY_DELETE = 261,
	SWIFT_KEY_RIGHT = 262,
	SWIFT_KEY_LEFT = 263,
	SWIFT_KEY_DOWN = 264,
	SWIFT_KEY_UP = 265,
	SWIFT_KEY_PAGE_UP = 266,
	SWIFT_KEY_PAGE_DOWN = 267,
	SWIFT_KEY_HOME = 268,
	SWIFT_KEY_END = 269,
	SWIFT_KEY_CAPS_LOCK = 280,
	SWIFT_KEY_SCROLL_LOCK = 281,
	SWIFT_KEY_NUM_LOCK = 282,
	SWIFT_KEY_PRINT_SCREEN = 283,
	SWIFT_KEY_PAUSE = 284,
	SWIFT_KEY_F1 = 290,
	SWIFT_KEY_F2 = 291,
	SWIFT_KEY_F3 = 292,
	SWIFT_KEY_F4 = 293,
	SWIFT_KEY_F5 = 294,
	SWIFT_KEY_F6 = 295,
	SWIFT_KEY_F7 = 296,
	SWIFT_KEY_F8 = 297,
	SWIFT_KEY_F9 = 298,
	SWIFT_KEY_F10 = 299,
	SWIFT_KEY_F11 = 300,
	SWIFT_KEY_F12 = 301,
	SWIFT_KEY_F13 = 302,
	SWIFT_KEY_F14 = 303,
	SWIFT_KEY_F15 = 304,
	SWIFT_KEY_F16 = 305,
	SWIFT_KEY_F17 = 306,
	SWIFT_KEY_F18 = 307,
	SWIFT_KEY_F19 = 308,
	SWIFT_KEY_F20 = 309,
	SWIFT_KEY_F21 = 310,
	SWIFT_KEY_F22 = 311,
	SWIFT_KEY_F23 = 312,
	SWIFT_KEY_F24 = 313,
	SWIFT_KEY_F25 = 314,
	SWIFT_KEY_KP_0 = 320,
	SWIFT_KEY_KP_1 = 321,
	SWIFT_KEY_KP_2 = 322,
	SWIFT_KEY_KP_3 = 323,
	SWIFT_KEY_KP_4 = 324,
	SWIFT_KEY_KP_5 = 325,
	SWIFT_KEY_KP_6 = 326,
	SWIFT_KEY_KP_7 = 327,
	SWIFT_KEY_KP_8 = 328,
	SWIFT_KEY_KP_9 = 329,
	SWIFT_KEY_KP_DECIMAL = 330,
	SWIFT_KEY_KP_DIVIDE = 331,
	SWIFT_KEY_KP_MULTIPLY = 332,
	SWIFT_KEY_KP_SUBTRACT = 333,
	SWIFT_KEY_KP_ADD = 334,
	SWIFT_KEY_KP_ENTER = 335,
	SWIFT_KEY_KP_EQUAL = 336,
	SWIFT_KEY_LEFT_SHIFT = 340,
	SWIFT_KEY_LEFT_CONTROL = 341,
	SWIFT_KEY_LEFT_ALT = 342,
	SWIFT_KEY_LEFT_SUPER = 343,
	SWIFT_KEY_RIGHT_SHIFT = 344,
	SWIFT_KEY_RIGHT_CONTROL = 345,
	SWIFT_KEY_RIGHT_ALT = 346,
	SWIFT_KEY_RIGHT_SUPER = 347,
	SWIFT_KEY_MENU = 348
};

enum swift_key_mods_t
{
	SWIFT_MOD_SHIFT = 0x0001,
	SWIFT_MOD_CONTROL = 0x0002,
	SWIFT_MOD_ALT = 0x0004,
	SWIFT_MOD_SUPER = 0x0008
};

enum swift_mouse_btn_t
{
	SWIFT_MOUSE_BUTTON_LEFT = 0,
	SWIFT_MOUSE_BUTTON_RIGHT = 1,
	SWIFT_MOUSE_BUTTON_MIDDLE = 2,
	SWIFT_MOUSE_BUTTON_4 = 3,
	SWIFT_MOUSE_BUTTON_5 = 4,
	SWIFT_MOUSE_BUTTON_6 = 5,
	SWIFT_MOUSE_BUTTON_7 = 6,
	SWIFT_MOUSE_BUTTON_8 = 7
};

enum swift_joystick_t
{
	SWIFT_JOYSTICK_1 = 0,
	SWIFT_JOYSTICK_2 = 1,
	SWIFT_JOYSTICK_3 = 2,
	SWIFT_JOYSTICK_4 = 3,
	SWIFT_JOYSTICK_5 = 4,
	SWIFT_JOYSTICK_6 = 5,
	SWIFT_JOYSTICK_7 = 6,
	SWIFT_JOYSTICK_8 = 7,
	SWIFT_JOYSTICK_9 = 8,
	SWIFT_JOYSTICK_10 = 9,
	SWIFT_JOYSTICK_11 = 10,
	SWIFT_JOYSTICK_12 = 11,
	SWIFT_JOYSTICK_13 = 12,
	SWIFT_JOYSTICK_14 = 13,
	SWIFT_JOYSTICK_15 = 14,
	SWIFT_JOYSTICK_16 = 15
};

enum swift_button_event_t
{
	SWIFT_BUTTON_RELEASE = 0,
	SWIFT_BUTTON_PRESS = 1,
	SWIFT_BUTTON_REPEAT = 2
};

SWIFT_WINDOW_API bool swift_create_callbacks(swift_window_t *window);
SWIFT_WINDOW_API void swift_destroy_callbacks(swift_window_t *window);
SWIFT_WINDOW_API void swift_set_char_callback(swift_window_t *window,
	swift_char_fn_t callback);
SWIFT_WINDOW_API void swift_set_mods_callback(swift_window_t *window,
	swift_mods_fn_t callback);
SWIFT_WINDOW_API void swift_set_key_callback(swift_window_t *window,
	swift_key_fn_t callback);
SWIFT_WINDOW_API void swift_set_cursor_pos_callback(swift_window_t *window,
	swift_cur_pos_fn_t callback);
SWIFT_WINDOW_API void swift_set_mouse_press_callback(swift_window_t *window,
	swift_mouse_btn_fn_t callback);
SWIFT_WINDOW_API void swift_set_scroll_callback(swift_window_t *window,
	swift_scroll_fn_t callback);
SWIFT_WINDOW_API void swift_set_window_close_callback(swift_window_t *window,
	swift_win_close_fn_t callback);
SWIFT_WINDOW_API void swift_set_window_pos_callback(swift_window_t *window,
	swift_win_pos_fn_t callback);
SWIFT_WINDOW_API void swift_set_window_resize_callback(swift_window_t *window,
	swift_win_resize_fn_t callback);
SWIFT_WINDOW_API void swift_set_window_refresh_callback(swift_window_t *window,
	swift_win_refresh_fn_t callback);
SWIFT_WINDOW_API void swift_set_window_focus_callback(swift_window_t *window,
	swift_win_focus_fn_t callback);
SWIFT_WINDOW_API void swift_set_iconify_callback(swift_window_t *window,
	swift_iconify_fn_t callback);
SWIFT_WINDOW_API void swift_set_buffer_resize_callback(swift_window_t *window,
	swift_buf_resize_fn_t callback);
SWIFT_WINDOW_API void swift_set_cursor_entered_callback(swift_window_t *window,
	swift_cur_enter_fn_t callback);
SWIFT_WINDOW_API void swift_set_drops_callback(swift_window_t *window,
	swift_drop_fn_t callback);

#endif /* SWIFT_WINDOW_CALLBACKS_H */
