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

\begin{DoxyCodeInclude}
\textcolor{comment}{//Compile with:}
\textcolor{comment}{//gcc eina\_tiler\_01.c -o eina\_tiler\_01 `pkg-config --cflags --libs ecore-evas ecore evas eina`}

\textcolor{preprocessor}{#include <\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}>}
\textcolor{preprocessor}{#include <Ecore.h>}
\textcolor{preprocessor}{#include <Evas.h>}
\textcolor{preprocessor}{#include <\hyperlink{Eina_8h}{Eina.h}>}

\textcolor{preprocessor}{#define WINDOW\_PAD (20)}

\textcolor{keyword}{static} \hyperlink{group__Eina__Tiler__Group_gabcc29c8a2b66db646e0d6e4b1828954c}{Eina\_Tiler} *tiler;
\textcolor{keyword}{static} \hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle} *input\_rects;
\textcolor{keyword}{static} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} input\_count;
\textcolor{keyword}{static} \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} input\_idx = 0, input\_color\_idx = 0, output\_color\_idx = 0;
\textcolor{keyword}{static} \hyperlink{struct__Eina__List}{Eina\_List} *output\_objs = NULL;
\textcolor{keyword}{static} \hyperlink{group__Evas_ga2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord} maxw, maxh, winw, winh;
\textcolor{keyword}{static} \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas} *\hyperlink{namespaceevas}{evas};

\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }color \{
   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} r, g, b;
\} colors[] = \{
  \{255, 0, 0\},
  \{0, 255, 0\},
  \{0, 0, 255\},

  \{255, 128, 0\},
  \{0, 255, 128\},
  \{128, 0, 255\},

  \{255, 255, 0\},
  \{0, 255, 255\},
  \{255, 0, 255\},

  \{255, 0, 128\},
  \{128, 255, 0\},
  \{0, 128, 255\},

  \{128, 128, 0\},
  \{0, 128, 128\},
  \{128, 0, 128\},

  \{128, 0, 0\},
  \{0, 128, 0\},
  \{0, 0, 128\},

  \{255, 128, 0\},
  \{0, 255, 128\},
  \{128, 0, 255\},

  \{64, 64, 0\},
  \{0, 64, 64\},
  \{64, 0, 64\},

  \{128, 128, 0\},
  \{0, 128, 128\},
  \{128, 0, 128\},

  \{255, 0, 128\},
  \{128, 255, 0\},
  \{0, 128, 255\},

  \{128, 64, 0\},
  \{0, 128, 64\},
  \{64, 0, 128\},

  \{128, 0, 64\},
  \{64, 128, 0\},
  \{0, 64, 128\}
\};

\textcolor{preprocessor}{#define MAX\_COLORS (sizeof(colors) / sizeof(colors[0]))}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
add\_text(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *text, \textcolor{keywordtype}{int} x, \textcolor{keywordtype}{int} y, \textcolor{keywordtype}{int} w)
\{
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *o = \hyperlink{group__Evas__Object__Text_ga72224822cf1772ef16b1554f0a6205d5}{evas\_object\_text\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 0, 0, 0, 255);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, x, y);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, w, WINDOW\_PAD);
   \hyperlink{group__Evas__Object__Text_ga1813cea2c010c923d31787caec5dc857}{evas\_object\_text\_font\_set}(o, \textcolor{stringliteral}{"Sans"}, 10);
   \hyperlink{group__Evas__Object__Text_gabe57fc428ee4db9e9d7feb9e3a108fb3}{evas\_object\_text\_text\_set}(o, text);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
output\_rects\_reset(\textcolor{keywordtype}{void})
\{
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *o;
   \hyperlink{group__Eina__List__Group_gae27a2c686a0a11693f9b06957c9bba83}{EINA\_LIST\_FREE}(output\_objs, o)
     \hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}(o);
   output\_color\_idx = 0;
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
add\_input\_rect(\textcolor{keyword}{const} \hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle} *r)
\{
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *o;
   \hyperlink{group__Evas_ga2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord} bx, by;

   bx = WINDOW\_PAD;
   by = WINDOW\_PAD;

   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
\textcolor{preprocessor}{#define C(comp) (((int)colors[input\_color\_idx].comp * 128) / 255)}
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, C(r), C(g), C(b), 128);
\textcolor{preprocessor}{#undef C}
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + bx, r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + by);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h});
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   input\_color\_idx = (input\_color\_idx + 1) % MAX\_COLORS;

   bx += maxw + WINDOW\_PAD;

   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 32, 32, 32, 128);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + bx, r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + by);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, 1);
   \hyperlink{group__Evas__Font__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}(o, \hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX});
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 32, 32, 32, 128);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + bx, r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + by);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, 1, r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h});
   \hyperlink{group__Evas__Font__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}(o, \hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX});
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 32, 32, 32, 128);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + bx, r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + by + r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h});
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, 1);
   \hyperlink{group__Evas__Font__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}(o, \hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX});
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 32, 32, 32, 128);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + bx + r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + by);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, 1, r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h});
   \hyperlink{group__Evas__Font__Group_gac04277bfd84a7201ba329328a18e21fd}{evas\_object\_layer\_set}(o, \hyperlink{Evas__Common_8h_a1456f5c97f03ebd786c49d4d1178e7a0}{EVAS\_LAYER\_MAX});
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
add\_output\_rect(\textcolor{keyword}{const} \hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle} *r)
\{
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(
      \hyperlink{namespaceevas}{evas});
\textcolor{preprocessor}{#define C(comp) (((int)colors[output\_color\_idx].comp * 128) / 255)}
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, C(r), C(g), C(b), 128);
\textcolor{preprocessor}{#undef C}
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + maxw + 2 * WINDOW\_PAD, r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + WINDOW\_PAD);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h});
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   output\_color\_idx = (output\_color\_idx + 1) % MAX\_COLORS;

   output\_objs = \hyperlink{group__Eina__List__Group_ga92ec14d1a1040a361c4d8cd0ab7b0ecc}{eina\_list\_append}(output\_objs, o);
