\hypertarget{evas-map-utils_8c-example}{}\section{evas-\/map-\/utils.\+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}{#include <math.h>}
\textcolor{preprocessor}{#include "evas-common.h"}

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

\textcolor{keyword}{typedef} \textcolor{keyword}{struct}
\{
   Ecore\_Evas *ee;
   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}       *canvas;
   \textcolor{keyword}{struct }\{
        \textcolor{keywordtype}{int} r, g, b, a;
   \} colors[6];
   \textcolor{keywordtype}{int} colors\_index;
   \textcolor{keywordtype}{int} frame;
   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   alpha : 1;
   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   smooth : 1;
   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   backface\_culling : 1;
   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   apply\_perspective : 1;
   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   apply\_lighting : 1;
\} App\_Data;

\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *img1\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"/cube1.png"};
\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *img2\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"/enlightenment.png"};
\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *img3\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"/im1.png"};

\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *help\_string =
        \textcolor{stringliteral}{"Valid commands:\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)ta - toggle alpha for maps\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)ts - toggle smooth for maps\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)tc - switch map color\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)tb - toggle backface culling\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)tp - toggle perspective\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)tl - toggle lighting\(\backslash\)n"}
        \textcolor{stringliteral}{"\(\backslash\)th - prints this help\(\backslash\)n"};

