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

\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#ifdef HAVE\_CONFIG\_H}
\textcolor{preprocessor}{#include "config.h"}
\textcolor{preprocessor}{#else}
\textcolor{preprocessor}{#define PACKAGE\_EXAMPLES\_DIR "."}
\textcolor{preprocessor}{#endif}

\textcolor{preprocessor}{#include <Ecore.h>}
\textcolor{preprocessor}{#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}

\textcolor{preprocessor}{#include <stdlib.h>}
\textcolor{preprocessor}{#include <stdio.h>}
\textcolor{preprocessor}{#include <string.h>}

\textcolor{preprocessor}{#define WIDTH  320}
\textcolor{preprocessor}{#define HEIGHT 320}

\textcolor{keyword}{struct }test\_data
\{
   Ecore\_Evas  *ee;
   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *canvas;
   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bg;
   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *rects[3]; \textcolor{comment}{/* red, green, blue */}
   \textcolor{keywordtype}{int}          layers[3]; \textcolor{comment}{/* default, below it, above it */}
   \textcolor{keywordtype}{int}          cur\_rect, cur\_layer;
\};

\textcolor{keyword}{static} \textcolor{keyword}{struct }test\_data d = \{0\};

\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *commands = \(\backslash\)
  \textcolor{stringliteral}{"commands are:\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tc - change the target rectangle to operate on\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)ta - stack target rectangle one level above\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tb - stack target rectangle one level below\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tt - stack target rectangle up to the top of its layer\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tm - stack target rectangle down to the bottom of its layer\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tp - toggle target rectangle's 'pass events' property\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tr - toggle target rectangle's 'repeat events' property\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)ts - print current stacking information\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tl - change background rectangle's layer\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)th - print help\(\backslash\)n"};

\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *
\_name\_get(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o)
\{
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *s = \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga7934106d84f6a019fcb421b6b4d860a3}{evas\_object\_name\_get}}(o);
   \textcolor{keywordflow}{if} (!s) s = \textcolor{stringliteral}{"(null)"};
   \textcolor{keywordflow}{return} s;
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_mouse\_down(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},
               \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},
               \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o,
               \textcolor{keywordtype}{void}        *einfo \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})
\{
   printf(\textcolor{stringliteral}{"Mouse down on rectangle %s!\(\backslash\)n"}, \_name\_get(o));
\}

\textcolor{comment}{/* Keep the example's window size in sync with the background image's size */}
\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_canvas\_resize\_cb(Ecore\_Evas *ee)
\{
   \textcolor{keywordtype}{int} w, h;

   \mbox{\hyperlink{group__Ecore__Evas__Group_ga931aadf4603731e73e8a84e4b14f1493}{ecore\_evas\_geometry\_get}}(ee, NULL, NULL, &w, &h);
   evas\_object\_resize(d.bg, w, h);
\}

\textcolor{comment}{/* use the following commands to interact with this example - 'h' is}
\textcolor{comment}{ * the key for help */}
\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_keydown(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},
            \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},
            \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},
            \textcolor{keywordtype}{void}        *einfo)
\{
   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev = einfo;
   \textcolor{keyword}{const} \textcolor{keywordtype}{char} *name = \_name\_get(d.rects[d.cur\_rect]);

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"h"}) == 0)  \textcolor{comment}{/* print help */}
     \{
        printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, commands);
        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"s"}) == 0)  \textcolor{comment}{/* get status of the}
\textcolor{comment}{                                        * rectangles WRT size}
\textcolor{comment}{                                        * hints */}
     \{
        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *rect;

        printf(\textcolor{stringliteral}{"Order of stacking, from top to bottom, is: "});

        rect = \mbox{\hyperlink{group__Evas__Canvas_ga076169dc9fa3cefb9780e9732d7dcbe1}{evas\_object\_top\_get}}(evas);
        printf(\textcolor{stringliteral}{"%s"}, \_name\_get(rect));

        rect = evas\_object\_below\_get(rect);
        \textcolor{keywordflow}{while} (rect)
          \{
             printf(\textcolor{stringliteral}{", %s"}, \_name\_get(rect));
             rect = evas\_object\_below\_get(rect);
          \}

        printf(\textcolor{stringliteral}{".\(\backslash\)n"});

        printf(\textcolor{stringliteral}{"Current target rectangle is %s\(\backslash\)n"},
               \_name\_get(d.rects[d.cur\_rect]));

        printf(\textcolor{stringliteral}{"Background rectangle's layer is %d\(\backslash\)n"},
               evas\_object\_layer\_get(d.bg));

        \textcolor{keywordflow}{return};
     \}

   \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 */}
     \{
        d.cur\_layer = (d.cur\_layer + 1) % 3;
        evas\_object\_layer\_set(d.bg, d.layers[d.cur\_layer]);

        printf(\textcolor{stringliteral}{"Changing background rectangle's layer to %d\(\backslash\)n"},
               d.layers[d.cur\_layer]);
        \textcolor{keywordflow}{return};
     \}

   \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 */}
     \{
        d.cur\_rect = (d.cur\_rect + 1) % 3;

        printf(\textcolor{stringliteral}{"Changing target rectangle to the %s one\(\backslash\)n"},
               \_name\_get(d.rects[d.cur\_rect]));
        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"t"}) == 0)  \textcolor{comment}{/* bring target to top */}
     \{
        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour;

        evas\_object\_raise(d.rects[d.cur\_rect]);

        printf(\textcolor{stringliteral}{"%s rectangle was re-stacked to the top if its layer\(\backslash\)n"},
               name);

        neighbour = evas\_object\_below\_get(d.rects[d.cur\_rect]);
        printf(\textcolor{stringliteral}{"Below of %s rect is %s\(\backslash\)n"}, name,
               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"no object"});
        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"m"}) == 0)  \textcolor{comment}{/* bring target to bottom */}
     \{
        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour;

        evas\_object\_lower(d.rects[d.cur\_rect]);

        printf(\textcolor{stringliteral}{"%s rectangle was re-stacked to the bottom if its layer\(\backslash\)n"},
               name);

        neighbour = evas\_object\_below\_get(d.rects[d.cur\_rect]);
        printf(\textcolor{stringliteral}{"Below of %s rect is %s\(\backslash\)n"}, name,
               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"no object"});
        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"p"}) == 0)  \textcolor{comment}{/* toggle pass events */}
     \{
        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} pass = evas\_object\_pass\_events\_get(d.rects[d.cur\_rect]);

        evas\_object\_pass\_events\_set(d.rects[d.cur\_rect], !pass);

        printf(\textcolor{stringliteral}{"%s rectangle is now set to%s pass (ignore) events\(\backslash\)n"},
               name, pass ? \textcolor{stringliteral}{" NOT"} : \textcolor{stringliteral}{""});

        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"r"}) == 0)  \textcolor{comment}{/* toggle repeat events */}
     \{
        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} repeat = evas\_object\_repeat\_events\_get(d.rects[d.cur\_rect]);

        evas\_object\_repeat\_events\_set(d.rects[d.cur\_rect], !repeat);

        printf(\textcolor{stringliteral}{"%s rectangle is now set to%s repeat events\(\backslash\)n"},
               name, repeat ? \textcolor{stringliteral}{" NOT"} : \textcolor{stringliteral}{""});

        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"a"}) == 0)  \textcolor{comment}{/* stack target above */}
     \{
        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour = evas\_object\_above\_get(d.rects[d.cur\_rect]);

        \textcolor{keywordflow}{if} (!neighbour || (evas\_object\_layer\_get(d.rects[d.cur\_rect]) !=
                           evas\_object\_layer\_get(neighbour)))
          \textcolor{keywordflow}{return};

        evas\_object\_stack\_above(d.rects[d.cur\_rect], neighbour);

        printf(\textcolor{stringliteral}{"%s rectangle was re-stacked one level above\(\backslash\)n"}, name);

        neighbour = evas\_object\_above\_get(d.rects[d.cur\_rect]);
        printf(\textcolor{stringliteral}{"Above of %s rect is %s\(\backslash\)n"}, name,
               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"no object"});

        neighbour = evas\_object\_below\_get(d.rects[d.cur\_rect]);
        printf(\textcolor{stringliteral}{"Below of %s rect is %s\(\backslash\)n"}, name,
               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"no object"});
        \textcolor{keywordflow}{return};
     \}

   \textcolor{keywordflow}{if} (strcmp(ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"b"}) == 0)  \textcolor{comment}{/* stack target below */}
     \{
        \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *neighbour = evas\_object\_below\_get(d.rects[d.cur\_rect]);

        \textcolor{keywordflow}{if} (!neighbour || (evas\_object\_layer\_get(d.rects[d.cur\_rect]) !=
                           evas\_object\_layer\_get(neighbour)))
          \textcolor{keywordflow}{return};

        evas\_object\_stack\_below(d.rects[d.cur\_rect], neighbour);

        printf(\textcolor{stringliteral}{"%s rectangle was re-stacked one level below\(\backslash\)n"}, name);

        neighbour = evas\_object\_above\_get(d.rects[d.cur\_rect]);
        printf(\textcolor{stringliteral}{"Above of %s rect is %s\(\backslash\)n"}, name,
               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"no object"});

        neighbour = evas\_object\_below\_get(d.rects[d.cur\_rect]);

        printf(\textcolor{stringliteral}{"Below of %s rect is %s\(\backslash\)n"}, name,
               neighbour ? \_name\_get(neighbour) : \textcolor{stringliteral}{"no object"});
        \textcolor{keywordflow}{return};
     \}
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_destroy(Ecore\_Evas *ee \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})
\{
   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{void})
