\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_ga7934106d84f6a019fcb421b6b4d860a3}{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{   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 = evas\_object\_top\_get(evas);}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"\%s"}, \_name\_get(rect));}
\DoxyCodeLine{}
\DoxyCodeLine{        rect = evas\_object\_below\_get(rect);}
\DoxyCodeLine{        \textcolor{keywordflow}{while} (rect)}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             printf(\textcolor{stringliteral}{", \%s"}, \_name\_get(rect));}
\DoxyCodeLine{             rect = 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{               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{        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{        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 = 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{        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 = 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_gad0e384b0a4b3712fd2c1276689872bfc}{evas\_object\_pass\_events\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga8bab997bfe68d4bcdf4ab2b4f4a41674}{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_gae6ed18c035470c88970c28ab9cd5478a}{evas\_object\_repeat\_events\_get}}(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_gab168003bb3efb683d5d0c5b652b58620}{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 = evas\_object\_above\_get(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (!neighbour || (evas\_object\_layer\_get(d.rects[d.cur\_rect]) !=}
\DoxyCodeLine{                           evas\_object\_layer\_get(neighbour)))}
\DoxyCodeLine{          \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{        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 = 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 = 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 = evas\_object\_below\_get(d.rects[d.cur\_rect]);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (!neighbour || (evas\_object\_layer\_get(d.rects[d.cur\_rect]) !=}
\DoxyCodeLine{                           evas\_object\_layer\_get(neighbour)))}
\DoxyCodeLine{          \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{        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 = 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 = 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_gac7f2cdbcb79635c34317c1183dd04cb0}{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_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(d.ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.bg = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.bg, \textcolor{stringliteral}{"background"});  \textcolor{comment}{/* white bg */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.bg, 255, 255, 255, 255);}
\DoxyCodeLine{   evas\_object\_move(d.bg, 0, 0);}
\DoxyCodeLine{   evas\_object\_resize(d.bg, WIDTH, HEIGHT);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.layers[0] = 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{   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_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga4405e118e1fb762987af1269b6848db5}{evas\_object\_focus\_set}}(d.bg, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{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_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.rects[2], \textcolor{stringliteral}{"blue"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.rects[2], 0, 0, 255, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(d.rects[2], WIDTH / 2.2, WIDTH / 2.2);}
\DoxyCodeLine{   evas\_object\_move(d.rects[2], WIDTH / 6, WIDTH / 4.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.rects[2]);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{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_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.rects[1], \textcolor{stringliteral}{"green"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.rects[1], 0, 255, 0, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(d.rects[1], WIDTH / 2.2, WIDTH / 2.2);}
\DoxyCodeLine{   evas\_object\_move(d.rects[1], WIDTH / 2.5, WIDTH / 7);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.rects[1]);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{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_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.rects[0], \textcolor{stringliteral}{"red"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.rects[0], 255, 0, 0, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(d.rects[0], WIDTH / 2.2, WIDTH / 2.2);}
\DoxyCodeLine{   evas\_object\_move(d.rects[0], WIDTH / 3, WIDTH / 2.5);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.rects[0]);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{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}
 