In this example, we illustrate how to start using the Edje library, with the very basic one needs to instantiate an Edje object.

We place, in the canvas, an Edje object along with a {\bfseries red} border image to delimit its geometry. After we instantiate the Edje object, we {\bfseries have} to set a file and a group, within that file, to bind to it. For this example, we're using an E\+D\+C file which declares two parts (blue and green rectangles) and an item data\+: 
\begin{DoxyCodeInclude}
1 collections \{
2    group \{
3       name: "example\_group";
4       max: 500 500;
5       min: 50 50;
6 
7       data \{
8          item: "example\_data" "a string";
9       \}
10 
11       parts \{
12          part \{
13             name: "part\_one";
14             type: RECT;
15             scale: 1;
16             description \{
17                min: 50 50;
18                max: 50 50;
19                state: "default" 0.0;
20                color: 0 0 255 255; /* blue */
21                rel1.relative: 0.0 0.0;
22                rel2.relative: 1.0 1.0;
23             \}
24          \}
25 
26          part \{
27             name: "part\_two";
28             type: RECT;
29             description \{
30                state: "default" 0.0;
31                color: 0 255 0 255; /* green */
32                rel1.relative: -1.0 -1.0;
33                rel2.relative: 0.0 0.0;
34             \}
35          \}
36       \}
37 
38    \}
39 \}
\end{DoxyCodeInclude}


We start by trying to access an {\bfseries unexistant} group in the file, so that you can see the usefulness of edje\+\_\+object\+\_\+load\+\_\+error\+\_\+get() and \hyperlink{group__Edje__Object__File_ga034465c2de4ab495802da20f332c386e}{edje\+\_\+load\+\_\+error\+\_\+str()}. Check that the error message will tell you just that -- a group which didn't exist in the file was called for\+:  
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}
  
\begin{DoxyCodeInclude}
   edje\_obj = edje\_object\_add(evas);

   \textcolor{comment}{/* exercising Edje loading error, on purpose */}
   \textcolor{keywordflow}{if} (!edje\_object\_file\_set(edje\_obj, edje\_file, \textcolor{stringliteral}{"unexistant\_group"}))
     \{
        \textcolor{keywordtype}{int} err = edje\_object\_load\_error\_get(edje\_obj);
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg = \hyperlink{group__Edje__Object__File_ga034465c2de4ab495802da20f332c386e}{edje\_load\_error\_str}(err);
        fprintf(stderr, \textcolor{stringliteral}{"Could not load 'unexistant\_group' from basic.edj:"}
                        \textcolor{stringliteral}{" %s\(\backslash\)n"}, errmsg);
     \}

\end{DoxyCodeInclude}


