\chapter{Perspective example}
\hypertarget{tutorial_edje_perspective}{}\label{tutorial_edje_perspective}\index{Perspective example@{Perspective example}}
This example demonstrates how someone can set a perspective to be used by an Edje object, but setting a global perspective. The API for setting a perspective for just one Edje object is almost the same and it\textquotesingle{}s trivial, so we are not doing that on this example.

Let\textquotesingle{}s go first to the main function, where we start creating our objects and loading the theme. We also set some variables that will be used globally in our program\+:

 
\begin{DoxyCodeInclude}{0}
\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}{"{}/perspective.edj"{}};}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ \ app;}
\DoxyCodeLine{\ \ \ Ecore\_Evas\ \ *ee;}
\DoxyCodeLine{\ \ \ Evas\ \ \ \ \ \ \ \ *evas;}
\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{\ \ \ \mbox{\hyperlink{group__Edje__Object__Animation_gac9b19ee918546740c0144904393a1acd}{edje\_frametime\_set}}(1.0\ /\ 60.0);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ this\ will\ give\ you\ a\ window\ with\ an\ Evas\ canvas\ under\ the\ first}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ engine\ available\ */}}
\DoxyCodeLine{\ \ \ app.animating\ =\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\ \ \ app.x\ =\ 0;}
\DoxyCodeLine{\ \ \ app.y\ =\ 0;}
\DoxyCodeLine{\ \ \ app.focal\ =\ 50;}

\end{DoxyCodeInclude}
 A boolean is used to indicate that we are animating.

We also set the {\ttfamily app.\+x} and {\ttfamily app.\+y} to (0, 0) because the original position of our text + rectangle part will be on top left. This is a convention that we are using in this example, and setting x, y to 1, 1 would mean bottom right. We do this to later define the name of the signals that we are sending to the theme.

After this, some boilerplate code to load the theme\+:


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ee\ =\ \mbox{\hyperlink{group__Ecore__Evas__Group_gaaa770b6f2f1395f9eeb0e50e26c3f933}{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_ga3680b5c89157167318192157a5d24ec4}{ecore\_evas\_callback\_destroy\_set}}(ee,\ \_on\_destroy);}
\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\ Perspective\ Example"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Evas__Group_gaa86c5abd200a02711aced53d27b9ddb2}{ecore\_evas\_data\_set}}(ee,\ \textcolor{stringliteral}{"{}app"{}},\ \&app);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ evas\ =\ \mbox{\hyperlink{group__Ecore__Evas__Group_ga6f8d214cd55bc940d7cc62fecd8dbc06}{ecore\_evas\_get}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.bg\ =\ \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}}(app.bg,\ 255,\ 255,\ 255,\ 255);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(app.bg,\ WIDTH,\ HEIGHT);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gac6d65f8896ab59780553676d0017c2ef}{evas\_object\_focus\_set}}(app.bg,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(app.bg);}

\end{DoxyCodeInclude}
 Now we are going to setup a callback to tell us that the animation has ended. We do this just to avoid sending signals to the theme while it\textquotesingle{}s animating.


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(app.bg,\ \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}},\ \_on\_bg\_key\_down,\ \&app);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.edje\_obj\ =\ \mbox{\hyperlink{group__Edje__Object__Group_ga5548cef32568746f40df9bd0be339bea}{edje\_object\_add}}(evas);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gaec1edd24b5bd8e82823759a8dddc1996}{edje\_object\_file\_set}}(app.edje\_obj,\ edje\_file,\ \textcolor{stringliteral}{"{}example/group"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(app.edje\_obj,\ 0,\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(app.edje\_obj,\ WIDTH,\ HEIGHT);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(app.edje\_obj);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gab7a1542309f1ffdc76c07f280842d4b1}{edje\_object\_signal\_callback\_add}}(app.edje\_obj,\ \textcolor{stringliteral}{"{}animation,end"{}},\ \textcolor{stringliteral}{"{}"{}},\ \_animation\_end\_cb,\ \&app);}

