-
Notifications
You must be signed in to change notification settings - Fork 4
/
widget.h
66 lines (53 loc) · 1.29 KB
/
widget.h
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
typedef struct Scroll {
/* scroll position */
int row, ydiff;
int highlight;
} Scroll;
typedef struct Item {
unsigned char mode; /* entry mode */
char *name; /* item display name */
char *fullname; /* item full name */
char *status; /* item statusbar info */
size_t icon; /* index for the icon array */
} Item;
typedef enum {
WIDGET_NONE,
WIDGET_INTERNAL,
WIDGET_CONTEXT,
WIDGET_CLOSE,
WIDGET_OPEN,
WIDGET_PREV,
WIDGET_NEXT,
WIDGET_GOTO,
WIDGET_KEYPRESS,
WIDGET_DROPASK,
WIDGET_DROPCOPY,
WIDGET_DROPMOVE,
WIDGET_DROPLINK,
WIDGET_ERROR,
} WidgetEvent;
typedef struct Widget Widget;
Widget *widget_create(
const char *class,
const char *name,
int argc,
char *argv[],
const char *resources[]
);
int widget_set(
Widget *widget,
const char *cwd,
const char *title,
Item *items,
size_t nitems,
Scroll *scrl
);
/* get value of icons resource into allocated string */
char *widget_geticons(Widget *widget);
WidgetEvent widget_wait(Widget *widget);
int widget_fd(Widget *widget);
void widget_map(Widget *widget);
WidgetEvent widget_poll(Widget *widget, int *selitems, int *nselitems, Scroll *scrl, char **sel);
void widget_thumb(Widget *widget, char *path, int index);
void widget_free(Widget *widget);
void widget_busy(Widget *widget);