blob: f1754453920c0527370e7303499d53ad1c963986 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#ifndef SF_FM_H
#define SF_FM_H
#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;
} file_item;
typedef struct {
file_item *items;
size_t count;
size_t cap;
} file_list;
typedef struct {
file_list *cur;
file_list *next;
int cursor;
window *windows[2];
/* int got_next_dir; */
char got_dir[PATH_MAX];
char cwd[PATH_MAX];
int top, bottom;
bool need_redraw;
} fm_info;
file_list *fm_getdir(file_list *list, const char *path);
fm_info *fm_init(terminal *t);
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 */
|