\hypertarget{test_bouncing_text_8c-example}{}\doxysection{test\+\_\+bouncing\+\_\+text.\+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}\ \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_world\_populate(Test\_Data\ *test\_data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}}\ *text\_body;}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}\ *text;}
\DoxyCodeLine{\ \ \ \textcolor{keywordtype}{int}\ x,\ y,\ w;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ text\ =\ \mbox{\hyperlink{group__Evas__Object__Text__Group_gae4d422b8ccfeadf3e24c5349a78e530a}{evas\_object\_text\_add}}(\mbox{\hyperlink{group__Evas__Object__Group_ga7e211219d11abced5f3089362f7476b9}{evas\_object\_evas\_get}}(test\_data-\/>win));}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Text__Group_ga1c9f3b5f76d5c2f020320d84a8197492}{evas\_object\_text\_text\_set}}(text,\ \textcolor{stringliteral}{"{}EPHYSICS"{}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Text__Group_gac5dd3bf469c8df9c4fe36d08c066f122}{evas\_object\_text\_font\_set}}(text,\ \textcolor{stringliteral}{"{}Sans"{}},\ 54);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(text,\ 95,\ 56,\ 19,\ 255);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(text,\ WIDTH\ /\ 4,\ HEIGHT\ /\ 8);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(text);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6e8e78e110392480dd612df86a16b630}{evas\_object\_geometry\_get}}(text,\ \&x,\ \&y,\ \&w,\ NULL);}
\DoxyCodeLine{\ \ \ test\_data-\/>evas\_objs\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>evas\_objs,\ text);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ text\_body\ =\ \mbox{\hyperlink{group__EPhysics__Body_ga6381538c9002ea30171c0a64100350f5}{ephysics\_body\_box\_add}}(test\_data-\/>world);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga39cb9e95bbe1d097926a09365c501db3}{ephysics\_body\_evas\_object\_set}}(text\_body,\ text,\ \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga8821fa07fb5be9d956cc090b14223fd2}{ephysics\_body\_geometry\_set}}(text\_body,\ x,\ y,\ -\/15,\ w\ *\ 5\ /\ 6,\ 46,\ 30);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(text\_body,\ 0.95);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(text\_body,\ 0.1);}
\DoxyCodeLine{\ \ \ test\_data-\/>bodies\ =\ \mbox{\hyperlink{group__Eina__List__Group_ga625698a383dda8fc0db245a1c7608c49}{eina\_list\_append}}(test\_data-\/>bodies,\ text\_body);}
\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{}
\DoxyCodeLine{\ \ \ DBG(\textcolor{stringliteral}{"{}Restart\ pressed"{}});}
\DoxyCodeLine{\ \ \ test\_clean(test\_data);}
\DoxyCodeLine{\ \ \ \_world\_populate(test\_data);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{void}}
\DoxyCodeLine{test\_bouncing\_text(\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}{"{}Bouncing\ Text"{}},\ \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\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,\ 100);}
\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.65);}
\DoxyCodeLine{\ \ \ \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(boundary,\ 2);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \_world\_populate(test\_data);}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 