rofi
1.7.0
|
Typedefs | |
typedef struct _listview | listview |
typedef void(* | listview_update_callback) (textbox *tb, icon *ico, 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 1 of file listview.h.
typedef void(* listview_mouse_activated_cb) (listview *, gboolean, void *) |
Callback when a element is activated.
Definition at line 73 of file listview.h.
typedef void(* listview_update_callback) (textbox *tb, icon *ico, 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 66 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 49 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 660 of file listview.c.
References _listview_draw(), _listview_row::box, _listview::callback, config, Settings::cycle, _listview::cycle, DEFAULT_MENU_COLUMNS, DEFAULT_SPACING, _widget::draw, _listview::dynamic, _listview::eh, _listview::element_height, _listview::emode, _widget::find_mouse_target, _listview::fixed_columns, Settings::fixed_num_lines, _listview::fixed_num_lines, _widget::free, _widget::get_desired_height, LISTVIEW, listview_create_row(), listview_find_mouse_target(), listview_free(), listview_get_desired_height(), _listview::listview_name, listview_resize(), listview_set_show_scrollbar(), listview_trigger_action(), _listview::menu_columns, _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, _listview_row::textbox, textbox_text(), _widget::trigger_action, _listview::type, _listview::udata, WIDGET, _listview::widget, widget_free(), widget_get_desired_height(), widget_init(), and WIDGET_TYPE_LISTVIEW.
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 957 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 945 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 530 of file listview.c.
References _listview::selected.
Referenced by listview_element_motion_notify(), rofi_view_get_next_position(), rofi_view_listview_mouse_activated_cb(), rofi_view_nav_row_select(), rofi_view_nav_row_tab(), rofi_view_refilter(), rofi_view_trigger_global_action(), and textbox_button_trigger_action().
void listview_nav_down | ( | listview * | lv | ) |
lv | listview handle. |
Move the selection one row down.
Definition at line 762 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 773 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 869 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 859 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 786 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 752 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_ellipsize_start | ( | listview * | lv | ) |
lv | Handler to the listview object. |
Set ellipsize mode to start.
Definition at line 969 of file listview.c.
References _listview::boxes, _listview::cur_elements, _listview::emode, _listview_row::textbox, and textbox_set_ellipsize().
Referenced by rofi_view_ellipsize_start().
void listview_set_fixed_num_lines | ( | listview * | lv | ) |
lv | Handler to the listview object. |
Set fixed num lines mode.
Definition at line 963 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 951 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 926 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 934 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 516 of file listview.c.
References listview_recompute_elements(), listview_set_selected(), _listview::req_elements, _listview::selected, TICK_N, 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 939 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 920 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 537 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_motion_notify(), 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 909 of file listview.c.
References listview_recompute_elements(), _listview::scrollbar, WIDGET, widget_disable(), and widget_enable().
Referenced by listview_create().
void listview_toggle_ellipsizing | ( | listview * | lv | ) |
lv | Handler to the listview object. |
Set ellipsize mode.
Definition at line 978 of file listview.c.
References _listview::boxes, _listview::cur_elements, _listview::emode, _listview_row::textbox, and textbox_set_ellipsize().
Referenced by rofi_view_trigger_global_action().