\hypertarget{ephysics_logo_c_ephysics-logo-c}{}\doxysection{ephysics\+\_\+logo.\+c}\label{ephysics_logo_c_ephysics-logo-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 <Elementary.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{EPhysics_8h}{EPhysics.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Evas.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WIDTH (512)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define HEIGHT (384)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define DEPTH (100)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define FLOOR\_Y (HEIGHT -\/ 80)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define SH\_THRESHOLD (250)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define SH\_OFFSET\_X (-\/ 16)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define OFFSET\_X (90)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PADDING\_X\_1 (16)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PADDING\_X\_2 (12)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PADDING\_X\_3 (22)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define E\_THRESHOLD (WIDTH + 560)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define LAYER\_SHADOW (10)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define LAYER\_LETTER (20)}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define CENTER(total, item)  (((total) -\/ (item)) / 2)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define LIMIT(val, op, ref) (((val) op (ref)) ? (val) : (ref));}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PROP\_GET(pos, min, max) (((min) + ((max) -\/ (min)) * (pos)) / (max))}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_update\_box\_cb(\textcolor{keywordtype}{void} *data \_\_UNUSED\_\_, \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *body, \textcolor{keywordtype}{void} *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *image = event\_info;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *shadow = \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga3b85d805f879e71beed360650dda697b}{evas\_object\_data\_get}}(image, \textcolor{stringliteral}{"{}shadow"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *light = \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga3b85d805f879e71beed360650dda697b}{evas\_object\_data\_get}}(image, \textcolor{stringliteral}{"{}light"{}});}
\DoxyCodeLine{   \textcolor{keywordtype}{int} x, y, w, h, floor\_distance, alpha = 0;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* modify the evas object according to the body */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga7209e650176e0612efb2a2cc2af0ec27}{ephysics\_body\_evas\_object\_update}}(body);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6e8e78e110392480dd612df86a16b630}{evas\_object\_geometry\_get}}(image, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{   floor\_distance = FLOOR\_Y -\/ h;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* Bodies penetrates the ground slightly before bouncing. */}}
\DoxyCodeLine{   \textcolor{comment}{/* This is to be expected in realtime physics engines. */}}
\DoxyCodeLine{   \textcolor{comment}{// TODO BUG: should we move the object up by the difference????}}
\DoxyCodeLine{   \textcolor{comment}{//y = LIMIT(y, <=, floor\_distance);}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* We should show the shadow when we're close enough to ground */}}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (y > SH\_THRESHOLD)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordtype}{int} sh\_w, sh\_h;}
\DoxyCodeLine{        \textcolor{keywordtype}{double} pos\_x;}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(shadow, \&sh\_w, \&sh\_h);}
\DoxyCodeLine{        \textcolor{comment}{/* shadow is darker with bigger y */}}
\DoxyCodeLine{        alpha = 255 * (y -\/ SH\_THRESHOLD) / (floor\_distance -\/ SH\_THRESHOLD);}
\DoxyCodeLine{        \textcolor{comment}{/* and with bigger x -\/-\/ it's proportional to x / WIDTH, but varies}}
\DoxyCodeLine{\textcolor{comment}{         * from 100 to 255.}}
\DoxyCodeLine{\textcolor{comment}{         */}}
\DoxyCodeLine{        pos\_x = (double) x / (WIDTH -\/ w);}
\DoxyCodeLine{        alpha = alpha * PROP\_GET(pos\_x, 100, 255);}
\DoxyCodeLine{        \textcolor{comment}{/* box shadow is not resized, just moved */}}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(shadow, x + CENTER(w, sh\_w) + SH\_OFFSET\_X,}
\DoxyCodeLine{                         FLOOR\_Y -\/ sh\_h + 2);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(shadow, alpha, alpha, alpha, alpha);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(light, x, y);}
\DoxyCodeLine{   \textcolor{comment}{/* it's lighter with bigger y */}}
\DoxyCodeLine{   alpha = (y <= 0) ? 0 : y * 255 / floor\_distance;}
\DoxyCodeLine{   \textcolor{comment}{/* and with bigger x */}}
\DoxyCodeLine{   alpha = alpha * (x -\/ OFFSET\_X + 80) / (WIDTH -\/ OFFSET\_X);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(light, alpha, alpha, alpha, alpha);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_update\_circle\_cb(\textcolor{keywordtype}{void} *data \_\_UNUSED\_\_, \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *body, \textcolor{keywordtype}{void} *event\_info)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *image = event\_info;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *shadow = \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga3b85d805f879e71beed360650dda697b}{evas\_object\_data\_get}}(image, \textcolor{stringliteral}{"{}shadow"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *light = \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga3b85d805f879e71beed360650dda697b}{evas\_object\_data\_get}}(image, \textcolor{stringliteral}{"{}light"{}});}
\DoxyCodeLine{   \textcolor{keywordtype}{int} x, y, w, h, sh\_w, sh\_h, alpha = 0;}
\DoxyCodeLine{   \textcolor{keyword}{const} Evas\_Map *map;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* modify the evas object according to the body */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga7209e650176e0612efb2a2cc2af0ec27}{ephysics\_body\_evas\_object\_update}}(body);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga6e8e78e110392480dd612df86a16b630}{evas\_object\_geometry\_get}}(image, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(light, x, y);}
\DoxyCodeLine{   alpha = x * 255 / (WIDTH -\/ w);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(light, alpha, alpha, alpha, alpha);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* use the same map from image to the light (rotate it) */}}
\DoxyCodeLine{   map = \mbox{\hyperlink{group__Evas__Object__Group_ga90e3944802458cfc356a6823d5caa827}{evas\_object\_map\_get}}(image);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gadbb970a1e0da91183bab3af1eb276953}{evas\_object\_map\_set}}(light, map);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gafca4ed9f6cb6063ff7e8d9193418129e}{evas\_object\_map\_enable\_set}}(light, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(shadow, \&sh\_w, \&sh\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(shadow, x + CENTER(w, sh\_w) + SH\_OFFSET\_X,}
\DoxyCodeLine{                    FLOOR\_Y -\/ sh\_h + 2);}
\DoxyCodeLine{   alpha = 127 + alpha / 2;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(shadow, alpha, alpha, alpha, alpha);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (x > E\_THRESHOLD)}
\DoxyCodeLine{     \mbox{\hyperlink{group__EPhysics__Body_gae3c32aa0cdd60ffec86fff30097e75e1}{ephysics\_body\_move}}(body, -\/w -\/ 1, y, -\/15);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_letter\_add(\mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *evas, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *letter, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} **image, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} **light, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} **shadow)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{int} w, h, sh\_w, sh\_h;}
\DoxyCodeLine{   \textcolor{keywordtype}{char} buf[1024];}
\DoxyCodeLine{}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), PACKAGE\_DATA\_DIR \textcolor{stringliteral}{"{}/logo\_shadow-\/\%s.png"{}}, letter);}
\DoxyCodeLine{   *shadow = \mbox{\hyperlink{group__Evas__Object__Image_gafb52be265f315186a28d43af2d559ec6}{evas\_object\_image\_filled\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac2e588476b16b04f85ca9a594c140c1d}{evas\_object\_image\_file\_set}}(*shadow, buf, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(*shadow, \&sh\_w, \&sh\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(*shadow, sh\_w, sh\_h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(*shadow, 0, 0, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga6f4b41c65c99eb5d53e207439eeffd76}{evas\_object\_layer\_set}}(*shadow, LAYER\_SHADOW);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(*shadow);}
\DoxyCodeLine{}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), PACKAGE\_DATA\_DIR \textcolor{stringliteral}{"{}/logo\_letter-\/\%s.png"{}}, letter);}
\DoxyCodeLine{   *image = \mbox{\hyperlink{group__Evas__Object__Image_gafb52be265f315186a28d43af2d559ec6}{evas\_object\_image\_filled\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac2e588476b16b04f85ca9a594c140c1d}{evas\_object\_image\_file\_set}}(*image, buf, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(*image, \&w, \&h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(*image, w, h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga6f4b41c65c99eb5d53e207439eeffd76}{evas\_object\_layer\_set}}(*image, LAYER\_LETTER);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(*image);}
\DoxyCodeLine{}
\DoxyCodeLine{   snprintf(buf, \textcolor{keyword}{sizeof}(buf), PACKAGE\_DATA\_DIR \textcolor{stringliteral}{"{}/logo\_light-\/\%s.png"{}}, letter);}
\DoxyCodeLine{   *light = \mbox{\hyperlink{group__Evas__Object__Image_gafb52be265f315186a28d43af2d559ec6}{evas\_object\_image\_filled\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac2e588476b16b04f85ca9a594c140c1d}{evas\_object\_image\_file\_set}}(*light, buf, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gacad94595f83580c18908cb3b69b08d1a}{evas\_object\_resize}}(*light, w, h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga6f4b41c65c99eb5d53e207439eeffd76}{evas\_object\_layer\_set}}(*light, LAYER\_LETTER);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(*light);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* allow easy access to shadow and light from the letter image */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga3061f8abe8f1a1f657d622ae0409d8e3}{evas\_object\_data\_set}}(*image, \textcolor{stringliteral}{"{}shadow"{}}, *shadow);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga3061f8abe8f1a1f657d622ae0409d8e3}{evas\_object\_data\_set}}(*image, \textcolor{stringliteral}{"{}light"{}}, *light);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_letter\_body\_setup\_common(\mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *body, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *view)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga39cb9e95bbe1d097926a09365c501db3}{ephysics\_body\_evas\_object\_set}}(body, view, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gaa0915777f634079ca6c088fda5c20e8f}{ephysics\_body\_mass\_set}}(body, 1.2);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(body, 0.6);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga049f9410c5d04d5b810a1755da993cc0}{ephysics\_body\_angular\_movement\_enable\_set}}(body, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}}, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},}
\DoxyCodeLine{                                             \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}});}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *}
\DoxyCodeLine{\_letter\_body\_box\_add(\mbox{\hyperlink{group__EPhysics__World_ga83c0d22744748525aa2dac11726c58e6}{EPhysics\_World}} *world, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *image)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *body = \mbox{\hyperlink{group__EPhysics__Body_ga6381538c9002ea30171c0a64100350f5}{ephysics\_body\_box\_add}}(world);}
\DoxyCodeLine{}
\DoxyCodeLine{   \_letter\_body\_setup\_common(body, image);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gada176f4748a4c2fc4ba2042021ea7067}{ephysics\_body\_event\_callback\_add}}}
\DoxyCodeLine{     (body, \mbox{\hyperlink{group__EPhysics__Body_gga904d0d1462e71c1f32cb27f540b5277cacb2363cd59bc8642e74ad916c6658e0a}{EPHYSICS\_CALLBACK\_BODY\_UPDATE}}, \_update\_box\_cb, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} body;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *}
\DoxyCodeLine{\_letter\_body\_circle\_add(\mbox{\hyperlink{group__EPhysics__World_ga83c0d22744748525aa2dac11726c58e6}{EPhysics\_World}} *world, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *image)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *body = \mbox{\hyperlink{group__EPhysics__Body_gaf2c29ed64a1c548903c39400af792293}{ephysics\_body\_cylinder\_add}}(world);}
\DoxyCodeLine{}
\DoxyCodeLine{   \_letter\_body\_setup\_common(body, image);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gada176f4748a4c2fc4ba2042021ea7067}{ephysics\_body\_event\_callback\_add}}}
\DoxyCodeLine{     (body, \mbox{\hyperlink{group__EPhysics__Body_gga904d0d1462e71c1f32cb27f540b5277cacb2363cd59bc8642e74ad916c6658e0a}{EPHYSICS\_CALLBACK\_BODY\_UPDATE}}, \_update\_circle\_cb, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} body;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int} argc \_\_UNUSED\_\_, \textcolor{keywordtype}{char} **argv \_\_UNUSED\_\_)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *win, *bg, *image, *light, *shadow;}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gaf39ad724f8a2f81f9139c63263900bf1}{EPhysics\_Body}} *ground\_body, *letter\_body;}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__World_ga83c0d22744748525aa2dac11726c58e6}{EPhysics\_World}} *world;}
\DoxyCodeLine{   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} i = 0;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} x, w, h, sh\_w;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *evas;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keyword}{struct }letter\_desc \{}
\DoxyCodeLine{      \textcolor{keyword}{const} \textcolor{keywordtype}{char} *letter;}
\DoxyCodeLine{      \textcolor{keywordtype}{int} padding;}
\DoxyCodeLine{   \} falling\_letters[] = \{}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}P"{}}, PADDING\_X\_1\},}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}H"{}}, PADDING\_X\_1\},}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}Y"{}}, PADDING\_X\_3\},}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}S1"{}}, PADDING\_X\_2\},}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}I"{}}, PADDING\_X\_2\},}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}C"{}}, PADDING\_X\_3\},}
\DoxyCodeLine{     \{\textcolor{stringliteral}{"{}S2"{}}, 0\}}
\DoxyCodeLine{   \};}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__EPhysics_gaca8fc170d73b3f688349cc4dbaf219fd}{ephysics\_init}}())}
\DoxyCodeLine{     \textcolor{keywordflow}{return} -\/ 1;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}}, \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{}
\DoxyCodeLine{   win = \mbox{\hyperlink{group__Elm__Win__Group_gaf5459d4b6f30d687dfc82e8cb9cc878d}{elm\_win\_add}}(NULL, \textcolor{stringliteral}{"{}main"{}}, \mbox{\hyperlink{group__Elm__Win__Group_gga4df03d1a1e94e8b24a58d8ccc5d4d514aa95778c3971171c57b421e85e2dbbc8c}{ELM\_WIN\_SPLASH}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win__Group_ga0e0b613ac6b5d1e0e71f2ec17e80cb07}{elm\_win\_title\_set}}(win, \textcolor{stringliteral}{"{}EPhysics Logo"{}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win__Group_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{   bg = \mbox{\hyperlink{group__Elm__Bg_gac8eba3fcce966addec75ab6335e60f6e}{elm\_bg\_add}}(win);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Bg_ga0b11c11879de61126414adfbfe3e431c}{elm\_bg\_file\_set}}(bg, PACKAGE\_DATA\_DIR \textcolor{stringliteral}{"{}/logo\_background.png"{}}, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win__Group_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win, bg);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gaf20fdb7dc524a95091d72d24cf6a05e8}{evas\_object\_size\_hint\_min\_set}}(bg, WIDTH, HEIGHT);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e6ae4ff5f67ec7d6ad0968c5d9acb44}{evas\_object\_size\_hint\_max\_set}}(bg, WIDTH, HEIGHT);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga07208fcafd4739de606bc35fff684bf5}{evas\_object\_show}}(bg);}
\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, 0, 0, -\/50, WIDTH, HEIGHT, DEPTH);}
\DoxyCodeLine{}
\DoxyCodeLine{   ground\_body = \mbox{\hyperlink{group__EPhysics__Body_ga6381538c9002ea30171c0a64100350f5}{ephysics\_body\_box\_add}}(world);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gaa0915777f634079ca6c088fda5c20e8f}{ephysics\_body\_mass\_set}}(ground\_body, \mbox{\hyperlink{group__EPhysics__Body_ga6f5a7cbea749e1567d608b9321af9eb9}{EPHYSICS\_BODY\_MASS\_STATIC}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga8821fa07fb5be9d956cc090b14223fd2}{ephysics\_body\_geometry\_set}}(ground\_body, -\/100, FLOOR\_Y, -\/15, WIDTH + 800, 10,}
\DoxyCodeLine{                              30);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga731c9a6443f7c4294fce23fc1287b778}{ephysics\_body\_restitution\_set}}(ground\_body, 0.65);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(ground\_body, 0.8);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas = \mbox{\hyperlink{group__Evas__Object__Group_ga7e211219d11abced5f3089362f7476b9}{evas\_object\_evas\_get}}(win);}
\DoxyCodeLine{   x = OFFSET\_X;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{group__Eina__Types__Group_ga7c1b6f81660b4e30516169e9e7d3261c}{EINA\_C\_ARRAY\_LENGTH}}(falling\_letters); i++)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \_letter\_add(evas, falling\_letters[i].letter, \&image, \&light, \&shadow);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(shadow, \&sh\_w, NULL);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(image, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{comment}{/* place image and light on top, above what the viewport can show */}}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(image, x, -\/h * (i + 1) -\/ 50);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(light, x, -\/h * (i + 1) -\/ 50);}
\DoxyCodeLine{        \textcolor{comment}{/* place shadow below the hit-\/line: FLOOR\_Y, centered at image */}}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(shadow, x + CENTER(w, sh\_w), FLOOR\_Y);}
\DoxyCodeLine{}
\DoxyCodeLine{        x += falling\_letters[i].padding + w;}
\DoxyCodeLine{}
\DoxyCodeLine{        letter\_body = \_letter\_body\_box\_add(world, image);}
\DoxyCodeLine{        \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(letter\_body, 0.4);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* E is a circle that comes rolling on the floor */}}
\DoxyCodeLine{   \_letter\_add(evas, \textcolor{stringliteral}{"{}E"{}}, \&image, \&light, \&shadow);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gab751e9d24c16e74af6f7c08ea5b930c2}{evas\_object\_color\_set}}(shadow, 255, 255, 255, 255);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(shadow, \&sh\_w, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga29401fb02f1d51ddf09d195f10a004e7}{evas\_object\_image\_size\_get}}(image, \&w, \&h);}
\DoxyCodeLine{   \textcolor{comment}{/* place image and light so they are above the floor,}}
\DoxyCodeLine{\textcolor{comment}{    * and to the left of viewport}}
\DoxyCodeLine{\textcolor{comment}{    */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(image, -\/w -\/ 1, FLOOR\_Y -\/ h + 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(light, -\/w -\/ 1, FLOOR\_Y -\/ h + 1);}
\DoxyCodeLine{   \textcolor{comment}{/* place the shadow below the hit-\/line: FLOOR\_Y, centered at image */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga335c8ee6eaeaac9710656af4f8b0db91}{evas\_object\_move}}(shadow, -\/w -\/ 1 + CENTER(w, sh\_w), FLOOR\_Y);}
\DoxyCodeLine{}
\DoxyCodeLine{   letter\_body = \_letter\_body\_circle\_add(world, image);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga986d45060bf6ba1689a56889a2bcabce}{ephysics\_body\_friction\_set}}(letter\_body, 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_gaa0915777f634079ca6c088fda5c20e8f}{ephysics\_body\_mass\_set}}(letter\_body, 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga049f9410c5d04d5b810a1755da993cc0}{ephysics\_body\_angular\_movement\_enable\_set}}(letter\_body, \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}},}
\DoxyCodeLine{                                             \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}}, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* make the "{}E"{} logo get into the viewport by applying an horizontal force */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__Body_ga9109b39047a724640f6a18c683c9eb07}{ephysics\_body\_central\_impulse\_apply}}(letter\_body, 390, 0, 0);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics__World_ga99ebd1425f258f895c0089d6eb13def9}{ephysics\_world\_del}}(world);}
\DoxyCodeLine{   \mbox{\hyperlink{group__EPhysics_ga07e695074fb4d5d125b36c3a1d963f49}{ephysics\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga9de9b3690cc9d500e4576e0f086a099a}{elm\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{\mbox{\hyperlink{group__Elm__General_ga50fe52d513f7e89c9c770afd76de7ad9}{ELM\_MAIN}}()}

\end{DoxyCodeInclude}
 