\hypertarget{evas-images_8c-example}{}\doxysection{evas-\/images.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#ifdef HAVE\_CONFIG\_H}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include "config.h"}}
\DoxyCodeLine{\textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define PACKAGE\_EXAMPLES\_DIR "."}}
\DoxyCodeLine{\textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Ecore.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <\mbox{\hyperlink{Ecore__Evas_8h}{Ecore\_Evas.h}}>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <errno.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include "evas-\/common.h"}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#define WIDTH  (320)}}
\DoxyCodeLine{\textcolor{preprocessor}{\#define HEIGHT (240)}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *border\_img\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"/red.png"};}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *valid\_path = PACKAGE\_EXAMPLES\_DIR EVAS\_IMAGE\_FOLDER \textcolor{stringliteral}{"/enlightenment.png"};}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *bogus\_path = \textcolor{stringliteral}{"/tmp/non-\/existent-\/220986.png"};}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *commands = \(\backslash\)}
\DoxyCodeLine{  \textcolor{stringliteral}{"commands are:\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tx -\/ change image's x fill coordinate\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)ty -\/ change image's y fill coordinate\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tw -\/ change image's w fill size\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)te -\/ change image's h fill size\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tf -\/ toggle image filled property (overrides fill)\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)ta -\/ toggle image's alpha channel usage\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tm -\/ toggle border's smooth scaling\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tt -\/ change border's thickness\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tb -\/ change border's center region aspect\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)tc -\/ change border's scaling factor\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)ts -\/ print image's fill property status\(\backslash\)n"}}
\DoxyCodeLine{  \textcolor{stringliteral}{"\(\backslash\)th -\/ print help\(\backslash\)n"};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{struct }test\_data}
\DoxyCodeLine{\{}
\DoxyCodeLine{   Ecore\_Evas  *ee;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas;}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *img1, *img2, *bg, *border;}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{struct }test\_data d = \{0\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_destroy(Ecore\_Evas *ee \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{/* Keep the example's window size in sync with the background image's size */}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_canvas\_resize\_cb(Ecore\_Evas *ee)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{int} w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga931aadf4603731e73e8a84e4b14f1493}{ecore\_evas\_geometry\_get}}(ee, NULL, NULL, \&w, \&h);}
\DoxyCodeLine{   evas\_object\_resize(d.bg, w, h);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *}
\DoxyCodeLine{\_border\_fill\_mode\_to\_str(Evas\_Border\_Fill\_Mode mode)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordflow}{switch} (mode)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} EVAS\_BORDER\_FILL\_NONE:}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"none"};}
\DoxyCodeLine{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} EVAS\_BORDER\_FILL\_DEFAULT:}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"default"};}
\DoxyCodeLine{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} EVAS\_BORDER\_FILL\_SOLID:}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"solid"};}
\DoxyCodeLine{}
\DoxyCodeLine{      \textcolor{keywordflow}{default}:}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"invalid"};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_keydown(\textcolor{keywordtype}{void}        *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}}        *evas \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *o \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}},}
\DoxyCodeLine{            \textcolor{keywordtype}{void}        *einfo)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down}} *ev = einfo;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"h"}) == 0) \textcolor{comment}{/* print help */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        puts(commands);}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"m"}) == 0) \textcolor{comment}{/* toggle border image's smooth scaling */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} smooth\_scale = evas\_object\_image\_smooth\_scale\_get(d.border);}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_smooth\_scale\_set(d.border, !smooth\_scale);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's border is now \%s smooth scaling\(\backslash\)n"},}
\DoxyCodeLine{               smooth\_scale ? \textcolor{stringliteral}{"without"} : \textcolor{stringliteral}{"with"});}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"t"}) == 0) \textcolor{comment}{/* change border's thickness */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordtype}{int} l, r, t, b;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_border\_get(d.border, \&l, \&r, \&t, \&b);}
\DoxyCodeLine{}
\DoxyCodeLine{        l = (l + 3) \% 9;}
\DoxyCodeLine{        r = (r + 3) \% 9;}
\DoxyCodeLine{        t = (t + 3) \% 9;}
\DoxyCodeLine{        b = (b + 3) \% 9;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_border\_set(d.border, l, r, t, b);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's border thickness is now \%d\(\backslash\)n"}, l);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"c"}) == 0) \textcolor{comment}{/* change border's scaling factor */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \textcolor{keywordtype}{double} scale = evas\_object\_image\_border\_scale\_get(d.border);}
\DoxyCodeLine{}
\DoxyCodeLine{        scale *= 2;}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (scale > 4.0) scale = 1.0;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_border\_scale\_set(d.border, scale);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's border scaling factor is now \%f\(\backslash\)n"}, scale);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"b"}) == 0) \textcolor{comment}{/* change border's center}}
\DoxyCodeLine{\textcolor{comment}{                                       * region's aspect */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} fill = \(\backslash\)}
\DoxyCodeLine{          evas\_object\_image\_border\_center\_fill\_get(d.border);}
\DoxyCodeLine{}
\DoxyCodeLine{        fill = (fill + 1) \% 3;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_border\_center\_fill\_set(d.border, fill);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's border center region aspect is now \(\backslash\)"\%s\(\backslash\)"\(\backslash\)n"},}
\DoxyCodeLine{               \_border\_fill\_mode\_to\_str(fill));}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"a"}) == 0) \textcolor{comment}{/* toggle alpha channel usage */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} alpha = evas\_object\_image\_alpha\_get(d.img1);}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_alpha\_set(d.img1, !alpha);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's alpha channel is now \%s\(\backslash\)n"},}
\DoxyCodeLine{               alpha ? \textcolor{stringliteral}{"off"} : \textcolor{stringliteral}{"on"});}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"f"}) == 0) \textcolor{comment}{/* toggle filled property */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}} filled = evas\_object\_image\_filled\_get(d.img1);}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_filled\_set(d.img1, !filled);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's x filled property is now \%s\(\backslash\)n"},}
\DoxyCodeLine{               filled ? \textcolor{stringliteral}{"off"} : \textcolor{stringliteral}{"on"});}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"x"}) == 0) \textcolor{comment}{/* change x fill coordinate */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_fill\_get(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{        x = (x + 20) \% (WIDTH / 2);}
\DoxyCodeLine{        evas\_object\_image\_fill\_set(d.img1, x, y, w, h);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's x fill coordinate changed to \%d\(\backslash\)n"}, x);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"y"}) == 0) \textcolor{comment}{/* change y fill coordinate */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_fill\_get(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{        y = (y + 20) \% (HEIGHT / 2);}
\DoxyCodeLine{        evas\_object\_image\_fill\_set(d.img1, x, y, w, h);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's y fill coordinate changed to \%d\(\backslash\)n"}, y);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"w"}) == 0) \textcolor{comment}{/* change w fill size */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_fill\_get(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (w == (WIDTH / 4)) w = (WIDTH / 2);}
\DoxyCodeLine{        \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (w == WIDTH / 2) w = WIDTH;}
\DoxyCodeLine{        \textcolor{keywordflow}{else} w = (WIDTH / 4);}
\DoxyCodeLine{        evas\_object\_image\_fill\_set(d.img1, x, y, w, h);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's w fill size changed to \%d\(\backslash\)n"}, w);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"e"}) == 0) \textcolor{comment}{/* change h fill size */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_fill\_get(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (h == (HEIGHT / 4)) h = (HEIGHT / 2);}
\DoxyCodeLine{        \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (h == HEIGHT / 2) h = HEIGHT;}
\DoxyCodeLine{        \textcolor{keywordflow}{else} h = (HEIGHT / 4);}
\DoxyCodeLine{        evas\_object\_image\_fill\_set(d.img1, x, y, w, h);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image's h fill size changed to \%d\(\backslash\)n"}, h);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (strcmp(ev-\/>\mbox{\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}}, \textcolor{stringliteral}{"s"}) == 0) \textcolor{comment}{/* status */}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        \mbox{\hyperlink{Evas__Common_8h_a2453e92182bad3b0e0d84e5aff433b07}{Evas\_Coord}} x, y, w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_image\_fill\_get(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Image has fill properties set to: \%d, \%d, \%d, \%d\(\backslash\)n"},}
\DoxyCodeLine{               x, y, w, h);}
\DoxyCodeLine{}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}}
\DoxyCodeLine{main(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!\mbox{\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}}())}
\DoxyCodeLine{     \textcolor{keywordflow}{return} EXIT\_FAILURE;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* this will give you a window with an Evas canvas under the first}}
\DoxyCodeLine{\textcolor{comment}{    * engine available */}}
\DoxyCodeLine{   d.ee = \mbox{\hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}}(NULL, 10, 10, WIDTH, HEIGHT, NULL);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!d.ee)}
\DoxyCodeLine{     \textcolor{keywordflow}{goto} error;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga3680b5c89157167318192157a5d24ec4}{ecore\_evas\_callback\_destroy\_set}}(d.ee, \_on\_destroy);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gaac67f679c9027059a34519fbdea360df}{ecore\_evas\_callback\_resize\_set}}(d.ee, \_canvas\_resize\_cb);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}}(d.ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* the canvas pointer, de facto */}}
\DoxyCodeLine{   d.evas = \mbox{\hyperlink{group__Ecore__Evas__Group_ga75a7cc694b6069e78df47dab0b0f2d20}{ecore\_evas\_get}}(d.ee);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.bg = \mbox{\hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}}(d.evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}}(d.bg, 255, 255, 255, 255); \textcolor{comment}{/* white bg */}}
\DoxyCodeLine{   evas\_object\_move(d.bg, 0, 0); \textcolor{comment}{/* at canvas' origin */}}
\DoxyCodeLine{   evas\_object\_resize(d.bg, WIDTH, HEIGHT); \textcolor{comment}{/* covers full canvas */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.bg);}
\DoxyCodeLine{}
\DoxyCodeLine{   d.img1 = \mbox{\hyperlink{group__Evas__Object__Image_gadd901a6b181c38dc040537b3fd76fcc6}{evas\_object\_image\_add}}(d.evas);}
\DoxyCodeLine{   evas\_object\_image\_file\_set(d.img1, valid\_path, NULL);}
\DoxyCodeLine{   err = evas\_object\_image\_load\_error\_get(d.img1);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (err != EVAS\_LOAD\_ERROR\_NONE)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fprintf(stderr, \textcolor{stringliteral}{"could not load image '\%s'. error string is \(\backslash\)"\%s\(\backslash\)"\(\backslash\)n"},}
\DoxyCodeLine{                valid\_path, \mbox{\hyperlink{group__Evas__Utils_gaca3384642e5ebb32cfeab24c760c739a}{evas\_load\_error\_str}}(err));}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"loaded image '\%s' with succes! error string is \(\backslash\)"\%s\(\backslash\)"\(\backslash\)n"},}
\DoxyCodeLine{               valid\_path, \mbox{\hyperlink{group__Evas__Utils_gaca3384642e5ebb32cfeab24c760c739a}{evas\_load\_error\_str}}(err));}
\DoxyCodeLine{}
\DoxyCodeLine{        evas\_object\_move(d.img1, 3, 3);}
\DoxyCodeLine{        evas\_object\_image\_fill\_set(d.img1, 0, 0, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        evas\_object\_resize(d.img1, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.img1);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga4405e118e1fb762987af1269b6848db5}{evas\_object\_focus\_set}}(d.bg, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(}
\DoxyCodeLine{          d.bg, \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}}, \_on\_keydown, NULL);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* this is a border around the image above, here just to emphasize}}
\DoxyCodeLine{\textcolor{comment}{    * its geometry */}}
\DoxyCodeLine{   d.border = evas\_object\_image\_filled\_add(d.evas);}
\DoxyCodeLine{   evas\_object\_image\_file\_set(d.border, border\_img\_path, NULL);}
\DoxyCodeLine{   evas\_object\_image\_border\_set(d.border, 3, 3, 3, 3);}
\DoxyCodeLine{   evas\_object\_image\_border\_center\_fill\_set(d.border, EVAS\_BORDER\_FILL\_NONE);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_move(d.border, 0, 0);}
\DoxyCodeLine{   evas\_object\_resize(d.border, (WIDTH / 2) + 6, (HEIGHT / 2) + 6);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.border);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{/* image loading will fail for this one -\/-\/ unless one cheats and}}
\DoxyCodeLine{\textcolor{comment}{    * puts a valid image on that path */}}
\DoxyCodeLine{   d.img2 = \mbox{\hyperlink{group__Evas__Object__Image_gadd901a6b181c38dc040537b3fd76fcc6}{evas\_object\_image\_add}}(d.evas);}
\DoxyCodeLine{   evas\_object\_image\_file\_set(d.img2, bogus\_path, NULL);}
\DoxyCodeLine{   err = evas\_object\_image\_load\_error\_get(d.img2);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (err != EVAS\_LOAD\_ERROR\_NONE)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        fprintf(stderr, \textcolor{stringliteral}{"could not load image '\%s': error string is \(\backslash\)"\%s\(\backslash\)"\(\backslash\)n"},}
\DoxyCodeLine{                bogus\_path, \mbox{\hyperlink{group__Evas__Utils_gaca3384642e5ebb32cfeab24c760c739a}{evas\_load\_error\_str}}(err));}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{else}}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        evas\_object\_move(d.img2, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        evas\_object\_image\_fill\_set(d.img2, 0, 0, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        evas\_object\_resize(d.img2, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(d.img2);}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   puts(commands);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}}(d.ee);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{}
\DoxyCodeLine{error:}
\DoxyCodeLine{   fprintf(stderr, \textcolor{stringliteral}{"error: Requires at least one Evas engine built and linked"}}
\DoxyCodeLine{                   \textcolor{stringliteral}{" to ecore-\/evas for this example to run properly.\(\backslash\)n"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}}();}
\DoxyCodeLine{   \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\}}
\end{DoxyCodeInclude}
 