\end{DoxyCodeInclude}
 Finally, let\textquotesingle{}s create our perspective object, define its position, focal distance and z plane position, and set it as global\+:


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.ps\ =\ \mbox{\hyperlink{group__Edje__Perspective_gab9535d9102c796181d633192b63bf25c}{edje\_perspective\_new}}(evas);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Perspective_gaeee5dfe8b3f428583e4f8a846f0b0d15}{edje\_perspective\_set}}(app.ps,\ 240,\ 160,\ 0,\ app.focal);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Perspective_ga9e560272fb6b954a9e99eaad72a6755f}{edje\_perspective\_global\_set}}(app.ps,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}

\end{DoxyCodeInclude}
 Notice that if we wanted to set it just to our edje object, instead of setting the perspective as global to the entire canvas, we could just use \doxylink{group__Edje__Perspective_ga0087812fb067751f8b3ce1581575cafc}{edje\+\_\+object\+\_\+perspective\+\_\+set()} instead of \doxylink{group__Edje__Perspective_ga9e560272fb6b954a9e99eaad72a6755f}{edje\+\_\+perspective\+\_\+global\+\_\+set()}. The rest of the code would be exactly the same.

Now, let\textquotesingle{}s take a look at what we do in our callbacks.

The callback for key\+\_\+down is converting the arrow keys to a signal that represents where we want our text and rectangle moved to. It does that by using the following function\+:

 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\_part\_move(\textcolor{keyword}{struct}\ \_App\ *app,\ \textcolor{keywordtype}{int}\ dx,\ \textcolor{keywordtype}{int}\ dy)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{char}\ emission[64];}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>animating)}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app-\/>x\ +=\ dx;}
\DoxyCodeLine{\ \ \ app-\/>y\ +=\ dy;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>x\ >\ 1)}
\DoxyCodeLine{\ \ \ \ \ app-\/>x\ =\ 1;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>x\ <\ 0)}
\DoxyCodeLine{\ \ \ \ \ app-\/>x\ =\ 0;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>y\ >\ 1)}
\DoxyCodeLine{\ \ \ \ \ app-\/>y\ =\ 1;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>y\ <\ 0)}
\DoxyCodeLine{\ \ \ \ \ app-\/>y\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ snprintf(emission,\ \textcolor{keyword}{sizeof}(emission),\ \textcolor{stringliteral}{"{}move,\%d,\%d"{}},\ app-\/>x,\ app-\/>y);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Group_ga2a6422befdfb9c9757414122ff23cb8e}{edje\_object\_signal\_emit}}(app-\/>edje\_obj,\ emission,\ \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{\ \ \ app-\/>animating\ =\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 Notice that, after sending the signal to the Edje object, we set our boolean to store that we are animating now. It will only be unset when we receive a signal from the theme that the animation has ended.

Now, on the key\+\_\+down code, we just call this function when the arrows or "{}\+Pg\+Up"{} or "{}\+Pg\+Down"{} keys are pressed\+:


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_bg\_key\_down(\textcolor{keywordtype}{void}\ *data,\ Evas\ *e\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ Evas\_Object\ *o\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ *app\ =\ data;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}}\ *ev\ =\ 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{comment}{//\ just\ moving\ the\ part\ and\ text}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Down"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 0,\ 1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Up"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 0,\ -\/1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Left"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ -\/1,\ 0);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Right"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 1,\ 0);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Prior"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ -\/1,\ -\/1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Next"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 1,\ 1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//\ adjusting\ the\ perspective\ focal\ point\ distance}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}KP\_Add"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ app-\/>focal\ +=\ 5;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Perspective_gaeee5dfe8b3f428583e4f8a846f0b0d15}{edje\_perspective\_set}}(app-\/>ps,\ 240,\ 160,\ 0,\ app-\/>focal);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gadc7c4c5fe418b85f56a8f545637f4589}{edje\_object\_calc\_force}}(app-\/>edje\_obj);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}KP\_Subtract"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ app-\/>focal\ -\/=\ 5;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (app-\/>focal\ <\ 5)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ app-\/>focal\ =\ 5;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Perspective_gaeee5dfe8b3f428583e4f8a846f0b0d15}{edje\_perspective\_set}}(app-\/>ps,\ 240,\ 160,\ 0,\ app-\/>focal);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gadc7c4c5fe418b85f56a8f545637f4589}{edje\_object\_calc\_force}}(app-\/>edje\_obj);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//\ exiting}}
\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}
 Notice that we also do something else when the numeric keyboard "{}+"{} and "{}-\/"{} keys are pressed. We change the focal distance of our global perspective, and that will affect the part that has a map rotation applied to it, with perspective enabled. We also need to call \doxylink{group__Edje__Object__Group_gadc7c4c5fe418b85f56a8f545637f4589}{edje\+\_\+object\+\_\+calc\+\_\+force()}, otherwise the Edje object has no way to know that we changed the global perspective.

Try playing with these keys and see what happens to the animation when the value of the focal distance changes.

Finally we add a callback for the animation ended signal\+:


\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\_animation\_end\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *o\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *emission\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *source\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ *app\ =\ data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app-\/>animating\ =\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}


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

  
\begin{DoxyImageNoCaption}
  \mbox{\includegraphics[width=\textwidth]{edje-perspective-example}}