Than, we finally bind our Edje object to {\ttfamily \char`\"{}example\+\_\+group\char`\"{}}, printing a message afterwards\+:  
\begin{DoxyCodeInclude}

\end{DoxyCodeInclude}


What follows is a series of Edje A\+P\+I calls which are of general use. The first of them is edje\+\_\+object\+\_\+data\+\_\+get(), which we use to get the value we have put in the {\ttfamily \char`\"{}example\+\_\+data\char`\"{}} data field, in our E\+D\+C object declaration\+:  
\begin{DoxyCodeInclude}
   fprintf(stdout, \textcolor{stringliteral}{"'example\_data' data field in group 'example\_group' has "}
                   \textcolor{stringliteral}{"the value: %s\(\backslash\)n"}, edje\_object\_data\_get(edje\_obj,
                                                           \textcolor{stringliteral}{"example\_data"}));

\end{DoxyCodeInclude}


Than, we exemplify edje\+\_\+object\+\_\+part\+\_\+exists()\+:  
\begin{DoxyCodeInclude}
   fprintf(stdout, \textcolor{stringliteral}{"Testing if 'part\_one' part exists: %s\(\backslash\)n"},
           edje\_object\_part\_exists(edje\_obj, \textcolor{stringliteral}{"part\_one"}) ? \textcolor{stringliteral}{"yes!"} : \textcolor{stringliteral}{"no"});

\end{DoxyCodeInclude}


The next call is to query {\ttfamily \char`\"{}part\+\_\+one\char`\"{}'s} geometry, relative to the whole Edje object's area. The part will be situated in the middle of the Edje object's, because it has a restricted forced size (we set its minimum size equal to its maximum, for that) and, by default, parts are aligned to the center of their containers\+:  
\begin{DoxyCodeInclude}
   edje\_object\_part\_geometry\_get(edje\_obj, \textcolor{stringliteral}{"part\_one"}, &x, &y, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The geometry of that part inside the Edje object's area "}
                   \textcolor{stringliteral}{"is: x = %d, y = %d, w = %d, h = %d\(\backslash\)n"}, x, y, w, h);

\end{DoxyCodeInclude}


We can grab a direct pointer on the rectangle implementing {\ttfamily \char`\"{}part\+\_\+one\char`\"{}}, by using edje\+\_\+object\+\_\+part\+\_\+object\+\_\+get(). Since we are not allowed to set properties on it, we just check its color, to assure its really blue, as declared in the E\+D\+C\+:  
\begin{DoxyCodeInclude}
   \hyperlink{group__Evas__Object__Group__Basic_ga0854bae878bfc39f51b9c989353c973f}{evas\_object\_color\_get}(edje\_object\_part\_object\_get(edje\_obj, \textcolor{stringliteral}{"part\_one"}),
                         &x, &y, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"That part's color components are: r = %d, g = %d, b = %d,"}
                   \textcolor{stringliteral}{" a = %d\(\backslash\)n"}, x, y, w, h);

\end{DoxyCodeInclude}


The {\ttfamily \char`\"{}min\char`\"{}} and {\ttfamily \char`\"{}max\char`\"{}} E\+D\+C properties can be queried with the following calls\+:  
\begin{DoxyCodeInclude}
   edje\_object\_size\_max\_get(edje\_obj, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's max. size is: %d, %d\(\backslash\)n"}, w, h);

   edje\_object\_size\_min\_get(edje\_obj, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's min. size is: %d, %d\(\backslash\)n"}, w, h);

\end{DoxyCodeInclude}


The next two calls are to make {\bfseries size calculations} on our object. Because of the minimum size declared for {\ttfamily \char`\"{}part\+\_\+one\char`\"{}} part's default state description, that will be our exact minimum size calculated for the group (remember the {\ttfamily \char`\"{}min\char`\"{}} declaration at group level is just a {\bfseries hint}, not an enforcement). We then exercise the edje\+\_\+object\+\_\+size\+\_\+min\+\_\+restricted\+\_\+calc() function, passing a minimum size of 500, in each axis. Since we have {\bfseries no} object bigger than that, it will be the minimum size calculated, in the end\+:  
\begin{DoxyCodeInclude}
   edje\_object\_size\_min\_calc(edje\_obj, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's min. size reported by min. size"}
                   \textcolor{stringliteral}{" calculation is: w = %d, h = %d\(\backslash\)n"}, w, h);

   edje\_object\_size\_min\_restricted\_calc(edje\_obj, &w, &h, 500, 500);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's min. size reported by *restricted* "}
                   \textcolor{stringliteral}{"min. size calculation is: w = %d, h = %d\(\backslash\)n"}, w, h);

\end{DoxyCodeInclude}


{\ttfamily \char`\"{}part\+\_\+two\char`\"{}} part is there with a purpose\+: since it extrapolates the Edje object's boundaries, the edje\+\_\+object\+\_\+parts\+\_\+extends\+\_\+calc() function will report origin coordinates for the rectangle grouping both parts with {\bfseries negative} values, indicating it extrapolates to the upper left of our group, just as we see it.

To interact with the last features exemplified in the program, there's a command line interface. A help string can be asked for with the 'h' key\+:  
\begin{DoxyCodeInclude}
\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} commands[] = \(\backslash\)
  \textcolor{stringliteral}{"commands are:\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)ts - change Edje's global scaling factor\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tr - change center rectangle's scaling factor\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tEsc - exit\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)th - print help\(\backslash\)n"};

\end{DoxyCodeInclude}


Those commands will change the scaling factors of our Edje objects. The first of them, {\ttfamily 's'}, will change Edje's {\bfseries global} scaling factor between {\ttfamily 1.\+0} (no scaling) and {\ttfamily 2.\+0} (double scale). Scaling will be applied to {\ttfamily \char`\"{}part\+\_\+one\char`\"{}}, only, because that's the part flagged to be scaled at E\+D\+C level\+:  
\begin{DoxyCodeInclude}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}, \textcolor{stringliteral}{"s"}) == 0) \textcolor{comment}{/* global scaling factor */}
     \{
        \textcolor{keywordtype}{double} scale = \hyperlink{group__Edje__Object__Scale_ga481c3d35b55207c2536872e1d3e235cf}{edje\_scale\_get}();

        printf(\textcolor{stringliteral}{"got scale %f\(\backslash\)n"}, scale);

        \textcolor{keywordflow}{if} (scale != 1.0) scale = 1.0;
        \textcolor{keywordflow}{else} scale = 2.0;

        \hyperlink{group__Edje__Object__Scale_gadfb6850eece96768a651702b0a7535fb}{edje\_scale\_set}(scale);

        fprintf(stdout, \textcolor{stringliteral}{"Setting global scaling factor to %f.\(\backslash\)n"}, scale);

        \textcolor{keywordflow}{return};
     \}

\end{DoxyCodeInclude}


Note, finally, that the {\ttfamily 's'} command will depend on the 'r' one to have its effects applied. The latter will change {\ttfamily \char`\"{}part\+\_\+one\char`\"{}'s} {\bfseries individual} scaling factor, which {\bfseries overrides} Edje's global scaling factor. Only when the individual one is set to zero, will the global one take effect\+:  
\begin{DoxyCodeInclude}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}, \textcolor{stringliteral}{"r"}) == 0) \textcolor{comment}{/* individual scaling factor */}
     \{
        \textcolor{keywordtype}{double} scale = edje\_object\_scale\_get(edje\_obj);

        printf(\textcolor{stringliteral}{"got scale %f\(\backslash\)n"}, scale);

        \textcolor{keywordflow}{if} (!scale) scale = 1.0;
        \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (scale == 1.0) scale = 2.0;
        \textcolor{keywordflow}{else} scale = 0.0;

        edje\_object\_scale\_set(edje\_obj, scale);

        fprintf(stdout, \textcolor{stringliteral}{"Setting center rectangle's scaling factor to %f.\(\backslash\)n"},
                scale);

        \textcolor{keywordflow}{return};
     \}

\end{DoxyCodeInclude}


The example's window should look like this picture\+:

  
\begin{DoxyImage}
\includegraphics{edje-basics-example}
\caption{width=}
\end{DoxyImage}


The full example follows. 
\begin{DoxyCodeInclude}

\textcolor{preprocessor}{#ifdef HAVE\_CONFIG\_H}
\textcolor{preprocessor}{# include "config.h"}
\textcolor{preprocessor}{#else}
\textcolor{preprocessor}{# define EINA\_UNUSED}
\textcolor{preprocessor}{#endif}

\textcolor{preprocessor}{#ifndef PACKAGE\_DATA\_DIR}
\textcolor{preprocessor}{#define PACKAGE\_DATA\_DIR "."}
\textcolor{preprocessor}{#endif}

\textcolor{preprocessor}{#include <stdio.h>}

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

\textcolor{preprocessor}{#define WIDTH  (300)}
\textcolor{preprocessor}{#define HEIGHT (300)}

\textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char} commands[] = \(\backslash\)
  \textcolor{stringliteral}{"commands are:\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)ts - change Edje's global scaling factor\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tr - change center rectangle's scaling factor\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)tEsc - exit\(\backslash\)n"}
  \textcolor{stringliteral}{"\(\backslash\)th - print help\(\backslash\)n"};

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_keydown(\textcolor{keywordtype}{void}        *data,
            \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}        *evas EINA\_UNUSED,
            \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *o EINA\_UNUSED,
            \textcolor{keywordtype}{void}        *einfo)
\{
   \hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down} *ev;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}         *edje\_obj;

   ev = (\hyperlink{struct__Evas__Event__Key__Down}{Evas\_Event\_Key\_Down} *)einfo;
   edje\_obj = (\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *)data;

   \textcolor{keywordflow}{if} (strcmp(ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}, \textcolor{stringliteral}{"h"}) == 0) \textcolor{comment}{/* print help */}
     \{
        fprintf(stdout, commands);
        \textcolor{keywordflow}{return};
     \}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}, \textcolor{stringliteral}{"s"}) == 0) \textcolor{comment}{/* global scaling factor */}
     \{
        \textcolor{keywordtype}{double} scale = \hyperlink{group__Edje__Object__Scale_ga481c3d35b55207c2536872e1d3e235cf}{edje\_scale\_get}();

        printf(\textcolor{stringliteral}{"got scale %f\(\backslash\)n"}, scale);

        \textcolor{keywordflow}{if} (scale != 1.0) scale = 1.0;
        \textcolor{keywordflow}{else} scale = 2.0;

        \hyperlink{group__Edje__Object__Scale_gadfb6850eece96768a651702b0a7535fb}{edje\_scale\_set}(scale);

        fprintf(stdout, \textcolor{stringliteral}{"Setting global scaling factor to %f.\(\backslash\)n"}, scale);

        \textcolor{keywordflow}{return};
     \}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}, \textcolor{stringliteral}{"r"}) == 0) \textcolor{comment}{/* individual scaling factor */}
     \{
        \textcolor{keywordtype}{double} scale = edje\_object\_scale\_get(edje\_obj);

        printf(\textcolor{stringliteral}{"got scale %f\(\backslash\)n"}, scale);

        \textcolor{keywordflow}{if} (!scale) scale = 1.0;
        \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (scale == 1.0) scale = 2.0;
        \textcolor{keywordflow}{else} scale = 0.0;

        edje\_object\_scale\_set(edje\_obj, scale);

        fprintf(stdout, \textcolor{stringliteral}{"Setting center rectangle's scaling factor to %f.\(\backslash\)n"},
                scale);

        \textcolor{keywordflow}{return};
     \}
   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key}, \textcolor{stringliteral}{"Escape"}))
     \hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}();
   \textcolor{keywordflow}{else}
     \{
        printf(\textcolor{stringliteral}{"unhandled key: %s\(\backslash\)n"}, ev->\hyperlink{struct__Evas__Event__Key__Down_a70473bba88a1afaee180a54150513824}{key});
        fprintf(stdout, commands);
     \}
