2 /** \file lib/widget/history.h
3 * \brief Header: show history
6 #ifndef MC__WIDGET_HISTORY_H
7 #define MC__WIDGET_HISTORY_H
9 /*** typedefs(not structures) and defined constants **********************************************/
11 /* forward declarations */
12 struct history_descriptor_t
;
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
);
19 /*** enums ***************************************************************************************/
21 /*** structures declarations (and typedefs of structures)*****************************************/
23 typedef struct history_descriptor_t
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 */
32 size_t max_width
; /**< maximum width of string in history */
33 struct WListbox
*listbox
; /**< listbox widget to draw history */
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
;
40 /*** global variables defined in .c file *********************************************************/
42 /*** declarations of public functions ************************************************************/
44 void history_descriptor_init (history_descriptor_t
* hd
, int y
, int x
, GList
* history
,
47 void history_show (history_descriptor_t
* hd
);
49 /*** inline functions ****************************************************************************/
51 #endif /* MC__WIDGET_HISTORY_H */