Project

General

Profile

Revision 334

added more docs

View differences:

menu.h
13 13

  
14 14
#include "font.h"
15 15

  
16
/**
17
 * @brief Menu.
18
 */
16 19
typedef struct menu menu_t;
17

  
20
/**
21
 * @brief Construct menu.
22
 * @param   fnt Font to use when rendering menu options text
23
 * @return      Pointer to constructed menu, or NULL if failed.
24
 */
18 25
menu_t* (menu_ctor)(const font_t *fnt);
19

  
26
/**
27
 * @brief Destruct menu.
28
 * @param   p   Pointer to menu to destruct
29
 */
30
void (menu_dtor)(menu_t *p);
31
/**
32
 * @brief Add item to menu.
33
 * @param   menu    Pointer to menu
34
 * @param   s       String to be used as text for the new item
35
 * @return  SUCCESS if operation was successful, other value otherwise
36
 */
20 37
int (menu_add_item)(menu_t *menu, const char *s);
21

  
38
/**
39
 * @brief Update menu state.
40
 *
41
 * This function allows to check if the mouse is hovering over an item, and knowing
42
 * if an item was clicked.
43
 * @param   menu    Pointer to menu
44
 * @param   click   0 if mouse right button is clicked, other value otherwise
45
 * @return  selected option if clicked, -1 otherwise
46
 */
22 47
int (menu_update_state)(menu_t *menu, int click);
23

  
48
/**
49
 * @brief Draw menu on screen buffer.
50
 * @param   menu    Pointer to menu to be drawn
51
 */
24 52
void (menu_draw)(menu_t *menu);
25 53

  
26
void (menu_dtor)(menu_t *p);
27

  
28 54
/**
29 55
 * @}
30 56
 */

Also available in: Unified diff