aboutsummaryrefslogtreecommitdiffstats
path: root/src/list_window.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/list_window.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/list_window.h b/src/list_window.h
index 2fadeebd1..2efff8a5c 100644
--- a/src/list_window.h
+++ b/src/list_window.h
@@ -14,7 +14,7 @@ typedef const char *(*list_window_callback_fn_t)(unsigned index,
int *highlight,
void *data);
-typedef struct {
+typedef struct list_window {
WINDOW *w;
unsigned rows, cols;
@@ -26,41 +26,42 @@ typedef struct {
int flags;
} list_window_t;
-typedef struct {
+typedef struct list_window_state {
GList *list;
} list_window_state_t;
/* create a new list window */
-list_window_t *list_window_init(WINDOW *w, unsigned width, unsigned height);
+struct list_window *list_window_init(WINDOW *w,
+ unsigned width, unsigned height);
/* destroy a list window (returns NULL) */
-list_window_t *list_window_free(list_window_t *lw);
+struct list_window *list_window_free(struct list_window *lw);
/* reset a list window (selected=0, start=0, clear=1) */
-void list_window_reset(list_window_t *lw);
+void list_window_reset(struct list_window *lw);
/* paint a list window */
-void list_window_paint(list_window_t *lw,
+void list_window_paint(struct list_window *lw,
list_window_callback_fn_t callback,
void *callback_data);
/* perform basic list window commands (movement) */
-int list_window_cmd(list_window_t *lw, unsigned rows, command_t cmd);
+int list_window_cmd(struct list_window *lw, unsigned rows, command_t cmd);
/* select functions */
-void list_window_set_selected(list_window_t *lw, unsigned n);
-void list_window_previous(list_window_t *lw, unsigned length);
-void list_window_next(list_window_t *lw, unsigned length);
-void list_window_first(list_window_t *lw);
-void list_window_last(list_window_t *lw, unsigned length);
-void list_window_previous_page(list_window_t *lw);
-void list_window_next_page(list_window_t *lw, unsigned length);
-void list_window_check_selected(list_window_t *lw, unsigned length);
+void list_window_set_selected(struct list_window *lw, unsigned n);
+void list_window_previous(struct list_window *lw, unsigned length);
+void list_window_next(struct list_window *lw, unsigned length);
+void list_window_first(struct list_window *lw);
+void list_window_last(struct list_window *lw, unsigned length);
+void list_window_previous_page(struct list_window *lw);
+void list_window_next_page(struct list_window *lw, unsigned length);
+void list_window_check_selected(struct list_window *lw, unsigned length);
/* find a string in a list window */
-int list_window_find(list_window_t *lw,
+int list_window_find(struct list_window *lw,
list_window_callback_fn_t callback,
void *callback_data,
const char *str,
@@ -68,7 +69,7 @@ int list_window_find(list_window_t *lw,
/* find a string in a list window (reversed) */
int
-list_window_rfind(list_window_t *lw,
+list_window_rfind(struct list_window *lw,
list_window_callback_fn_t callback,
void *callback_data,
const char *str,
@@ -78,8 +79,9 @@ list_window_rfind(list_window_t *lw,
/* list window states */
list_window_state_t *list_window_init_state(void);
list_window_state_t *list_window_free_state(list_window_state_t *state);
-void list_window_push_state(list_window_state_t *state, list_window_t *lw);
-bool list_window_pop_state(list_window_state_t *state, list_window_t *lw);
+void list_window_push_state(list_window_state_t *state,
+ struct list_window *lw);
+bool list_window_pop_state(list_window_state_t *state, struct list_window *lw);