Support
Contribute
Contact
Tracker
Navigation
Personal tools
 

Edje Program


A program block is used to manipulate the different interface elements and to serve as a bridge between the application and interface.

In order to be executed, a program must be triggered by a signal or started by another program using the after property.

Signals are the way Edje communicates interface events (like a mouse click), but they can also be generated by the application using the Edje API or even by another "Edje Program" using SIGNAL_EMIT.

Once a program is triggered, it can execute one of the predefined actions over a part or group of parts, or a custom Embryo Script.

Contents

Syntax

program {
  name:       "program_name";
  signal:     "signal,description";
  source:     "source_name";  
  action:      TYPE ..parameters..;
  target:     "target_name";
  in:          0.0 0.0;
  transition:  TYPE ..parameters..;
  after:      "program_name";
  script:     { }
}


name: "program_name";
Symbolic name of the program as a unique identifier. Program names, as part names, are limited by the group.


signal: "signal,description";
The description of the signal that will trigger the program. Wildcards can be included to widen the scope, for example, signal: "mouse,down,*" will trigger the program every a mouse button is pressed. Only one signal can be set per program. See #Signals.


source: "source_name";
All signals come from a source, in standard interface event, the source is the name of the part where the event occurred, but the source name can also be set by the application (using the Edje API) or by another edje program (using action: SIGNAL_EMIT). Only one source can be set per program, but the scope can be widen with the use of wildcards, for example, source: "*"; would accept any signal that fits the description from any source.


action: TYPE ..parameters..;
Defines the action that will be executed by the program, only one action can be set per program. There is a list of predefined actions. Alternatively a program can execute an custom Embryo script.


target: "target_name";
Links the action to a given target by name. There is no limit to the number of targets a program can have, but each has to be specified separately and no wildcards are allowed. See #Actions.


in: 0.0 0.0;
Specifies a delay on running your program, the first argument is the number of seconds to wait before running the program, and the second argument specifies the maximum random delay which is added to the first argument. This is useful when you want the program to wait for a random amount of time that is at least a half a second but no more than 3 seconds, which would be described as in: 0.5 3.0;. Delays always occur before the action specified by the program is preformed.


transition: TYPE ..parameters..;
When an action is set, the transition property can be used to change the execution flow. See #Transitions.


after: "program_name";
Once the program finishes execution, it will trigger the program under the defined name if it's located inside the same group. After can be used to execute the same program in a loop.


script: { EMBRYO_SCRIPT };
You can set a Embryo script to be executed instead of specifying an action. The script will get two parameters, the first being the signal name, the second being the source of the signal.

Signals

All signals emitted by the Edje Interface are named following a certain standard, and the source is always the name of the parts/program where the event takes place.

The name and source of signals emitted by the application (using the Edje API) or by another edje program (using action: SIGNAL_EMIT), are setup by the developer and the designer respectively.

A signal emitted reaches all programs in all groups regardless of the source, it's up to the program to filter signals it wants to accept.

Mouse Signals

The source of these signals is part name where the events took place.

mouse,in
The pointer enters.
mouse,out
The pointer exits.
mouse,move
Emitted in a loop during mouse movement.
mouse,down,#
The button number # has been pressed.
mouse,up,#
The button number # has been released.
mouse,clicked,#
The button number # has been clicked.
  • Indexing begins at 1. 0 does not match a button.

Edje Program Signals

The source of these signals is the program name.

program,start
The program has been triggered.
program,stop
The program has finished.

Interface Signals

These signals have no source.

load
Emitted when the interface is loaded.
show
Emitted when the interface is shown.
hide
Emitted when the interface is hidden.
resize
Emitted in a loop during a resize.


Actions

Actions will be executed once the program is triggered and can affect multiple targets, the type of the target will depend on the action, it can be a part, a program or no target at all.

No action or target properties are set if a program executes an Embryo script.


action: STATE_SET "state_name" INDEX;
Changes the current part description to the one defined by the name and index. target: "part_name";


action: ACTION_STOP;
Breaks execution of another program. target: "program_name";


action: SIGNAL_EMIT "name" "source";
Emits a signal with the defined name and source. It doesn't have targets.


Transitions

Transitions affect the flow of the action being executed.

NONE
LINEAR
SINUSOIDAL
ACCELERATE
DECELERATE