1 #ifndef WIDGET_INPUT_BOX_H 2 #define WIDGET_INPUT_BOX_H 3 4 #include "graphics/font.h" 5 #include "input/mouse.h" 6 7 typedef struct { 8 int x; 9 int y; 10 int width_blocks; 11 int height_blocks; 12 font_t font; 13 int allow_punctuation; 14 uint8_t *text; 15 int text_length; 16 } input_box; 17 18 /** 19 * This will start text input. The `text` variable of the box will be used to capture 20 * input until @link input_box_stop @endlink is called 21 * @param box Input box 22 */ 23 void input_box_start(input_box *box); 24 void input_box_pause(input_box *box); 25 void input_box_resume(input_box *box); 26 void input_box_stop(input_box *box); 27 28 void input_box_refresh_text(input_box *box); 29 int input_box_is_accepted(input_box *box); 30 31 int input_box_handle_mouse(const mouse *m, const input_box *box); 32 void input_box_draw(const input_box *box); 33 34 #endif // WIDGET_INPUT_BOX_H 35