#ifndef SWIFT_GUI_CHATBOX_H
#define SWIFT_GUI_CHATBOX_H

#include <swift/gui/api.h>
#include <swift/gui/widget.h>
#include <swift/string.h>

typedef struct swift_chatbox_t swift_chatbox_t;

struct swift_chatbox_t {
	swift_widget_t *control, vbar;
	swift_array_t list;
	swift_sprite_t select, over;
	bool selected, isover;
	swift_vec2f_t offset;
	size_t voffset, max, font_size, max_msgs;
	swift_font_t *font;
};

SWIFT_GUI_API void swift_create_chatbox(swift_widget_t *control,
	swift_widget_t *parent, swift_vec3f_t pos, swift_vec2f_t hw, float barwidth,
		swift_vec2f_t btn_hw, swift_vec2f_t offset, swift_font_t *font,
			swift_str_t *imgchatbg, swift_str_t *imgbg, swift_str_t *imgup,
				swift_str_t *imgdown, swift_str_t *bar,
					swift_vec4f_t select_color, swift_vec4f_t over_color,
						size_t font_size, size_t max_msgs, bool visible);
SWIFT_GUI_API void swift_chatbox_add(swift_widget_t *control,
	swift_str_t *username, swift_vec4f_t user_color, swift_str_t *msg,
		swift_vec4f_t msg_color);
SWIFT_GUI_API void swift_unload_chatbox(swift_widgets_t *wgts,
	swift_widget_t *control);
SWIFT_GUI_API void swift_set_chatbox_selected(swift_widget_t *control,
	swift_str_t *username, swift_vec4f_t user_color, swift_str_t *msg,
		swift_vec4f_t msg_color);
SWIFT_GUI_API void swift_set_chatbox_msg(swift_widget_t *control,
	swift_str_t *username, swift_vec4f_t user_color, swift_str_t *msg,
		swift_vec4f_t msg_color, size_t index);
SWIFT_GUI_API void swift_remove_chatbox_msg(swift_widget_t *control,
	size_t index);
SWIFT_GUI_API void swift_remove_chatbox_msg_range(swift_widget_t *control,
	size_t index, size_t count);
size_t swift_get_selected_msg_index(swift_widget_t *control);
#endif /*SWIFT_GUI_CHATBOX_H*/
