summaryrefslogtreecommitdiff
path: root/ted.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-21 19:13:40 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-21 19:13:40 -0500
commit46a02444bdeac16474e31c4e836b118c07f8f57f (patch)
tree3b8079c0e19704c5c0c45ca838c84a35d4ad608c /ted.h
parent8fca7beaf35cfc438d5d29f352f80dd18efe7d2e (diff)
trying to make clicking on directories work; not done yet
Diffstat (limited to 'ted.h')
-rw-r--r--ted.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/ted.h b/ted.h
index 8f2958f..86f3269 100644
--- a/ted.h
+++ b/ted.h
@@ -76,9 +76,10 @@ ENUM_U16 {
MENU_OPEN
} ENUM_U16_END(Menu);
-// file entries for menus involving a file selector
+// file entries for file selectors
typedef struct {
- char *name;
+ char *name; // just the file name
+ char *path; // full path
FsType type;
} FileEntry;
@@ -86,11 +87,15 @@ typedef struct {
Rect bounds;
u32 n_entries;
FileEntry *entries;
+ char *cwd; // a dynamic null-terminated array of chars representing the current directory
+ bool submitted; // set to true if the line buffer was just submitted this frame.
} FileSelector;
typedef struct Ted {
Font *font;
TextBuffer *active_buffer;
+ // buffer we are currently drag-to-selecting in, if any
+ TextBuffer *drag_buffer;
// while a menu or something is open, there is no active buffer. when the menu is closed,
// the old active buffer needs to be restored. that's what this stores.
TextBuffer *prev_active_buffer;
@@ -104,5 +109,6 @@ typedef struct Ted {
TextBuffer line_buffer; // general-purpose line buffer for inputs -- used for menus
TextBuffer main_buffer;
KeyAction key_actions[KEY_COMBO_COUNT];
+ char cwd[TED_PATH_MAX]; // current working directory
char error[256];
} Ted;