#ifndef zori_widget_H_INCLUDED
#define zori_widget_H_INCLUDED

struct zori_widget;

void zori_widget_cleanup_widget_only(struct zori_widget * widget);
void zori_widget_destroy_widget_only(struct zori_widget * widget);
void zori_widget_call_destructor_and_destroy(struct zori_widget * widget);
void zori_widget_destroy(struct zori_widget * widget);
int zori_widget_accepts_event(struct zori_widget *widget, union zori_event *event);
int zori_widget_self_raise_event(struct zori_widget *widget, union zori_event *event);
int zori_widget_raise_event(struct zori_widget *widget, union zori_event *event);
int zori_widget_raise_system_event(struct zori_widget *widget, zori_system_event *sysev);
int zori_widget_raise_draw_event(struct zori_widget *widget);
int zori_widget_raise_overdraw_event(struct zori_widget *widget);
int zori_widget_raise_done_event(struct zori_widget *widget);
int zori_widget_raise_free_event(struct zori_widget *widget);
int zori_widget_raise_update_event(struct zori_widget *widget, double dt);
int zori_widget_raise_action_event(struct zori_widget *widget);
int zori_widget_raise_internal_action_event(struct zori_widget * widget);
int zori_widget_raise_internal_close_event(struct zori_widget * widget);
int zori_widget_raise_close_event(struct zori_widget *widget, struct zori_widget *from);
int zori_widget_compare(const void *v1, const void *v2);
struct zori_handler *zori_widget_add_handler(struct zori_widget *widget, zori_event_type type, zori_handler_func *handler, void *data);
struct zori_handler *zori_widget_add_handlers(struct zori_widget *widget, struct zori_handler *handlers, size_t amount);
struct zori_widget *zori_widget_done(struct zori_widget *widget);
void zori_widget_free(struct zori_widget *widget);
struct zori_widget *zori_widget_add_child(struct zori_widget *parent, struct zori_widget *child);
zori_id zori_widget_margins_(struct zori_widget *widget, int left, int top, int right, int bottom);
zori_id zori_widget_margin_(struct zori_widget *widget, int size);
void zori_widget_draw_background(struct zori_widget *widget);
enum zori_handle_result 
zori_widget_must_draw_children(struct zori_widget * widget);
int zori_widget_visible(struct zori_widget *widget);
int zori_widget_active(struct zori_widget *widget);
int zori_widget_active_(struct zori_widget *widget, int set);
int zori_widget_visible_(struct zori_widget *widget, int set);
int zori_widget_hover(struct zori_widget *widget);
int zori_widget_hover_(struct zori_widget *widget, int set);
int zori_widget_marked(struct zori_widget *widget);
int zori_widget_marked_(struct zori_widget *widget, int set);
int zori_widget_ready(struct zori_widget *widget);
int zori_widget_ready_(struct zori_widget *widget, int set);
int zori_xy_inside_widget_p(struct zori_widget *widget, double x, double y);
zori_font *zori_widget_font(struct zori_widget *widget);
zori_color zori_widget_forecolor(struct zori_widget *widget);
zori_color zori_widget_backcolor(struct zori_widget *widget);
int zori_widget_h(struct zori_widget *widget);
int zori_widget_w(struct zori_widget *widget);
int zori_widget_x(struct zori_widget *widget);
int zori_widget_y(struct zori_widget *widget);
int zori_widget_count_children(struct zori_widget *widget);
struct zori_widget *zori_widget_get_child(struct zori_widget *widget, int index);
zori_id zori_widget_paddings_(struct zori_widget *widget, int left, int top, int right, int bottom);
zori_id zori_widget_padding_(struct zori_widget *widget, int size);
zori_font *zori_widget_text_font(struct zori_widget *widget);
struct zori_widget *zori_widget_init(struct zori_widget *widget, zori_widget_type type, zori_id id, struct zori_widget *parent, zori_rebox *box, struct zori_style *style);
struct zori_widget *zori_widget_initall(struct zori_widget *widget, zori_widget_type type, int id, struct zori_widget *parent, zori_rebox *box, struct zori_style *style, struct zori_handler *handlers, size_t amount);
void zori_widget_handle_event(struct zori_widget *widget, union zori_event *event);
struct zori_widget *zori_widget_find_parent(struct zori_widget *widget, _Bool (*predicate)(struct zori_widget *parent, void *extra), void *extra);
bool zori_widget_is_type(struct zori_widget * widget, zori_widget_type type);
_Bool zori_widget_is_type_predicate(struct zori_widget *widget, void *extra);
struct zori_widget *zori_widget_get_parent_of_type(struct zori_widget *widget, zori_widget_type type);
struct zori_screen *zori_widget_get_screen(struct zori_widget *widget);
int zori_mark_widget(struct zori_widget *widget);
zori_id zori_widget_set_int_result(struct zori_widget * widget, int value);
zori_id zori_widget_set_string_result(struct zori_widget * widget, zori_string * value);
zori_id zori_widget_set_closed_result(struct zori_widget * widget, int value);


#endif




