\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{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{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(\mbox{\hyperlink{group__Evas__Object__Image_ga9f789224285e646309b7dd81a2401910}{Evas\_Border\_Fill\_Mode}} mode)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordflow}{switch} (mode)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \mbox{\hyperlink{group__Evas__Object__Image_gga9f789224285e646309b7dd81a2401910a2ad856ac6aab5e2659c3a584a37aec70}{EVAS\_BORDER\_FILL\_NONE}}:}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}none"{}};}
\DoxyCodeLine{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \mbox{\hyperlink{group__Evas__Object__Image_gga9f789224285e646309b7dd81a2401910a712fa943763dc39ab49c66b9d0182a73}{EVAS\_BORDER\_FILL\_DEFAULT}}:}
\DoxyCodeLine{        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}default"{}};}
\DoxyCodeLine{}
\DoxyCodeLine{      \textcolor{keywordflow}{case} \mbox{\hyperlink{group__Evas__Object__Image_gga9f789224285e646309b7dd81a2401910ab85dc4cffd8ce11305df0d3857f0799a}{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 = \mbox{\hyperlink{group__Evas__Object__Image_gac0177597371f246ac377782fcc59c5be}{evas\_object\_image\_smooth\_scale\_get}}(d.border);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_gaf79e692448eb80c39da1fd60f8db5dda}{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{        \mbox{\hyperlink{group__Evas__Object__Image_gaa7a8a4cb7969686d32a3bf2e046ce892}{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{        \mbox{\hyperlink{group__Evas__Object__Image_gace5efad74de9f87cd996b2a34b3ea591}{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 = \mbox{\hyperlink{group__Evas__Object__Image_ga78faa38034ae563bdce1ecd4012c0936}{evas\_object\_image\_border\_scale\_get}}(d.border);}
\DoxyCodeLine{}
\DoxyCodeLine{        scale *= 2;}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (scale > 4.0) scale = 1.0;}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_ga8bddfe1356d0d798e85bb9f07b76dedc}{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{        \mbox{\hyperlink{group__Evas__Object__Image_ga1f134668dedc8ad855c3af28fd2df8f6}{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 = \mbox{\hyperlink{group__Evas__Image_ga6dbbaa884de84071352a94b50f6606da}{evas\_object\_image\_alpha\_get}}(d.img1);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_ga325eaa4977ef66b8a0cd5de1a221cb26}{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 = \mbox{\hyperlink{group__Evas__Object__Image_ga005e2719d91af1123cc20cf1e6e8b182}{evas\_object\_image\_filled\_get}}(d.img1);}
\DoxyCodeLine{}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_ga26dff9f60428cac5e02bc822b025031a}{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{        \mbox{\hyperlink{group__Evas__Object__Image_ga12091147e3567d1714d1a6986c48f179}{evas\_object\_image\_fill\_get}}(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{        x = (x + 20) \% (WIDTH / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_gaf9a32e36b3446f597baf95aab37e33da}{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{        \mbox{\hyperlink{group__Evas__Object__Image_ga12091147e3567d1714d1a6986c48f179}{evas\_object\_image\_fill\_get}}(d.img1, \&x, \&y, \&w, \&h);}
\DoxyCodeLine{        y = (y + 20) \% (HEIGHT / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_gaf9a32e36b3446f597baf95aab37e33da}{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{        \mbox{\hyperlink{group__Evas__Object__Image_ga12091147e3567d1714d1a6986c48f179}{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{        \mbox{\hyperlink{group__Evas__Object__Image_gaf9a32e36b3446f597baf95aab37e33da}{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{        \mbox{\hyperlink{group__Evas__Object__Image_ga12091147e3567d1714d1a6986c48f179}{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{        \mbox{\hyperlink{group__Evas__Object__Image_gaf9a32e36b3446f597baf95aab37e33da}{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{        \mbox{\hyperlink{group__Evas__Object__Image_ga12091147e3567d1714d1a6986c48f179}{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{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(d.bg, 0, 0); \textcolor{comment}{/* at canvas' origin */}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{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{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(d.img1, valid\_path, NULL);}
\DoxyCodeLine{   err = \mbox{\hyperlink{group__Evas__Object__Image_ga5a1eec674128f5d1365e80d628ad2bc3}{evas\_object\_image\_load\_error\_get}}(d.img1);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (err != \mbox{\hyperlink{group__Evas__Image_gga17a0211044defa51aa3ceaadaa4e53c2a016233a6ae27765a3aa2759753c112ac}{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{        \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(d.img1, 3, 3);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_gaf9a32e36b3446f597baf95aab37e33da}{evas\_object\_image\_fill\_set}}(d.img1, 0, 0, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{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 = \mbox{\hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}}(d.evas);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(d.border, border\_img\_path, NULL);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_gace5efad74de9f87cd996b2a34b3ea591}{evas\_object\_image\_border\_set}}(d.border, 3, 3, 3, 3);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Image_ga1f134668dedc8ad855c3af28fd2df8f6}{evas\_object\_image\_border\_center\_fill\_set}}(d.border, \mbox{\hyperlink{group__Evas__Object__Image_gga9f789224285e646309b7dd81a2401910a2ad856ac6aab5e2659c3a584a37aec70}{EVAS\_BORDER\_FILL\_NONE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(d.border, 0, 0);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{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{   \mbox{\hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}}(d.img2, bogus\_path, NULL);}
\DoxyCodeLine{   err = \mbox{\hyperlink{group__Evas__Object__Image_ga5a1eec674128f5d1365e80d628ad2bc3}{evas\_object\_image\_load\_error\_get}}(d.img2);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (err != \mbox{\hyperlink{group__Evas__Image_gga17a0211044defa51aa3ceaadaa4e53c2a016233a6ae27765a3aa2759753c112ac}{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{        \mbox{\hyperlink{group__Evas__Object__Group_ga02da8091bbac768b8e86c7b74b2a94f9}{evas\_object\_move}}(d.img2, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Image_gaf9a32e36b3446f597baf95aab37e33da}{evas\_object\_image\_fill\_set}}(d.img2, 0, 0, WIDTH / 2, HEIGHT / 2);}
\DoxyCodeLine{        \mbox{\hyperlink{group__Evas__Object__Group_ga21e8604c0e4a93e469bff4bd069e82b5}{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}
 