rofi  1.7.0
listview.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2017 Qball Cow <qball@gmpclient.org>
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining
8  * a copy of this software and associated documentation files (the
9  * "Software"), to deal in the Software without restriction, including
10  * without limitation the rights to use, copy, modify, merge, publish,
11  * distribute, sublicense, and/or sell copies of the Software, and to
12  * permit persons to whom the Software is furnished to do so, subject to
13  * the following conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  */
27 
28 #ifndef ROFI_LISTVIEW_H
29 #define ROFI_LISTVIEW_H
30 
31 #include "widgets/textbox.h"
32 
44 typedef struct _listview listview;
45 
49 typedef enum {
55 
66 typedef void (*listview_update_callback)(textbox *tb, icon *ico,
67  unsigned int entry, void *udata,
68  TextBoxFontType *type, gboolean full);
69 
73 typedef void (*listview_mouse_activated_cb)(listview *, gboolean, void *);
74 
85 listview *listview_create(widget *parent, const char *name,
87  unsigned int eh, gboolean reverse);
88 
95 void listview_set_num_elements(listview *lv, unsigned int rows);
96 
103 void listview_set_selected(listview *lv, unsigned int selected);
104 
112 unsigned int listview_get_selected(listview *lv);
113 
120 void listview_nav_up(listview *lv);
127 void listview_nav_down(listview *lv);
135 void listview_nav_right(listview *lv);
142 void listview_nav_left(listview *lv);
151 
160 
167 void listview_set_show_scrollbar(listview *lv, gboolean enabled);
174 void listview_set_scrollbar_width(listview *lv, unsigned int width);
175 
182 void listview_set_cycle(listview *lv, gboolean cycle);
191 
201  void *udata);
208 void listview_set_multi_select(listview *lv, gboolean enable);
215 void listview_set_num_lines(listview *lv, unsigned int num_lines);
216 
224 unsigned int listview_get_num_lines(listview *lv);
225 
234 
241 
248 void listview_set_max_lines(listview *lv, unsigned int max_lines);
249 
256 
266 #endif // ROFI_LISTVIEW_H
TextBoxFontType
Definition: textbox.h:101
void listview_nav_page_next(listview *lv)
Definition: listview.c:869
void listview_set_fixed_num_lines(listview *lv)
Definition: listview.c:963
void listview_set_cycle(listview *lv, gboolean cycle)
void listview_set_num_lines(listview *lv, unsigned int num_lines)
Definition: listview.c:939
void listview_set_show_scrollbar(listview *lv, gboolean enabled)
Definition: listview.c:909
void listview_set_num_elements(listview *lv, unsigned int rows)
Definition: listview.c:516
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
Definition: listview.c:660
void listview_nav_right(listview *lv)
Definition: listview.c:786
void listview_set_mouse_activated_cb(listview *lv, listview_mouse_activated_cb cb, void *udata)
Definition: listview.c:926
void listview_toggle_ellipsizing(listview *lv)
Definition: listview.c:978
void listview_set_selected(listview *lv, unsigned int selected)
Definition: listview.c:537
void listview_set_max_lines(listview *lv, unsigned int max_lines)
Definition: listview.c:951
void listview_nav_left(listview *lv)
Definition: listview.c:773
void listview_set_scroll_type(listview *lv, ScrollType type)
Definition: listview.c:920
unsigned int listview_get_num_lines(listview *lv)
Definition: listview.c:945
gboolean listview_get_fixed_num_lines(listview *lv)
Definition: listview.c:957
void listview_set_ellipsize_start(listview *lv)
Definition: listview.c:969
unsigned int listview_get_selected(listview *lv)
Definition: listview.c:530
ScrollType
Definition: listview.h:49
void listview_set_scrollbar_width(listview *lv, unsigned int width)
void listview_set_multi_select(listview *lv, gboolean enable)
Definition: listview.c:934
void(* listview_mouse_activated_cb)(listview *, gboolean, void *)
Definition: listview.h:73
void(* listview_update_callback)(textbox *tb, icon *ico, unsigned int entry, void *udata, TextBoxFontType *type, gboolean full)
Definition: listview.h:66
void listview_nav_up(listview *lv)
Definition: listview.c:752
void listview_nav_page_prev(listview *lv)
Definition: listview.c:859
void listview_nav_down(listview *lv)
Definition: listview.c:762
@ LISTVIEW_SCROLL_PER_PAGE
Definition: listview.h:51
@ LISTVIEW_SCROLL_CONTINIOUS
Definition: listview.h:53
Definition: icon.c:39
gboolean cycle
Definition: listview.c:98
void * udata
Definition: listview.c:107
unsigned int reverse
Definition: listview.c:97
RofiOrientation type
Definition: listview.c:69
unsigned int selected
Definition: listview.c:78
unsigned int eh
Definition: listview.c:96