Tizen Native API
Edje
Date:
2003 (created)

Table of Contents

Introduction

Edje is a complex graphical design & layout library.

It doesn't intend to do a containing and regular layout like a widget set, but it is the base for such components. Based on the requirements of Enlightenment 0.17, Edje should serve all the purposes of creating visual elements (borders of windows, buttons, scrollbars, etc.) and allow the designer the ability to animate, layout, and control the look and feel of any program using Edje as its basic GUI constructor. This library allows for multiple collections of Layouts in one file, sharing the same image and font database and thus allowing a whole theme to be conveniently packaged into 1 file and shipped around.

Edje separates the layout and behavior logic. Edje files ship with an image and font database that is used by all the parts of all the collections to source graphical data. It has a directory of logical part names pointing to the part collection entry ID in the file (thus allowing for multiple logical names to point to the same part collection, allowing for the sharing of data between display elements). Each part collection consists of a list of visual parts, as well as a list of programs. A program is a conditionally run program such that if a particular event occurs (a button is pressed, a mouse enters or leaves a part) it triggers an action that may affect other parts. In this way a part collection can be "programmed" via its file to highlight buttons when the mouse passes over them or show hidden parts when a button is clicked somewhere, and so on. The actions performed in changing from one state to another are also allowed to transition over a period of time, allowing animation. Programs and animations can be run in "parallel".

This separation and simplistic event driven style of programming can produce almost any look and feel that one could want for basic visual elements. Anything more complex is mostly the domain of an application or a widget set that may use Edje as a convenient way to able to configure parts of the display.

For details on Edje's history, see the Edje History section.

So how does this all work?

Edje internally holds a geometry state machine and state graph of what is visible or not, where it is visible, at what size, with what colors, and so on. This is described to Edje from an Edje .edj file containing this information. These files can be produced by using edje_cc to take a text file (a .edc file) and "compile" an output .edj file that contains this information, images, and any other data that is needed.

The application using Edje then creates an object in its Evas canvas and sets the bundle file to use, specifying the group name to use. Edje loads such information and creates all the required children objects with the specified properties as defined in each part of the given group.

Before going into the depth of changing or creating your own edje source (edc) files, read edcref.

Edje History

It's a sequel to "Ebits" which has serviced the needs of Enlightenment development for early version 0.17. The original design parameters under which Ebits is built are a lot more restricted than the resulting use of them, thus Edje is born.

Edje is a more complex layout engine compared to Ebits. It doesn't pretend to do a containing and regular layout like a widget set. It still inherits the more simplistic layout ideas behind Ebits, but it now does them a lot more cleanly, allowing for easy expansion, and the ability to cover much more ground than Ebits could. For the purposes of Enlightenment 0.17, Edje is conceived to serve all the purposes of creating visual elements (borders of windows, buttons, scrollbars, etc.) and allow the designer the ability to animate, layout, and control the look and feel of any program using Edje as its basic GUI constructor.

Unlike Ebits, Edje separates the layout and behavior logic.

How to compile

Next Steps

After you understood what Edje is and installed it in your system you should proceed understanding the programming interface for all objects, then see the specific for the most used elements. We'd recommend you to take a while to learn Ecore, Evas, and Eina as they are the building blocks for Edje. There is a widget set built on top of Edje providing high level elements such as buttons, lists and selectors called Elementary (http://docs.enlightenment.org/auto/elementary/) as they will likely save you tons of work compared to using just Evas directly.

Recommended reading: