rofi  1.7.3
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 
225 
232 
239 void listview_set_max_lines(listview *lv, unsigned int max_lines);
240 
247 
257 #endif // ROFI_LISTVIEW_H
listview_toggle_ellipsizing
void listview_toggle_ellipsizing(listview *lv)
Definition: listview.c:981
_listview::type
RofiOrientation type
Definition: listview.c:69
listview_nav_up
void listview_nav_up(listview *lv)
Definition: listview.c:760
LISTVIEW_SCROLL_CONTINIOUS
@ LISTVIEW_SCROLL_CONTINIOUS
Definition: listview.h:53
listview_nav_page_prev
void listview_nav_page_prev(listview *lv)
Definition: listview.c:867
listview_set_num_elements
void listview_set_num_elements(listview *lv, unsigned int rows)
Definition: listview.c:523
listview_create
listview * listview_create(widget *parent, const char *name, listview_update_callback cb, void *udata, unsigned int eh, gboolean reverse)
Definition: listview.c:667
listview_set_scroll_type
void listview_set_scroll_type(listview *lv, ScrollType type)
Definition: listview.c:929
_listview::eh
unsigned int eh
Definition: listview.c:96
_icon
Definition: icon.c:39
_listview::selected
unsigned int selected
Definition: listview.c:78
listview_mouse_activated_cb
void(* listview_mouse_activated_cb)(listview *, gboolean, void *)
Definition: listview.h:73
listview_set_show_scrollbar
void listview_set_show_scrollbar(listview *lv, gboolean enabled)
Definition: listview.c:918
listview_set_mouse_activated_cb
void listview_set_mouse_activated_cb(listview *lv, listview_mouse_activated_cb cb, void *udata)
Definition: listview.c:935
ScrollType
ScrollType
Definition: listview.h:49
listview_nav_right
void listview_nav_right(listview *lv)
Definition: listview.c:794
listview_set_num_lines
void listview_set_num_lines(listview *lv, unsigned int num_lines)
Definition: listview.c:948
_listview::reverse
unsigned int reverse
Definition: listview.c:97
listview_set_ellipsize_start
void listview_set_ellipsize_start(listview *lv)
Definition: listview.c:972
listview_get_selected
unsigned int listview_get_selected(listview *lv)
Definition: listview.c:537
listview_update_callback
void(* listview_update_callback)(textbox *tb, icon *ico, unsigned int entry, void *udata, TextBoxFontType *type, gboolean full)
Definition: listview.h:66
_listview::udata
void * udata
Definition: listview.c:107
_listview
Definition: listview.c:66
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:943
listview_nav_page_next
void listview_nav_page_next(listview *lv)
Definition: listview.c:877
listview_set_fixed_num_lines
void listview_set_fixed_num_lines(listview *lv)
Definition: listview.c:966
LISTVIEW_SCROLL_PER_PAGE
@ LISTVIEW_SCROLL_PER_PAGE
Definition: listview.h:51
TextBoxFontType
TextBoxFontType
Definition: textbox.h:101
listview_set_max_lines
void listview_set_max_lines(listview *lv, unsigned int max_lines)
Definition: listview.c:954
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:960
listview_nav_left
void listview_nav_left(listview *lv)
Definition: listview.c:781
textbox
Definition: textbox.h:61
textbox.h
listview_set_selected
void listview_set_selected(listview *lv, unsigned int selected)
Definition: listview.c:544
_listview::cycle
gboolean cycle
Definition: listview.c:98
listview_nav_down
void listview_nav_down(listview *lv)
Definition: listview.c:770
_widget
Definition: widget-internal.h:57