aboutsummaryrefslogtreecommitdiffstats
path: root/fm.h
diff options
context:
space:
mode:
Diffstat (limited to 'fm.h')
-rw-r--r--fm.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/fm.h b/fm.h
index b50dabe..f175445 100644
--- a/fm.h
+++ b/fm.h
@@ -4,9 +4,15 @@
#include <limits.h>
#include <linux/limits.h>
#include <ncurses.h>
+#include <stdbool.h>
#include "wm.h"
+#define PANE_LEFT 0
+#define PANE_RIGHT 1
+
+#define MARGIN 3
+
typedef struct {
char name[256];
int is_dir;
@@ -14,26 +20,33 @@ typedef struct {
typedef struct {
file_item *items;
- int count;
- int cap;
+ size_t count;
+ size_t cap;
} file_list;
typedef struct {
file_list *cur;
file_list *next;
- int selected_idx;
- window *fm_l, *fm_r;
- int got_next_dir;
+ int cursor;
+ window *windows[2];
+ /* int got_next_dir; */
char got_dir[PATH_MAX];
char cwd[PATH_MAX];
- int top, bottom, margin_bottom;
- int needs_redraw;
+ int top, bottom;
+ bool need_redraw;
} fm_info;
-void fm_getdir(fm_info *i, file_list *l, const char *path);
+file_list *fm_getdir(file_list *list, const char *path);
fm_info *fm_init(terminal *t);
-void fm_getcwd(fm_info *f);
-void fm_draw_entries(fm_info *i, int n, int m);
-void fm_entries_scrool(terminal *t, fm_info *i, int n);
-void fm_draw_right_window(fm_info *i);
+void fm_getcwd(fm_info *info);
+void fm_draw_entries(window *window, file_list *list, size_t cursor, int top,
+ int bottom);
+void fm_entries_scroll(fm_info *info, int n);
+/* void fm_draw_right_window(fm_info *i); */
+
+void fm_cd_up(fm_info *i);
+void fm_cd_down(fm_info *i);
+bool fm_preview_file(window *w, const char *path);
+void magic_init(void);
+void magic_cleanup(void);
#endif /* SF_FM_H */