\end{DoxyImageNoCaption}


The full source code 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\ \ 480}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define\ HEIGHT\ 320}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ commands[]\ =\ \(\backslash\)}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}commands\ are:\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tDown\ -\/\ move\ part\ down\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tUp\ -\/\ \ move\ part\ up\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tLeft\ -\/\ move\ part\ left\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tRight\ -\/\ move\ part\ right\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tPrior\ -\/\ move\ part\ up-\/left\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tNext\ -\/\ move\ part\ down-\/right\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tInsert\ -\/\ increase\ focal\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tSuppr\ -\/\ decrease\ focal\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)tEsc\ -\/\ exit\(\backslash\)n"{}}}
\DoxyCodeLine{\ \ \textcolor{stringliteral}{"{}\(\backslash\)th\ -\/\ print\ help\(\backslash\)n"{}};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{struct\ }\_App\ \{}
\DoxyCodeLine{\ \ \ \ Evas\_Object\ *edje\_obj;}
\DoxyCodeLine{\ \ \ \ Evas\_Object\ *bg;}
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group__Edje_gaa34f2bebed885cea3d891858ad7c2e2b}{Edje\_Perspective}}\ *ps;}
\DoxyCodeLine{\ \ \ \ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}\ animating;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ x,\ y;\ \textcolor{comment}{//\ relative\ position\ of\ part\ in\ the\ screen}}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ focal;}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_destroy(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{comment}{/*\ here\ just\ to\ keep\ our\ example's\ window\ size\ and\ background\ image's}}
\DoxyCodeLine{\textcolor{comment}{\ *\ size\ in\ synchrony\ */}}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_canvas\_resize(Ecore\_Evas\ *ee)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ w,\ h;}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ *app\ =\ \mbox{\hyperlink{group__Ecore__Evas__Group_ga85531b3a6bcbe868d2cf5d32fab99c60}{ecore\_evas\_data\_get}}(ee,\ \textcolor{stringliteral}{"{}app"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Evas__Group_ga931aadf4603731e73e8a84e4b14f1493}{ecore\_evas\_geometry\_get}}(ee,\ NULL,\ NULL,\ \&w,\ \&h);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(app-\/>bg,\ w,\ h);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(app-\/>edje\_obj,\ w,\ h);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_part\_move(\textcolor{keyword}{struct}\ \_App\ *app,\ \textcolor{keywordtype}{int}\ dx,\ \textcolor{keywordtype}{int}\ dy)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{char}\ emission[64];}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>animating)}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app-\/>x\ +=\ dx;}
\DoxyCodeLine{\ \ \ app-\/>y\ +=\ dy;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>x\ >\ 1)}
\DoxyCodeLine{\ \ \ \ \ app-\/>x\ =\ 1;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>x\ <\ 0)}
\DoxyCodeLine{\ \ \ \ \ app-\/>x\ =\ 0;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>y\ >\ 1)}
\DoxyCodeLine{\ \ \ \ \ app-\/>y\ =\ 1;}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (app-\/>y\ <\ 0)}
\DoxyCodeLine{\ \ \ \ \ app-\/>y\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ snprintf(emission,\ \textcolor{keyword}{sizeof}(emission),\ \textcolor{stringliteral}{"{}move,\%d,\%d"{}},\ app-\/>x,\ app-\/>y);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Group_ga2a6422befdfb9c9757414122ff23cb8e}{edje\_object\_signal\_emit}}(app-\/>edje\_obj,\ emission,\ \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{\ \ \ app-\/>animating\ =\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_bg\_key\_down(\textcolor{keywordtype}{void}\ *data,\ Evas\ *e\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ Evas\_Object\ *o\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keywordtype}{void}\ *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ *app\ =\ data;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}}\ *ev\ =\ 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{comment}{//\ just\ moving\ the\ part\ and\ text}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Down"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 0,\ 1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Up"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 0,\ -\/1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Left"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ -\/1,\ 0);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Right"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 1,\ 0);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Prior"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ -\/1,\ -\/1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}Next"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \_part\_move(app,\ 1,\ 1);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//\ adjusting\ the\ perspective\ focal\ point\ distance}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}KP\_Add"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ app-\/>focal\ +=\ 5;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Perspective_gaeee5dfe8b3f428583e4f8a846f0b0d15}{edje\_perspective\_set}}(app-\/>ps,\ 240,\ 160,\ 0,\ app-\/>focal);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gadc7c4c5fe418b85f56a8f545637f4589}{edje\_object\_calc\_force}}(app-\/>edje\_obj);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (!strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}},\ \textcolor{stringliteral}{"{}KP\_Subtract"{}}))}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ app-\/>focal\ -\/=\ 5;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (app-\/>focal\ <\ 5)}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ app-\/>focal\ =\ 5;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Perspective_gaeee5dfe8b3f428583e4f8a846f0b0d15}{edje\_perspective\_set}}(app-\/>ps,\ 240,\ 160,\ 0,\ app-\/>focal);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gadc7c4c5fe418b85f56a8f545637f4589}{edje\_object\_calc\_force}}(app-\/>edje\_obj);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \textcolor{comment}{//\ exiting}}
\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{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_animation\_end\_cb(\textcolor{keywordtype}{void}\ *data,\ Evas\_Object\ *o\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *emission\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *source\ \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ *app\ =\ data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app-\/>animating\ =\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\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}{"{}/perspective.edj"{}};}
\DoxyCodeLine{\ \ \ \textcolor{keyword}{struct\ }\_App\ \ app;}
\DoxyCodeLine{\ \ \ Ecore\_Evas\ \ *ee;}
\DoxyCodeLine{\ \ \ Evas\ \ \ \ \ \ \ \ *evas;}
\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{\ \ \ \mbox{\hyperlink{group__Edje__Object__Animation_gac9b19ee918546740c0144904393a1acd}{edje\_frametime\_set}}(1.0\ /\ 60.0);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{comment}{/*\ this\ will\ give\ you\ a\ window\ with\ an\ Evas\ canvas\ under\ the\ first}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ *\ engine\ available\ */}}
\DoxyCodeLine{\ \ \ app.animating\ =\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{\ \ \ app.x\ =\ 0;}
\DoxyCodeLine{\ \ \ app.y\ =\ 0;}
\DoxyCodeLine{\ \ \ app.focal\ =\ 50;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ ee\ =\ \mbox{\hyperlink{group__Ecore__Evas__Group_gaaa770b6f2f1395f9eeb0e50e26c3f933}{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_ga3680b5c89157167318192157a5d24ec4}{ecore\_evas\_callback\_destroy\_set}}(ee,\ \_on\_destroy);}
\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\ Perspective\ Example"{}});}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Evas__Group_gaa86c5abd200a02711aced53d27b9ddb2}{ecore\_evas\_data\_set}}(ee,\ \textcolor{stringliteral}{"{}app"{}},\ \&app);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ evas\ =\ \mbox{\hyperlink{group__Ecore__Evas__Group_ga6f8d214cd55bc940d7cc62fecd8dbc06}{ecore\_evas\_get}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.bg\ =\ \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}}(app.bg,\ 255,\ 255,\ 255,\ 255);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(app.bg,\ WIDTH,\ HEIGHT);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gac6d65f8896ab59780553676d0017c2ef}{evas\_object\_focus\_set}}(app.bg,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(app.bg);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(app.bg,\ \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}},\ \_on\_bg\_key\_down,\ \&app);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.edje\_obj\ =\ \mbox{\hyperlink{group__Edje__Object__Group_ga5548cef32568746f40df9bd0be339bea}{edje\_object\_add}}(evas);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gaec1edd24b5bd8e82823759a8dddc1996}{edje\_object\_file\_set}}(app.edje\_obj,\ edje\_file,\ \textcolor{stringliteral}{"{}example/group"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(app.edje\_obj,\ 0,\ 0);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(app.edje\_obj,\ WIDTH,\ HEIGHT);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(app.edje\_obj);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Object__Group_gab7a1542309f1ffdc76c07f280842d4b1}{edje\_object\_signal\_callback\_add}}(app.edje\_obj,\ \textcolor{stringliteral}{"{}animation,end"{}},\ \textcolor{stringliteral}{"{}"{}},\ \_animation\_end\_cb,\ \&app);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ app.ps\ =\ \mbox{\hyperlink{group__Edje__Perspective_gab9535d9102c796181d633192b63bf25c}{edje\_perspective\_new}}(evas);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Perspective_gaeee5dfe8b3f428583e4f8a846f0b0d15}{edje\_perspective\_set}}(app.ps,\ 240,\ 160,\ 0,\ app.focal);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Edje__Perspective_ga9e560272fb6b954a9e99eaad72a6755f}{edje\_perspective\_global\_set}}(app.ps,\ \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}


The full .edc file 
\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{collections\ \{}
\DoxyCodeLine{\ \ \ group\ \{}
\DoxyCodeLine{\ \ \ \ \ \ name:\ "{}example/group"{};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ min:\ 480\ 320;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ parts\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}bg"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ RECT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ mouse\_events:\ 1;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}\ //\ bg}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}rectangle"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ RECT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ mouse\_events:\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 255\ 0\ 0\ 128;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel1\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ offset:\ -\/5\ -\/5;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ to:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel2\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ offset:\ 4\ 4;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ to:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ map\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ on:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ perspective\_on:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rotation\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x:\ 45;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}\ //\ rectangle}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ part\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ type:\ TEXT;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ mouse\_events:\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ state:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ color:\ 200\ 200\ 200\ 255;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ align:\ 0.0\ 0.5;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel1.relative:\ 0.1\ 0.1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel2.relative:\ 0.1\ 0.1;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ text:\ "{}Perspective\ example"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ font:\ "{}Sans"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ size:\ 16;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ min:\ 1\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ map\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ on:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ perspective\_on:\ 1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rotation\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ x:\ 45;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ state:\ "{}right"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ inherit:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel1.relative:\ 0.5\ 0.1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel2.relative:\ 0.5\ 0.1;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ state:\ "{}bottom"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ inherit:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel1.relative:\ 0.1\ 0.9;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel2.relative:\ 0.1\ 0.9;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ description\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ state:\ "{}bottomright"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ inherit:\ "{}default"{}\ 0.0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel1.relative:\ 0.5\ 0.9;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ rel2.relative:\ 0.5\ 0.9;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}\ //\ title}
\DoxyCodeLine{\ \ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ programs\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}move,right"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}move,1,0"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ STATE\_SET\ "{}right"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ transition:\ SINUSOIDAL\ 1.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ target:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ after:\ "{}animation,end"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}move,bottom"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}move,0,1"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ STATE\_SET\ "{}bottom"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ transition:\ SINUSOIDAL\ 1.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ target:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ after:\ "{}animation,end"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}move,bottomright"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}move,1,1"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ STATE\_SET\ "{}bottomright"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ transition:\ SINUSOIDAL\ 1.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ target:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ after:\ "{}animation,end"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}move,default"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ signal:\ "{}move,0,0"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ STATE\_SET\ "{}default"{}\ 0.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ transition:\ SINUSOIDAL\ 1.0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ target:\ "{}title"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ after:\ "{}animation,end"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ program\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ name:\ "{}animation,end"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ action:\ SIGNAL\_EMIT\ "{}animation,end"{}\ "{}"{};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \}}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}


To compile use this command\+: \begin{DoxyVerb}* gcc -o edje-perspective edje-perspective.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 perspective.edc
* \end{DoxyVerb}
 