Languages

Menu
Sites
Language
what's difference between the script and the program in edc programming

I am trying to study the edc programming on Tizen Native App, find that there are script and program section in edc file. I want to know the difference between them. 

I prefer sample code, not just one internet link. Thanks!!!

Responses

4 Replies
Jean Yang

This script 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.

Programs define how your interface reacts to events. Programs can change the state of parts, react to events or trigger other events.

colin Rao

Hi,

Thanks! but how/where to trigger the scripts? Actually, I wanna the sample code. :)

Seems their's less edc programming related training material/guide on the help doc, also the tizen developer site.

Alex Dem

Hi, just fyi (I have faced)
EDC of SelfCamera uses program which contains in some parts "script" section inside.
Alexey.

Jeongsu Kim

I understand you prefer sample code instead of link but below link is very important.

https://developer.tizen.org/development/ui-practices/native-application/efl/themes/edje-data-collection-reference

 

Basically, program is run by event like "mouse,1,clicked". program block has "signal" and "source".
It means matched "signal" from "source" will trigger this program.
Program also has "action" that describes what will do when triggered. You can check actions from above link.

 

Sometimes action is not enough to do what you want. Then you can add script block instead of "action" of program.
Action uses embryo script. It is a small interpreter language.

https://git.tizen.org/cgit/framework/uifw/efl.git/tree/data/embryo/default.inc?h=tizen_2.4_mobile_release
https://git.tizen.org/cgit/framework/uifw/efl.git/tree/data/edje/include/edje.inc?h=tizen_2.4_mobile_release

You can see what functions are supported in "script" block from above links.

 

At the last, there is "script" block too in group block. It is a something like global scope area.
You can decleare some global variables, common function here.

 

https://git.tizen.org/cgit/framework/uifw/efl.git/tree/src/examples/edje/embryo_pong.edc?h=tizen_2.4_mobile_release

I think above example is good for how script working.