\}

\textcolor{keyword}{static} \textcolor{keywordtype}{void}
\_on\_delete(Ecore\_Evas *ee EINA\_UNUSED)
\{
   \hyperlink{group__Ecore__Main__Loop__Group_ga95cf8e97dff0716433c2c5474d606a98}{ecore\_main\_loop\_quit}();
\}

\textcolor{keywordtype}{int}
main(\textcolor{keywordtype}{int} argc EINA\_UNUSED, \textcolor{keywordtype}{char} *argv[] EINA\_UNUSED)
\{
   \textcolor{keyword}{const} \textcolor{keywordtype}{char}  *img\_file = PACKAGE\_DATA\_DIR\textcolor{stringliteral}{"/red.png"};
   \textcolor{keyword}{const} \textcolor{keywordtype}{char}  *edje\_file = PACKAGE\_DATA\_DIR\textcolor{stringliteral}{"/basic.edj"};
   Ecore\_Evas  *ee;
   \hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}        *evas;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *bg;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *border;
   \hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object} *edje\_obj;
   \textcolor{keywordtype}{int}          x;
   \textcolor{keywordtype}{int}          y;
   \textcolor{keywordtype}{int}          w;
   \textcolor{keywordtype}{int}          h;

   \textcolor{keywordflow}{if} (!\hyperlink{group__Ecore__Evas__Group_ga32ddbb6457033ad435a177eb0c4fe235}{ecore\_evas\_init}())
     \textcolor{keywordflow}{return} EXIT\_FAILURE;

   \textcolor{keywordflow}{if} (!\hyperlink{group__Edje__General__Group_ga1c9c6594f38023c29fbfb2d0c8c675db}{edje\_init}())
     \textcolor{keywordflow}{goto} shutdown\_ecore\_evas;

   \textcolor{comment}{/* this will give you a window with an Evas canvas under the first}
\textcolor{comment}{    * engine available */}
   ee = \hyperlink{group__Ecore__Evas__Group_gac7f2cdbcb79635c34317c1183dd04cb0}{ecore\_evas\_new}(NULL, 0, 0, WIDTH, HEIGHT, NULL);
   \textcolor{keywordflow}{if} (!ee) \textcolor{keywordflow}{goto} shutdown\_edje;

   \hyperlink{group__Ecore__Evas__Group_ga3d478e975e2101b9b821ef24baf3dd9e}{ecore\_evas\_callback\_delete\_request\_set}(ee, \_on\_delete);
   \hyperlink{group__Ecore__Evas__Group_ga3b2832e0373bbafae2bb7143618535c1}{ecore\_evas\_title\_set}(ee, \textcolor{stringliteral}{"Edje Basics Example"});

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

   bg = \hyperlink{group__Evas__Object__Rectangle_ga4d80fc32ad1cac28428cebd65d746751}{evas\_object\_rectangle\_add}(evas);
   \hyperlink{group__Evas__Object__Group__Basic_gae34bdcfd7f5100151f6ea8ef4a392949}{evas\_object\_color\_set}(bg, 255, 255, 255, 255); \textcolor{comment}{/* white bg */}
   evas\_object\_move(bg, 0, 0); \textcolor{comment}{/* at canvas' origin */}
   evas\_object\_resize(bg, WIDTH, HEIGHT); \textcolor{comment}{/* covers full canvas */}
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(bg);
   \hyperlink{group__Ecore__Evas__Group_gac35627a5c3a766ee42762dbcc9eb733d}{ecore\_evas\_object\_associate}(ee, bg, ECORE\_EVAS\_OBJECT\_ASSOCIATE\_BASE);

   evas\_object\_focus\_set(bg, \hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE});

   edje\_obj = edje\_object\_add(evas);

   \textcolor{comment}{/* exercising Edje loading error, on purpose */}
   \textcolor{keywordflow}{if} (!edje\_object\_file\_set(edje\_obj, edje\_file, \textcolor{stringliteral}{"unexistant\_group"}))
     \{
        \textcolor{keywordtype}{int} err = edje\_object\_load\_error\_get(edje\_obj);
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg = \hyperlink{group__Edje__Object__File_ga034465c2de4ab495802da20f332c386e}{edje\_load\_error\_str}(err);
        fprintf(stderr, \textcolor{stringliteral}{"Could not load 'unexistant\_group' from basic.edj:"}
                        \textcolor{stringliteral}{" %s\(\backslash\)n"}, errmsg);
     \}

   \textcolor{keywordflow}{if} (!edje\_object\_file\_set(edje\_obj, edje\_file, \textcolor{stringliteral}{"example\_group"}))
     \{
        \textcolor{keywordtype}{int} err = edje\_object\_load\_error\_get(edje\_obj);
        \textcolor{keyword}{const} \textcolor{keywordtype}{char} *errmsg = \hyperlink{group__Edje__Object__File_ga034465c2de4ab495802da20f332c386e}{edje\_load\_error\_str}(err);
        fprintf(stderr, \textcolor{stringliteral}{"Could not load 'example\_group' from basic.edj: %s\(\backslash\)n"},
                errmsg);

        \hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}(edje\_obj);
        \textcolor{keywordflow}{goto} shutdown\_edje;
     \}

   fprintf(stdout, \textcolor{stringliteral}{"Loaded Edje object bound to group 'example\_group' from"}
                   \textcolor{stringliteral}{" file basic.edj with success!\(\backslash\)n"});

   evas\_object\_move(edje\_obj, 20, 20);
   evas\_object\_resize(edje\_obj, WIDTH - 40, HEIGHT - 40);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(edje\_obj);

   \hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}(bg, 
      \hyperlink{Evas__Common_8h_a99e208e463a20499aabe6faac8a8cb8aa336b86bad4f145f84c155e4922335584}{EVAS\_CALLBACK\_KEY\_DOWN}, \_on\_keydown, edje\_obj);

   \textcolor{comment}{/* this is a border around the Edje object above, here just to}
\textcolor{comment}{    * emphasize its geometry */}
   border = \hyperlink{group__Evas__Object__Image_ga0e8cb83d31d02bf583c75925b7cd14d7}{evas\_object\_image\_filled\_add}(evas);
   \hyperlink{group__Evas__Object__Image_gac27fd0ceabe5f56607b7a86d71577df1}{evas\_object\_image\_file\_set}(border, img\_file, NULL);
   evas\_object\_image\_border\_set(border, 2, 2, 2, 2);
   evas\_object\_image\_border\_center\_fill\_set(border, \hyperlink{Evas__Common_8h_a4a05f0fd82f51c6b330e349457cdc7e2a2ad856ac6aab5e2659c3a584a37aec70}{EVAS\_BORDER\_FILL\_NONE});

   evas\_object\_resize(border, WIDTH - 40 + 4, HEIGHT - 40 + 4);
   evas\_object\_move(border, 20 - 2, 20 - 2);
   \hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}(border);

   fprintf(stdout, \textcolor{stringliteral}{"'example\_data' data field in group 'example\_group' has "}
                   \textcolor{stringliteral}{"the value: %s\(\backslash\)n"}, edje\_object\_data\_get(edje\_obj,
                                                           \textcolor{stringliteral}{"example\_data"}));

   fprintf(stdout, \textcolor{stringliteral}{"Testing if 'part\_one' part exists: %s\(\backslash\)n"},
           edje\_object\_part\_exists(edje\_obj, \textcolor{stringliteral}{"part\_one"}) ? \textcolor{stringliteral}{"yes!"} : \textcolor{stringliteral}{"no"});

   edje\_object\_part\_geometry\_get(edje\_obj, \textcolor{stringliteral}{"part\_one"}, &x, &y, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The geometry of that part inside the Edje object's area "}
                   \textcolor{stringliteral}{"is: x = %d, y = %d, w = %d, h = %d\(\backslash\)n"}, x, y, w, h);

   \hyperlink{group__Evas__Object__Group__Basic_ga0854bae878bfc39f51b9c989353c973f}{evas\_object\_color\_get}(edje\_object\_part\_object\_get(edje\_obj, \textcolor{stringliteral}{"part\_one"}),
                         &x, &y, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"That part's color components are: r = %d, g = %d, b = %d,"}
                   \textcolor{stringliteral}{" a = %d\(\backslash\)n"}, x, y, w, h);

   edje\_object\_size\_max\_get(edje\_obj, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's max. size is: %d, %d\(\backslash\)n"}, w, h);

   edje\_object\_size\_min\_get(edje\_obj, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's min. size is: %d, %d\(\backslash\)n"}, w, h);

   edje\_object\_size\_min\_calc(edje\_obj, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's min. size reported by min. size"}
                   \textcolor{stringliteral}{" calculation is: w = %d, h = %d\(\backslash\)n"}, w, h);

   edje\_object\_size\_min\_restricted\_calc(edje\_obj, &w, &h, 500, 500);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's min. size reported by *restricted* "}
                   \textcolor{stringliteral}{"min. size calculation is: w = %d, h = %d\(\backslash\)n"}, w, h);

   edje\_object\_parts\_extends\_calc(edje\_obj, &x, &y, &w, &h);
   fprintf(stdout, \textcolor{stringliteral}{"The Edje object's \(\backslash\)"extended\(\backslash\)" geometry is: x = %d, "}
                   \textcolor{stringliteral}{"y = %d, w = %d, h = %d\(\backslash\)n"}, x, y, w, h);

   fprintf(stdout, commands);

   \hyperlink{group__Ecore__Evas__Group_ga4953047ff97d4f1b0d75a7d513d4f317}{ecore\_evas\_show}(ee);

   \hyperlink{group__Ecore__Main__Loop__Group_gaf103b9f668bb3e4fed12e52c6180132d}{ecore\_main\_loop\_begin}();

   \hyperlink{group__Ecore__Evas__Group_gad3ec61f2aa03df4d3dbfd0d311e0c8dc}{ecore\_evas\_free}(ee);
   \hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}();
   \hyperlink{group__Edje__General__Group_ga01041f6702f2d81bf10c3e41899805cb}{edje\_shutdown}();

   \textcolor{keywordflow}{return} EXIT\_SUCCESS;

 shutdown\_edje:
   \hyperlink{group__Edje__General__Group_ga01041f6702f2d81bf10c3e41899805cb}{edje\_shutdown}();
 shutdown\_ecore\_evas:
   \hyperlink{group__Ecore__Evas__Group_gab8fa311077f749190c9b622f672b2214}{ecore\_evas\_shutdown}();

   \textcolor{keywordflow}{return} EXIT\_FAILURE;
\}
\end{DoxyCodeInclude}


To compile use this command\+: \begin{DoxyVerb}* gcc -o edje-basic edje-basic.c -DPACKAGE_BIN_DIR=\"/Where/enlightenment/is/installed/bin\" -DPACKAGE_LIB_DIR=\"/Where/enlightenment/is/installed/lib\"
* -DPACKAGE_DATA_DIR=\"/Where/enlightenment/is/installed/share\"
* `pkg-config --cflags --libs evas ecore ecore-evas edje`
*
* edje_cc basic.edc
* \end{DoxyVerb}
 