rofi 1.7.5
listview
Collaboration diagram for listview:

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_selection_changed_callback) (listview *lv, unsigned int index, void *udata)
 
typedef void(* listview_mouse_activated_cb) (listview *, gboolean, void *)
 

Enumerations

enum  ScrollType { LISTVIEW_SCROLL_PER_PAGE , LISTVIEW_SCROLL_CONTINIOUS }
 

Functions

listviewlistview_create (widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
 
void listview_set_selection_changed_callback (listview *lv, listview_selection_changed_callback cb, void *udata)
 
void listview_set_num_elements (listview *lv, unsigned int rows)
 
void listview_set_selected (listview *lv, unsigned int selected)
 
unsigned int listview_get_selected (listview *lv)
 
void listview_nav_next (listview *lv)
 
void listview_nav_prev (listview *lv)
 
void listview_nav_up (listview *lv)
 
void listview_nav_down (listview *lv)
 
void listview_nav_right (listview *lv)
 
void listview_nav_left (listview *lv)
 
void listview_nav_page_next (listview *lv)
 
void listview_nav_page_prev (listview *lv)
 
void listview_set_show_scrollbar (listview *lv, gboolean enabled)
 
void listview_set_scrollbar_width (listview *lv, unsigned int width)
 
void listview_set_cycle (listview *lv, gboolean cycle)
 
void listview_set_scroll_type (listview *lv, ScrollType type)
 
void listview_set_mouse_activated_cb (listview *lv, listview_mouse_activated_cb cb, void *udata)
 
void listview_set_num_lines (listview *lv, unsigned int num_lines)
 
gboolean listview_get_fixed_num_lines (listview *lv)
 
void listview_set_fixed_num_lines (listview *lv)
 
void listview_set_max_lines (listview *lv, unsigned int max_lines)
 
void listview_toggle_ellipsizing (listview *lv)
 
void listview_set_ellipsize_start (listview *lv)
 
void listview_set_filtered (listview *lv, gboolean filtered)
 

Detailed Description

Typedef Documentation

◆ listview

typedef struct _listview listview

Handle to the listview. No internal fields should be accessed directly.

Definition at line 44 of file listview.h.

◆ listview_mouse_activated_cb

typedef void(* listview_mouse_activated_cb) (listview *, gboolean, void *)

Callback when a element is activated.

Definition at line 84 of file listview.h.

◆ listview_selection_changed_callback

typedef void(* listview_selection_changed_callback) (listview *lv, unsigned int index, void *udata)
Parameters
lvThe listview
indexthe selected row
udatauser data

Selection changed callback.

Definition at line 78 of file listview.h.

◆ listview_update_callback

typedef void(* listview_update_callback) (textbox *tb, icon *ico, unsigned int entry, void *udata, TextBoxFontType *type, gboolean full)
Parameters
tbThe textbox to set
icoThe icon to set
entryThe position of the textbox
udataUser data
typeThe textbox font style to apply to this entry (normal, selected, alternative row)
fullIf true Set both text and style.

Update callback, this is called to set the value of each (visible) element.

Definition at line 67 of file listview.h.

Enumeration Type Documentation

◆ ScrollType

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.

Function Documentation

◆ listview_create()

listview * listview_create ( widget * parent,
const char * name,
listview_update_callback cb,
void * udata,
unsigned int eh,
gboolean reverse )
Parameters
parentThe widget's parent.
nameThe name of the to be created widget.
cbThe update callback.
udataThe user data to pass to the callback
ehThe height of one element
reverseReverse the listview order.
Returns
a new listview

Definition at line 711 of file listview.c.

References _listview_draw(), _listview_row::box, _listview::callback, config, _listview::cycle, Settings::cycle, DEFAULT_MENU_COLUMNS, DEFAULT_SPACING, _widget::draw, _listview::dynamic, _listview::eh, _listview::element_height, _listview::emode, _widget::find_mouse_target, _listview::fixed_columns, _listview::fixed_num_lines, Settings::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, _listview::pack_direction, _listview::require_input, _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_moveresize(), 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_get_fixed_num_lines()

gboolean listview_get_fixed_num_lines ( listview * lv)
Parameters
lvHandler to the listview object.

Get the fixed-height property.

Returns
get fixed-height.

Definition at line 1067 of file listview.c.

References _listview::fixed_num_lines.

◆ listview_get_selected()

unsigned int listview_get_selected ( listview * lv)
Parameters
lvThe listview handle

Returns the selected row.

Returns
the selected row.

Definition at line 578 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_real(), rofi_view_trigger_global_action(), and textbox_button_trigger_action().

Here is the caller graph for this function:

◆ listview_nav_down()

void listview_nav_down ( listview * lv)
Parameters
lvlistview handle.

Move the selection one row down.

  • Wrap around.

Definition at line 857 of file listview.c.

References listview_nav_column_left_int(), listview_nav_column_right_int(), listview_nav_down_int(), listview_nav_up_int(), _listview::pack_direction, _listview::reverse, and ROFI_ORIENTATION_HORIZONTAL.

Referenced by listview_trigger_action(), rofi_view_nav_row_tab(), and rofi_view_trigger_global_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_left()

void listview_nav_left ( listview * lv)
Parameters
lvThe listview handle

Move the selection one column to the left.

  • No wrap around.

Definition at line 876 of file listview.c.

References BARVIEW, listview_nav_up_int(), _listview::max_rows, _listview::pack_direction, ROFI_ORIENTATION_HORIZONTAL, _listview::sc_callback, _listview::sc_udata, _listview::selected, _listview::type, WIDGET, and widget_queue_redraw().

Referenced by listview_trigger_action(), and rofi_view_trigger_global_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_next()

void listview_nav_next ( listview * lv)
Parameters
lvThe listview handle

Move the selection next element.

  • Wrap around.

Definition at line 811 of file listview.c.

References listview_nav_down_int().

Referenced by rofi_view_trigger_global_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_page_next()

void listview_nav_page_next ( listview * lv)
Parameters
lvThe listview handle

Move the selection one page down.

  • No wrap around.
  • Clip at top/bottom

Definition at line 989 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_page_prev()

void listview_nav_page_prev ( listview * lv)
Parameters
lvThe listview handle

Move the selection one page up.

  • No wrap around.
  • Clip at top/bottom

Definition at line 979 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_prev()

void listview_nav_prev ( listview * lv)
Parameters
lvThe listview handle

Move the selection previous element.

  • Wrap around.

Definition at line 817 of file listview.c.

References listview_nav_up_int().

Referenced by rofi_view_trigger_global_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_right()

void listview_nav_right ( listview * lv)
Parameters
lvThe listview handle

Move the selection one column to the right.

  • No wrap around.
  • Do not move to top row when at start.

Definition at line 897 of file listview.c.

References BARVIEW, listview_nav_down_int(), _listview::max_rows, _listview::pack_direction, _listview::req_elements, ROFI_ORIENTATION_HORIZONTAL, _listview::sc_callback, _listview::sc_udata, _listview::selected, _listview::type, WIDGET, and widget_queue_redraw().

Referenced by listview_trigger_action(), and rofi_view_trigger_global_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_nav_up()

void listview_nav_up ( listview * lv)
Parameters
lvThe listview handle

Move the selection one row up.

  • Wrap around.

Definition at line 839 of file listview.c.

References listview_nav_column_left_int(), listview_nav_column_right_int(), listview_nav_down_int(), listview_nav_up_int(), _listview::pack_direction, _listview::reverse, and ROFI_ORIENTATION_HORIZONTAL.

Referenced by listview_trigger_action(), and rofi_view_trigger_global_action().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_set_cycle()

void listview_set_cycle ( listview * lv,
gboolean cycle )
Parameters
lvHandler to the listview object
cycleTrue for cycle mode

Set cycle mode. On last entry go to first.

◆ listview_set_ellipsize_start()

void listview_set_ellipsize_start ( listview * lv)
Parameters
lvHandler to the listview object.

Set ellipsize mode to start.

Definition at line 1079 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_set_filtered()

void listview_set_filtered ( listview * lv,
gboolean filtered )
Parameters
lvHandler to the listview object.
filteredboolean indicating if list is filtered.

Definition at line 1105 of file listview.c.

References _listview::filtered.

Referenced by rofi_view_refilter_real().

Here is the caller graph for this function:

◆ listview_set_fixed_num_lines()

void listview_set_fixed_num_lines ( listview * lv)
Parameters
lvHandler to the listview object.

Set fixed num lines mode.

Definition at line 1073 of file listview.c.

References _listview::fixed_num_lines.

Referenced by rofi_view_create(), and rofi_view_error_dialog().

Here is the caller graph for this function:

◆ listview_set_max_lines()

void listview_set_max_lines ( listview * lv,
unsigned int max_lines )
Parameters
lvHandler to the listview object.
max_linesthe maximum number of lines to display.

Set the maximum number of lines to display.

Definition at line 1061 of file listview.c.

References _listview::max_displayed_lines.

Referenced by _rofi_view_reload_row(), and rofi_view_add_widget().

Here is the caller graph for this function:

◆ listview_set_mouse_activated_cb()

void listview_set_mouse_activated_cb ( listview * lv,
listview_mouse_activated_cb cb,
void * udata )
Parameters
lvHandler to the listview object
cbThe callback
udataUser data

Set the mouse activated callback.

Definition at line 1047 of file listview.c.

References _listview::mouse_activated, and _listview::mouse_activated_data.

Referenced by rofi_view_add_widget().

Here is the caller graph for this function:

◆ listview_set_num_elements()

void listview_set_num_elements ( listview * lv,
unsigned int rows )
Parameters
lvThe listview handle
rowsNumber of elements

Set the maximum number of elements to display.

Definition at line 561 of file listview.c.

References _listview::filtered, listview_recompute_elements(), listview_set_selected(), _listview::req_elements, _listview::require_input, _listview::selected, TICK_N, WIDGET, and widget_queue_redraw().

Referenced by rofi_view_refilter_real().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_set_num_lines()

void listview_set_num_lines ( listview * lv,
unsigned int num_lines )
Parameters
lvHandler to the listview object.
num_linesthe maximum number of lines to display.

Set the maximum number of lines to display.

Definition at line 1055 of file listview.c.

References _listview::menu_lines.

Referenced by rofi_view_add_widget().

Here is the caller graph for this function:

◆ listview_set_scroll_type()

void listview_set_scroll_type ( listview * lv,
ScrollType type )
Parameters
lvHandler to the listview object
typeScrollType

Set the scroll type ScrollType::LISTVIEW_SCROLL_CONTINIOUS or ScrollType::LISTVIEW_SCROLL_PER_PAGE

Definition at line 1041 of file listview.c.

References _listview::scroll_type.

Referenced by rofi_view_add_widget().

Here is the caller graph for this function:

◆ listview_set_scrollbar_width()

void listview_set_scrollbar_width ( listview * lv,
unsigned int width )
Parameters
lvHandler to the listview object
widthWidth in pixels

Set the width of the scrollbar

◆ listview_set_selected()

void listview_set_selected ( listview * lv,
unsigned int selected )
Parameters
lvThe listview handle
selectedThe row index to select

Select the row, if selected > the number of rows, it selects the last one.

Definition at line 585 of file listview.c.

References _listview::barview, _listview::direction, LEFT_TO_RIGHT, _listview::req_elements, _listview::sc_callback, _listview::sc_udata, _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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_set_selection_changed_callback()

void listview_set_selection_changed_callback ( listview * lv,
listview_selection_changed_callback cb,
void * udata )

Set the selection changed callback.

Definition at line 1111 of file listview.c.

References _listview::sc_callback, and _listview::sc_udata.

Referenced by rofi_view_add_widget().

Here is the caller graph for this function:

◆ listview_set_show_scrollbar()

void listview_set_show_scrollbar ( listview * lv,
gboolean enabled )
Parameters
lvHandler to the listview object
enabledenable

Hide the scrollbar.

Definition at line 1030 of file listview.c.

References listview_recompute_elements(), _listview::scrollbar, WIDGET, widget_disable(), and widget_enable().

Referenced by listview_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listview_toggle_ellipsizing()

void listview_toggle_ellipsizing ( listview * lv)
Parameters
lvHandler to the listview object.

Set ellipsize mode.

Definition at line 1088 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().

Here is the call graph for this function:
Here is the caller graph for this function: