summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-21 11:50:51 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-21 11:50:51 -0500
commitdd91d6c72625cc7ed2ec5954a5cbca35fd7655d4 (patch)
tree4b1e52098e3fdbb9a36395c33ad057b7cbaf0d01 /ted.h
parent3d86329abd754319a36459f8eb3e4bce6efffe1e (diff)
split file selector into its own thing
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ted.h b/ted.h
index af1a2ae..8f2958f 100644
--- a/ted.h
+++ b/ted.h
@@ -7,10 +7,12 @@ typedef struct {
float cursor_blink_time_on, cursor_blink_time_off;
u32 colors[COLOR_COUNT];
u16 text_size;
+ u16 max_menu_width;
u8 tab_width;
u8 cursor_width;
u8 undo_save_time;
u8 border_thickness;
+ u8 padding;
} Settings;
#define SCANCODE_COUNT 0x120 // SDL scancodes should be less than this value.
@@ -74,6 +76,18 @@ ENUM_U16 {
MENU_OPEN
} ENUM_U16_END(Menu);
+// file entries for menus involving a file selector
+typedef struct {
+ char *name;
+ FsType type;
+} FileEntry;
+
+typedef struct {
+ Rect bounds;
+ u32 n_entries;
+ FileEntry *entries;
+} FileSelector;
+
typedef struct Ted {
Font *font;
TextBuffer *active_buffer;
@@ -86,6 +100,7 @@ typedef struct Ted {
u8 nmouse_clicks[4]; // nmouse_clicks[i] = length of mouse_clicks[i]
v2 mouse_clicks[4][32]; // mouse_clicks[SDL_BUTTON_RIGHT], for example, is all the right mouse-clicks that have happened this frame
Menu menu;
+ FileSelector file_selector;
TextBuffer line_buffer; // general-purpose line buffer for inputs -- used for menus
TextBuffer main_buffer;
KeyAction key_actions[KEY_COMBO_COUNT];