lightdm-mini-greeter
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 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