In this example we will figure out how to manipulate the animations on an Edje object. After reading this document you will be able to manipulate the frametime, freeze, pause and stop, all animations on an Edje object.

To play with this example you will use the keyboard. Below are listed the keys and what each does.


\begin{DoxyItemize}
\item \textquotesingle{}+\textquotesingle{} Increase the frametime;
\item \textquotesingle{}-\/\textquotesingle{} Decrease the frametime;
\item \textquotesingle{}=\textquotesingle{} Prints the actual frametime and says if the animations is playing;
\item \textquotesingle{}f\textquotesingle{} Freezes the animations in the Edje object;
\item \textquotesingle{}F\textquotesingle{} Freezes the animations in all objects in the running program;
\item \textquotesingle{}t\textquotesingle{} Thaws the animations in the Edje object;
\item \textquotesingle{}T\textquotesingle{} Thaws the animations in all objects in the running program;
\item \textquotesingle{}s\textquotesingle{} Pauses the animations;
\item \textquotesingle{}p\textquotesingle{} Plays the animations previously stopped;
\item \textquotesingle{}a\textquotesingle{} Starts the animation in the Edje object;
\item \textquotesingle{}A\textquotesingle{} Stops the animations in the Edje object;
\end{DoxyItemize}

Now that we\textquotesingle{}ve explained how to use our example, we will see how it is made. Let\textquotesingle{}s start by looking at the piece of code responsible to the actions commented above.  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\_on\_key\_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}} *obj, \textcolor{keywordtype}{void} *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev;}
\DoxyCodeLine{   \textcolor{keywordtype}{double}               ft;}
\DoxyCodeLine{}
\DoxyCodeLine{   ev = (\mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *)event\_info;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"h"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(commands);}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"plus"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        frametime *= 2.0;}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Increasing frametime to: \%f\(\backslash\)n"}, frametime);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_gac9b19ee918546740c0144904393a1acd}{edje\_frametime\_set}}(frametime);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"minus"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        frametime /= 2.0;}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Decreasing frametime to: \%f\(\backslash\)n"}, frametime);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_gac9b19ee918546740c0144904393a1acd}{edje\_frametime\_set}}(frametime);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"equal"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        ft = \mbox{\hyperlink{group__Edje__Object__Animation_gad9593e50d1d5bc847e9b34b104c83935}{edje\_frametime\_get}}();}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Frametime: \%f\(\backslash\)n"}, ft);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (edje\_object\_play\_get(obj))}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Object is playing\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{else}}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Object was paused\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__Edje__Object__Group_ga728d0a0b58f9dc1001d121d4c04657b5}{edje\_object\_animation\_get}}(obj))}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Animation is running\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{else}}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Animation was stopped\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"s"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        edje\_object\_play\_set(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Pausing the object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"p"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        edje\_object\_play\_set(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Playing the object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"f"}))}
\DoxyCodeLine{       printf(\textcolor{stringliteral}{"Freezing object. Count: \%d\(\backslash\)n"}, edje\_object\_freeze(obj));}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"t"}))}
\DoxyCodeLine{       printf(\textcolor{stringliteral}{"Thawing object. Count: \%d\(\backslash\)n"}, edje\_object\_thaw(obj));}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"F"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_ga8f4779b06ca82ab279cecfafe4bf6149}{edje\_freeze}}();}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Freezing all objects\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"T"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_ga1963a864ac582582780dcbf3db3a4e45}{edje\_thaw}}();}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Thawing all objects\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"a"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Group_ga5e3d1908fd5b8a5a96d1b73bf123f789}{edje\_object\_animation\_set}}(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Starting the animation in the Edje object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"A"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Group_ga5e3d1908fd5b8a5a96d1b73bf123f789}{edje\_object\_animation\_set}}(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Stopping the animation in the Edje object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"Escape"}))}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"unhandled key: \%s\(\backslash\)n"}, ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}});}
\DoxyCodeLine{        printf(commands);}
\DoxyCodeLine{     \}}

\end{DoxyCodeInclude}
 \begin{DoxyNote}{Note}
The actions for the keys \textquotesingle{}f\textquotesingle{} and \textquotesingle{}F\textquotesingle{} will have the same effect in our example, just because there is only one object in the running program, The same happens with the keys \textquotesingle{}t\textquotesingle{} and \textquotesingle{}T\textquotesingle{}.
\end{DoxyNote}
As you may have seen these set of functions are pretty easy to handle. The other important part of this example is the E\+DC file. The animations used in the code were created there  
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{      program \{}
\DoxyCodeLine{         signal: "load";}
\DoxyCodeLine{         source: "";}
\DoxyCodeLine{         in: 2.0 0.0;}
\DoxyCodeLine{         after: "animation,state1";}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      program \{}
\DoxyCodeLine{         name: "animation,state1";}
\DoxyCodeLine{         in: 1.0 0.0;}
\DoxyCodeLine{         action: STATE\_SET "invert" 1.0;}
\DoxyCodeLine{         target: "part\_one";}
\DoxyCodeLine{         target: "part\_two";}
\DoxyCodeLine{         target: "part\_three";}
\DoxyCodeLine{         transition: LINEAR 0.6;}
\DoxyCodeLine{         after: "animation,state2";}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      program \{}
\DoxyCodeLine{         name: "animation,state2";}
\DoxyCodeLine{         in: 1.0 0.0;}
\DoxyCodeLine{         action: STATE\_SET "default" 0.0;}
\DoxyCodeLine{         target: "part\_one";}
\DoxyCodeLine{         target: "part\_two";}
\DoxyCodeLine{         target: "part\_three";}
\DoxyCodeLine{         transition: LINEAR 0.6;}
\DoxyCodeLine{         after: "animation,state1";}
\DoxyCodeLine{   \}}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}


The example\textquotesingle{}s window should look like this picture\+:

  
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{edje-animations}}
\end{DoxyImageNoCaption}
 ~\newline
   
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{edje-animations2}}
\end{DoxyImageNoCaption}


The full example follows.


