diff --git a/src/list_window.h b/src/list_window.h
index eef6b9a7c43c1d8739971bfe3470e8041f65056a..98fcfbef7fc44327cd7ab07f704f51154b2b5d06 100644 (file)
--- a/src/list_window.h
+++ b/src/list_window.h
unsigned start;
unsigned selected;
- unsigned selected_start; /* for range selection, first selected item */
- unsigned selected_end; /* for range selection, last selected item */
unsigned range_base; /* represents the base item. */
bool range_selection; /* range selection activated */
bool hide_cursor;
};
+/**
+ * The bounds of a range selection, see list_window_get_range().
+ */
+struct list_window_range {
+ /**
+ * The index of the first selected item.
+ */
+ unsigned start;
+
+ /**
+ * The index after the last selected item. The selection is
+ * empty when this is the same as "start".
+ */
+ unsigned end;
+};
+
/* create a new list window */
struct list_window *list_window_init(WINDOW *w,
unsigned width, unsigned height);
void
list_window_fetch_cursor(struct list_window *lw);
+/**
+ * Determines the lower and upper bound of the range selection. If
+ * range selection is disabled, it returns the cursor position (range
+ * length is 1).
+ */
+void
+list_window_get_range(const struct list_window *lw,
+ struct list_window_range *range);
+
/* find a string in a list window */
bool
list_window_find(struct list_window *lw,