|
ginnOS
The reference: libc, the libraries and the kernel
|
idunn: a list view: rows of 32 pixels with an icon, text and a muted second text on the right; and a grid view, the same with tiles: a 48 pixel colour icon and the name below it (a file manager's icons). More...
Macros | |
| #define | PAD 4 |
| #define | ROW 32 |
| #define | ROW_GAP 1 |
| #define | ROW_PAD 10 |
| #define | ICON 16 |
| #define | ICON_GAP 10 |
| #define | TILE_W 96 |
| #define | TILE_H 88 |
| #define | PICTURE 48 |
| #define | ROW_PICTURE 20 |
| #define | TILE_GAP 4 |
| #define | FIND_MS 1000 |
| #define | FIND_MAX 32 |
| #define | EDIT_TILE_W 150 |
| #define | EDIT_ROW_W 360 |
| #define | COLUMNS_MAX 8 |
Enumerations | |
| enum | { EDIT_OPEN , EDIT_KEEP , EDIT_CANCEL } |
Functions | |
| idunn_widget_t * | idunn_list_view (void) |
| a list view: rows with a Lucide icon (or NULL), text and a muted second text on the right (or NULL). | |
| idunn_widget_t * | idunn_grid_view (void) |
| a grid view: the same, as tiles of a 48 point Tela icon (a file or folder icon name) with the name below; it wraps to the width. | |
| int | idunn_list_view_add (idunn_widget_t *list, const char *icon, const char *text, const char *detail) |
| void | idunn_list_view_clear (idunn_widget_t *list) |
| void | idunn_list_view_set_item (idunn_widget_t *list, int item, const char *icon, const char *text, const char *detail) |
| change an item; only its row is drawn again, and only when something differs (a list that is filled again each second, as in a monitor). | |
| void | idunn_list_view_set_count (idunn_widget_t *list, int count) |
| keep only the first count items (a smaller count than now) | |
| int | idunn_list_view_count (const idunn_widget_t *list) |
| void | idunn_list_view_set_multiple (idunn_widget_t *list, bool multiple) |
| many items can be selected (Ctrl, Shift, Ctrl+A) | |
| void | idunn_list_view_set_framed (idunn_widget_t *list, bool framed) |
| a border, the large radius and the card colour around the items | |
| bool | idunn_list_view_selected (const idunn_widget_t *list, int row) |
| void | idunn_list_view_select (idunn_widget_t *list, int row, bool selected) |
| void | idunn_list_view_go_to (idunn_widget_t *list, int item) |
| make an item the current one and select only it, as the arrow keys do | |
| int | idunn_list_view_columns (const idunn_widget_t *list) |
| the items in a line (1 for a list, more for a grid) | |
| int | idunn_list_view_current (const idunn_widget_t *list) |
| the item with the keyboard, or -1 | |
| const char * | idunn_list_view_text (const idunn_widget_t *list, int row) |
| void | idunn_list_view_on_select (idunn_widget_t *list, idunn_callback_t on_select, void *data) |
| on_select after the selection changes; on_activate on a double click or Enter | |
| void | idunn_list_view_on_activate (idunn_widget_t *list, idunn_callback_t on_activate, void *data) |
| void | idunn_list_view_set_single_click (idunn_widget_t *list, bool single) |
| one click activates an item (a launcher); the arrow keys only move | |
| void | idunn_list_view_on_menu (idunn_widget_t *list, idunn_callback_t on_menu, void *data) |
| on_menu on a right click: on an item that is not selected, it selects only that item first; on no item, nothing stays selected. | |
| int | idunn_list_view_item_at (const idunn_widget_t *list, int32_t x, int32_t y) |
| the item at a point of the window, or -1 | |
| bool | idunn_list_view_edit (idunn_widget_t *list, int item, size_t start, size_t end, idunn_edit_done_t done, void *data) |
| edit an item's text in place (a rename): a text field over it with the bytes start to end selected ((size_t)-1: to the end). | |
| void | idunn_list_view_set_columns (idunn_widget_t *list, const int32_t *widths, int count) |
| columns at the right of the rows: an item's detail is split at tabs, and each part is drawn at the right of its column (numbers line up). | |
| int | idunn_list_columns_at (const idunn_widget_t *list, int32_t *name_x, int32_t *row_x, int32_t *left, int32_t *right) |
| the columns of a list view, in the window (for its heads). | |
| bool | idunn_list_column_left (const idunn_widget_t *list, int column) |
| true if a column of a list is drawn at its left | |
| void | idunn_list_view_set_columns_left (idunn_widget_t *list, uint32_t mask) |
| draw some columns at their left, for text (a date, a type); the others stay at their right, for numbers. | |
| void | idunn_list_set_heads (idunn_widget_t *list, idunn_widget_t *heads) |
| the heads over a list (NULL: none); the list draws them again on layout | |
| bool | idunn_list_view_editing (const idunn_widget_t *list) |
| true while an item is edited in place | |
| void | idunn_list_view_set_pictures (idunn_widget_t *list, bool pictures) |
| rows with a Tela icon (a file or folder icon name) in colour, not a Lucide one | |
idunn: a list view: rows of 32 pixels with an icon, text and a muted second text on the right; and a grid view, the same with tiles: a 48 pixel colour icon and the name below it (a file manager's icons).
the item under the pointer has the hover colour, selected items the selection colour. only the items that can be seen are drawn, so a long list in a scroll view is fast.
keys: the arrows, Page Up and Page Down, Home and End move the current row (with Shift, they select from the anchor when many can be selected); Space selects; Enter activates; Ctrl+A selects all; typing finds the next row that starts with what was typed. the mouse: a press selects, Ctrl toggles a row, Shift selects a range, a double click activates.
idunn_list_view_edit puts a text field over an item's name (a rename in place). Enter or a press elsewhere keeps the text, Escape takes it back. the result comes from a timer, after the event, so the program can make the list again in it.
| #define PAD 4 |
| #define ROW 32 |
| #define ROW_GAP 1 |
| #define ROW_PAD 10 |
| #define ICON 16 |
| #define ICON_GAP 10 |
| #define TILE_W 96 |
| #define TILE_H 88 |
| #define PICTURE 48 |
| #define ROW_PICTURE 20 |
| #define TILE_GAP 4 |
| #define FIND_MS 1000 |
| #define FIND_MAX 32 |
| #define EDIT_TILE_W 150 |
| #define EDIT_ROW_W 360 |
| #define COLUMNS_MAX 8 |
| idunn_widget_t * idunn_list_view | ( | void | ) |
a list view: rows with a Lucide icon (or NULL), text and a muted second text on the right (or NULL).
put it in a scroll view when it is long.
| idunn_widget_t * idunn_grid_view | ( | void | ) |
a grid view: the same, as tiles of a 48 point Tela icon (a file or folder icon name) with the name below; it wraps to the width.
| int idunn_list_view_add | ( | idunn_widget_t * | list, |
| const char * | icon, | ||
| const char * | text, | ||
| const char * | detail ) |
| void idunn_list_view_clear | ( | idunn_widget_t * | list | ) |
| void idunn_list_view_set_item | ( | idunn_widget_t * | list, |
| int | item, | ||
| const char * | icon, | ||
| const char * | text, | ||
| const char * | detail ) |
change an item; only its row is drawn again, and only when something differs (a list that is filled again each second, as in a monitor).
| void idunn_list_view_set_count | ( | idunn_widget_t * | list, |
| int | count ) |
keep only the first count items (a smaller count than now)
| int idunn_list_view_count | ( | const idunn_widget_t * | list | ) |
| void idunn_list_view_set_multiple | ( | idunn_widget_t * | list, |
| bool | multiple ) |
many items can be selected (Ctrl, Shift, Ctrl+A)
| void idunn_list_view_set_framed | ( | idunn_widget_t * | list, |
| bool | framed ) |
a border, the large radius and the card colour around the items
| bool idunn_list_view_selected | ( | const idunn_widget_t * | list, |
| int | row ) |
| void idunn_list_view_select | ( | idunn_widget_t * | list, |
| int | row, | ||
| bool | selected ) |
| void idunn_list_view_go_to | ( | idunn_widget_t * | list, |
| int | item ) |
make an item the current one and select only it, as the arrow keys do
| int idunn_list_view_columns | ( | const idunn_widget_t * | list | ) |
the items in a line (1 for a list, more for a grid)
| int idunn_list_view_current | ( | const idunn_widget_t * | list | ) |
the item with the keyboard, or -1
| const char * idunn_list_view_text | ( | const idunn_widget_t * | list, |
| int | row ) |
| void idunn_list_view_on_select | ( | idunn_widget_t * | list, |
| idunn_callback_t | on_select, | ||
| void * | data ) |
on_select after the selection changes; on_activate on a double click or Enter
| void idunn_list_view_on_activate | ( | idunn_widget_t * | list, |
| idunn_callback_t | on_activate, | ||
| void * | data ) |
| void idunn_list_view_set_single_click | ( | idunn_widget_t * | list, |
| bool | single ) |
one click activates an item (a launcher); the arrow keys only move
| void idunn_list_view_on_menu | ( | idunn_widget_t * | list, |
| idunn_callback_t | on_menu, | ||
| void * | data ) |
on_menu on a right click: on an item that is not selected, it selects only that item first; on no item, nothing stays selected.
open a menu with idunn_menu_popup_at_pointer.
| int idunn_list_view_item_at | ( | const idunn_widget_t * | list, |
| int32_t | x, | ||
| int32_t | y ) |
the item at a point of the window, or -1
| bool idunn_list_view_edit | ( | idunn_widget_t * | list, |
| int | item, | ||
| size_t | start, | ||
| size_t | end, | ||
| idunn_edit_done_t | done, | ||
| void * | data ) |
edit an item's text in place (a rename): a text field over it with the bytes start to end selected ((size_t)-1: to the end).
Enter, or the keyboard going elsewhere, keeps the text; Escape takes it back.
| void idunn_list_view_set_columns | ( | idunn_widget_t * | list, |
| const int32_t * | widths, | ||
| int | count ) |
columns at the right of the rows: an item's detail is split at tabs, and each part is drawn at the right of its column (numbers line up).
| widths | the columns' widths in design pixels, left to right. |
| int idunn_list_columns_at | ( | const idunn_widget_t * | list, |
| int32_t * | name_x, | ||
| int32_t * | row_x, | ||
| int32_t * | left, | ||
| int32_t * | right ) |
the columns of a list view, in the window (for its heads).
| name_x | where the names start. |
| row_x | where the rows start. |
| left,right | the edges of each column (COLUMNS_MAX at most). |
| bool idunn_list_column_left | ( | const idunn_widget_t * | list, |
| int | column ) |
true if a column of a list is drawn at its left
| void idunn_list_view_set_columns_left | ( | idunn_widget_t * | list, |
| uint32_t | mask ) |
draw some columns at their left, for text (a date, a type); the others stay at their right, for numbers.
bit c is column c.
| void idunn_list_set_heads | ( | idunn_widget_t * | list, |
| idunn_widget_t * | heads ) |
the heads over a list (NULL: none); the list draws them again on layout
| bool idunn_list_view_editing | ( | const idunn_widget_t * | list | ) |
true while an item is edited in place
| void idunn_list_view_set_pictures | ( | idunn_widget_t * | list, |
| bool | pictures ) |
rows with a Tela icon (a file or folder icon name) in colour, not a Lucide one