\{
   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}())
     \textcolor{keywordflow}{return} EXIT\_FAILURE;

   \textcolor{comment}{/* this will give you a window with an Evas canvas under the first}
\textcolor{comment}{    * engine available */}
   d.ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}}(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   \textcolor{keywordflow}{if} (!d.ee)
     \textcolor{keywordflow}{goto} error;

   \mbox{\hyperlink{group__Ecore__Evas__Group_ga3680b5c89157167318192157a5d24ec4}{ecore\_evas\_callback\_destroy\_set}}(d.ee, \_on\_destroy);
   \mbox{\hyperlink{group__Ecore__Evas__Group_gaac67f679c9027059a34519fbdea360df}{ecore\_evas\_callback\_resize\_set}}(d.ee, \_canvas\_resize\_cb);
   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(d.ee);

   \textcolor{comment}{/* the canvas pointer, de facto */}
   d.canvas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(d.ee);

   d.bg = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.bg, \textcolor{stringliteral}{"background"});  \textcolor{comment}{/* white bg */}
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.bg, 255, 255, 255, 255);
   evas\_object\_move(d.bg, 0, 0);
   evas\_object\_resize(d.bg, WIDTH, HEIGHT);

   d.layers[0] = evas\_object\_layer\_get(d.bg);
   d.layers[1] = d.layers[0] - 1;
   d.layers[2] = d.layers[0] + 1;

   d.cur\_layer = 1;
   evas\_object\_layer\_set(d.bg, d.layers[d.cur\_layer]);  \textcolor{comment}{/* let's start with it}
\textcolor{comment}{                                                         * below the default}
\textcolor{comment}{                                                         * layer */}

   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.bg);

   evas\_object\_focus\_set(d.bg, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});
   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(
     d.bg, \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}}, \_on\_keydown, NULL);

   d.rects[2] = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.rects[2], \textcolor{stringliteral}{"blue"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.rects[2], 0, 0, 255, 255);

   evas\_object\_resize(d.rects[2], WIDTH / 2.2, WIDTH / 2.2);
   evas\_object\_move(d.rects[2], WIDTH / 6, WIDTH / 4.5);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.rects[2]);
   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(
     d.rects[2], \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}}, \_on\_mouse\_down, NULL);

   d.rects[1] = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.rects[1], \textcolor{stringliteral}{"green"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.rects[1], 0, 255, 0, 255);

   evas\_object\_resize(d.rects[1], WIDTH / 2.2, WIDTH / 2.2);
   evas\_object\_move(d.rects[1], WIDTH / 2.5, WIDTH / 7);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.rects[1]);
   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(
     d.rects[1], \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}}, \_on\_mouse\_down, NULL);

   d.rects[0] = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.canvas);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(d.rects[0], \textcolor{stringliteral}{"red"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.rects[0], 255, 0, 0, 255);

   evas\_object\_resize(d.rects[0], WIDTH / 2.2, WIDTH / 2.2);
   evas\_object\_move(d.rects[0], WIDTH / 3, WIDTH / 2.5);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.rects[0]);
   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(
     d.rects[0], \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a9fa52651ccf7e47cd3b7785fc4cf393f}{EVAS\_CALLBACK\_MOUSE\_DOWN}}, \_on\_mouse\_down, NULL);

   printf(\textcolor{stringliteral}{"%s\(\backslash\)n"}, commands);
   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();

   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();
   \textcolor{keywordflow}{return} 0;

error:
   fprintf(stderr, \textcolor{stringliteral}{"error: Requires at least one Evas engine built and linked"}
                   \textcolor{stringliteral}{" to ecore-evas for this example to run properly.\(\backslash\)n"});
   \textcolor{keywordflow}{return} -1;
\}
\end{DoxyCodeInclude}
 