aversive_10-03-12/modules/ihm/menu/menu.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <aversive.h>
#include "menu.h"

Go to the source code of this file.

Functions

char * menu_get_name (struct menu *m)
uint8_t menu_get_type (struct menu *m)
uint8_t menu_call_fct (struct menu *m)
struct menumenu_get_previous (struct menu *m)
struct menumenu_get_next (struct menu *m)
struct menumenu_get_parent (struct menu *m)
struct menumenu_get_first_son (struct menu *m)
struct menumenu_get_sub (struct menu *m, uint8_t num)
uint8_t menu_get_sub_howmany (struct menu *m)
struct menumenu_left (struct menu *m)
struct menumenu_right (struct menu *m)
struct menumenu_up (struct menu *m)
struct menumenu_down (struct menu *m)
struct menumenu_default_update (struct menu *m, char c)
void menu_default_display (struct menu *m)


Function Documentation

uint8_t menu_call_fct ( struct menu m  ) 

call the function described by the menu, and return 0 on success

Definition at line 64 of file menu.c.

References parse_symbols::f, MENU_TYPE_FCT_DATA, MENU_TYPE_FCT_HDR, MENU_TYPE_FCT_PTR, and menu::type.

Referenced by menu_right().

void menu_default_display ( struct menu m  ) 

default function to display a menu, you can reimplement it

Definition at line 328 of file menu.c.

References i, menu_get_name(), menu_get_parent(), menu_get_sub(), and menu_get_sub_howmany().

struct menu* menu_default_update ( struct menu m,
char  c 
) [read]

move in the menu, depending on the action

Definition at line 299 of file menu.c.

References menu_down(), menu_get_parent(), menu_get_sub(), menu_left(), menu_right(), MENU_TYPE_ROOT, menu_up(), and menu::type.

struct menu* menu_down ( struct menu m  )  [read]

return the next menu on same level (if it is the first, go back to the end

Definition at line 274 of file menu.c.

References menu_get_next(), and menu_get_previous().

Referenced by menu_default_update().

struct menu* menu_get_first_son ( struct menu m  )  [read]

return first son or NULL if there is no son

Definition at line 178 of file menu.c.

Referenced by menu_get_sub(), menu_get_sub_howmany(), and menu_right().

char* menu_get_name ( struct menu m  ) 

return name of a menu, if the type is correct

Definition at line 34 of file menu.c.

References menu::data, MENU_TYPE_FCT_HDR, MENU_TYPE_MENU, MENU_TYPE_ROOT, and menu::type.

Referenced by menu_default_display().

struct menu* menu_get_next ( struct menu m  )  [read]

get next menu on same level, return NULL if no one

Definition at line 120 of file menu.c.

References MENU_TYPE_END, MENU_TYPE_FCT_HDR, MENU_TYPE_MENU, MENU_TYPE_ROOT, and menu::type.

Referenced by menu_down(), menu_get_sub(), menu_get_sub_howmany(), and menu_up().

struct menu* menu_get_parent ( struct menu m  )  [read]

get the parent of the menu - return NULL if no parent

Definition at line 154 of file menu.c.

References menu_get_previous(), MENU_TYPE_ROOT, and menu::type.

Referenced by menu_default_display(), menu_default_update(), and menu_left().

struct menu* menu_get_previous ( struct menu m  )  [read]

get previous menu on same level, return NULL if no one

Definition at line 87 of file menu.c.

References MENU_TYPE_END, MENU_TYPE_FCT_HDR, MENU_TYPE_MENU, MENU_TYPE_ROOT, and menu::type.

Referenced by menu_down(), menu_get_parent(), and menu_up().

struct menu* menu_get_sub ( struct menu m,
uint8_t  num 
) [read]

get the submenu 'num' -> can return NULL if does not exist

Definition at line 190 of file menu.c.

References menu_get_first_son(), and menu_get_next().

Referenced by menu_default_display(), and menu_default_update().

uint8_t menu_get_sub_howmany ( struct menu m  ) 

return number of submenus in a menu

Definition at line 203 of file menu.c.

References menu_get_first_son(), and menu_get_next().

Referenced by menu_default_display().

uint8_t menu_get_type ( struct menu m  ) 

return type of a menu

Definition at line 47 of file menu.c.

References MENU_TYPE_UNKNOWN, and menu::type.

struct menu* menu_left ( struct menu m  )  [read]

get the parent of the menu - never return NULL except if m is null

Definition at line 219 of file menu.c.

References menu_get_parent().

Referenced by menu_default_update().

struct menu* menu_right ( struct menu m  )  [read]

get the son number 'num' or self if it does not exist, try to call the function if it exists, does not return null except if m is null

Definition at line 235 of file menu.c.

References menu_call_fct(), and menu_get_first_son().

Referenced by menu_default_update().

struct menu* menu_up ( struct menu m  )  [read]

return the next menu on same level (if it is the last, go back to beginning

Definition at line 250 of file menu.c.

References menu_get_next(), and menu_get_previous().

Referenced by menu_default_update().


Generated on Fri Mar 12 06:32:07 2010 for AVR by  doxygen 1.5.6