\}

\textcolor{keyword}{static} \hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}
process\_input(\textcolor{keywordtype}{void} *data \hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED})
\{
   \hyperlink{struct__Eina__Iterator}{Eina\_Iterator} *itr;
   \hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle} r, *r1;
   \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} out = 0;

   \textcolor{keywordflow}{if} (input\_idx == input\_count)
     \{
        add\_text(\textcolor{stringliteral}{"Done. Close the window to exit"},
                 WINDOW\_PAD, winh - WINDOW\_PAD, winw - 2 * WINDOW\_PAD);
        \textcolor{keywordflow}{return} \hyperlink{group__Eina__Types__Group_ga1feb115f8e9913e806e090d9bd5a7301}{EINA\_FALSE};
     \}

   output\_rects\_reset();

   r = input\_rects[input\_idx];
   printf(\textcolor{stringliteral}{"Iteration #%u: %dx%d%+d%+d\(\backslash\)n"}, input\_idx, r.\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, r.\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h}, r.\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x}, r.\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y});
   input\_idx++;
   add\_input\_rect(&r);

   \hyperlink{group__Eina__Tiler__Group_ga5a7eaf8984afbd801794bb17b8a1b4c4}{eina\_tiler\_rect\_add}(tiler, &r);
   itr = \hyperlink{group__Eina__Tiler__Group_ga4cf2a6df653219c8e9cb7fbcf0c40954}{eina\_tiler\_iterator\_new}(tiler);
   \hyperlink{group__Eina__Iterator__Group_gac7314580e18868ef229f5d2814562794}{EINA\_ITERATOR\_FOREACH}(itr, r1)
     \{
        printf(\textcolor{stringliteral}{"\(\backslash\)tOutput #%u: %dx%d%+d%+d\(\backslash\)n"}, out, r1->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}, r1->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h}, r1->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x}, r1->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y});
        add\_output\_rect(r1);
        out++;
     \}
   \hyperlink{group__Eina__Iterator__Group_gaf9261991a4b05dc63e3401278a3281f8}{eina\_iterator\_free}(itr);

   \textcolor{keywordflow}{return} \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE};
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
usage(\textcolor{keyword}{const} \textcolor{keywordtype}{char} *progname)
\{
   fprintf(stderr,
           \textcolor{stringliteral}{"Usage:\(\backslash\)n\(\backslash\)n"}
           \textcolor{stringliteral}{"\(\backslash\)t%s <rect1> ... <rectN>\(\backslash\)n\(\backslash\)n"}
           \textcolor{stringliteral}{"with rectangles being in the format:\(\backslash\)n"}
           \textcolor{stringliteral}{"\(\backslash\)tWIDTHxHEIGHT<+->X<+->Y\(\backslash\)n"}
           \textcolor{stringliteral}{"examples:\(\backslash\)n"}
           \textcolor{stringliteral}{"\(\backslash\)t100x100+10+10 - width=100, height=100 at x=10, y=10\(\backslash\)n"}
           \textcolor{stringliteral}{"\(\backslash\)t150x50+5+6    - width=150, height=50 at x=5, y=6\(\backslash\)n"},
           progname);
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} *argv[])
\{
   Ecore\_Evas *ee;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *o;
   \textcolor{keywordtype}{int} i;

   \textcolor{keywordflow}{if} (argc < 2)
     \{
        usage(argv[0]);
        \textcolor{keywordflow}{return} -2;
     \}

   input\_rects = calloc(argc - 1, \textcolor{keyword}{sizeof}(\hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle}));
   input\_count = 0;
   maxw = 0;
   maxh = 0;
   \textcolor{keywordflow}{for} (i = 1; i < argc; i++)
     \{
        \hyperlink{struct__Eina__Rectangle}{Eina\_Rectangle} *r = input\_rects + input\_count;
        \textcolor{keywordtype}{char} sx, sy;

        \textcolor{keywordflow}{if} (sscanf(argv[i], \textcolor{stringliteral}{"%dx%d%c%d%c%d"},
                   &(r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}), &(r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h}), &sx, &(r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x}), &sy, &(r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y})) == 6)
          \{
             \textcolor{keywordflow}{if} (sx == \textcolor{charliteral}{'-'}) r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} *= -1;
             \textcolor{keywordflow}{if} (sy == \textcolor{charliteral}{'-'}) r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} *= -1;

             \textcolor{keywordflow}{if} (maxw < r->x + r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w}) maxw = r->\hyperlink{struct__Eina__Rectangle_a8358c0791dcf476432687510ca4e5d5c}{x} + r->\hyperlink{struct__Eina__Rectangle_af6a92d51ec25ee3464c81297ffc3a330}{w};
             \textcolor{keywordflow}{if} (maxh < r->y + r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h}) maxh = r->\hyperlink{struct__Eina__Rectangle_ae74dc834fb71a1f4cd9e3fe11dec3940}{y} + r->\hyperlink{struct__Eina__Rectangle_a7570ed17f58fc94be997414a86130074}{h};
             input\_count++;
          \}
        \textcolor{keywordflow}{else}
          fprintf(stderr, \textcolor{stringliteral}{"ERROR: invalid rectangle ignored: %s\(\backslash\)n"}, argv[i]);
     \}

   \textcolor{keywordflow}{if} (input\_count == 0)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: Could not find any valid rectangle. Exit!\(\backslash\)n"}, stderr);
        usage(argv[0]);
        free(input\_rects);
        \textcolor{keywordflow}{return} -3;
     \}

   \textcolor{keywordflow}{if} ((maxw == 0) || (maxh == 0))
     \{
        fputs(\textcolor{stringliteral}{"ERROR: All rectangles with size 0x0. Exit!\(\backslash\)n"}, stderr);
        usage(argv[0]);
        free(input\_rects);
        \textcolor{keywordflow}{return} -3;
     \}

   \hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}();
   \hyperlink{group__Ecore__Init__Group_ga77757609684a2c922dc5ec398274751b}{ecore\_init}();
   \hyperlink{group__Evas__Main__Group_ga65b3f060b6dd9e488afd0b8cbe101869}{evas\_init}();
   \hyperlink{group__Eina__Main__Group_gabf448ada5bc81a07342b66c6f818ee5e}{eina\_init}();

   winw = 2 * maxw + 3 * WINDOW\_PAD;
   winh = maxh + 2 * WINDOW\_PAD;

   ee = \hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}(NULL, 0, 0, winw, winh, NULL);
   \textcolor{keywordflow}{if} (!ee)
     \{
        fputs(\textcolor{stringliteral}{"ERROR: Could not create window. Check ecore-evas install.\(\backslash\)n"},
              stderr);
        \textcolor{keywordflow}{goto} end;
     \}

   \hyperlink{namespaceevas}{evas} = \hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}(ee);

   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 255, 255, 255, 255);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, winw, winh);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   add\_text(\textcolor{stringliteral}{"Input"}, WINDOW\_PAD, 0, maxw);
   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 200, 200, 200, 255);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, WINDOW\_PAD, WINDOW\_PAD);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, maxw, maxh);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   add\_text(\textcolor{stringliteral}{"Output"}, maxw + 2 * WINDOW\_PAD, 0, maxw);
   o = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(\hyperlink{namespaceevas}{evas});
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(o, 200, 200, 200, 255);
   \hyperlink{group__Evas__Font__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}(o, maxw + 2 * WINDOW\_PAD, WINDOW\_PAD);
   \hyperlink{group__Evas__Font__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{evas\_object\_resize}(o, maxw, maxh);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(o);

   tiler = \hyperlink{group__Eina__Tiler__Group_gaec465d28aa8f533db01e41cbf27aa3c9}{eina\_tiler\_new}(maxw, maxh);
   \hyperlink{group__Ecore__Timer__Group_ga7b9cb9d24ecebfdbb957436e2e669402}{ecore\_timer\_add}(2.0, process\_input, NULL);

   \hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}(ee);
   \hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();

   \hyperlink{group__Eina__List__Group_ga608bd2fbf06293a1b794648990703ab4}{eina\_list\_free}(output\_objs);
   \hyperlink{group__Eina__Tiler__Group_ga73fe7b688f448084d2aa2afb37c76217}{eina\_tiler\_free}(tiler);
   \hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}(ee);

 end:
   free(input\_rects);

   \hyperlink{group__Eina__Main__Group_ga6741fcaba116e31e96ce14dcfa03f568}{eina\_shutdown}();
   \hyperlink{group__Evas__Main__Group_ga95a8864f81d944a92bb012b77ffd1b09}{evas\_shutdown}();
   \hyperlink{group__Ecore__Init__Group_ga768298b932f18d7e7593a447493e5cde}{ecore\_shutdown}();
   \hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}();

   \textcolor{keywordflow}{return} 0;
\}
\end{DoxyCodeInclude}
 