\hypertarget{evas-stacking_8c-example}{}\doxysection{evas-\/stacking.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifdef HAVE\_CONFIG\_H}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include "{}config.h"{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PACKAGE\_EXAMPLES\_DIR "{}."{}}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <string.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WIDTH  320}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define HEIGHT 320}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{struct }test\_data}
\DoxyCodeLine{\{}
\DoxyCodeLine{   Ecore\_Evas  *ee;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *canvas;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bg;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *rects[3]; \textcolor{comment}{/* red, green, blue */}}
\DoxyCodeLine{   \textcolor{keywordtype}{int}          layers[3]; \textcolor{comment}{/* default, below it, above it */}}
\DoxyCodeLine{   \textcolor{keywordtype}{int}          cur\_rect, cur\_layer;}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{struct }test\_data d = \{0\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *commands = \(\backslash\)}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}commands are:\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tc -\/ change the target rectangle to operate on\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)ta -\/ stack target rectangle one level above\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tb -\/ stack target rectangle one level below\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tt -\/ stack target rectangle up to the top of its layer\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tm -\/ stack target rectangle down to the bottom of its layer\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tp -\/ toggle target rectangle's 'pass events' property\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tr -\/ toggle target rectangle's 'repeat events' property\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)ts -\/ print current stacking information\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)tl -\/ change background rectangle's layer\(\backslash\)n"{}}}
\DoxyCodeLine{  \textcolor{stringliteral}{"{}\(\backslash\)th -\/ print help\(\backslash\)n"{}};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{\_name\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s = \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga30207eec263c05c17d453f8b8cc7a259}{evas\_object\_name\_get}}(o);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!s) s = \textcolor{stringliteral}{"{}(null)"{}};}
\DoxyCodeLine{   \textcolor{keywordflow}{return} s;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_mouse\_down(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{               \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{               \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o,}
\DoxyCodeLine{               \textcolor{keywordtype}{void}        *einfo \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}Mouse down on rectangle \%s!\(\backslash\)n"{}}, \_name\_get(o));}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* Keep the example's window size in sync with the background image's size */}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_canvas\_resize\_cb(Ecore\_Evas *ee)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{int} w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga931aadf4603731e73e8a84e4b14f1493}{ecore\_evas\_geometry\_get}}(ee, NULL, NULL, \&w, \&h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(d.bg, w, h);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* use the following commands to interact with this example -\/ 'h' is}}
\DoxyCodeLine{\textcolor{comment}{ * the key for help */}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_keydown(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \textcolor{keywordtype}{void}        *einfo)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev = einfo;}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name = \_name\_get(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}h"{}}) == 0)  \textcolor{comment}{/* print help */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, commands);}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}s"{}}) == 0)  \textcolor{comment}{/* get status of the}}
\DoxyCodeLine{\textcolor{comment}{                                        * rectangles WRT size}}
\DoxyCodeLine{\textcolor{comment}{                                        * hints */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *rect;}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Order of stacking, from top to bottom, is: "{}});}
\DoxyCodeLine{}
\DoxyCodeLine{        rect = \mbox{\hyperlink{group__Evas__Canvas_ga15293a80e719b16fc2d44af72dce96ff}{evas\_object\_top\_get}}(evas);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s"{}}, \_name\_get(rect));}
\DoxyCodeLine{}
\DoxyCodeLine{        rect = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(rect);}
\DoxyCodeLine{        \textcolor{keywordflow}{while} (rect)}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             printf(\textcolor{stringliteral}{"{}, \%s"{}}, \_name\_get(rect));}
\DoxyCodeLine{             rect = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(rect);}
\DoxyCodeLine{          \}}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}.\(\backslash\)n"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Current target rectangle is \%s\(\backslash\)n"{}},}
\DoxyCodeLine{               \_name\_get(d.rects[d.cur\_rect]));}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Background rectangle's layer is \%d\(\backslash\)n"{}},}
\DoxyCodeLine{               \mbox{\hyperlink{group__Evas__Object__Group_ga840f2d2744de42e80b70904132d87ebb}{evas\_object\_layer\_get}}(d.bg));}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}l"{}}) == 0)  \textcolor{comment}{/* change background rectangle's layer */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        d.cur\_layer = (d.cur\_layer + 1) \% 3;}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga6f4b41c65c99eb5d53e207439eeffd76}{evas\_object\_layer\_set}}(d.bg, d.layers[d.cur\_layer]);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Changing background rectangle's layer to \%d\(\backslash\)n"{}},}
\DoxyCodeLine{               d.layers[d.cur\_layer]);}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}c"{}}) == 0)  \textcolor{comment}{/* change rectangle to operate on */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        d.cur\_rect = (d.cur\_rect + 1) \% 3;}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Changing target rectangle to the \%s one\(\backslash\)n"{}},}
\DoxyCodeLine{               \_name\_get(d.rects[d.cur\_rect]));}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}t"{}}) == 0)  \textcolor{comment}{/* bring target to top */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour;}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga4327cbfab244f0bb1cf8354c8b6c160d}{evas\_object\_raise}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s rectangle was re-\/stacked to the top if its layer\(\backslash\)n"{}},}
\DoxyCodeLine{               name);}
\DoxyCodeLine{}
\DoxyCodeLine{        neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Below of \%s rect is \%s\(\backslash\)n"{}}, name,}
\DoxyCodeLine{               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"{}no object"{}});}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}m"{}}) == 0)  \textcolor{comment}{/* bring target to bottom */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour;}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_gaafab63557fcbf7cee72b5696d10c21bb}{evas\_object\_lower}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s rectangle was re-\/stacked to the bottom if its layer\(\backslash\)n"{}},}
\DoxyCodeLine{               name);}
\DoxyCodeLine{}
\DoxyCodeLine{        neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Below of \%s rect is \%s\(\backslash\)n"{}}, name,}
\DoxyCodeLine{               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"{}no object"{}});}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}p"{}}) == 0)  \textcolor{comment}{/* toggle pass events */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} pass = \mbox{\hyperlink{group__Evas__Object__Group_ga30d0116239b0f18a5325f0c225bfbc8d}{evas\_object\_pass\_events\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga816476972852135c9d419602b0430419}{evas\_object\_pass\_events\_set}}(d.rects[d.cur\_rect], !pass);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s rectangle is now set to\%s pass (ignore) events\(\backslash\)n"{}},}
\DoxyCodeLine{               name, pass ? \textcolor{stringliteral}{"{} NOT"{}} : \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}r"{}}) == 0)  \textcolor{comment}{/* toggle repeat events */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} repeat = \mbox{\hyperlink{group__Evas__Object__Group_gaaccdcfe1e3c61c3287c5de47c14ca30c}{evas\_object\_repeat\_events\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_gab1618a7fe4ce75eb77c5a1f327cb7044}{evas\_object\_repeat\_events\_set}}(d.rects[d.cur\_rect], !repeat);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s rectangle is now set to\%s repeat events\(\backslash\)n"{}},}
\DoxyCodeLine{               name, repeat ? \textcolor{stringliteral}{"{} NOT"{}} : \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}a"{}}) == 0)  \textcolor{comment}{/* stack target above */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga81325bd74bd230efd9cb248593f2a3ad}{evas\_object\_above\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (!neighbour || (\mbox{\hyperlink{group__Evas__Object__Group_ga840f2d2744de42e80b70904132d87ebb}{evas\_object\_layer\_get}}(d.rects[d.cur\_rect]) !=}
\DoxyCodeLine{                           \mbox{\hyperlink{group__Evas__Object__Group_ga840f2d2744de42e80b70904132d87ebb}{evas\_object\_layer\_get}}(neighbour)))}
\DoxyCodeLine{          \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9b3e1b7c3908f112fc401e528c73138c}{evas\_object\_stack\_above}}(d.rects[d.cur\_rect], neighbour);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s rectangle was re-\/stacked one level above\(\backslash\)n"{}}, name);}
\DoxyCodeLine{}
\DoxyCodeLine{        neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga81325bd74bd230efd9cb248593f2a3ad}{evas\_object\_above\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Above of \%s rect is \%s\(\backslash\)n"{}}, name,}
\DoxyCodeLine{               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"{}no object"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{        neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Below of \%s rect is \%s\(\backslash\)n"{}}, name,}
\DoxyCodeLine{               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"{}no object"{}});}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"{}b"{}}) == 0)  \textcolor{comment}{/* stack target below */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (!neighbour || (\mbox{\hyperlink{group__Evas__Object__Group_ga840f2d2744de42e80b70904132d87ebb}{evas\_object\_layer\_get}}(d.rects[d.cur\_rect]) !=}
\DoxyCodeLine{                           \mbox{\hyperlink{group__Evas__Object__Group_ga840f2d2744de42e80b70904132d87ebb}{evas\_object\_layer\_get}}(neighbour)))}
\DoxyCodeLine{          \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga6371e77b57f8f711711f5773649791c3}{evas\_object\_stack\_below}}(d.rects[d.cur\_rect], neighbour);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\%s rectangle was re-\/stacked one level below\(\backslash\)n"{}}, name);}
\DoxyCodeLine{}
\DoxyCodeLine{        neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga81325bd74bd230efd9cb248593f2a3ad}{evas\_object\_above\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Above of \%s rect is \%s\(\backslash\)n"{}}, name,}
\DoxyCodeLine{               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"{}no object"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{        neighbour = \mbox{\hyperlink{group__Evas__Object__Group_ga5e07e200ce7cda082bdc41fa3996515d}{evas\_object\_below\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}Below of \%s rect is \%s\(\backslash\)n"{}}, name,}
\DoxyCodeLine{               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"{}no object"{}});}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_destroy(Ecore\_Evas *ee \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}())}
\DoxyCodeLine{     \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* this will give you a window with an Evas canvas under the first}}
\DoxyCodeLine{\textcolor{comment}{    * engine available */}}
\DoxyCodeLine{   d.ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gaaa770b6f2f1395f9eeb0e50e26c3f933}{ecore\_evas\_new}}(NULL, 0, 0, WIDTH, HEIGHT, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!d.ee)}
\DoxyCodeLine{     \textcolor{keywordflow}{goto} error;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga3680b5c89157167318192157a5d24ec4}{ecore\_evas\_callback\_destroy\_set}}(d.ee, \_on\_destroy);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gaac67f679c9027059a34519fbdea360df}{ecore\_evas\_callback\_resize\_set}}(d.ee, \_canvas\_resize\_cb);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(d.ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* the canvas pointer, de facto */}}
\DoxyCodeLine{   d.canvas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga6f8d214cd55bc940d7cc62fecd8dbc06}{ecore\_evas\_get}}(d.ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.bg = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga48f9cbae79a45e5f672dbe2076a0cf36}{evas\_object\_name\_set}}(d.bg, \textcolor{stringliteral}{"{}background"{}});  \textcolor{comment}{/* white bg */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(d.bg, 255, 255, 255, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(d.bg, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(d.bg, WIDTH, HEIGHT);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.layers[0] = \mbox{\hyperlink{group__Evas__Object__Group_ga840f2d2744de42e80b70904132d87ebb}{evas\_object\_layer\_get}}(d.bg);}
\DoxyCodeLine{   d.layers[1] = d.layers[0] -\/ 1;}
\DoxyCodeLine{   d.layers[2] = d.layers[0] + 1;}
\DoxyCodeLine{}
\DoxyCodeLine{   d.cur\_layer = 1;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga6f4b41c65c99eb5d53e207439eeffd76}{evas\_object\_layer\_set}}(d.bg, d.layers[d.cur\_layer]);  \textcolor{comment}{/* let's start with it}}
\DoxyCodeLine{\textcolor{comment}{                                                         * below the default}}
\DoxyCodeLine{\textcolor{comment}{                                                         * layer */}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(d.bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gac6d65f8896ab59780553676d0017c2ef}{evas\_object\_focus\_set}}(d.bg, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(}
\DoxyCodeLine{     d.bg, \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}}, \_on\_keydown, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.rects[2] = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga48f9cbae79a45e5f672dbe2076a0cf36}{evas\_object\_name\_set}}(d.rects[2], \textcolor{stringliteral}{"{}blue"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(d.rects[2], 0, 0, 255, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(d.rects[2], WIDTH / 2.2, WIDTH / 2.2);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(d.rects[2], WIDTH / 6, WIDTH / 4.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(d.rects[2]);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(}
\DoxyCodeLine{     d.rects[2], \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}}, \_on\_mouse\_down, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.rects[1] = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga48f9cbae79a45e5f672dbe2076a0cf36}{evas\_object\_name\_set}}(d.rects[1], \textcolor{stringliteral}{"{}green"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(d.rects[1], 0, 255, 0, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(d.rects[1], WIDTH / 2.2, WIDTH / 2.2);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(d.rects[1], WIDTH / 2.5, WIDTH / 7);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(d.rects[1]);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(}
\DoxyCodeLine{     d.rects[1], \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}}, \_on\_mouse\_down, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.rects[0] = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga48f9cbae79a45e5f672dbe2076a0cf36}{evas\_object\_name\_set}}(d.rects[0], \textcolor{stringliteral}{"{}red"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(d.rects[0], 255, 0, 0, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(d.rects[0], WIDTH / 2.2, WIDTH / 2.2);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(d.rects[0], WIDTH / 3, WIDTH / 2.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(d.rects[0]);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(}
\DoxyCodeLine{     d.rects[0], \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}}, \_on\_mouse\_down, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}\%s\(\backslash\)n"{}}, commands);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{}
\DoxyCodeLine{error:}
\DoxyCodeLine{   fprintf(stderr, \textcolor{stringliteral}{"{}error: Requires at least one Evas engine built and linked"{}}}
\DoxyCodeLine{                   \textcolor{stringliteral}{"{} to ecore-\/evas for this example to run properly.\(\backslash\)n"{}});}
\DoxyCodeLine{   \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 