rofi  1.5.1
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 
42 typedef struct _listview listview;
43 
47 typedef enum
48 {
53 } ScrollType;
54 
64 typedef void ( *listview_update_callback )( textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full );
65 
69 typedef void ( *listview_mouse_activated_cb )( listview *, gboolean, void * );
70 
81 listview *listview_create ( widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse );
82 
89 void listview_set_num_elements ( listview *lv, unsigned int rows );
90 
97 void listview_set_selected ( listview *lv, unsigned int selected );
98 
106 unsigned int listview_get_selected ( listview *lv );
107 
114 void listview_nav_up ( listview *lv );
121 void listview_nav_down ( listview *lv );
129 void listview_nav_right ( listview *lv );
136 void listview_nav_left ( listview *lv );
144 void listview_nav_page_next ( listview *lv );
145 
153 void listview_nav_page_prev ( listview *lv );
154 
161 void listview_set_show_scrollbar ( listview *lv, gboolean enabled );
168 void listview_set_scrollbar_width ( listview *lv, unsigned int width );
169 
176 void listview_set_cycle ( listview *lv, gboolean cycle );
184 
199 void listview_set_multi_select ( listview *lv, gboolean enable );
206 void listview_set_num_lines ( listview *lv, unsigned int num_lines );
207 
215 unsigned int listview_get_num_lines ( listview *lv );
216 
224 gboolean listview_get_fixed_num_lines ( listview *lv );
225 
232 
239 void listview_set_max_lines ( listview *lv, unsigned int max_lines );
240 
241 /* @} */
242 
243 #endif // ROFI_LISTVIEW_H
gboolean cycle
Definition: listview.c:85
void listview_set_selected(listview *lv, unsigned int selected)
Definition: listview.c:401
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
Definition: listview.c:514
unsigned int selected
Definition: listview.c:65
void listview_nav_up(listview *lv)
Definition: listview.c:587
void listview_nav_page_prev(listview *lv)
Definition: listview.c:702
void(* listview_update_callback)(textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full)
Definition: listview.h:64
unsigned int listview_get_num_lines(listview *lv)
Definition: listview.c:798
void listview_set_num_elements(listview *lv, unsigned int rows)
Definition: listview.c:382
void listview_set_scroll_type(listview *lv, ScrollType type)
Definition: listview.c:771
ScrollType
Definition: listview.h:47
unsigned int eh
Definition: listview.c:83
void listview_nav_right(listview *lv)
Definition: listview.c:626
ViewType type
Definition: listview.c:56
void listview_set_show_scrollbar(listview *lv, gboolean enabled)
Definition: listview.c:758
void listview_set_mouse_activated_cb(listview *lv, listview_mouse_activated_cb cb, void *udata)
Definition: listview.c:778
void listview_set_num_lines(listview *lv, unsigned int num_lines)
Definition: listview.c:791
void * udata
Definition: listview.c:94
unsigned int listview_get_selected(listview *lv)
Definition: listview.c:393
void(* listview_mouse_activated_cb)(listview *, gboolean, void *)
Definition: listview.h:69
TextBoxFontType
Definition: textbox.h:93
unsigned int reverse
Definition: listview.c:84
void listview_set_multi_select(listview *lv, gboolean enable)
Definition: listview.c:785
void listview_set_scrollbar_width(listview *lv, unsigned int width)
void listview_set_fixed_num_lines(listview *lv)
Definition: listview.c:819
void listview_nav_page_next(listview *lv)
Definition: listview.c:714
void listview_set_cycle(listview *lv, gboolean cycle)
void listview_set_max_lines(listview *lv, unsigned int max_lines)
Definition: listview.c:805
gboolean listview_get_fixed_num_lines(listview *lv)
Definition: listview.c:812
void listview_nav_left(listview *lv)
Definition: listview.c:612
void listview_nav_down(listview *lv)
Definition: listview.c:599