\hypertarget{eina_tiler_01_8c-example}{}\doxysection{eina\+\_\+tiler\+\_\+01.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{\textcolor{comment}{//Compile with:}}
\DoxyCodeLine{\textcolor{comment}{//gcc eina\_tiler\_01.c -\/o eina\_tiler\_01 `pkg-\/config -\/-\/cflags -\/-\/libs ecore-\/evas ecore evas eina`}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Evas.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Eina_8h}{Eina.h}}>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WINDOW\_PAD (20)}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Tiler__Group_gabcc29c8a2b66db646e0d6e4b1828954c}{Eina\_Tiler}} *tiler;}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}} *input\_rects;}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} input\_count;}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} input\_idx = 0, input\_color\_idx = 0, output\_color\_idx = 0;}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{struct__Eina__List}{Eina\_List}} *output\_objs = NULL;}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} maxw, maxh, winw, winh;}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *evas;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }color \{}
\DoxyCodeLine{   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} r, g, b;}
\DoxyCodeLine{\} colors[] = \{}
\DoxyCodeLine{  \{255, 0, 0\},}
\DoxyCodeLine{  \{0, 255, 0\},}
\DoxyCodeLine{  \{0, 0, 255\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{255, 128, 0\},}
\DoxyCodeLine{  \{0, 255, 128\},}
\DoxyCodeLine{  \{128, 0, 255\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{255, 255, 0\},}
\DoxyCodeLine{  \{0, 255, 255\},}
\DoxyCodeLine{  \{255, 0, 255\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{255, 0, 128\},}
\DoxyCodeLine{  \{128, 255, 0\},}
\DoxyCodeLine{  \{0, 128, 255\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{128, 128, 0\},}
\DoxyCodeLine{  \{0, 128, 128\},}
\DoxyCodeLine{  \{128, 0, 128\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{128, 0, 0\},}
\DoxyCodeLine{  \{0, 128, 0\},}
\DoxyCodeLine{  \{0, 0, 128\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{255, 128, 0\},}
\DoxyCodeLine{  \{0, 255, 128\},}
\DoxyCodeLine{  \{128, 0, 255\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{64, 64, 0\},}
\DoxyCodeLine{  \{0, 64, 64\},}
\DoxyCodeLine{  \{64, 0, 64\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{128, 128, 0\},}
\DoxyCodeLine{  \{0, 128, 128\},}
\DoxyCodeLine{  \{128, 0, 128\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{255, 0, 128\},}
\DoxyCodeLine{  \{128, 255, 0\},}
\DoxyCodeLine{  \{0, 128, 255\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{128, 64, 0\},}
\DoxyCodeLine{  \{0, 128, 64\},}
\DoxyCodeLine{  \{64, 0, 128\},}
\DoxyCodeLine{}
\DoxyCodeLine{  \{128, 0, 64\},}
\DoxyCodeLine{  \{64, 128, 0\},}
\DoxyCodeLine{  \{0, 64, 128\}}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define MAX\_COLORS (sizeof(colors) / sizeof(colors[0]))}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{add\_text(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *text, \textcolor{keywordtype}{int} x, \textcolor{keywordtype}{int} y, \textcolor{keywordtype}{int} w)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o = \mbox{\hyperlink{group__Evas__Object__Text__Group_ga72224822cf1772ef16b1554f0a6205d5}{evas\_object\_text\_add}}(evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(o, 0, 0, 0, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, x, y);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, w, WINDOW\_PAD);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Text__Group_ga1813cea2c010c923d31787caec5dc857}{evas\_object\_text\_font\_set}}(o, \textcolor{stringliteral}{"{}Sans"{}}, 10);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Text__Group_gabe57fc428ee4db9e9d7feb9e3a108fb3}{evas\_object\_text\_text\_set}}(o, text);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{output\_rects\_reset(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__List__Group_gae27a2c686a0a11693f9b06957c9bba83}{EINA\_LIST\_FREE}}(output\_objs, o)}
\DoxyCodeLine{     \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}}(o);}
\DoxyCodeLine{   output\_color\_idx = 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{add\_input\_rect(\textcolor{keyword}{const} \mbox{\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}} *r)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;}
\DoxyCodeLine{   \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} bx, by;}
\DoxyCodeLine{}
\DoxyCodeLine{   bx = WINDOW\_PAD;}
\DoxyCodeLine{   by = WINDOW\_PAD;}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{\textcolor{preprocessor}{\#define C(comp) (((int)colors[input\_color\_idx].comp * 128) / 255)}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(o, C(r), C(g), C(b), 128);}
\DoxyCodeLine{\textcolor{preprocessor}{\#undef C}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, r-\/>x + bx, r-\/>y + by);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, r-\/>w, r-\/>h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   input\_color\_idx = (input\_color\_idx + 1) \% MAX\_COLORS;}
\DoxyCodeLine{}
\DoxyCodeLine{   bx += maxw + WINDOW\_PAD;}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \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}}(o, 32, 32, 32, 128);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, r-\/>x + bx, r-\/>y + by);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, r-\/>w, 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}}(o, \mbox{\hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \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}}(o, 32, 32, 32, 128);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, r-\/>x + bx, r-\/>y + by);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, 1, r-\/>h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}}(o, \mbox{\hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \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}}(o, 32, 32, 32, 128);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, r-\/>x + bx, r-\/>y + by + r-\/>h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, r-\/>w, 1);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}}(o, \mbox{\hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \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}}(o, 32, 32, 32, 128);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, r-\/>x + bx + r-\/>w, r-\/>y + by);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, 1, r-\/>h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}}(o, \mbox{\hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{add\_output\_rect(\textcolor{keyword}{const} \mbox{\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}} *r)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(evas);}
\DoxyCodeLine{\textcolor{preprocessor}{\#define C(comp) (((int)colors[output\_color\_idx].comp * 128) / 255)}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(o, C(r), C(g), C(b), 128);}
\DoxyCodeLine{\textcolor{preprocessor}{\#undef C}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, r-\/>x + maxw + 2 * WINDOW\_PAD, r-\/>y + WINDOW\_PAD);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, r-\/>w, r-\/>h);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   output\_color\_idx = (output\_color\_idx + 1) \% MAX\_COLORS;}
\DoxyCodeLine{}
\DoxyCodeLine{   output\_objs = \mbox{\hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}}(output\_objs, o);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{process\_input(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__Iterator}{Eina\_Iterator}} *itr;}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}} r, *r1;}
\DoxyCodeLine{   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} out = 0;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (input\_idx == input\_count)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        add\_text(\textcolor{stringliteral}{"{}Done. Close the window to exit"{}},}
\DoxyCodeLine{                 WINDOW\_PAD, winh -\/ WINDOW\_PAD, winw -\/ 2 * WINDOW\_PAD);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE}};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   output\_rects\_reset();}
\DoxyCodeLine{}
\DoxyCodeLine{   r = input\_rects[input\_idx];}
\DoxyCodeLine{   printf(\textcolor{stringliteral}{"{}Iteration \#\%u: \%dx\%d\%+d\%+d\(\backslash\)n"{}}, input\_idx, r.w, r.h, r.x, r.y);}
\DoxyCodeLine{   input\_idx++;}
\DoxyCodeLine{   add\_input\_rect(\&r);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Tiler__Group_ga5a7eaf8984afbd801794bb17b8a1b4c4}{eina\_tiler\_rect\_add}}(tiler, \&r);}
\DoxyCodeLine{   itr = \mbox{\hyperlink{group__Eina__Tiler__Group_ga4cf2a6df653219c8e9cb7fbcf0c40954}{eina\_tiler\_iterator\_new}}(tiler);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Iterator__Group_gac7314580e18868ef229f5d2814562794}{EINA\_ITERATOR\_FOREACH}}(itr, r1)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"{}\(\backslash\)tOutput \#\%u: \%dx\%d\%+d\%+d\(\backslash\)n"{}}, out, r1-\/>\mbox{\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}}, r1-\/>\mbox{\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h}}, r1-\/>\mbox{\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x}}, r1-\/>\mbox{\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y}});}
\DoxyCodeLine{        add\_output\_rect(r1);}
\DoxyCodeLine{        out++;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}}(itr);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{usage(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *progname)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   fprintf(stderr,}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}Usage:\(\backslash\)n\(\backslash\)n"{}}}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}\(\backslash\)t\%s <rect1> ... <rectN>\(\backslash\)n\(\backslash\)n"{}}}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}with rectangles being in the format:\(\backslash\)n"{}}}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}\(\backslash\)tWIDTHxHEIGHT<+-\/>X<+-\/>Y\(\backslash\)n"{}}}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}examples:\(\backslash\)n"{}}}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}\(\backslash\)t100x100+10+10 -\/ width=100, height=100 at x=10, y=10\(\backslash\)n"{}}}
\DoxyCodeLine{           \textcolor{stringliteral}{"{}\(\backslash\)t150x50+5+6    -\/ width=150, height=50 at x=5, y=6\(\backslash\)n"{}},}
\DoxyCodeLine{           progname);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} *argv[])}
\DoxyCodeLine{\{}
\DoxyCodeLine{   Ecore\_Evas *ee;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o;}
\DoxyCodeLine{   \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (argc < 2)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        usage(argv[0]);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   input\_rects = calloc(argc -\/ 1, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}}));}
\DoxyCodeLine{   input\_count = 0;}
\DoxyCodeLine{   maxw = 0;}
\DoxyCodeLine{   maxh = 0;}
\DoxyCodeLine{   \textcolor{keywordflow}{for} (i = 1; i < argc; i++)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}} *r = input\_rects + input\_count;}
\DoxyCodeLine{        \textcolor{keywordtype}{char} sx, sy;}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (sscanf(argv[i], \textcolor{stringliteral}{"{}\%dx\%d\%c\%d\%c\%d"{}},}
\DoxyCodeLine{                   \&(r-\/>w), \&(r-\/>h), \&sx, \&(r-\/>x), \&sy, \&(r-\/>y)) == 6)}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             \textcolor{keywordflow}{if} (sx == \textcolor{charliteral}{'-\/'}) r-\/>x *= -\/1;}
\DoxyCodeLine{             \textcolor{keywordflow}{if} (sy == \textcolor{charliteral}{'-\/'}) r-\/>y *= -\/1;}
\DoxyCodeLine{}
\DoxyCodeLine{             \textcolor{keywordflow}{if} (maxw < r-\/>x + r-\/>w) maxw = r-\/>x + r-\/>w;}
\DoxyCodeLine{             \textcolor{keywordflow}{if} (maxh < r-\/>y + r-\/>h) maxh = r-\/>y + r-\/>h;}
\DoxyCodeLine{             input\_count++;}
\DoxyCodeLine{          \}}
\DoxyCodeLine{        \textcolor{keywordflow}{else}}
\DoxyCodeLine{          fprintf(stderr, \textcolor{stringliteral}{"{}ERROR: invalid rectangle ignored: \%s\(\backslash\)n"{}}, argv[i]);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (input\_count == 0)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fputs(\textcolor{stringliteral}{"{}ERROR: Could not find any valid rectangle. Exit!\(\backslash\)n"{}}, stderr);}
\DoxyCodeLine{        usage(argv[0]);}
\DoxyCodeLine{        free(input\_rects);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} -\/3;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} ((maxw == 0) || (maxh == 0))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fputs(\textcolor{stringliteral}{"{}ERROR: All rectangles with size 0x0. Exit!\(\backslash\)n"{}}, stderr);}
\DoxyCodeLine{        usage(argv[0]);}
\DoxyCodeLine{        free(input\_rects);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} -\/3;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Main__Group_ga65b3f060b6dd9e488afd0b8cbe101869}{evas\_init}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_gafee4bfc0e509b6ffed6598edf6f4b3de}{eina\_init}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   winw = 2 * maxw + 3 * WINDOW\_PAD;}
\DoxyCodeLine{   winh = maxh + 2 * WINDOW\_PAD;}
\DoxyCodeLine{}
\DoxyCodeLine{   ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}}(NULL, 0, 0, winw, winh, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!ee)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fputs(\textcolor{stringliteral}{"{}ERROR: Could not create window. Check ecore-\/evas install.\(\backslash\)n"{}},}
\DoxyCodeLine{              stderr);}
\DoxyCodeLine{        \textcolor{keywordflow}{goto} end;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   evas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   o = \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}}(o, 255, 255, 255, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, winw, winh);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   add\_text(\textcolor{stringliteral}{"{}Input"{}}, WINDOW\_PAD, 0, maxw);}
\DoxyCodeLine{   o = \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}}(o, 200, 200, 200, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, WINDOW\_PAD, WINDOW\_PAD);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, maxw, maxh);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   add\_text(\textcolor{stringliteral}{"{}Output"{}}, maxw + 2 * WINDOW\_PAD, 0, maxw);}
\DoxyCodeLine{   o = \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}}(o, 200, 200, 200, 255);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(o, maxw + 2 * WINDOW\_PAD, WINDOW\_PAD);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}}(o, maxw, maxh);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(o);}
\DoxyCodeLine{}
\DoxyCodeLine{   tiler = \mbox{\hyperlink{group__Eina__Tiler__Group_gaec465d28aa8f533db01e41cbf27aa3c9}{eina\_tiler\_new}}(maxw, maxh);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}}(2.0, process\_input, NULL);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(ee);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__List__Group_ga608bd2fbf06293a1b794648990703ab4}{eina\_list\_free}}(output\_objs);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Tiler__Group_ga73fe7b688f448084d2aa2afb37c76217}{eina\_tiler\_free}}(tiler);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}}(ee);}
\DoxyCodeLine{}
\DoxyCodeLine{ end:}
\DoxyCodeLine{   free(input\_rects);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Eina__Main__Group_ga2c8b4020427108a30c44707af22c99d3}{eina\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Main__Group_ga95a8864f81d944a92bb012b77ffd1b09}{evas\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}}();}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}

\end{DoxyCodeInclude}
 