documentation improvements:

- quick access in the huuuuuuuge edcref
 - block name is top-aligned to its example fragment



SVN revision: 46668
This commit is contained in:
Gustavo Sverzut Barbieri 2010-02-28 19:25:10 +00:00
parent e9b5f89824
commit 15ee9e8847
4 changed files with 406 additions and 74 deletions

View File

@ -170,7 +170,7 @@ SEPARATE_MEMBER_PAGES = NO
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 2
TAB_SIZE = 8
# This tag can be used to specify a number of aliases that acts
# as commands in the documentation. An alias has the form "name=value".
@ -187,6 +187,7 @@ ALIASES += property="<tr><td>&nbsp;</td><td><table class=\"edcref\
ALIASES += parameters="</tt></td><td class=\"parameters\"><tt>"
ALIASES += effect="</tt></td></tr><tr><td>&nbsp;</td><td class=\"effect\">"
ALIASES += endproperty="</td></tr></table></td></tr>"
ALIASES += edcsection{2}="<tr class=\"section\"><td class=\"section\" colspan=\"2\">\anchor sec_\1 \ref sec_quickaccess \"\2\"</td></tr>"
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
# sources only. Doxygen will then generate output that is more tailored for C.
@ -841,7 +842,7 @@ DOCSET_FEEDNAME = "Doxygen generated docs"
# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
# will append .docset to the name.
DOCSET_BUNDLE_ID = org.doxygen.Project
DOCSET_BUNDLE_ID = org.enlightenment.Edje
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
# will be generated that can be used as input for tools like the

View File

@ -271,3 +271,20 @@ td.nav_active {
width: 100%;
}
table.edcref tr td.block {
vertical-align: top;
padding-top: 10px;
}
table.edcref tr.section td.section {
color: #888;
font-size: 16pt;
padding: 15px;
border-top: 1px solid #ccc;
text-align: center;
}
table.edcref tr.section td.section a {
color: #888;
text-decoration: none;
}

View File

