1
2 /** \file lib/widget/history.h
3 * \brief Header: show history
4 */
5
6 #ifndef MC__WIDGET_HISTORY_H
7 #define MC__WIDGET_HISTORY_H
8
9 /*** typedefs(not structures) and defined constants **********************************************/
10
11 /* forward declarations */
12 struct history_descriptor_t;
13 struct WLEntry;
14 struct WListbox;
15
16 typedef void (*history_create_item_func) (struct history_descriptor_t *hd, void *data);
17 typedef void *(*history_release_item_func) (struct history_descriptor_t *hd, struct WLEntry *le);
18
19 /*** enums ***************************************************************************************/
20
21 /*** structures declarations (and typedefs of structures)*****************************************/
22
23 typedef struct history_descriptor_t
24 {
25 GList *list; // list with history items
26 int y; // y-coordinate to place history window
27 int x; // x-coordinate to place history window
28 int current; // initially selected item in the history
29 int action; // return action in the history
30 char *text; // return text of selected item
31
32 size_t max_width; // maximum width of string in history
33 struct WListbox *listbox; // listbox widget to draw history
34
35 history_create_item_func create; // function to create item of @list
36 history_release_item_func release; // function to release item of @list
37 GDestroyNotify free; // function to destroy element of @list
38 } history_descriptor_t;
39
40 /*** global variables defined in .c file *********************************************************/
41
42 /*** declarations of public functions ************************************************************/
43
44 void history_descriptor_init (history_descriptor_t *hd, int y, int x, GList *history, int current);
45
46 void history_show (history_descriptor_t *hd);
47
48 /*** inline functions ****************************************************************************/
49
50 #endif