history.h 1.9 KB

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