\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}
\_anim\_cb(\textcolor{keywordtype}{void} *data)
\{
   App\_Data *ad = data;
   Evas\_Map *m;
   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;
   \textcolor{keywordtype}{int} r, g, b, a;
   \textcolor{keywordtype}{int} win\_w, win\_h, img\_w, img\_h;
   \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;

   \mbox{\hyperlink{group__Evas__Canvas_gadd22b11c786b3b00448ef58550aa55c4}{evas\_output\_size\_get}}(ad->canvas, &win\_w, &win\_h);

   m = \mbox{\hyperlink{group__Evas__Object__Group__Map_ga68a1a6d2dfdd5c9d88a9200eb78cca4e}{evas\_map\_new}}(4);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_gab8575043030c84cd457419e33775d884}{evas\_map\_smooth\_set}}(m, ad->smooth);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_gac40eaffef33cb5a9afe362c9e7759cae}{evas\_map\_alpha\_set}}(m, ad->alpha);

   r = ad->colors[ad->colors\_index].r;
   g = ad->colors[ad->colors\_index].g;
   b = ad->colors[ad->colors\_index].b;
   a = ad->colors[ad->colors\_index].a;
   \mbox{\hyperlink{group__Evas__Object__Group__Map_gafad0e4df4fcd8258fff8c1c1b41c6671}{evas\_map\_util\_points\_color\_set}}(m, r, g, b, a);

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad->canvas, \textcolor{stringliteral}{"obj1"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, &x, &y, &w, &h);

   \mbox{\hyperlink{group__Evas__Object__Group__Map_gaa21f5c7338fbb125b8e50890b3fefb91}{evas\_map\_util\_points\_populate\_from\_object}}(m, o);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga0db530bdf4f619b3c9c4c74c3e87ccac}{evas\_map\_util\_rotate}}(m, 3 * ad->frame, x + (w / 2), y + (h / 2));
   evas\_object\_map\_set(o, m);
   evas\_object\_map\_enable\_set(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad->canvas, \textcolor{stringliteral}{"obj2"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, &x, &y, &w, &h);
   evas\_object\_image\_size\_get(o, &img\_w, &img\_h);

   \mbox{\hyperlink{group__Evas__Object__Group__Map_gaea5fa874b56c188ed001f38ad1d05d7d}{evas\_map\_util\_points\_populate\_from\_object\_full}}(m, o, 100);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 0, 0, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 1, img\_w, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 2, img\_w, img\_h);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 3, 0, img\_h);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga8ec45ba806d347d313556b0d5c5330c8}{evas\_map\_util\_3d\_rotate}}(m, ad->frame * 6, ad->frame * 6, ad->frame * 6,
                           x + (w / 3), y + 10, 0);
   \textcolor{keywordflow}{if} (ad->apply\_lighting)
     \mbox{\hyperlink{group__Evas__Object__Group__Map_gaffb11ebe4dfd914f97cdde7e9f713c97}{evas\_map\_util\_3d\_lighting}}(m, win\_w / 2, win\_h / 2, -100,
                               255, 255, 255, 0, 0, 0);
   evas\_object\_map\_set(o, m);
   evas\_object\_map\_enable\_set(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad->canvas, \textcolor{stringliteral}{"obj3"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, &x, &y, &w, &h);
   evas\_object\_image\_size\_get(o, &img\_w, &img\_h);

   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga535ba6d2e0d57f0854c201507a74826e}{evas\_map\_util\_points\_populate\_from\_geometry}}(m, x, y + (h / 2)
      , w, h, -20);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 0, 0, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 1, img\_w, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 2, img\_w, img\_h);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 3, 0, img\_h);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga8ec45ba806d347d313556b0d5c5330c8}{evas\_map\_util\_3d\_rotate}}(m, 20, ad->frame * 6, 0,
                           x + (w / 2), y + (w / 2), w / 2);

   \textcolor{keywordflow}{if} (ad->apply\_perspective)
     \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2d28d92f2189d8ec098c6dd29da6cdca}{evas\_map\_util\_3d\_perspective}}(m, x + (w / 2), y + (h / 2), 0, 256);
   \textcolor{keywordflow}{if} (ad->apply\_lighting)
     \{
        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} mx, my;
        \mbox{\hyperlink{group__Evas__Canvas_gaaf560a4dc5371742c6177c6f77c9e444}{evas\_pointer\_canvas\_xy\_get}}(ad->canvas, &mx, &my);
        \mbox{\hyperlink{group__Evas__Object__Group__Map_gaffb11ebe4dfd914f97cdde7e9f713c97}{evas\_map\_util\_3d\_lighting}}(m, mx, my, -256,
                                  255, 255, 255, 0, 0, 0);
     \}
   \textcolor{keywordflow}{if} (ad->backface\_culling)
     \{
        \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__Evas__Object__Group__Map_gaf9b0303984e52012014bdade3e8f2ad0}{evas\_map\_util\_clockwise\_get}}(m))
          \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);
        \textcolor{keywordflow}{else}
          \mbox{\hyperlink{group__Evas__Object__Group__Basic_gacc307a0d7bfc9df151fd9ec75808c587}{evas\_object\_hide}}(o);
     \}
   \textcolor{keywordflow}{else}
     \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);
   evas\_object\_map\_set(o, m);
   evas\_object\_map\_enable\_set(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});

   \mbox{\hyperlink{group__Evas__Object__Group__Map_gab3e18d6086e352b121a57c130041bb24}{evas\_map\_free}}(m);

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad->canvas, \textcolor{stringliteral}{"obj4"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, &x, &y, &w, &h);
   evas\_object\_image\_size\_get(o, &img\_w, &img\_h);

   m = \mbox{\hyperlink{group__Evas__Object__Group__Map_ga68a1a6d2dfdd5c9d88a9200eb78cca4e}{evas\_map\_new}}(4);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 0, x, y + h, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 1, x + w, y + h, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 2, win\_w - 10, win\_h - 30, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 3, (win\_w / 2) + 10, win\_h - 30, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 0, 0, img\_h);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 1, img\_w, img\_h);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 2, img\_w, 2 * (img\_h / 3));
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 3, 0, 2 * (img\_h / 3));
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 0, 200, 200, 200, 150);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 1, 200, 200, 200, 150);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 2, 0, 0, 0, 0);
   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 3, 0, 0, 0, 0);
   evas\_object\_map\_set(o, m);
   evas\_object\_map\_enable\_set(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});

   \mbox{\hyperlink{group__Evas__Object__Group__Map_gab3e18d6086e352b121a57c130041bb24}{evas\_map\_free}}(m);

   ad->frame = (ad->frame + 1) % 60;

   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_keydown(\textcolor{keywordtype}{void} *data, \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *e \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} *event)
\{
   App\_Data *ad = data;
   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev = event;
   \textcolor{keywordflow}{switch} (ev->\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}[0])
     \{
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'a'}:
         ad->alpha = !ad->alpha;
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'s'}:
         ad->smooth = !ad->smooth;
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'c'}:
         ad->colors\_index = (ad->colors\_index + 1) % 6;
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'b'}:
         ad->backface\_culling = !ad->backface\_culling;
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'p'}:
         ad->apply\_perspective = !ad->apply\_perspective;
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'l'}:
         ad->apply\_lighting = !ad->apply\_lighting;
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{case} \textcolor{charliteral}{'h'}:
         puts(help\_string);
         \textcolor{keywordflow}{break};
      \textcolor{keywordflow}{default}:
         \textcolor{keywordflow}{break};
     \}
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_objs\_fit(\mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *e)
\{
   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;
   \textcolor{keywordtype}{int} w, h;

   \mbox{\hyperlink{group__Evas__Canvas_gadd22b11c786b3b00448ef58550aa55c4}{evas\_output\_size\_get}}(e, &w, &h);
   w /= 2;
   h /= 2;

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"obj1"});
   evas\_object\_move(o, w / 4, h / 4);
   evas\_object\_resize(o, w / 2, h / 2);

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"obj2"});
   evas\_object\_move(o, 5 * w / 4, h / 4);
   evas\_object\_resize(o, w / 2, h / 2);

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"obj3"});
   evas\_object\_move(o, w / 4, 5 * h / 4);
   evas\_object\_resize(o, w / 2, h / 2);

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"obj4\_source"});
   evas\_object\_move(o, 5 * w / 4, 5 * h / 4);
   evas\_object\_resize(o, w / 2, h / 2);

   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"obj4"});
   evas\_object\_move(o, 5 * w / 4, 5 * h / 4);
   evas\_object\_resize(o, w / 2, h / 2);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_resize(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *e, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o 
      \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *event \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})