@ -11,7 +11,7 @@ These routines are used for Edje.
@image html e.png
@version @PACKAGE_VERSION@
@author Carsten Haitzler <raster\@rasterman.com>
@date 2003-2008
@date 2003-2010
@ -26,43 +26,39 @@ These routines are used for Edje.
Edje is a complex graphical design & layout library.
It's purpose is to be a sequel to "Ebits" which to date has serviced the
needs of Enlightenment development for 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.
It doesn't pretend to do 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 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
should serve all the purposes of creating visual elements (borders of
windows, 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 database and thus allowing a whole theme to
be conveniently packaged into 1 file and shipped around.
Edje, unlike Ebits, separates the layout and behavior logic. Edje files ship
with an image 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
way a part collection can be "programmed" via its file as to hilight 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.
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
way a part collection can be "programmed" via its file as to hilight
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.
For details of Edje's history, see the \ref history section.
@ -79,8 +75,10 @@ you need:
- Evas (library)
- Ecore (library)
- Eet (library)
- Embryo (library)
- Eina (library)
Evas needs to be build with the PNG and EET image loaders enabled at a
Evas needs to be build with the JPEG, PNG and EET image loaders enabled at a
minimum. Edje uses X for the test program, so you will need the SOFTWARE_X11
engine built into Evas as well. A suggested configure list is below in the
"cheat sheet" for Evas.
@ -89,48 +87,59 @@ Ecore needs the ECORE, ECORE_EVAS and ECORE_X modules built at a minimum.
It's suggested to build all the Ecore modules, but the ECORE_FB modules is
definitely optional.
Eet has no options so just build and install it.
Eina, Eet and Embryo have no interesting options so just build and
install them.
It is suggested right now that you get the latest CVS versions of the
It is suggested right now that you get the latest SVN versions of the
required libraries. You also need to build them in the right order and make
sure the right options are enabled in the required libraries. Here is a
quick "cheat sheet" on how to get started.
@verbatim
1. You need Eet from the HEAD cvs branch (must be up-to-date)
1. You need Eina from the trunk svn branch.
cvs co e17/libs/eet
cd e17/libs/eet
svn co http://svn.enlightenment.org/svn/e/trunk/eina/
cd eina
./autogen.sh
./configure
make
sudo make install
cd
2. You need Evas from the HEAD branch built with eet loader support.
2. You need Eet from the trunk svn branch.
cvs co e17/libs/evas
cd e17/libs/evas
./autogen.sh
./configure
make
sudo make install
cd
3. You need Ecore from the HEAD cvs branch
cvs co e17/libs/ecore
cd e17/libs/ecore
svn co http://svn.enlightenment.org/svn/e/trunk/eet/
cd eet
./autogen.sh
./configure
make
sudo make install
cd
4. You need embryo from the HEAD cvs branch
3. You need Evas from the trunk svn branch built with eet, png and jpeg loader support.
cvs co e17/libs/embryo
cd e17/libs/embryo
svn co http://svn.enlightenment.org/svn/e/trunk/evas/
cd evas
./autogen.sh
./configure --enable-image-loader-eet --enable-font-loader-eet --enable-image-loader-jpeg --enable-image-loader-png --enable-buffer
make
sudo make install
cd
4. You need Ecore from the trunk svn branch built with ecore-x and ecore-evas.
svn co http://svn.enlightenment.org/svn/e/trunk/ecore/
cd ecore
./autogen.sh
./configure --enable-ecore-x --enable-ecore-evas --enable-ecore-evas-software-buffer --enable-ecore-evas-software-x11 --enable-ecore-evas-software-buffer
make
sudo make install
cd
5. You need embryo from the trunk svn branch
svn co http://svn.enlightenment.org/svn/e/trunk/embryo/
cd embryo
./autogen.sh
./configure
make
@ -157,24 +166,15 @@ Now you need to compile and install Edje.
sudo make install
@endverbatim
You now have it installed and ready to go, but you are missing data files. In
data/ there are data sets for you to look at as examples. To try one out do:
You now have it installed and ready to go, but you need input
data. There are lots of examples in SVN, the best one is
Enlightenment's own theme file.
@verbatim
cd data
./e_logo.sh
edje ./e_logo.eet
@endverbatim
The Edje test program/viewer is able to view multiple Edje data sets. The
following will view 3 of them at once in the one window (which you can resize
to give you more space to move and resize the Edje data sets around):
@verbatim
edje ./e_logo.eet ./e_logo.eet ./e_logo.eet
@endverbatim
You may use different tools to edit and view the generated ".edj"
files, for instance:
- editje (http://trac.enlightenment.org/e/wiki/Editje)
- edje_viewer (http://trac.enlightenment.org/e/wiki/Edje_Viewer)
@ -189,11 +189,259 @@ to give you more space to move and resize the Edje data sets around):
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 .eet file containing this information. These files can
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 .eet file that contains this information, images and any other
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
part of the given group. See the following annotated example:
@code
/*
* edje_example.c:
*
* Creates a window using Ecore_Evas and inside it an object with
* the edje group "my_group" from file "edje_example.edj".
*
* Requires edje_example.edj in the current folder.
*
* Compile:
* gcc -o edje_example edje_example.c `pkg-config --cflags --libs eina-0 evas ecore ecore-evas edje`
*/
#include <Eina.h>
#include <Evas.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
#include <Edje.h>
#define WIDTH 320
#define HEIGHT 240
static Evas_Object *create_my_group(Evas *canvas, const char *text)
{
Evas_Object *edje;
/* create the edje object where we'll load our file */
edje = edje_object_add(canvas);
if (!edje)
{
EINA_LOG_CRIT("could not create edje object!");
return NULL;
}
/* load our desired file */
if (!edje_object_file_set(edje, "edje_example.edj", "my_group"))
{
int err = edje_object_load_error_get(edje);
const char *errmsg = edje_load_error_str(err);
EINA_LOG_ERR("could not load 'my_group' from edje_example.edj: %s",
errmsg);
evas_object_del(edje);
return NULL;
}
if (text)
{
/* this is will replace the string used by "text" part in "my_group" */
if (!edje_object_part_text_set(edje, "text", text))
{
EINA_LOG_WARN("could not set the text. "
"Maybe part 'text' does not exist?");
}
}
/* operate on edje as any other object */
evas_object_move(edje, 0, 0);
evas_object_resize(edje, WIDTH, HEIGHT);
evas_object_show(edje);
return edje;
}
int main(int argc, char *argv[])
{
Ecore_Evas *window;
Evas *canvas;
Evas_Object *edje;
const char *text;
eina_init();
evas_init();
ecore_init();
ecore_evas_init();
edje_init();
window = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL);
if (!window)
{
EINA_LOG_CRIT("could not create window.");
return -1;
}
canvas = ecore_evas_get(window);
text = (argc > 1) ? argv[1] : NULL;
edje = create_my_group(canvas, text);
if (!edje)
return -2;
ecore_evas_show(window);
ecore_main_loop_begin();
evas_object_del(edje);
ecore_evas_free(window);
return 0;
}
@endcode
It requires the following source Edje file:
@code
// compile: edje_cc edje_example.edc
collections {
group {
name: "my_group"; // must be the same as in edje_example.c
parts {
part {
name: "background";
type: RECT; // plain boring rectangle
mouse_events: 0; // we don't need any mouse event on the background
// just one state "default"
description {
state: "default" 0.0; // must always exist
color: 255 255 255 255; // white
// define part coordinates:
rel1 { // top-left point at (0, 0) [WIDTH * 0 + 0, HEIGHT * 0 + 0]
relative: 0.0 0.0;
offset: 0 0;
}
rel2 { // bottom-right point at (WIDTH * 1.0 - 1, HEIGHT * 1.0 - 1)
relative: 1.0 1.0;
offset: -1 -1;
}
}
}
part {
name: "text";
type: TEXT;
mouse_events: 1; // we want to change the color on mouse-over
// 2 states, one "default" and another "over" to be used
// on mouse over effect
description {
state: "default" 0.0;
color: 255 0 0 255; // red
// define part coordinates:
rel1 { // top-left at (WIDTH * 0.1 + 5, HEIGHT * 0.2 + 10)
relative: 0.1 0.2;
offset: 5 10;
}
rel2 { // bottom-right at (WIDTH * 0.9 - 6, HEIGHT * 0.8 - 11)
relative: 0.9 0.8;
offset: -6 -11;
}
// define text specific state details
text {
font: "Sans"; /* using fontconfig name! */
size: 10;
text: "hello world";
}
}
description {
state: "over" 0.0;
inherit: "default" 0.0; // copy everything from "default" at this point
color: 0 255 0 255; // override color, now it is green
}
}
// do programs to change color on text mouse in/out (over)
programs {
program {
// what triggers this program:
signal: "mouse,in";
source: "text";
// what this program does:
action: STATE_SET "over" 0.0;
target: "text";
// do the state-set in a nice interpolation animation
// using linear time in 0.1 second
transition: LINEAR 0.1;
}
program {
// what triggers this program:
signal: "mouse,out";
source: "text";
// what this program does:
action: STATE_SET "default" 0.0;
target: "text";
// do the state-set in a nice interpolation animation
// using linear time in 0.1 second
transition: LINEAR 0.1;
}
}
}
}
}
@endcode
One should save these files as edje_example.c and edje_example.edc then:
@verbatim
gcc -o edje_example edje_example.c `pkg-config --cflags --libs eina-0 evas ecore ecore-evas edje`
edje_cc edje_example.edc
./edje_example "some text"
@endverbatim
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)
files, read the \ref edcref.
@section history 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 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.
@ -203,7 +451,6 @@ data needed.
@todo See src/lib/edje_private.h for a list of FIXME's
@todo Complete documentation of API
@todo Bytecode language for extending programs... but what/how?

