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

typedef struct swift_text_t swift_text_t;

struct swift_text_t {
	swift_str_t *str;
	swift_vec2f_t maxchars, text_hw, offset;
	swift_vec4f_t color;
	swift_array_t *buf;
	swift_font_t *font;
	size_t font_size;
};

SWIFT_GUI_API size_t swift_get_string_width(swift_str_t *text, float size,
	swift_font_t *font);
SWIFT_GUI_API void swift_text_set(swift_text_t *data, swift_vec2f_t offset,
	swift_vec2f_t maxchars, swift_font_t *font, swift_vec4f_t color,
		swift_str_t *string, size_t size);
SWIFT_GUI_API void swift_create_text_vertex(swift_text_t *str,
	swift_widget_t *control);
SWIFT_GUI_API void swift_create_chatbox_text_vertex(swift_text_t *str,
	swift_widget_t *control, swift_vec4f_t color, swift_str_t *new_str);
SWIFT_GUI_API void swift_lbl_pos_update(swift_text_t *str,
	swift_widget_t *control);
SWIFT_GUI_API void swift_lbl_col_update(swift_text_t *str,
	swift_widget_t *control);
SWIFT_GUI_API void swift_textbox_pos_update(swift_text_t *str,
	swift_widget_t *control);
SWIFT_GUI_API void swift_textbox_text_update(swift_text_t *str,
	swift_widget_t *control);
#endif /*SWIFT_GUI_TEXT_H*/
