\hypertarget{ecore_animator_example_8c-example}{}\doxysection{ecore\+\_\+animator\+\_\+example.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc -\/g -\/Wall -\/o ecore\_animator\_example ecore\_animator\_example.c `pkg-\/config -\/-\/cflags -\/-\/libs evas ecore-\/evas ecore`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} \_advance\_frame(\textcolor{keywordtype}{void} *data, \textcolor{keywordtype}{double} pos);}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} \_advance\_frame2(\textcolor{keywordtype}{void} *data, \textcolor{keywordtype}{double} pos);}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} \_advance\_frame3(\textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} \_start\_second\_anim(\textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} \_freeze\_third\_anim(\textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} \_thaw\_third\_anim(\textcolor{keywordtype}{void} *data);}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *rect, *bg, *rect2;}
\DoxyCodeLine{   Ecore\_Evas *ee;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *evas;}
\DoxyCodeLine{   Ecore\_Animator *anim;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}}(NULL, 0, 0, 300, 400, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(ee);}
\DoxyCodeLine{   evas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   bg = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{   evas\_object\_resize(bg, 300, 400);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   rect = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(rect, 0, 0, 255, 255);}
\DoxyCodeLine{   evas\_object\_resize(rect, 50, 50);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(rect);}
\DoxyCodeLine{}
\DoxyCodeLine{   rect2 = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(rect2, 0, 55, 0, 255);}
\DoxyCodeLine{   evas\_object\_resize(rect2, 50, 50);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(rect2);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_ga2c7aa7e621cd68562519066ad87a3fa1}{ecore\_animator\_frametime\_set}}(1. / 50);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_ga523a0e9716bcc6573eb9f4b310067ed1}{ecore\_animator\_timeline\_add}}(5, \_advance\_frame, rect);}
\DoxyCodeLine{}
\DoxyCodeLine{   anim = \mbox{\hyperlink{group__Ecore__Animator__Group_gaa1e33b8be9117a26918823c535e429ea}{ecore\_animator\_add}}(\_advance\_frame3, rect2);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}}(10, \_start\_second\_anim, rect);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}}(5, \_freeze\_third\_anim, anim);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}}(10, \_thaw\_third\_anim, anim);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}}(rect);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}}(ee);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_gaadfa590f3c1638035393ed9d7aa10e2f}{ecore\_animator\_del}}(anim);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_advance\_frame(\textcolor{keywordtype}{void} *data, \textcolor{keywordtype}{double} pos)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{double} frame = pos;}
\DoxyCodeLine{   frame = \mbox{\hyperlink{group__Ecore__Animator__Group_ga5d4c42b9fdb22748943efa9ae6ba0a47}{ecore\_animator\_pos\_map}}(pos, \mbox{\hyperlink{group__Ecore__Animator__Group_gga1047011623d9e2ea31b7e5678b451016ac8cbb42f58cabb5db04f52cede85dacd}{ECORE\_POS\_MAP\_SPRING}}, 1.2, 15);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(data, 50 * (1 + frame), 50 * (1 + frame));}
\DoxyCodeLine{   evas\_object\_move(data, 100 * frame, 100 * frame);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(data, 255 * frame, 0, 255 * (1 -\/ frame), 255);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_start\_second\_anim(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_ga2c7aa7e621cd68562519066ad87a3fa1}{ecore\_animator\_frametime\_set}}(1. / 10);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_ga523a0e9716bcc6573eb9f4b310067ed1}{ecore\_animator\_timeline\_add}}(20, \_advance\_frame2, data);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gae0c653baad8836232c0dc27f91f875d6}{ECORE\_CALLBACK\_CANCEL}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_advance\_frame2(\textcolor{keywordtype}{void} *data, \textcolor{keywordtype}{double} pos)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{double} frame = pos;}
\DoxyCodeLine{   frame = \mbox{\hyperlink{group__Ecore__Animator__Group_ga5d4c42b9fdb22748943efa9ae6ba0a47}{ecore\_animator\_pos\_map}}(pos, \mbox{\hyperlink{group__Ecore__Animator__Group_gga1047011623d9e2ea31b7e5678b451016a2eb0a9af74a33bf88fc19d350f703f5e}{ECORE\_POS\_MAP\_BOUNCE}}, 1.2, 50);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(data, 100 -\/ (50 * frame), 100 -\/ (50 * frame));}
\DoxyCodeLine{   evas\_object\_move(data, 100 * (1 -\/ frame), 100 * (1 -\/ frame));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(data, 255 * (1 -\/ frame), 0, 255 * frame, 255);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_advance\_frame3(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keyword}{static} \textcolor{keywordtype}{int} x = 0;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (x >= 250)}
\DoxyCodeLine{     x = 0;}
\DoxyCodeLine{   evas\_object\_move(data, ++x, 350);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga1ee9db07f9a46a8b20fb83e1c6dbed09}{ECORE\_CALLBACK\_RENEW}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_freeze\_third\_anim(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_gaff76e892f893610f9360aa6fddd810ef}{ecore\_animator\_freeze}}(data);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gae0c653baad8836232c0dc27f91f875d6}{ECORE\_CALLBACK\_CANCEL}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_thaw\_third\_anim(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_ga11c89906f136e3132e23527e412ccc69}{ecore\_animator\_thaw}}(data);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gae0c653baad8836232c0dc27f91f875d6}{ECORE\_CALLBACK\_CANCEL}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\end{DoxyCodeInclude}
 