From db657412e6ae93341ed42d59df6aef564a739a1f Mon Sep 17 00:00:00 2001 From: Spacedio Date: Thu, 26 Feb 2026 19:20:14 -0500 Subject: Initial commit after clone --- src/focus_ring.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/focus_ring.h (limited to 'src/focus_ring.h') diff --git a/src/focus_ring.h b/src/focus_ring.h new file mode 100644 index 0000000..74e9002 --- /dev/null +++ b/src/focus_ring.h @@ -0,0 +1,31 @@ +#ifndef FOCUSRING_H +#define FOCUSRING_H + +#include + + +/* A FocusRing is an scrollable list that wraps around to the beginning/end + * when the selection is moved out-of-bounds. + */ +typedef struct FocusRing_ { + /* Points to current selection */ + const GList *selected; + /* Points to beginning of list */ + const GList *beginning; + /* Points to end of list */ + const GList *end; + + /* Function to retrieve the target "inner value" from the GList's data */ + gchar *(*getter_function)(gconstpointer); +} FocusRing; + +FocusRing *initialize_focus_ring(const GList *options, gchar *(*getter_function)(gconstpointer), const gchar *const label); +void destroy_focus_ring(FocusRing *ring); + +gchar *focus_ring_next(FocusRing *ring); +gchar *focus_ring_prev(FocusRing *ring); +gconstpointer focus_ring_get_selected(FocusRing *ring); +gchar *focus_ring_get_value(FocusRing *ring); +gchar *focus_ring_scroll_to_value(FocusRing *ring, const gchar *target_value); + +#endif -- cgit v1.2.3