View File

@ -49,6 +49,22 @@
* The syntax for the edje data collection files follows a simple structure of
* "blocks { .. }" that can contain "properties: ..", more blocks, or both.
*
* @anchor sec_quickaccess Quick access to block descriptions:
* <ul>
* <li>@ref sec_toplevel "Top-Level"</li>
* <li>@ref sec_group "Group"</li>
* <li>@ref sec_description "State description"</li>
* <ul>
* <li>@ref sec_description_image "Image"</li>
* <li>@ref sec_description_text "Text"</li>
* <li>@ref sec_description_gradient "Gradient"</li>
* <li>@ref sec_description_box "Box"</li>
* <li>@ref sec_description_table "Table"</li>
* <li>@ref sec_description_map "Map (3d/transformations)"</li>
* </ul>
* <li>@ref sec_program "Program block"</li>
* </ul>
*
* @author Andres Blanc (dresb) andresblanc@gmail.com
*
* <table class="edcref" border="0">
@ -686,6 +702,10 @@ statement_handler_num(void)
/*****/
/**
@edcsection{toplevel,Top-Level blocks}
*/
/**
@page edcref
@ -1384,6 +1404,10 @@ ob_collections(void)
edje_file->collection_dir = mem_alloc(SZ(Edje_Part_Collection_Directory));
}
/**
@edcsection{group,Group sub blocks}
*/
/**
@page edcref
@block
@ -2984,6 +3008,10 @@ static void st_collections_group_parts_part_table_items_item_span(void)
item->rowspan = parse_int_range(1, 1, 0xffff);
}
/**
@edcsection{description,State description sub blocks}
*/
/**
@page edcref
@block
@ -3932,6 +3960,10 @@ st_collections_group_parts_part_description_rel2_to_y(void)
}
}
/**
@edcsection{description_image,Image state description sub blocks}
*/
/**
@page edcref
@block
@ -4563,6 +4595,11 @@ st_collections_group_parts_part_description_fill_size_offset(void)
ed->fill.abs_y = parse_int(1);
}
/**
@edcsection{description_text,Text state description sub blocks}
*/
/**
@page edcref
@ -5110,6 +5147,11 @@ st_collections_group_parts_part_description_text_elipsis(void)
ed->text.elipsis = parse_float_range(0, 0.0, 1.0);
}
/**
@edcsection{description_gradient,Gradient state description sub blocks}
*/
/**
@page edcref
@ -5370,6 +5412,11 @@ st_collections_group_parts_part_description_gradient_rel2_offset(void)
}
}
/**
@edcsection{description_box,Box state description sub blocks}
*/
/**
@page edcref
@ -5544,6 +5591,11 @@ st_collections_group_parts_part_description_box_min(void)
ed->box.min.v = parse_bool(1);
}
/**
@edcsection{description_table,Table state description sub blocks}
*/
/**
@page edcref
@ -5673,6 +5725,11 @@ static void st_collections_group_parts_part_description_table_padding(void)
ed->table.padding.y = parse_int_range(1, 0, 0x7fffffff);
}
/**
@edcsection{description_map,Map state description sub blocks}
*/
/**
@page edcref
@block
@ -6131,6 +6188,11 @@ st_collections_group_parts_part_description_perspective_focal(void)
ed->persp.focal = parse_int_range(0, 1, 0x7fffffff);
}
/**
@edcsection{description_params,Params state description sub blocks}
*/
/**
@page edcref
@block
@ -6265,6 +6327,11 @@ st_collections_group_parts_part_description_params_string(void)
_st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_STRING);
}
/**
@edcsection{program, Program block}
*/
/**
@page edcref
@block