\chapter{layout\+\_\+example\+\_\+02.\+c}
\hypertarget{layout_example_02_c}{}\label{layout_example_02_c}\index{layout\_example\_02.c@{layout\_example\_02.c}}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile\ with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc\ -\/g\ layout\_example\_02.c\ -\/o\ layout\_example\_02\ \`{}pkg-\/config\ -\/-\/cflags\ -\/-\/libs\ elementary`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ <Elementary.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ TABLE\ "{}example/table"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ BOX\ "{}example/box"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ TITLE\ "{}example/title"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ SWALLOW\ "{}example/custom"{}}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *images[]\ =\ \{\ \textcolor{stringliteral}{"{}home"{}},\ \textcolor{stringliteral}{"{}close"{}},\ \textcolor{stringliteral}{"{}arrow\_up"{}},\ \textcolor{stringliteral}{"{}arrow\_down"{}},\ NULL\ \};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{struct\ }\_App\ \{}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordtype}{int}\ current;}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_signal\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *o,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *emission,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *source\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ *app\ =\ data;}
\DoxyCodeLine{\ \ \ Evas\_Object\ *icon\ =\ \mbox{\hyperlink{group__Elm__General_ga86b0088bbf018964a980f56e02ee2248}{elm\_object\_part\_content\_get}}(o,\ \textcolor{stringliteral}{"{}elm.swallow.content"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ printf(\textcolor{stringliteral}{"{}signal\ received\(\backslash\)n"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!strcmp(\textcolor{stringliteral}{"{}elm,action,back"{}},\ emission))}
\DoxyCodeLine{\ \ \ \ \ app-\/>current-\/-\/;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(\textcolor{stringliteral}{"{}elm,action,next"{}},\ emission))}
\DoxyCodeLine{\ \ \ \ \ app-\/>current++;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>current\ <\ 0)}
\DoxyCodeLine{\ \ \ \ \ app-\/>current\ =\ (\textcolor{keyword}{sizeof}(images)\ /\ \textcolor{keyword}{sizeof}(images[0]))\ -\/\ 2;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (images[app-\/>current]\ ==\ NULL)}
\DoxyCodeLine{\ \ \ \ \ app-\/>current\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(icon,\ images[app-\/>current]);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN\ \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int}\ argc\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{char}\ **argv\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Evas\_Object\ *win,\ *layout,\ *icon;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ app;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.current\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}},\ \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ win\ =\ \mbox{\hyperlink{group__Elm__Win__Group_ga23d9d1ffa0a65a1a1dd482d570db1ba0}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"{}layout"{}},\ \textcolor{stringliteral}{"{}Layout"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//\ Adding\ layout\ and\ filling\ it\ with\ widgets}}
\DoxyCodeLine{\ \ \ layout\ =\ \mbox{\hyperlink{group__Elm__Layout_ga5bcf7d68b0401cc7d557ef7d297baa3e}{elm\_layout\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(layout,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win,\ layout);}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group__Elm__Layout_ga8f28efed82872f5c57a61db5c81d4eb3}{elm\_layout\_theme\_set}}(}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ layout,\ \textcolor{stringliteral}{"{}layout"{}},\ \textcolor{stringliteral}{"{}application"{}},\ \textcolor{stringliteral}{"{}content-\/back-\/next"{}}))}
\DoxyCodeLine{\ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}Failed\ to\ set\ layout"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(layout);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ icon\ =\ \mbox{\hyperlink{group__Elm__Icon_gac369f2d67be417e5cff81e8f001ff326}{elm\_icon\_add}}(win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Icon_gab764b4c6c90543f254c013eff6a6db66}{elm\_icon\_standard\_set}}(icon,\ images[app.current]);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9379629ad8ad2860aa786d838a4a106a}{evas\_object\_size\_hint\_weight\_set}}(layout,\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}},\ \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga0531ec8867c72def7c780601764ca642}{elm\_object\_part\_content\_set}}(layout,\ \textcolor{stringliteral}{"{}elm.swallow.content"{}},\ icon);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga6f9574b798efcd454afdac6f2904f633}{elm\_object\_signal\_callback\_add}}(layout,\ \textcolor{stringliteral}{"{}elm,action,back"{}},\ \textcolor{stringliteral}{"{}elm"{}},\ \_signal\_cb,\ \&app);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga6f9574b798efcd454afdac6f2904f633}{elm\_object\_signal\_callback\_add}}(layout,\ \textcolor{stringliteral}{"{}elm,action,next"{}},\ \textcolor{stringliteral}{"{}elm"{}},\ \_signal\_cb,\ \&app);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(win,\ 320,\ 320);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{\mbox{\hyperlink{group__Elm__General_ga50fe52d513f7e89c9c770afd76de7ad9}{ELM\_MAIN}}()}

\end{DoxyCodeInclude}
 