rofi
1.5.1
|
![]() |
Typedefs | |
typedef struct _listview | listview |
typedef void(* | listview_update_callback) (textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full) |
typedef void(* | listview_mouse_activated_cb) (listview *, gboolean, void *) |
Enumerations | |
enum | ScrollType { LISTVIEW_SCROLL_PER_PAGE, LISTVIEW_SCROLL_CONTINIOUS } |
Handle to the listview. No internal fields should be accessed directly.
Definition at line 42 of file listview.h.
typedef void( * listview_mouse_activated_cb) (listview *, gboolean, void *) |
Callback when a element is activated.
Definition at line 69 of file listview.h.
typedef void( * listview_update_callback) (textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full) |
tb | The textbox to set |
entry | The position of the textbox |
udata | User data |
type | The textbox font style to apply to this entry (normal, selected, alternative row) |
full | If true Set both text and style. |
Update callback, this is called to set the value of each (visible) element.
Definition at line 64 of file listview.h.
enum ScrollType |
The scrolling type used in the list view
Enumerator | |
---|---|
LISTVIEW_SCROLL_PER_PAGE | Flip through the pages. |
LISTVIEW_SCROLL_CONTINIOUS | keep selected item centered |
Definition at line 47 of file listview.h.
listview* listview_create | ( | widget * | parent, |
const char * | name, | ||
listview_update_callback | cb, | ||
void * | udata, | ||
unsigned int | eh, | ||
gboolean | reverse | ||
) |
parent | The widget's parent. |
name | The name of the to be created widget. |
cb | The update callback. |
udata | The user data to pass to the callback |
eh | The height of one element |
reverse | Reverse the listview order. |
Definition at line 514 of file listview.c.
References _listview_draw(), _listview::callback, config, _listview::cycle, Settings::cycle, DEFAULT_SPACING, _widget::draw, _listview::dynamic, _listview::eh, _listview::element_height, _widget::find_mouse_target, _listview::fixed_num_lines, Settings::fixed_num_lines, _widget::free, _widget::get_desired_height, LISTVIEW, listview_find_mouse_target(), listview_free(), listview_get_desired_height(), _listview::listview_name, listview_resize(), listview_set_show_scrollbar(), listview_trigger_action(), Settings::menu_columns, _listview::menu_columns, NORMAL, _widget::resize, _listview::reverse, ROFI_ORIENTATION_VERTICAL, rofi_theme_get_boolean(), rofi_theme_get_distance(), rofi_theme_get_integer(), rofi_theme_get_orientation(), _listview::scrollbar, scrollbar_create(), _listview::spacing, textbox_create(), textbox_get_estimated_height(), _widget::trigger_action, _listview::type, _listview::udata, _listview::widget, WIDGET, widget_free(), widget_init(), WIDGET_TYPE_LISTVIEW, and WIDGET_TYPE_LISTVIEW_ELEMENT.
Referenced by rofi_view_add_widget().
gboolean listview_get_fixed_num_lines | ( | listview * | lv | ) |
lv | Handler to the listview object. |
Get the fixed-height property.
Definition at line 812 of file listview.c.
References _listview::fixed_num_lines.
Referenced by rofi_view_calculate_window_position().
unsigned int listview_get_num_lines | ( | listview * | lv | ) |
lv | Handler to the listview object. |
Get the maximum number of lines to display.
Definition at line 798 of file listview.c.
References _listview::menu_lines.
unsigned int listview_get_selected | ( | listview * | lv | ) |
lv | The listview handle |
Returns the selected row.
Definition at line 393 of file listview.c.
References _listview::selected.
Referenced by rofi_view_get_next_position(), rofi_view_listview_mouse_activated_cb(), rofi_view_nav_row_select(), rofi_view_nav_row_tab(), rofi_view_refilter(), and rofi_view_trigger_global_action().
void listview_nav_down | ( | listview * | lv | ) |
lv | listview handle. |
Move the selection one row down.
Definition at line 599 of file listview.c.
References listview_nav_down_int(), listview_nav_up_int(), and _listview::reverse.
Referenced by listview_trigger_action(), rofi_view_nav_row_tab(), and rofi_view_trigger_global_action().
void listview_nav_left | ( | listview * | lv | ) |
lv | The listview handle |
Move the selection one column to the left.
Definition at line 612 of file listview.c.
References BARVIEW, listview_nav_up_int(), _listview::max_rows, _listview::selected, _listview::type, WIDGET, and widget_queue_redraw().
Referenced by listview_trigger_action(), and rofi_view_trigger_global_action().
void listview_nav_page_next | ( | listview * | lv | ) |
lv | The listview handle |
Move the selection one page down.
Definition at line 714 of file listview.c.
References listview_nav_page_next_int(), listview_nav_page_prev_int(), and _listview::reverse.
Referenced by rofi_view_trigger_global_action().
void listview_nav_page_prev | ( | listview * | lv | ) |
lv | The listview handle |
Move the selection one page up.
Definition at line 702 of file listview.c.
References listview_nav_page_next_int(), listview_nav_page_prev_int(), and _listview::reverse.
Referenced by rofi_view_trigger_global_action().
void listview_nav_right | ( | listview * | lv | ) |
lv | The listview handle |
Move the selection one column to the right.
Definition at line 626 of file listview.c.
References BARVIEW, listview_nav_down_int(), _listview::max_rows, _listview::req_elements, _listview::selected, _listview::type, WIDGET, and widget_queue_redraw().
Referenced by listview_trigger_action(), and rofi_view_trigger_global_action().
void listview_nav_up | ( | listview * | lv | ) |
lv | The listview handle |
Move the selection one row up.
Definition at line 587 of file listview.c.
References listview_nav_down_int(), listview_nav_up_int(), and _listview::reverse.
Referenced by listview_trigger_action(), and rofi_view_trigger_global_action().
void listview_set_cycle | ( | listview * | lv, |
gboolean | cycle | ||
) |
lv | Handler to the listview object |
cycle | True for cycle mode |
Set cycle mode. On last entry go to first.
void listview_set_fixed_num_lines | ( | listview * | lv | ) |
lv | Handler to the listview object. |
Set fixed num lines mode.
Definition at line 819 of file listview.c.
References _listview::fixed_num_lines.
Referenced by rofi_view_create(), and rofi_view_error_dialog().
void listview_set_max_lines | ( | listview * | lv, |
unsigned int | max_lines | ||
) |
lv | Handler to the listview object. |
max_lines | the maximum number of lines to display. |
Set the maximum number of lines to display.
Definition at line 805 of file listview.c.
References _listview::max_displayed_lines.
Referenced by _rofi_view_reload_row(), and rofi_view_add_widget().
void listview_set_mouse_activated_cb | ( | listview * | lv, |
listview_mouse_activated_cb | cb, | ||
void * | udata | ||
) |
lv | Handler to the listview object |
cb | The callback |
udata | User data |
Set the mouse activated callback.
Definition at line 778 of file listview.c.
References _listview::mouse_activated, and _listview::mouse_activated_data.
Referenced by rofi_view_add_widget().
void listview_set_multi_select | ( | listview * | lv, |
gboolean | enable | ||
) |
lv | Handler to the listview object |
enable | boolean to enable/disable multi-select |
Enable,disable multi-select.
Definition at line 785 of file listview.c.
References _listview::multi_select.
Referenced by rofi_view_add_widget().
void listview_set_num_elements | ( | listview * | lv, |
unsigned int | rows | ||
) |
lv | The listview handle |
rows | Number of elements |
Set the maximum number of elements to display.
Definition at line 382 of file listview.c.
References listview_recompute_elements(), listview_set_selected(), _listview::req_elements, _listview::selected, WIDGET, and widget_queue_redraw().
Referenced by rofi_view_refilter().
void listview_set_num_lines | ( | listview * | lv, |
unsigned int | num_lines | ||
) |
lv | Handler to the listview object. |
num_lines | the maximum number of lines to display. |
Set the maximum number of lines to display.
Definition at line 791 of file listview.c.
References _listview::menu_lines.
Referenced by rofi_view_add_widget().
void listview_set_scroll_type | ( | listview * | lv, |
ScrollType | type | ||
) |
lv | Handler to the listview object |
type | ScrollType |
Set the scroll type ScrollType::LISTVIEW_SCROLL_CONTINIOUS or ScrollType::LISTVIEW_SCROLL_PER_PAGE
Definition at line 771 of file listview.c.
References _listview::scroll_type.
Referenced by rofi_view_add_widget().
void listview_set_scrollbar_width | ( | listview * | lv, |
unsigned int | width | ||
) |
lv | Handler to the listview object |
width | Width in pixels |
Set the width of the scrollbar
void listview_set_selected | ( | listview * | lv, |
unsigned int | selected | ||
) |
lv | The listview handle |
selected | The row index to select |
Select the row, if selected > the number of rows, it selects the last one.
Definition at line 401 of file listview.c.
References _listview::barview, _listview::direction, LEFT_TO_RIGHT, _listview::req_elements, _listview::selected, WIDGET, and widget_queue_redraw().
Referenced by listview_element_trigger_action(), listview_set_num_elements(), rofi_view_nav_first(), rofi_view_nav_last(), rofi_view_set_selected_line(), and scrollbar_scroll().
void listview_set_show_scrollbar | ( | listview * | lv, |
gboolean | enabled | ||
) |
lv | Handler to the listview object |
enabled | enable |
Hide the scrollbar.
Definition at line 758 of file listview.c.
References listview_recompute_elements(), _listview::scrollbar, WIDGET, widget_disable(), and widget_enable().
Referenced by listview_create().