3 // Copyright 2020 Bruce Hill
4 // Released under the MIT license with the Commons Clause
6 // This file contains definitions for bb column-drawing code.
9 #ifndef FILE_COLUMNS__H
10 #define FILE_COLUMNS__H
16 // Colors (using ANSI escape sequences):
17 #define TITLE_COLOR "\033[37;1m"
18 #define NORMAL_COLOR "\033[37m"
19 #define CURSOR_COLOR "\033[43;30;1m"
20 #define LINK_COLOR "\033[35m"
21 #define DIR_COLOR "\033[34m"
22 #define EXECUTABLE_COLOR "\033[31m"
23 #define SCROLLBAR_FG "\033[48;5;247m "
24 #define SCROLLBAR_BG "\033[48;5;239m "
26 #define TIME_FMT " %T %D "
27 #define SELECTED_INDICATOR " \033[31;7m \033[0m"
28 #define NOT_SELECTED_INDICATOR " "
29 #define SORT_INDICATOR "↓"
30 #define RSORT_INDICATOR "↑"
34 void (*render)(entry_t *, const char *, char *, int);
35 unsigned int stretchy : 1;
50 void draw_column_labels(FILE *out, char columns[], char *sort, int width);
51 void draw_row(FILE *out, char columns[], entry_t *entry, const char *color, int width);
52 int *get_column_widths(char columns[], int width);
53 void render(FILE *out, bb_t *bb);
55 void col_mreltime(entry_t *entry, const char *color, char *buf, int width);
56 void col_areltime(entry_t *entry, const char *color, char *buf, int width);
57 void col_creltime(entry_t *entry, const char *color, char *buf, int width);
58 void col_mtime(entry_t *entry, const char *color, char *buf, int width);
59 void col_atime(entry_t *entry, const char *color, char *buf, int width);
60 void col_ctime(entry_t *entry, const char *color, char *buf, int width);
61 void col_selected(entry_t *entry, const char *color, char *buf, int width);
62 void col_perm(entry_t *entry, const char *color, char *buf, int width);
63 void col_random(entry_t *entry, const char *color, char *buf, int width);
64 void col_size(entry_t *entry, const char *color, char *buf, int width);
65 void col_name(entry_t *entry, const char *color, char *buf, int width);
68 // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0