#ifndef SWIFT_GUI_LISTBOX_H
#define SWIFT_GUI_LISTBOX_H

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

typedef struct swift_listbox_t swift_listbox_t;

struct swift_listbox_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;
	swift_font_t *font;
	swift_vec4f_t color;
};

SWIFT_GUI_API void swift_create_listbox(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_vec4f_t color, swift_str_t *imglistbg, 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, bool visible);
SWIFT_GUI_API void swift_list_add(swift_widget_t *control, swift_str_t *name,
	void *data);
SWIFT_GUI_API void swift_list_insert(swift_widget_t *control, swift_str_t *name,
	void *data, size_t index);
SWIFT_GUI_API void swift_unload_listbox(swift_widgets_t *wgts,
	swift_widget_t *control);
SWIFT_GUI_API void swift_set_list_selected(swift_widget_t *control,
	swift_str_t *name, void *data);
SWIFT_GUI_API void swift_set_list_item(swift_widget_t *control,
	swift_str_t *name, void *data, size_t index);
SWIFT_GUI_API void swift_remove_list_item(swift_widget_t *control,
	size_t index);
SWIFT_GUI_API void swift_remove_list_item_range(swift_widget_t *control,
	size_t index, size_t count);
SWIFT_GUI_API void *swift_get_list_selected(swift_widget_t *control);
SWIFT_GUI_API void *swift_get_list_item(swift_widget_t *control,
	size_t index);
SWIFT_GUI_API size_t swift_get_selected_index(swift_widget_t *control);
#endif /*SWIFT_GUI_LISTBOX_H*/