\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 EINA\_UNUSED}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifndef PACKAGE\_DATA\_DIR}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PACKAGE\_DATA\_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{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Edje_8h}{Edje.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WIDTH  (400)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define HEIGHT (300)}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} commands[] = \(\backslash\)}
\DoxyCodeLine{  \textcolor{stringliteral}{"commands are:\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)t+ -\/ increase frametime\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)t-\/ -\/ decrease frametime\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)t= -\/ status of the animation\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)ts -\/ pause\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tp -\/ play\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tf -\/ freeze one object\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tF -\/ freeze all objects\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tt -\/ thaw one object\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tT -\/ thaw all objects\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)ta -\/ start animation of one object\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tA -\/ stop animation of one object\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tEsc -\/ exit\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)th -\/ print help\(\backslash\)n"};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{double} frametime = 1.0 / 30.0; \textcolor{comment}{/* default value */}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_delete\_cb(Ecore\_Evas *ee \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{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_canvas\_resize(Ecore\_Evas *ee)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bg;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *edje\_obj;}
\DoxyCodeLine{   \textcolor{keywordtype}{int}          w;}
\DoxyCodeLine{   \textcolor{keywordtype}{int}          h;}
\DoxyCodeLine{}
\DoxyCodeLine{   bg = \mbox{\hyperlink{group__Ecore__Evas__Group_gae00d4a4feb8aec5de03e464fe21a1d30}{ecore\_evas\_data\_get}}(ee, \textcolor{stringliteral}{"background"});}
\DoxyCodeLine{   edje\_obj = \mbox{\hyperlink{group__Ecore__Evas__Group_gae00d4a4feb8aec5de03e464fe21a1d30}{ecore\_evas\_data\_get}}(ee, \textcolor{stringliteral}{"edje\_obj"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga931aadf4603731e73e8a84e4b14f1493}{ecore\_evas\_geometry\_get}}(ee, NULL, NULL, \&w, \&h);}
\DoxyCodeLine{   evas\_object\_resize(bg, w, h);}
\DoxyCodeLine{   evas\_object\_resize(edje\_obj, w, h);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_key\_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}} *obj, \textcolor{keywordtype}{void} *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev;}
\DoxyCodeLine{   \textcolor{keywordtype}{double}               ft;}
\DoxyCodeLine{}
\DoxyCodeLine{   ev = (\mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *)event\_info;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"h"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(commands);}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"plus"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        frametime *= 2.0;}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Increasing frametime to: \%f\(\backslash\)n"}, frametime);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_gac9b19ee918546740c0144904393a1acd}{edje\_frametime\_set}}(frametime);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"minus"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        frametime /= 2.0;}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Decreasing frametime to: \%f\(\backslash\)n"}, frametime);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_gac9b19ee918546740c0144904393a1acd}{edje\_frametime\_set}}(frametime);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"equal"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        ft = \mbox{\hyperlink{group__Edje__Object__Animation_gad9593e50d1d5bc847e9b34b104c83935}{edje\_frametime\_get}}();}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Frametime: \%f\(\backslash\)n"}, ft);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (edje\_object\_play\_get(obj))}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Object is playing\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{else}}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Object was paused\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (\mbox{\hyperlink{group__Edje__Object__Group_ga728d0a0b58f9dc1001d121d4c04657b5}{edje\_object\_animation\_get}}(obj))}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Animation is running\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{else}}
\DoxyCodeLine{          printf(\textcolor{stringliteral}{"Animation was stopped\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"s"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        edje\_object\_play\_set(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Pausing the object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"p"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        edje\_object\_play\_set(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Playing the object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"f"}))}
\DoxyCodeLine{       printf(\textcolor{stringliteral}{"Freezing object. Count: \%d\(\backslash\)n"}, edje\_object\_freeze(obj));}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"t"}))}
\DoxyCodeLine{       printf(\textcolor{stringliteral}{"Thawing object. Count: \%d\(\backslash\)n"}, edje\_object\_thaw(obj));}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"F"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_ga8f4779b06ca82ab279cecfafe4bf6149}{edje\_freeze}}();}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Freezing all objects\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"T"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Animation_ga1963a864ac582582780dcbf3db3a4e45}{edje\_thaw}}();}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Thawing all objects\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"a"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Group_ga5e3d1908fd5b8a5a96d1b73bf123f789}{edje\_object\_animation\_set}}(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Starting the animation in the Edje object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"A"}))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Edje__Object__Group_ga5e3d1908fd5b8a5a96d1b73bf123f789}{edje\_object\_animation\_set}}(obj, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Stopping the animation in the Edje object\(\backslash\)n"});}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"Escape"}))}
\DoxyCodeLine{     \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"unhandled key: \%s\(\backslash\)n"}, ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}});}
\DoxyCodeLine{        printf(commands);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{int} argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{char} *argv[] \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keyword}{const} \textcolor{keywordtype}{char}  *edje\_file = PACKAGE\_DATA\_DIR\textcolor{stringliteral}{"/animations.edj"};}
\DoxyCodeLine{   Ecore\_Evas  *ee;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *bg;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *edje\_obj;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}())}
\DoxyCodeLine{     \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Edje__General__Group_ga1c9c6594f38023c29fbfb2d0c8c675db}{edje\_init}}())}
\DoxyCodeLine{     \textcolor{keywordflow}{goto} shutdown\_ecore\_evas;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* this will give you a window with an Evas canvas under the first}}
\DoxyCodeLine{\textcolor{comment}{    * engine available */}}
\DoxyCodeLine{   ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}}(NULL, 0, 0, WIDTH, HEIGHT, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!ee) \textcolor{keywordflow}{goto} shutdown\_edje;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga3d478e975e2101b9b821ef24baf3dd9e}{ecore\_evas\_callback\_delete\_request\_set}}(ee, \_on\_delete\_cb);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gaac67f679c9027059a34519fbdea360df}{ecore\_evas\_callback\_resize\_set}}(ee, \_on\_canvas\_resize);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga3b2832e0373bbafae2bb7143618535c1}{ecore\_evas\_title\_set}}(ee, \textcolor{stringliteral}{"Edje Animations Example"});}
\DoxyCodeLine{}
\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{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(bg, 255, 255, 255, 255); \textcolor{comment}{/* white bg */}}
\DoxyCodeLine{   evas\_object\_move(bg, 0, 0); \textcolor{comment}{/* at canvas' origin */}}
\DoxyCodeLine{   evas\_object\_resize(bg, WIDTH, HEIGHT); \textcolor{comment}{/* covers full canvas */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bg);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gaa86c5abd200a02711aced53d27b9ddb2}{ecore\_evas\_data\_set}}(ee, \textcolor{stringliteral}{"background"}, bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   edje\_obj = edje\_object\_add(evas);}
\DoxyCodeLine{}
\DoxyCodeLine{   edje\_object\_file\_set(edje\_obj, edje\_file, \textcolor{stringliteral}{"animations\_group"});}
\DoxyCodeLine{   evas\_object\_move(edje\_obj, 0, 0);}
\DoxyCodeLine{   evas\_object\_resize(edje\_obj, WIDTH, HEIGHT);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(edje\_obj);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gaa86c5abd200a02711aced53d27b9ddb2}{ecore\_evas\_data\_set}}(ee, \textcolor{stringliteral}{"edje\_obj"}, edje\_obj);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(edje\_obj, \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}},}
\DoxyCodeLine{                                  \_on\_key\_down, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga4405e118e1fb762987af1269b6848db5}{evas\_object\_focus\_set}}(edje\_obj, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   printf(commands);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}}(ee);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Edje__General__Group_ga01041f6702f2d81bf10c3e41899805cb}{edje\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} EXIT\_SUCCESS;}
\DoxyCodeLine{}
\DoxyCodeLine{ shutdown\_edje:}
\DoxyCodeLine{   \mbox{\hyperlink{group__Edje__General__Group_ga01041f6702f2d81bf10c3e41899805cb}{edje\_shutdown}}();}
\DoxyCodeLine{ shutdown\_ecore\_evas:}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}
 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{collections \{}
\DoxyCodeLine{   group \{}
\DoxyCodeLine{      name: "animations\_group";}
\DoxyCodeLine{      min: 100 80;}
\DoxyCodeLine{}
\DoxyCodeLine{      parts \{}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "part\_one";}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{            scale: 1;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               min: 50 50;}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               color: 0 0 0 255; /* black */}
\DoxyCodeLine{               rel1.relative: 0.0 0.0;}
\DoxyCodeLine{               rel2.relative: 0.33 1.0;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "invert" 1.0;}
\DoxyCodeLine{               inherit: "default" 0.0;}
\DoxyCodeLine{               rel1.relative: 0.0 0.0;}
\DoxyCodeLine{               rel2.relative: 1.0 0.33;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "part\_two";}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{            scale: 1;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               min: 50 50;}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               color: 255 255 0 255; /* yellow */}
\DoxyCodeLine{               rel1.relative: 0.33 0.0;}
\DoxyCodeLine{               rel2.relative: 0.66 1.0;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "invert" 1.0;}
\DoxyCodeLine{               inherit: "default" 0.0;}
\DoxyCodeLine{               rel1.relative: 0.0 0.66;}
\DoxyCodeLine{               rel2.relative: 1.0 1.0;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{}
\DoxyCodeLine{         part \{}
\DoxyCodeLine{            name: "part\_three";}
\DoxyCodeLine{            type: RECT;}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "default" 0.0;}
\DoxyCodeLine{               color: 255 0 0 255; /* red */}
\DoxyCodeLine{               rel1.relative: 0.66 0.0;}
\DoxyCodeLine{               rel2.relative: 1.0 1.0;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{            description \{}
\DoxyCodeLine{               state: "invert" 1.0;}
\DoxyCodeLine{               inherit: "default" 0.0;}
\DoxyCodeLine{               rel1.relative: 0.0 0.33;}
\DoxyCodeLine{               rel2.relative: 1.0 0.66;}
\DoxyCodeLine{            \}}
\DoxyCodeLine{         \}}
\DoxyCodeLine{      \}}
\DoxyCodeLine{}
\DoxyCodeLine{      program \{}
\DoxyCodeLine{         signal: "load";}
\DoxyCodeLine{         source: "";}
\DoxyCodeLine{         in: 2.0 0.0;}
\DoxyCodeLine{         after: "animation,state1";}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      program \{}
\DoxyCodeLine{         name: "animation,state1";}
\DoxyCodeLine{         in: 1.0 0.0;}
\DoxyCodeLine{         action: STATE\_SET "invert" 1.0;}
\DoxyCodeLine{         target: "part\_one";}
\DoxyCodeLine{         target: "part\_two";}
\DoxyCodeLine{         target: "part\_three";}
\DoxyCodeLine{         transition: LINEAR 0.6;}
\DoxyCodeLine{         after: "animation,state2";}
\DoxyCodeLine{      \}}
\DoxyCodeLine{      program \{}
\DoxyCodeLine{         name: "animation,state2";}
\DoxyCodeLine{         in: 1.0 0.0;}
\DoxyCodeLine{         action: STATE\_SET "default" 0.0;}
\DoxyCodeLine{         target: "part\_one";}
\DoxyCodeLine{         target: "part\_two";}
\DoxyCodeLine{         target: "part\_three";}
\DoxyCodeLine{         transition: LINEAR 0.6;}
\DoxyCodeLine{         after: "animation,state1";}
\DoxyCodeLine{   \}}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}


To compile use this command\+: \begin{DoxyVerb}* gcc -o edje-animations edje-animations.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\"
* -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
* -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
* `pkg-config --cflags --libs evas ecore ecore-evas edje`
*
* edje_cc animations.edc
* \end{DoxyVerb}
 