\hypertarget{test_growing_balls_8c-example}{}\doxysection{test\+\_\+growing\+\_\+balls.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifdef\ HAVE\_CONFIG\_H}}
\DoxyCodeLine{\textcolor{preprocessor}{\#\ include\ <config.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include\ "{}ephysics\_test.h"{}}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_grow\_cb(\textcolor{keywordtype}{void}\ *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Test\_Data\ *test\_data\ =\ data;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{struct__Eina__List}{Eina\_List}}\ *l;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ size,\ i\ =\ -\/1;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Eina__List__Group_gac6efafc19f526d916cdb9757240a8773}{EINA\_LIST\_FOREACH}}(test\_data-\/>evas\_objs,\ l,\ obj)}
\DoxyCodeLine{\ \ \ \ \ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6e8e78e110392480dd612df86a16b630}{evas\_object\_geometry\_get}}(obj,\ NULL,\ NULL,\ \&size,\ NULL);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ size\ +=\ i\ *\ 8;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ i++;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ ((size\ <\ 20)\ ||\ (size\ >\ 120))}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(obj,\ size,\ size);}
\DoxyCodeLine{\ \ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_add\_sphere(Test\_Data\ *test\_data,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *group,\ \textcolor{keywordtype}{int}\ size,\ \textcolor{keywordtype}{int}\ x,\ \textcolor{keywordtype}{int}\ y)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}}\ *sphere\_body;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *sphere;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ sphere\ =\ \mbox{\hyperlink{group__Elm__Image_ga1e320bab8a343c91522d0f09b938ab4f}{elm\_image\_add}}(test\_data-\/>win);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Image_gad1a96ede5f513042cef3c1dac4572f73}{elm\_image\_file\_set}}(sphere,\ PACKAGE\_DATA\_DIR\ \textcolor{stringliteral}{"{}/"{}}\ EPHYSICS\_TEST\_THEME\ \textcolor{stringliteral}{"{}.edj"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ group);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(sphere,\ x,\ y);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(sphere,\ size,\ size);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(sphere);}
\DoxyCodeLine{\ \ \ test\_data-\/>evas\_objs\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>evas\_objs,\ sphere);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ sphere\_body\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga9fe94b35f5b58527b1199a23468b1f86}{ephysics\_body\_sphere\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga39cb9e95bbe1d097926a09365c501db3}{ephysics\_body\_evas\_object\_set}}(sphere\_body,\ sphere,\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(sphere\_body,\ 0.5);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga9109b39047a724640f6a18c683c9eb07}{ephysics\_body\_central\_impulse\_apply}}(sphere\_body,\ 300,\ 0,\ 0);}
\DoxyCodeLine{\ \ \ test\_data-\/>bodies\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>bodies,\ sphere\_body);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_world\_populate(Test\_Data\ *test\_data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \_add\_sphere(test\_data,\ \textcolor{stringliteral}{"{}big-\/red-\/ball"{}},\ 60,\ 100,\ 100);}
\DoxyCodeLine{\ \ \ \_add\_sphere(test\_data,\ \textcolor{stringliteral}{"{}big-\/blue-\/ball"{}},\ 60,\ 150,\ 150);}
\DoxyCodeLine{\ \ \ \_add\_sphere(test\_data,\ \textcolor{stringliteral}{"{}big-\/green-\/ball"{}},\ 60,\ 200,\ 200);}
\DoxyCodeLine{\ \ \ test\_data-\/>data\ =\ \mbox{\hyperlink{group__Ecore__Timer__Group_ga926423e464d7ef71105dd822d90e1187}{ecore\_timer\_add}}(1,\ \_grow\_cb,\ test\_data);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_win\_del(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}\ *e\ \_\_UNUSED\_\_,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj\ \_\_UNUSED\_\_,\ \textcolor{keywordtype}{void}\ *event\_info\ \_\_UNUSED\_\_)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Test\_Data\ *test\_data\ =\ data;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Timer__Group_gaf96ffb609956658ec038e54bd39f46f0}{Ecore\_Timer}}\ *timer\ =\ test\_data-\/>data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (timer)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__Ecore__Timer__Group_ga7c118b6a6d232b63a6500e599d2a1b47}{ecore\_timer\_del}}(timer);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ test\_data\_del(test\_data);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics_ga07e695074fb4d5d125b36c3a1d963f49}{ephysics\_shutdown}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_restart(\textcolor{keywordtype}{void}\ *data,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj\ \_\_UNUSED\_\_,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *emission\ \_\_UNUSED\_\_,\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *source\ \_\_UNUSED\_\_)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ Test\_Data\ *test\_data\ =\ data;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Ecore__Timer__Group_gaf96ffb609956658ec038e54bd39f46f0}{Ecore\_Timer}}\ *timer\ =\ test\_data-\/>data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (timer)}
\DoxyCodeLine{\ \ \ \ \ \mbox{\hyperlink{group__Ecore__Timer__Group_ga7c118b6a6d232b63a6500e599d2a1b47}{ecore\_timer\_del}}(timer);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ DBG(\textcolor{stringliteral}{"{}Restart\ pressed"{}});}
\DoxyCodeLine{\ \ \ test\_clean(test\_data);}
\DoxyCodeLine{\ \ \ \_world\_populate(test\_data);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void}}
\DoxyCodeLine{test\_growing\_balls(\textcolor{keywordtype}{void}\ *data\ \_\_UNUSED\_\_,\ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *obj\ \_\_UNUSED\_\_,\ \textcolor{keywordtype}{void}\ *event\_info\ \_\_UNUSED\_\_)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}}\ *boundary;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__World_ga83c0d22744748525aa2dac11726c58e6}{EPhysics\_World}}\ *world;}
\DoxyCodeLine{\ \ \ Test\_Data\ *test\_data;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{group__EPhysics_gaca8fc170d73b3f688349cc4dbaf219fd}{ephysics\_init}}())}
\DoxyCodeLine{\ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ test\_data\ =\ test\_data\_new();}
\DoxyCodeLine{\ \ \ test\_win\_add(test\_data,\ \textcolor{stringliteral}{"{}Growing\ Balls"{}},\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Events_gac71a1038dad71da36f57b70c8ad10252}{evas\_object\_event\_callback\_add}}(test\_data-\/>win,\ \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a4471afbcbb4a754b7b0bbde00fb9a277}{EVAS\_CALLBACK\_DEL}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_win\_del,\ test\_data);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__General_ga1beada7edf5d714c0dba5459bcc993fc}{elm\_object\_signal\_emit}}(test\_data-\/>layout,\ \textcolor{stringliteral}{"{}borders,show"{}},\ \textcolor{stringliteral}{"{}ephysics\_test"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Elm__Layout_gadab42e647f164fc8ab585c0e1bd34cc0}{elm\_layout\_signal\_callback\_add}}(test\_data-\/>layout,\ \textcolor{stringliteral}{"{}restart"{}},\ \textcolor{stringliteral}{"{}test-\/theme"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \_restart,\ test\_data);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ world\ =\ \mbox{\hyperlink{group__EPhysics__World_ga7b24e5bada9bcd105bc7d1e68cf2e44e}{ephysics\_world\_new}}();}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__World_gaabf8abaf9c41b0c1e5daa4acf3df0356}{ephysics\_world\_render\_geometry\_set}}(world,\ 50,\ 40,\ -\/50,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ WIDTH\ -\/\ 100,\ FLOOR\_Y\ -\/\ 40,\ DEPTH);}
\DoxyCodeLine{\ \ \ test\_data-\/>world\ =\ world;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga41939240a53e1373d592b8a6be273978}{ephysics\_body\_bottom\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.8);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga58ecc44fc7febb980fe1857ef053f61f}{ephysics\_body\_top\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.8);}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga6bad14ec64496e39d589ac25aee889f0}{ephysics\_body\_left\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.8);}
\DoxyCodeLine{\ \ \ boundary\ =\ \mbox{\hyperlink{group__EPhysics__Body_gaa2db93bfa483a5a1b755801d14a343dd}{ephysics\_body\_right\_boundary\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(boundary,\ 0.8);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \_world\_populate(test\_data);}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 