Edje Data Collection reference
An Edje Data Collection, it's a plain text file (normally identified with the .edc extension),consisting of instructions for the Edje Compiler.
The syntax for the edje data collection files follows a simple structure of "blocks { .. }" that can contain "properties: ..", more blocks, or both.
images |
images {
image: "filename1.ext" COMP;
image: "filename2.ext" LOSSY 99;
..
}
| ||||
| The "images" block is used to list each image file that will be used in the theme along with its compression method (if any). Besides the domcument's root, additional "images" blocks can be included inside other blocks, normally "collections", "group" and "part", easing mantienance of the file list when the theme is split among multiple files. | ||||
|
| ||||
fonts |
fonts {
font: "filename1.ext" "fontname";
font: "filename2.ext" "otherfontname";
..
}
| ||||
| The "fonts" block is used to list each font file with an alias used later in the theme. As with the "images" block, additional "fonts" blocks can be included inside other blocks. | ||||
|
| ||||
data |
data {
item: "arbitraryname" "arbitraryvalue";
item: "othername" "othervalue";
..
}
| ||||
| The "data" block is used to pass arbitrary parameters from the theme to the application. Unlike the "images" and "fonts" blocks, additional "data" blocks can only be included inside the "group" block. | ||||
|
| ||||
data |
data {
file: "arbitraryname" "filename";
file: "othername" "otherfilename";
..
}
| ||||
| The "data" block is used to pass arbitrary parameters from the theme to the application. Unlike the "images" and "fonts" blocks, additional "data" blocks can only be included inside the "group" block. | ||||
|
| ||||
color_classes |
color_classes {
color_class {
name: "colorclassname";
color: [0-255] [0-255] [0-255] [0-255];
color2: [0-255] [0-255] [0-255] [0-255];
color3: [0-255] [0-255] [0-255] [0-255]
}
..
}
| ||||
| The "color_classes" block contains a list of one or more "color_class" blocks. Each "color_class" allows the designer to name an arbitrary group of colors to be used in the theme, the application can use that name to alter the color values at runtime. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
spectra |
spectra {
spectrum {
name: "colorspectrumname";
color: [0-255] [0-255] [0-255] [0-255] [0-?]
color: [0-255] [0-255] [0-255] [0-255] [0-?]
..
}
..
}
| ||||
| The "spectra" block contains a list of one or more "spectrum" blocks. Each "spectrum" block defines a color range used to fill GRADIENT parts. The colors are defined with the red, green, blue, alpha, delta format. | ||||
|
| ||||
|
| ||||
styles |
styles {
style {
name: "stylename";
base: "..default style properties..";
tag: "tagname" "..style properties..";
..
}
..
}
| ||||
| The "styles" block contains a list of one or more "style" blocks. A "style" block is used to create style <tags> for advanced TEXTBLOCK formatting. | ||||
|
| ||||
|
| ||||
|
| ||||
collections |
collections {
..
group { }
group { }
..
}
| ||||
| The "collections" block is used to list the groups that compose the theme. Additional "collections" blocks do not prevent overriding group names. | ||||
group |
collections {
..
group {
name: "nameusedbytheapplication";
alias: "anothername";
min: width height;
max: width height;
data { }
script { }
parts { }
programs { }
}
..
}
| ||||
| A "group" block contains the list of parts and programs that compose a given Edje Object. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
script |
..
group {
script {
//embryo script
}
..
program {
script {
//embryo script
}
}
..
}
..
| ||||
| This block is used to "inject" embryo scripts to a given Edje theme and it functions in two modalities. When it's included inside a "program" block, the script will be executed every time the program is run, on the other hand, when included directly into a "group", "part" or "description" block, it will be executed once at load time, in the load order. | ||||
part |
group {
parts {
..
part {
name: "partname";
type: IMAGE;
mouse_events: 1;
repeat_events: 0;
ignore_flags: NONE;
clip_to: "anotherpart";
source: "groupname";
pointer_mode: AUTOGRAB;
use_alternate_font_metrics: 0;
description { }
dragable { }
}
..
}
}
| ||||
| Parts are used to represent the most basic design elements of the theme, for example, a part can represent a line in a border or a label on a button. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
dragable |
part {
..
dragable {
confine: "another part";
events: "another dragable part";
x: 0 0 0;
y: 0 0 0;
}
..
}
| ||||
| When this block is used the resulting part can be dragged around the interface, do not confuse with external drag & drop. By default Edje (and most applications) will attempt to use the minimal size possible for a dragable part. If the min property is not set in the description the part will be (most likely) set to 0px width and 0px height, thus invisible. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
description |
description {
inherit: "another_description" INDEX;
state: "description_name" INDEX;
visible: 1;
min: 0 0;
max: -1 -1;
align: 0.5 0.5;
fixed: 0 0;
step: 0 0;
aspect: 1 1;
rel1 {
..
}
rel2 {
..
}
}
| ||||
| Every part can have one or more description blocks. Each description is used to define style and layout properties of a part in a given "state". | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
rel1/rel2 |
description {
..
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
..
rel2 {
relative: 1.0 1.0;
offset: -1 -1;
}
..
}
| ||||
| The rel1 and rel2 blocks are used to define the position of each corner of the part's container. With rel1 being the left-up corner and rel2 being the right-down corner. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
image |
description {
..
image {
normal: "filename.ext";
tween: "filename2.ext";
..
tween: "filenameN.ext";
border: left right top bottom;
middle: 0-1;
}
..
}
| ||||
| |||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
fill |
description {
..
fill {
smooth: 0-1;
origin {
relative: X-axis Y-axis;
offset: X-axis Y-axis;
}
size {
relative: width height;
offset: width height;
}
}
..
}
| ||||
| The fill method is an optional block that defines the way an IMAGE or GRADIENT part is going to be displayed inside its container. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
origin |
description {
..
fill {
..
origin {
relative: 0.0 0.0;
offset: 0 0;
}
..
}
..
}
| ||||
| The origin block is used to place the starting point, inside the displayed element, that will be used to render the tile. By default, the origin is set at the element's left-up corner. | ||||
|
| ||||
|
| ||||
size |
description {
..
fill {
..
size {
relative: 1.0 1.0;
offset: -1 -1;
}
..
}
..
}
| ||||
| The size block defines the tile size of the content that will be displayed. | ||||
|
| ||||
|
| ||||
text |
part {
description {
..
text {
text: "some string of text to display";
font: "font_name";
size: SIZE;
text_class: "class_name";
fit: horizontal vertical;
min: horizontal vertical;
max: horizontal vertical;
align: X-axis Y-axis;
source: "part_name";
text_source: "text_part_name";
elipsis: 0.0-1.0;
style: "stylename";
}
..
}
}
| ||||
| |||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
gradient |
part {
description {
..
gradient {
type: "linear";
spectrum "spectrumName";
rel1 {
relative: 0.0 0.0;
offset: 0 0;
}
rel2
relative: 1.0 1.0;
offset: -1 -1;
}
}
..
}
}
| ||||
| A gradient block is used to display a given "spectrum" inside a container. The container's shape is a rect but this not mean the gradient is restricted to a rectangular shape. Gradients can use "rel1" and "rel2" blocks to layout the initial and final point relatively inside the container. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
program |
group {
programs {
..
program {
name: "programname";
signal: "signalname";
source: "partname";
in: 0.3 0.0;
action: STATE_SET "statename" state_value;
transition: LINEAR 0.5;
target: "partname";
target: "anotherpart";
after: "programname";
after: "anotherprogram";
}
..
}
}
| ||||
| Programs define how your interface reacts to events. Programs can change the state of parts, react to events or trigger other events. | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||