#ifndef TEENSY_UI_H_ #define TEENSY_UI_H_ #include "teensy_common.h" #include "teensy.h" #define TYUI_MAX_LAYOUT_SIZE (16) #define TYUI_WIN_NORESIZE (1 << 0) #define TYUI_WIN_NOCLOSE (1 << 1) #define TYUI_WIN_NOMOVE (1 << 2) #define TYUI_WIN_INVISIBLE (1 << 3) #define tyui_begin_window(title, rect, id) \ tyui_begin_window_ex(title, rect, id, 0, NULL) #define tyui_text(...) tyui_text_ex(TYUI_ALIGN_LEFT, __VA_ARGS__) typedef uint8_t tyui_Align; enum { TYUI_ALIGN_LEFT, TYUI_ALIGN_RIGHT, TYUI_ALIGN_CENTER, }; typedef struct { ty_Color fg_normal; ty_Color bg_normal; ty_Color fg_hover; ty_Color bg_hover; ty_Color fg_pressed; ty_Color bg_pressed; ty_Color win_bg; ty_Color win_border; ty_Color win_title; ty_Color frame; int title_bar_height; int padding; int control_padding; int frame_size; } tyui_Style; typedef uint8_t tyui_Id; void tyui_init(const ty_Font *font); void tyui_deinit(void); void tyui_push_layout(const float *column_widths); void tyui_pop_layout(void); bool tyui_begin_window_ex( const char *title, ty_Recti rect, tyui_Id *id, uint32_t flags, bool *closed ); void tyui_end_window(void); bool tyui_button(const char *text); void tyui_text_ex(tyui_Align align, const char *fmt, ...); void tyui_draw(void); #endif // TEENSY_UI_H_