rofi  1.5.4
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 {
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 
247 /* @} */
248 
249 #endif // ROFI_LISTVIEW_H
listview_toggle_ellipsizing
void listview_toggle_ellipsizing(listview *lv)
Definition: listview.c:837
listview_nav_up
void listview_nav_up(listview *lv)
Definition: listview.c:598
LISTVIEW_SCROLL_CONTINIOUS
@ LISTVIEW_SCROLL_CONTINIOUS
Definition: listview.h:52
listview_nav_page_prev
void listview_nav_page_prev(listview *lv)
Definition: listview.c:713
listview_update_callback
void(* listview_update_callback)(textbox *tb, unsigned int entry, void *udata, TextBoxFontType type, gboolean full)
Definition: listview.h:64
listview_set_num_elements
void listview_set_num_elements(listview *lv, unsigned int rows)
Definition: listview.c:392
listview_create
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
Definition: listview.c:524
listview_set_scroll_type
void listview_set_scroll_type(listview *lv, ScrollType type)
Definition: listview.c:782
listview_get_num_lines
unsigned int listview_get_num_lines(listview *lv)
Definition: listview.c:809
_listview::eh
unsigned int eh
Definition: listview.c:91
_listview::selected
unsigned int selected
Definition: listview.c:74
_listview::type
ViewType type
Definition: listview.c:65
listview_set_show_scrollbar
void listview_set_show_scrollbar(listview *lv, gboolean enabled)
Definition: listview.c:769
listview_set_mouse_activated_cb
void listview_set_mouse_activated_cb(listview *lv, listview_mouse_activated_cb cb, void *udata)
Definition: listview.c:789
ScrollType
ScrollType
Definition: listview.h:48
listview_nav_right
void listview_nav_right(listview *lv)
Definition: listview.c:637
listview_set_num_lines
void listview_set_num_lines(listview *lv, unsigned int num_lines)
Definition: listview.c:802
_listview::reverse
unsigned int reverse
Definition: listview.c:92
listview_get_selected
unsigned int listview_get_selected(listview *lv)
Definition: listview.c:403
listview_mouse_activated_cb
void(* listview_mouse_activated_cb)(listview *, gboolean, void *)
Definition: listview.h:69
_listview::udata
void * udata
Definition: listview.c:102
_listview
Definition: listview.c:62
listview_set_scrollbar_width
void listview_set_scrollbar_width(listview *lv, unsigned int width)
listview_set_multi_select
void listview_set_multi_select(listview *lv, gboolean enable)
Definition: listview.c:796
listview_nav_page_next
void listview_nav_page_next(listview *lv)
Definition: listview.c:725
listview_set_fixed_num_lines
void listview_set_fixed_num_lines(listview *lv)
Definition: listview.c:830
LISTVIEW_SCROLL_PER_PAGE
@ LISTVIEW_SCROLL_PER_PAGE
Definition: listview.h:50
TextBoxFontType
TextBoxFontType
Definition: textbox.h:95
listview_set_max_lines
void listview_set_max_lines(listview *lv, unsigned int max_lines)
Definition: listview.c:816
listview_set_cycle
void listview_set_cycle(listview *lv, gboolean cycle)
listview_get_fixed_num_lines
gboolean listview_get_fixed_num_lines(listview *lv)
Definition: listview.c:823
listview_nav_left
void listview_nav_left(listview *lv)
Definition: listview.c:623
textbox
Definition: textbox.h:51
listview_set_selected
void listview_set_selected(listview *lv, unsigned int selected)
Definition: listview.c:411
_listview::cycle
gboolean cycle
Definition: listview.c:93
listview_nav_down
void listview_nav_down(listview *lv)
Definition: listview.c:610
_widget
Definition: widget-internal.h:36