\{
   \_objs\_fit(e);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_free(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *e \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} *event \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})
\{
   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bg, *o, *osrc;
   \textcolor{keyword}{static} App\_Data d = \{
        .ee = NULL,
        .canvas = NULL,
        .colors = \{
             \{ 255, 255, 255, 255 \},
             \{ 128, 128, 0, 128 \},
             \{ 255, 0, 0, 255 \},
             \{ 64, 128, 255, 255 \},
             \{ 11, 23, 58, 132 \},
             \{ 0, 0, 0, 255 \}
        \},
        .colors\_index = 0,
        .frame = 0,
        .alpha = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},
        .smooth = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},
        .backface\_culling = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},
        .apply\_perspective = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}},
        .apply\_lighting = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}}
   \};

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

   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} \mbox{\hyperlink{namespaceefl_1_1eina_1_1log__level_a0eec9fe47d243634f680b56a7d768ec7}{error}};

   d.canvas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(d.ee);

   bg = evas\_object\_image\_filled\_add(d.canvas);
   evas\_object\_image\_file\_set(bg, img1\_path, NULL);
   \mbox{\hyperlink{group__Ecore__Evas__Group_gac35627a5c3a766ee42762dbcc9eb733d}{ecore\_evas\_object\_associate}}(d.ee, bg, 0);
   evas\_object\_focus\_set(bg, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});
   evas\_object\_move(bg, 0, 0);
   evas\_object\_resize(bg, WIDTH, HEIGHT);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bg);

   o = \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}}(o, \textcolor{stringliteral}{"obj1"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(o, 128, 0, 200, 200);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);

   o = evas\_object\_image\_filled\_add(d.canvas);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(o, \textcolor{stringliteral}{"obj2"});
   evas\_object\_image\_file\_set(o, img2\_path, NULL);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);

   o = evas\_object\_image\_filled\_add(d.canvas);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(o, \textcolor{stringliteral}{"obj3"});
   evas\_object\_image\_file\_set(o, img2\_path, NULL);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);

   osrc = evas\_object\_image\_filled\_add(d.canvas);
   evas\_object\_image\_file\_set(osrc, img3\_path, NULL);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(osrc, \textcolor{stringliteral}{"obj4\_source"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(osrc);

   o = evas\_object\_image\_filled\_add(d.canvas);
   evas\_object\_image\_source\_set(o, osrc);
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(o, \textcolor{stringliteral}{"obj4"});
   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);

   \_objs\_fit(d.canvas);

   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(bg, 
      \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}}, \_on\_keydown, &d);
   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(bg, 
      \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a554e3341a4ae95e15d42da495f8adb21}{EVAS\_CALLBACK\_RESIZE}}, \_on\_resize, NULL);
   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(bg, 
      \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968aab869b5d534f02f1b3e151e2406a8c24}{EVAS\_CALLBACK\_FREE}}, \_on\_free, NULL);

   \mbox{\hyperlink{group__Ecore__Animator__Group_gaa1e33b8be9117a26918823c535e429ea}{ecore\_animator\_add}}(\_anim\_cb, &d);

   \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;

\mbox{\hyperlink{namespaceefl_1_1eina_1_1log__level_a0eec9fe47d243634f680b56a7d768ec7}{error}}:
   fprintf(stderr, \textcolor{stringliteral}{"you got to have at least one evas engine built and linked"}
                   \textcolor{stringliteral}{" up to ecore-evas for this example to run properly.\(\backslash\)n"});
   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();
   \textcolor{keywordflow}{return} -1;
\}
\end{DoxyCodeInclude}
 