2011-04-13 01:10:35 -07:00
|
|
|
/**
|
2011-04-08 00:45:46 -07:00
|
|
|
@brief Edje Graphical Design Library
|
2011-04-13 01:10:35 -07:00
|
|
|
|
2011-04-08 00:45:46 -07:00
|
|
|
These routines are used for Edje.
|
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@page edje_main Edje
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@date 2003 (created)
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@section toc Table of Contents
|
|
|
|
|
|
|
|
@li @ref edje_main_intro
|
|
|
|
@li @ref edje_main_work
|
|
|
|
@li @ref edje_main_compiling
|
|
|
|
@li @ref edje_main_next_steps
|
|
|
|
@li @ref edje_main_intro_example
|
|
|
|
|
|
|
|
@section edje_main_intro Introduction
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
Edje is a complex graphical design & layout library.
|
|
|
|
|
2012-03-21 07:21:14 -07:00
|
|
|
It doesn't intend to do containing and regular layout like a widget
|
2011-04-08 00:45:46 -07:00
|
|
|
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, used by all the parts in 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 that if a
|
|
|
|
particular event occurs (a button is pressed, a mouse enters or leaves
|
|
|
|
a part) will trigger an action that may affect other parts. In this
|
2018-08-29 22:01:21 -07:00
|
|
|
way a part collection can be "programmed" via its file as to highlight
|
2011-04-08 00:45:46 -07:00
|
|
|
buttons when the mouse passes over them or show hidden parts when a
|
|
|
|
button is clicked somewhere etc. 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 one could want for basic visual elements. Anything
|
|
|
|
more complex is likely the domain of an application or widget set that may
|
|
|
|
use Edje as a convenient way of being able to configure parts of the display.
|
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
For details of Edje's history, see the @ref edje_history section.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@subsection edje_main_work So how does this all work?
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
Edje internally holds a geometry state machine and state graph of what is
|
|
|
|
visible, not, where, at what size, with what colors etc. 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 needed.
|
|
|
|
|
|
|
|
The application using Edje will then create an object in its Evas
|
|
|
|
canvas and set the bundle file to use, specifying the @b group name to
|
|
|
|
use. Edje will load such information and create all the required
|
|
|
|
children objects with the specified properties as defined in each @b
|
2013-01-03 18:51:43 -08:00
|
|
|
part of the given group. See the example at @ref edje_main_intro_example.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
Although simple, this example illustrates that animations and state
|
|
|
|
changes can be done from the Edje file itself without any requirement
|
|
|
|
in the C application.
|
|
|
|
|
|
|
|
Before digging into changing or creating your own Edje source (edc)
|
2011-08-08 03:50:27 -07:00
|
|
|
files, read the @ref edcref.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@subsection edje_history Edje History
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
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 came about were a lot more restricted than the resulting
|
|
|
|
use of them, thus Edje was born.
|
|
|
|
|
|
|
|
Edje is a more complex layout engine compared to Ebits. It doesn't
|
|
|
|
pretend to do 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 ever could. For the
|
|
|
|
purposes of Enlightenment 0.17, Edje was 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.
|
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@section edje_main_compiling How to compile
|
|
|
|
|
|
|
|
Edje is a library your application links to. The procedure for this is
|
|
|
|
very simple. You simply have to compile your application with the
|
|
|
|
appropriate compiler flags that the @c pkg-config script outputs. For
|
|
|
|
example:
|
|
|
|
|
|
|
|
Compiling C or C++ files into object files:
|
|
|
|
|
|
|
|
@verbatim
|
|
|
|
gcc -c -o main.o main.c `pkg-config --cflags edje`
|
|
|
|
@endverbatim
|
|
|
|
|
|
|
|
Linking object files into a binary executable:
|
|
|
|
|
|
|
|
@verbatim
|
|
|
|
gcc -o my_application main.o `pkg-config --libs edje`
|
|
|
|
@endverbatim
|
|
|
|
|
|
|
|
See @ref pkgconfig
|
|
|
|
|
|
|
|
@section edje_main_next_steps 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 @ref Ecore, @ref Evas, @ref Eo
|
|
|
|
and @ref 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.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
Recommended reading:
|
|
|
|
@li @ref edcref
|
|
|
|
@li @ref Edje_General_Group
|
|
|
|
@li @ref Edje_Object_Group
|
|
|
|
@li @ref Edje_External_Group
|
2013-01-06 06:59:43 -08:00
|
|
|
@li @ref luaref
|
2013-01-03 18:51:43 -08:00
|
|
|
|
|
|
|
@section edje_main_intro_example Introductory Example
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2011-08-08 03:50:27 -07:00
|
|
|
What follows is a list with various commented examples, covering a great
|
2011-07-29 09:31:05 -07:00
|
|
|
part of Edje's API:
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
@include edje_example.c
|
|
|
|
|
|
|
|
The above example requires the following annotated source Edje file:
|
|
|
|
@include edje_example.edc
|
2011-04-08 00:45:46 -07:00
|
|
|
|
2011-08-03 14:01:03 -07:00
|
|
|
|
2013-01-03 18:51:43 -08:00
|
|
|
More examples can be found at @ref edje_examples.
|
|
|
|
*/
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
@example embryo_custom_state.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows how to create a custom state from embryo. Clicking on the
|
2011-04-08 00:45:46 -07:00
|
|
|
3 labels will rotate the object in the given direction.
|
|
|
|
|
|
|
|
@example embryo_pong.edc
|
|
|
|
Super-simple Pong implementation in pure embryo.
|
|
|
|
|
|
|
|
@example embryo_run_program.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows how to run an edje program from embryo code.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
@example embryo_set_state.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows how to change the state of a part from embryo code.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
@example embryo_set_text.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows how to set the text in TEXT part from embryo code.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
@example embryo_timer.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows the usage of timers in embryo.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
@example external_elm_anchorblock.edc
|
|
|
|
This example use an elementary anchorblock and a button to animate the text.
|
|
|
|
|
|
|
|
@example external_elm_button.edc
|
|
|
|
This example create some elementary buttons and do some actions on user click.
|
|
|
|
|
|
|
|
@example external_elm_check.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows EXTERNAL checkbox in action.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
@example external_elm_panes.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows EXTERNAL elementary panes in action.
|
2011-04-08 00:45:46 -07:00
|
|
|
|
|
|
|
@example external_emotion_elm.edc
|
|
|
|
Super-concise video player example using Edje/Emotion/Elementary.
|
|
|
|
|
|
|
|
@example lua_script.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows the usage of lua scripting to create and animate some
|
2011-04-08 00:45:46 -07:00
|
|
|
objects in the canvas.
|
|
|
|
|
|
|
|
@example toggle_using_filter.edc
|
2014-01-28 07:19:16 -08:00
|
|
|
This example shows how to toggle the state of a part using the 'filter'
|
2011-04-08 00:45:46 -07:00
|
|
|
param in edje programs
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2012-09-13 06:11:50 -07:00
|
|
|
/**
|
|
|
|
* @file Edje.h
|
2017-02-16 10:16:49 -08:00
|
|
|
* @brief Edje Graphical Design Library.
|
2012-09-13 06:11:50 -07:00
|
|
|
*
|
|
|
|
* These routines are used for Edje.
|
|
|
|
*/
|
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
#ifndef _EDJE_H
|
|
|
|
#define _EDJE_H
|
|
|
|
|
2010-12-13 21:56:46 -08:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
2009-11-23 12:21:22 -08:00
|
|
|
#include <math.h>
|
2010-05-21 12:28:33 -07:00
|
|
|
#include <float.h>
|
2010-05-21 15:53:41 -07:00
|
|
|
#include <limits.h>
|
2009-11-23 12:21:22 -08:00
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
#include <Evas.h>
|
2013-05-05 00:00:01 -07:00
|
|
|
#include <Eo.h>
|
2013-11-04 01:31:48 -08:00
|
|
|
#include <Efl_Config.h>
|
2003-06-02 16:49:56 -07:00
|
|
|
|
2004-11-24 21:18:31 -08:00
|
|
|
#ifdef EAPI
|
2008-05-30 23:15:41 -07:00
|
|
|
# undef EAPI
|
2004-11-24 21:18:31 -08:00
|
|
|
#endif
|
2008-05-30 23:15:41 -07:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
2018-01-18 01:04:03 -08:00
|
|
|
# ifdef EFL_BUILD
|
2008-05-30 23:15:41 -07:00
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
2018-01-18 01:04:03 -08:00
|
|
|
# endif
|
2004-11-24 21:18:31 -08:00
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
2018-01-18 01:04:03 -08:00
|
|
|
# endif
|
2004-11-24 21:18:31 -08:00
|
|
|
#else
|
2005-12-27 09:17:31 -08:00
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
2004-11-24 21:18:31 -08:00
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2010-05-29 01:05:11 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2011-04-03 02:29:40 -07:00
|
|
|
|
2013-11-04 01:31:48 -08:00
|
|
|
#define EDJE_VERSION_MAJOR EFL_VERSION_MAJOR
|
|
|
|
#define EDJE_VERSION_MINOR EFL_VERSION_MINOR
|
2011-04-03 02:29:40 -07:00
|
|
|
|
2013-04-11 02:48:20 -07:00
|
|
|
#include "Edje_Common.h"
|
|
|
|
#ifndef EFL_NOLEGACY_API_SUPPORT
|
|
|
|
#include "Edje_Legacy.h"
|
|
|
|
#endif
|
|
|
|
#include "Edje_Eo.h"
|
2012-09-21 10:20:37 -07:00
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-28 06:09:11 -07:00
|
|
|
#undef EAPI
|
|
|
|
#define EAPI
|
|
|
|
|
2003-06-02 16:49:56 -07:00
|
|
|
#endif
|