diff options
| author | Spacedio <spacedio@thernusen.net> | 2026-02-26 19:20:14 -0500 |
|---|---|---|
| committer | Spacedio <spacedio@thernusen.net> | 2026-02-26 19:20:14 -0500 |
| commit | db657412e6ae93341ed42d59df6aef564a739a1f (patch) | |
| tree | 6f67f55f6dc61fb0afa8829a950f0dbf1a0aeadf /src/focus_ring.h | |
| download | lightdm-mini-greeter-db657412e6ae93341ed42d59df6aef564a739a1f.tar.gz | |
Diffstat (limited to 'src/focus_ring.h')
| -rw-r--r-- | src/focus_ring.h | 31 |
1 files changed, 31 insertions, 0 deletions
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 <gdk/gdk.h> + + +/* 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 |
