\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{   \mbox{\hyperlink{structEcore__Animator}{Ecore\_Animator}} *anim;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gaaa770b6f2f1395f9eeb0e50e26c3f933}{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_ga6f8d214cd55bc940d7cc62fecd8dbc06}{ecore\_evas\_get}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   bg = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(bg, 300, 400);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   rect = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(rect, 0, 0, 255, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(rect, 50, 50);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(rect);}
\DoxyCodeLine{}
\DoxyCodeLine{   rect2 = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga1b7a9d8e6ce240590c1734da5f3449d2}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(rect2, 0, 55, 0, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(rect2, 50, 50);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{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_gaf05c3472d3ef2e62939ad55f70947177}{ecore\_animator\_timeline\_add}}(5, \_advance\_frame, rect);}
\DoxyCodeLine{}
\DoxyCodeLine{   anim = \mbox{\hyperlink{group__Ecore__Animator__Group_ga0eca52138288075de4487d31dd3942ff}{ecore\_animator\_add}}(\_advance\_frame3, rect2);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga926423e464d7ef71105dd822d90e1187}{ecore\_timer\_add}}(10, \_start\_second\_anim, rect);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga926423e464d7ef71105dd822d90e1187}{ecore\_timer\_add}}(5, \_freeze\_third\_anim, anim);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga926423e464d7ef71105dd822d90e1187}{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_ga9217cf1d90690dbd1960db155d1c7476}{evas\_object\_del}}(rect);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}}(ee);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_gac1b19c4289efbb15193077098a13b30e}{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{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(data, 50 * (1 + frame), 50 * (1 + frame));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(data, 100 * frame, 100 * frame);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{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_gaf05c3472d3ef2e62939ad55f70947177}{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{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(data, 100 -\/ (50 * frame), 100 -\/ (50 * frame));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(data, 100 * (1 -\/ frame), 100 * (1 -\/ frame));}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{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{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{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}
 