rofi  1.5.1
listview
Collaboration diagram for listview:

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 }
 

Functions

listviewlistview_create (widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
 
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_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_multi_select (listview *lv, gboolean enable)
 
void listview_set_num_lines (listview *lv, unsigned int num_lines)
 
unsigned int listview_get_num_lines (listview *lv)
 
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)
 

Detailed Description

Typedef Documentation

◆ listview

typedef struct _listview listview

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

Definition at line 42 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 69 of file listview.h.

◆ listview_update_callback

typedef void( * listview_update_callback) (textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full)
Parameters
tbThe textbox 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 64 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 47 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 
)

◆ 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 812 of file listview.c.

References _listview::fixed_num_lines.

Referenced by rofi_view_calculate_window_position().

Here is the caller graph for this function:

◆ listview_get_num_lines()

unsigned int listview_get_num_lines ( listview lv)
Parameters
lvHandler to the listview object.

Get the maximum number of lines to display.

Returns
get the numger of lines to display.

Definition at line 798 of file listview.c.

References _listview::menu_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 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().

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 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().

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 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().

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 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().

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 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().

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 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().

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 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().

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_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 819 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 805 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 778 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_multi_select()

void listview_set_multi_select ( listview lv,
gboolean  enable 
)
Parameters
lvHandler to the listview object
enableboolean 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().

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 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().

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 791 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 771 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 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().

Here is the call graph for this function:
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 758 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: