\section{aversive\_\-10-03-12/modules/ihm/menu/menu.h File Reference}
\label{menu_8h}\index{aversive\_\-10-03-12/modules/ihm/menu/menu.h@{aversive\_\-10-03-12/modules/ihm/menu/menu.h}}
{\tt \#include $<$aversive.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf menu}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf MENU\_\-TYPE\_\-ROOT}~0
\item 
\#define {\bf MENU\_\-TYPE\_\-MENU}~1
\item 
\#define {\bf MENU\_\-TYPE\_\-FCT\_\-HDR}~2
\item 
\#define {\bf MENU\_\-TYPE\_\-FCT\_\-PTR}~3
\item 
\#define {\bf MENU\_\-TYPE\_\-FCT\_\-DATA}~4
\item 
\#define {\bf MENU\_\-TYPE\_\-END}~5
\item 
\#define {\bf MENU\_\-TYPE\_\-UNKNOWN}~255
\item 
\#define {\bf MENU\_\-ROOT}(text)~\{ MENU\_\-TYPE\_\-ROOT, (void $\ast$)text \}
\item 
\#define {\bf MENU\_\-START}(text)~\{ MENU\_\-TYPE\_\-MENU, (void $\ast$)text \}
\item 
\#define {\bf MENU\_\-END}()~\{ MENU\_\-TYPE\_\-END, NULL \}
\item 
\#define {\bf MENU\_\-FCT}(text, f, data)
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-left} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-right} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-down} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-up} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-default\_\-update} (struct {\bf menu} $\ast$m, char c)
\item 
void {\bf menu\_\-default\_\-display} (struct {\bf menu} $\ast$m)
\item 
char $\ast$ {\bf menu\_\-get\_\-name} (struct {\bf menu} $\ast$m)
\item 
uint8\_\-t {\bf menu\_\-get\_\-type} (struct {\bf menu} $\ast$m)
\item 
uint8\_\-t {\bf menu\_\-call\_\-fct} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-previous} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-next} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-parent} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-first\_\-son} (struct {\bf menu} $\ast$m)
\item 
struct {\bf menu} $\ast$ {\bf menu\_\-get\_\-sub} (struct {\bf menu} $\ast$m, uint8\_\-t num)
\item 
uint8\_\-t {\bf menu\_\-get\_\-sub\_\-howmany} (struct {\bf menu} $\ast$m)
\end{CompactItemize}


\subsection{Define Documentation}
\index{menu.h@{menu.h}!MENU\_\-END@{MENU\_\-END}}
\index{MENU\_\-END@{MENU\_\-END}!menu.h@{menu.h}}
\subsubsection[MENU\_\-END]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-END()~\{ MENU\_\-TYPE\_\-END, NULL \}}\label{menu_8h_9fa6455e2c8ca55cf2afb669eff6530d}




Definition at line 250 of file menu.h.\index{menu.h@{menu.h}!MENU\_\-FCT@{MENU\_\-FCT}}
\index{MENU\_\-FCT@{MENU\_\-FCT}!menu.h@{menu.h}}
\subsubsection[MENU\_\-FCT]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-FCT(text, \/  f, \/  data)}\label{menu_8h_80b5578dc421558b2cdda2f75d7e08da}


\textbf{Value:}

\begin{Code}\begin{verbatim}{ MENU_TYPE_FCT_HDR, (void *)text }, \
 { MENU_TYPE_FCT_PTR, (void *)f },    \
 { MENU_TYPE_FCT_DATA, (void *)data }
\end{verbatim}
\end{Code}


Definition at line 252 of file menu.h.\index{menu.h@{menu.h}!MENU\_\-ROOT@{MENU\_\-ROOT}}
\index{MENU\_\-ROOT@{MENU\_\-ROOT}!menu.h@{menu.h}}
\subsubsection[MENU\_\-ROOT]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-ROOT(text)~\{ MENU\_\-TYPE\_\-ROOT, (void $\ast$)text \}}\label{menu_8h_60f99f4c5b6e4d37deae4e152167dcaa}




Definition at line 246 of file menu.h.\index{menu.h@{menu.h}!MENU\_\-START@{MENU\_\-START}}
\index{MENU\_\-START@{MENU\_\-START}!menu.h@{menu.h}}
\subsubsection[MENU\_\-START]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-START(text)~\{ MENU\_\-TYPE\_\-MENU, (void $\ast$)text \}}\label{menu_8h_a0539ea72f5857b1db3b3f940a983465}




Definition at line 248 of file menu.h.\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-END@{MENU\_\-TYPE\_\-END}}
\index{MENU\_\-TYPE\_\-END@{MENU\_\-TYPE\_\-END}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-END]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-END~5}\label{menu_8h_15dad1178e947f36b652d60dc53878ea}




Definition at line 243 of file menu.h.

Referenced by menu\_\-get\_\-next(), and menu\_\-get\_\-previous().\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-FCT\_\-DATA@{MENU\_\-TYPE\_\-FCT\_\-DATA}}
\index{MENU\_\-TYPE\_\-FCT\_\-DATA@{MENU\_\-TYPE\_\-FCT\_\-DATA}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-FCT\_\-DATA]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-FCT\_\-DATA~4}\label{menu_8h_dc232c1f2f3bfe4d46afb8fb740ed1ff}




Definition at line 242 of file menu.h.

Referenced by menu\_\-call\_\-fct().\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-FCT\_\-HDR@{MENU\_\-TYPE\_\-FCT\_\-HDR}}
\index{MENU\_\-TYPE\_\-FCT\_\-HDR@{MENU\_\-TYPE\_\-FCT\_\-HDR}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-FCT\_\-HDR]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-FCT\_\-HDR~2}\label{menu_8h_6e34e3e8a3bc25a16af004b7fa9d946d}




Definition at line 240 of file menu.h.

Referenced by menu\_\-call\_\-fct(), menu\_\-get\_\-name(), menu\_\-get\_\-next(), and menu\_\-get\_\-previous().\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-FCT\_\-PTR@{MENU\_\-TYPE\_\-FCT\_\-PTR}}
\index{MENU\_\-TYPE\_\-FCT\_\-PTR@{MENU\_\-TYPE\_\-FCT\_\-PTR}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-FCT\_\-PTR]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-FCT\_\-PTR~3}\label{menu_8h_96a5161916165968151e5dc152b98484}




Definition at line 241 of file menu.h.

Referenced by menu\_\-call\_\-fct().\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-MENU@{MENU\_\-TYPE\_\-MENU}}
\index{MENU\_\-TYPE\_\-MENU@{MENU\_\-TYPE\_\-MENU}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-MENU]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-MENU~1}\label{menu_8h_721a1d91420a4ebad6c2d4c37c344557}




Definition at line 239 of file menu.h.

Referenced by menu\_\-get\_\-name(), menu\_\-get\_\-next(), and menu\_\-get\_\-previous().\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-ROOT@{MENU\_\-TYPE\_\-ROOT}}
\index{MENU\_\-TYPE\_\-ROOT@{MENU\_\-TYPE\_\-ROOT}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-ROOT]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-ROOT~0}\label{menu_8h_b0419c153517b5b6512ba60daa3abd8b}




Definition at line 238 of file menu.h.

Referenced by menu\_\-default\_\-update(), menu\_\-get\_\-name(), menu\_\-get\_\-next(), menu\_\-get\_\-parent(), and menu\_\-get\_\-previous().\index{menu.h@{menu.h}!MENU\_\-TYPE\_\-UNKNOWN@{MENU\_\-TYPE\_\-UNKNOWN}}
\index{MENU\_\-TYPE\_\-UNKNOWN@{MENU\_\-TYPE\_\-UNKNOWN}!menu.h@{menu.h}}
\subsubsection[MENU\_\-TYPE\_\-UNKNOWN]{\setlength{\rightskip}{0pt plus 5cm}\#define MENU\_\-TYPE\_\-UNKNOWN~255}\label{menu_8h_8a8a5fd2577ab757208baf1bd3257fad}




Definition at line 244 of file menu.h.

Referenced by menu\_\-get\_\-type().

\subsection{Function Documentation}
\index{menu.h@{menu.h}!menu\_\-call\_\-fct@{menu\_\-call\_\-fct}}
\index{menu\_\-call\_\-fct@{menu\_\-call\_\-fct}!menu.h@{menu.h}}
\subsubsection[menu\_\-call\_\-fct]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t menu\_\-call\_\-fct (struct {\bf menu} $\ast$ {\em m})}\label{menu_8h_b5127423f815bab6488e95db6244ce42}


call the function described by the \doxyref{menu}{p.}{structmenu}, and return 0 on success

call the function described by the \doxyref{menu}{p.}{structmenu}, 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().\index{menu.h@{menu.h}!menu\_\-default\_\-display@{menu\_\-default\_\-display}}
\index{menu\_\-default\_\-display@{menu\_\-default\_\-display}!menu.h@{menu.h}}
\subsubsection[menu\_\-default\_\-display]{\setlength{\rightskip}{0pt plus 5cm}void menu\_\-default\_\-display (struct {\bf menu} $\ast$ {\em m})}\label{menu_8h_ad0d7840c7c16a4c087829fe21e12b31}


default function to display a \doxyref{menu}{p.}{structmenu}, 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().\index{menu.h@{menu.h}!menu\_\-default\_\-update@{menu\_\-default\_\-update}}
\index{menu\_\-default\_\-update@{menu\_\-default\_\-update}!menu.h@{menu.h}}
\subsubsection[menu\_\-default\_\-update]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-default\_\-update (struct {\bf menu} $\ast$ {\em m}, \/  char {\em c})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_75c6f3b5a07b6c48bf275535878f2757}


move in the \doxyref{menu}{p.}{structmenu}, depending on the action (the character c)

move in the \doxyref{menu}{p.}{structmenu}, 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.\index{menu.h@{menu.h}!menu\_\-down@{menu\_\-down}}
\index{menu\_\-down@{menu\_\-down}!menu.h@{menu.h}}
\subsubsection[menu\_\-down]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-down (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_0da12eec795a34a3313415d4803cc67c}


return the next \doxyref{menu}{p.}{structmenu} on same level (if it is the last, go back to beginning, never return NULL except if param is null

return the next \doxyref{menu}{p.}{structmenu} 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().\index{menu.h@{menu.h}!menu\_\-get\_\-first\_\-son@{menu\_\-get\_\-first\_\-son}}
\index{menu\_\-get\_\-first\_\-son@{menu\_\-get\_\-first\_\-son}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-first\_\-son]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-first\_\-son (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_9b90889004ace877dd4797d6c32347ff}


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().\index{menu.h@{menu.h}!menu\_\-get\_\-name@{menu\_\-get\_\-name}}
\index{menu\_\-get\_\-name@{menu\_\-get\_\-name}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-name]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ menu\_\-get\_\-name (struct {\bf menu} $\ast$ {\em m})}\label{menu_8h_2123b2017c94bdc32a8d83c752ae7ad8}


return name of a \doxyref{menu}{p.}{structmenu}, 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().\index{menu.h@{menu.h}!menu\_\-get\_\-next@{menu\_\-get\_\-next}}
\index{menu\_\-get\_\-next@{menu\_\-get\_\-next}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-next]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-next (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_49376d656f65aa69f945a3337a6a0762}


get next \doxyref{menu}{p.}{structmenu} 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().\index{menu.h@{menu.h}!menu\_\-get\_\-parent@{menu\_\-get\_\-parent}}
\index{menu\_\-get\_\-parent@{menu\_\-get\_\-parent}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-parent]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-parent (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_2113bfefb0ce9cc773fe06d16001db25}


get the parent of the \doxyref{menu}{p.}{structmenu} - 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().\index{menu.h@{menu.h}!menu\_\-get\_\-previous@{menu\_\-get\_\-previous}}
\index{menu\_\-get\_\-previous@{menu\_\-get\_\-previous}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-previous]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-previous (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_c8bf20f304fa210b6d97e575b23d0781}


get previous \doxyref{menu}{p.}{structmenu} 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().\index{menu.h@{menu.h}!menu\_\-get\_\-sub@{menu\_\-get\_\-sub}}
\index{menu\_\-get\_\-sub@{menu\_\-get\_\-sub}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-sub]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-get\_\-sub (struct {\bf menu} $\ast$ {\em m}, \/  uint8\_\-t {\em num})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_f75106c92662aa4087311f0778a32df2}


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().\index{menu.h@{menu.h}!menu\_\-get\_\-sub\_\-howmany@{menu\_\-get\_\-sub\_\-howmany}}
\index{menu\_\-get\_\-sub\_\-howmany@{menu\_\-get\_\-sub\_\-howmany}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-sub\_\-howmany]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t menu\_\-get\_\-sub\_\-howmany (struct {\bf menu} $\ast$ {\em m})}\label{menu_8h_767ed854209b296382c34ea4f3a40546}


return number of submenus in a \doxyref{menu}{p.}{structmenu} 

Definition at line 203 of file menu.c.

References menu\_\-get\_\-first\_\-son(), and menu\_\-get\_\-next().

Referenced by menu\_\-default\_\-display().\index{menu.h@{menu.h}!menu\_\-get\_\-type@{menu\_\-get\_\-type}}
\index{menu\_\-get\_\-type@{menu\_\-get\_\-type}!menu.h@{menu.h}}
\subsubsection[menu\_\-get\_\-type]{\setlength{\rightskip}{0pt plus 5cm}uint8\_\-t menu\_\-get\_\-type (struct {\bf menu} $\ast$ {\em m})}\label{menu_8h_11a396cd006d454bb584feab7f3259b9}


return type of a \doxyref{menu}{p.}{structmenu} 

Definition at line 47 of file menu.c.

References MENU\_\-TYPE\_\-UNKNOWN, and menu::type.\index{menu.h@{menu.h}!menu\_\-left@{menu\_\-left}}
\index{menu\_\-left@{menu\_\-left}!menu.h@{menu.h}}
\subsubsection[menu\_\-left]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-left (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_181625db1ec09e267a4756644ae538dd}


get the parent of the \doxyref{menu}{p.}{structmenu} - never return NULL except if param is null

get the parent of the \doxyref{menu}{p.}{structmenu} - 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().\index{menu.h@{menu.h}!menu\_\-right@{menu\_\-right}}
\index{menu\_\-right@{menu\_\-right}!menu.h@{menu.h}}
\subsubsection[menu\_\-right]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-right (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_33fb8db3ebecfbab3900a5e0d39fccf8}


get the first son number self if it does not exist, try to call the fonction if it exists, never return NULL except if param is null

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().\index{menu.h@{menu.h}!menu\_\-up@{menu\_\-up}}
\index{menu\_\-up@{menu\_\-up}!menu.h@{menu.h}}
\subsubsection[menu\_\-up]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf menu}$\ast$ menu\_\-up (struct {\bf menu} $\ast$ {\em m})\hspace{0.3cm}{\tt  [read]}}\label{menu_8h_cb3303048b2d6514e77a3f4fd05c1c98}


return the next \doxyref{menu}{p.}{structmenu} on same level (if it is the first, go back to the end, never return NULL except if param is null

return the next \doxyref{menu}{p.}{structmenu} 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().