\hypertarget{evas-map-utils_8c-example}{}\doxysection{evas-\/map-\/utils.\+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{\textcolor{preprocessor}{\#include <math.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include "{}evas-\/common.h"{}}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WIDTH  480}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define HEIGHT 480}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{typedef} \textcolor{keyword}{struct}}
\DoxyCodeLine{\{}
\DoxyCodeLine{   Ecore\_Evas *ee;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}       *canvas;}
\DoxyCodeLine{   \textcolor{keyword}{struct }\{}
\DoxyCodeLine{        \textcolor{keywordtype}{int} r, g, b, a;}
\DoxyCodeLine{   \} colors[6];}
\DoxyCodeLine{   \textcolor{keywordtype}{int} colors\_index;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} frame;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   alpha : 1;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   smooth : 1;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   backface\_culling : 1;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   apply\_perspective : 1;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}   apply\_lighting : 1;}
\DoxyCodeLine{\} App\_Data;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *img1\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"{}/cube1.png"{}};}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *img2\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"{}/enlightenment.png"{}};}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *img3\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"{}/im1.png"{}};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *help\_string =}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}Valid commands:\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)ta -\/ toggle alpha for maps\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)ts -\/ toggle smooth for maps\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)tc -\/ switch map color\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)tb -\/ toggle backface culling\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)tp -\/ toggle perspective\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)tl -\/ toggle lighting\(\backslash\)n"{}}}
\DoxyCodeLine{        \textcolor{stringliteral}{"{}\(\backslash\)th -\/ prints this help\(\backslash\)n"{}};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_anim\_cb(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   App\_Data *ad = data;}
\DoxyCodeLine{   Evas\_Map *m;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} r, g, b, a;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} win\_w, win\_h, img\_w, img\_h;}
\DoxyCodeLine{   \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_gadd22b11c786b3b00448ef58550aa55c4}{evas\_output\_size\_get}}(ad-\/>canvas, \&win\_w, \&win\_h);}
\DoxyCodeLine{}
\DoxyCodeLine{   m = \mbox{\hyperlink{group__Evas__Object__Group__Map_ga68a1a6d2dfdd5c9d88a9200eb78cca4e}{evas\_map\_new}}(4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gab8575043030c84cd457419e33775d884}{evas\_map\_smooth\_set}}(m, ad-\/>smooth);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gac40eaffef33cb5a9afe362c9e7759cae}{evas\_map\_alpha\_set}}(m, ad-\/>alpha);}
\DoxyCodeLine{}
\DoxyCodeLine{   r = ad-\/>colors[ad-\/>colors\_index].r;}
\DoxyCodeLine{   g = ad-\/>colors[ad-\/>colors\_index].g;}
\DoxyCodeLine{   b = ad-\/>colors[ad-\/>colors\_index].b;}
\DoxyCodeLine{   a = ad-\/>colors[ad-\/>colors\_index].a;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gafad0e4df4fcd8258fff8c1c1b41c6671}{evas\_map\_util\_points\_color\_set}}(m, r, g, b, a);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad-\/>canvas, \textcolor{stringliteral}{"{}obj1"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gaa21f5c7338fbb125b8e50890b3fefb91}{evas\_map\_util\_points\_populate\_from\_object}}(m, o);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga0db530bdf4f619b3c9c4c74c3e87ccac}{evas\_map\_util\_rotate}}(m, 3 * ad-\/>frame, x + (w / 2), y + (h / 2));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga78db7f5391fb317ac8787975c32e4266}{evas\_object\_map\_set}}(o, m);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga80bc36afa9fa3d0118d32ca4402f0fe1}{evas\_object\_map\_enable\_set}}(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad-\/>canvas, \textcolor{stringliteral}{"{}obj2"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga6307d5c3560528d7525a6c2ed16360ed}{evas\_object\_image\_size\_get}}(o, \&img\_w, \&img\_h);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gaea5fa874b56c188ed001f38ad1d05d7d}{evas\_map\_util\_points\_populate\_from\_object\_full}}(m, o, 100);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 0, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 1, img\_w, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 2, img\_w, img\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 3, 0, img\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga8ec45ba806d347d313556b0d5c5330c8}{evas\_map\_util\_3d\_rotate}}(m, ad-\/>frame * 6, ad-\/>frame * 6, ad-\/>frame * 6,}
\DoxyCodeLine{                           x + (w / 3), y + 10, 0);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (ad-\/>apply\_lighting)}
\DoxyCodeLine{     \mbox{\hyperlink{group__Evas__Object__Group__Map_gaffb11ebe4dfd914f97cdde7e9f713c97}{evas\_map\_util\_3d\_lighting}}(m, win\_w / 2, win\_h / 2, -\/100,}
\DoxyCodeLine{                               255, 255, 255, 0, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga78db7f5391fb317ac8787975c32e4266}{evas\_object\_map\_set}}(o, m);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga80bc36afa9fa3d0118d32ca4402f0fe1}{evas\_object\_map\_enable\_set}}(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad-\/>canvas, \textcolor{stringliteral}{"{}obj3"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga6307d5c3560528d7525a6c2ed16360ed}{evas\_object\_image\_size\_get}}(o, \&img\_w, \&img\_h);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga535ba6d2e0d57f0854c201507a74826e}{evas\_map\_util\_points\_populate\_from\_geometry}}(m, x, y + (h / 2), w, h, -\/20);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 0, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 1, img\_w, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 2, img\_w, img\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 3, 0, img\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga8ec45ba806d347d313556b0d5c5330c8}{evas\_map\_util\_3d\_rotate}}(m, 20, ad-\/>frame * 6, 0,}
\DoxyCodeLine{                           x + (w / 2), y + (w / 2), w / 2);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (ad-\/>apply\_perspective)}
\DoxyCodeLine{     \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2d28d92f2189d8ec098c6dd29da6cdca}{evas\_map\_util\_3d\_perspective}}(m, x + (w / 2), y + (h / 2), 0, 256);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (ad-\/>apply\_lighting)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} mx, my;}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Canvas_gaaf560a4dc5371742c6177c6f77c9e444}{evas\_pointer\_canvas\_xy\_get}}(ad-\/>canvas, \&mx, \&my);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group__Map_gaffb11ebe4dfd914f97cdde7e9f713c97}{evas\_map\_util\_3d\_lighting}}(m, mx, my, -\/256,}
\DoxyCodeLine{                                  255, 255, 255, 0, 0, 0);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (ad-\/>backface\_culling)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__Evas__Object__Group__Map_gaf9b0303984e52012014bdade3e8f2ad0}{evas\_map\_util\_clockwise\_get}}(m))}
\DoxyCodeLine{          \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{        \textcolor{keywordflow}{else}}
\DoxyCodeLine{          \mbox{\hyperlink{group__Evas__Object__Group__Basic_gacc307a0d7bfc9df151fd9ec75808c587}{evas\_object\_hide}}(o);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga78db7f5391fb317ac8787975c32e4266}{evas\_object\_map\_set}}(o, m);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga80bc36afa9fa3d0118d32ca4402f0fe1}{evas\_object\_map\_enable\_set}}(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gab3e18d6086e352b121a57c130041bb24}{evas\_map\_free}}(m);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(ad-\/>canvas, \textcolor{stringliteral}{"{}obj4"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6f52fab1a96dc58c85ee481d84bac871}{evas\_object\_geometry\_get}}(o, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga6307d5c3560528d7525a6c2ed16360ed}{evas\_object\_image\_size\_get}}(o, \&img\_w, \&img\_h);}
\DoxyCodeLine{}
\DoxyCodeLine{   m = \mbox{\hyperlink{group__Evas__Object__Group__Map_ga68a1a6d2dfdd5c9d88a9200eb78cca4e}{evas\_map\_new}}(4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 0, x, y + h, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 1, x + w, y + h, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 2, win\_w -\/ 10, win\_h -\/ 30, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga46ab921df9fe617d6c241056784217b7}{evas\_map\_point\_coord\_set}}(m, 3, (win\_w / 2) + 10, win\_h -\/ 30, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 0, 0, img\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 1, img\_w, img\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 2, img\_w, 2 * (img\_h / 3));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2f1b4d78f055c1752ab254a7ebce13b3}{evas\_map\_point\_image\_uv\_set}}(m, 3, 0, 2 * (img\_h / 3));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 0, 200, 200, 200, 150);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 1, 200, 200, 200, 150);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 2, 0, 0, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_ga2ba9f77377f7cc1a79deecb938c8289c}{evas\_map\_point\_color\_set}}(m, 3, 0, 0, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga78db7f5391fb317ac8787975c32e4266}{evas\_object\_map\_set}}(o, m);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga80bc36afa9fa3d0118d32ca4402f0fe1}{evas\_object\_map\_enable\_set}}(o, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Map_gab3e18d6086e352b121a57c130041bb24}{evas\_map\_free}}(m);}
\DoxyCodeLine{}
\DoxyCodeLine{   ad-\/>frame = (ad-\/>frame + 1) \% 60;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_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)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   App\_Data *ad = data;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev = event;}
\DoxyCodeLine{   \textcolor{keywordflow}{switch} (ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}[0])}
\DoxyCodeLine{     \{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'a'}:}
\DoxyCodeLine{         ad-\/>alpha = !ad-\/>alpha;}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'s'}:}
\DoxyCodeLine{         ad-\/>smooth = !ad-\/>smooth;}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'c'}:}
\DoxyCodeLine{         ad-\/>colors\_index = (ad-\/>colors\_index + 1) \% 6;}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'b'}:}
\DoxyCodeLine{         ad-\/>backface\_culling = !ad-\/>backface\_culling;}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'p'}:}
\DoxyCodeLine{         ad-\/>apply\_perspective = !ad-\/>apply\_perspective;}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'l'}:}
\DoxyCodeLine{         ad-\/>apply\_lighting = !ad-\/>apply\_lighting;}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \textcolor{charliteral}{'h'}:}
\DoxyCodeLine{         puts(help\_string);}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{      \textcolor{keywordflow}{default}:}
\DoxyCodeLine{         \textcolor{keywordflow}{break};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_objs\_fit(\mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *e)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_gadd22b11c786b3b00448ef58550aa55c4}{evas\_output\_size\_get}}(e, \&w, \&h);}
\DoxyCodeLine{   w /= 2;}
\DoxyCodeLine{   h /= 2;}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"{}obj1"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, w / 4, h / 4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, w / 2, h / 2);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"{}obj2"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, 5 * w / 4, h / 4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, w / 2, h / 2);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"{}obj3"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, w / 4, 5 * h / 4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, w / 2, h / 2);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"{}obj4\_source"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, 5 * w / 4, 5 * h / 4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, w / 2, h / 2);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Canvas_gada08589c83deabc061fa3e6740ebae35}{evas\_object\_name\_find}}(e, \textcolor{stringliteral}{"{}obj4"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, 5 * w / 4, 5 * h / 4);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, w / 2, h / 2);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_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}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \_objs\_fit(e);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_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}})}
\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{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bg, *o, *osrc;}
\DoxyCodeLine{   \textcolor{keyword}{static} App\_Data d = \{}
\DoxyCodeLine{        .ee = NULL,}
\DoxyCodeLine{        .canvas = NULL,}
\DoxyCodeLine{        .colors = \{}
\DoxyCodeLine{             \{ 255, 255, 255, 255 \},}
\DoxyCodeLine{             \{ 128, 128, 0, 128 \},}
\DoxyCodeLine{             \{ 255, 0, 0, 255 \},}
\DoxyCodeLine{             \{ 64, 128, 255, 255 \},}
\DoxyCodeLine{             \{ 11, 23, 58, 132 \},}
\DoxyCodeLine{             \{ 0, 0, 0, 255 \}}
\DoxyCodeLine{        \},}
\DoxyCodeLine{        .colors\_index = 0,}
\DoxyCodeLine{        .frame = 0,}
\DoxyCodeLine{        .alpha = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},}
\DoxyCodeLine{        .smooth = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},}
\DoxyCodeLine{        .backface\_culling = \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},}
\DoxyCodeLine{        .apply\_perspective = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}},}
\DoxyCodeLine{        .apply\_lighting = \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}}}
\DoxyCodeLine{   \};}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}())}
\DoxyCodeLine{     \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{}
\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{   d.canvas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(d.ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   bg = \mbox{\hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(bg, img1\_path, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gac35627a5c3a766ee42762dbcc9eb733d}{ecore\_evas\_object\_associate}}(d.ee, bg, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga4405e118e1fb762987af1269b6848db5}{evas\_object\_focus\_set}}(bg, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(bg, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(bg, WIDTH, HEIGHT);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \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}}(o, \textcolor{stringliteral}{"{}obj1"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(o, 128, 0, 200, 200);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(o, \textcolor{stringliteral}{"{}obj2"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(o, img2\_path, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(o, \textcolor{stringliteral}{"{}obj3"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(o, img2\_path, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   osrc = \mbox{\hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(osrc, img3\_path, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(osrc, \textcolor{stringliteral}{"{}obj4\_source"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(osrc);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}}(d.canvas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gabbe4dbd54b10e7e8200547ae91425acf}{evas\_object\_image\_source\_set}}(o, osrc);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga88bfcce07ad3bcef31687e29075ae2d2}{evas\_object\_name\_set}}(o, \textcolor{stringliteral}{"{}obj4"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   \_objs\_fit(d.canvas);}
\DoxyCodeLine{}
\DoxyCodeLine{   \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);}
\DoxyCodeLine{   \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);}
\DoxyCodeLine{   \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);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_gaa1e33b8be9117a26918823c535e429ea}{ecore\_animator\_add}}(\_anim\_cb, \&d);}
\DoxyCodeLine{}
\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{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 