forked from enlightenment/efl
parent
3821f74e99
commit
419bd77877
|
@ -143,16 +143,6 @@ collections {
|
||||||
item: "My Data" "The string to attach to this data";
|
item: "My Data" "The string to attach to this data";
|
||||||
item: "The Key" "String data attached to the key";
|
item: "The Key" "String data attached to the key";
|
||||||
}
|
}
|
||||||
script {
|
|
||||||
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
tst();
|
|
||||||
emit("Flabby", "Pants");
|
|
||||||
return 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
parts {
|
parts {
|
||||||
part {
|
part {
|
||||||
name: "background";
|
name: "background";
|
||||||
|
|
|
@ -40,6 +40,23 @@ collections
|
||||||
item: "My Data" "The string to attach to this data";
|
item: "My Data" "The string to attach to this data";
|
||||||
item: "The Key" "String data attached to the key";
|
item: "The Key" "String data attached to the key";
|
||||||
}
|
}
|
||||||
|
// this section is optional. it contains all "shared" subroutines for this
|
||||||
|
// group. so if any program scripts call functions that are not edje
|
||||||
|
// exported calls, then this is where you put your own subroutines.
|
||||||
|
script
|
||||||
|
{
|
||||||
|
my_routine(var)
|
||||||
|
{
|
||||||
|
new i;
|
||||||
|
|
||||||
|
if (var > 10) tst();
|
||||||
|
if (var > 20)
|
||||||
|
{
|
||||||
|
for (i = 20; i < var; i++)
|
||||||
|
emit("SMELLY", "Fish");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
parts
|
parts
|
||||||
{
|
{
|
||||||
part
|
part
|
||||||
|
@ -196,6 +213,24 @@ collections
|
||||||
action: STATE_SET "default" 0.0;
|
action: STATE_SET "default" 0.0;
|
||||||
target: "logo";
|
target: "logo";
|
||||||
}
|
}
|
||||||
|
program
|
||||||
|
{
|
||||||
|
name: "logo_unclick_script";
|
||||||
|
signal: "mouse,up,1";
|
||||||
|
source: "logo";
|
||||||
|
// code to execute if this program matches. it can use subroutines declared
|
||||||
|
// for this group or functions exported
|
||||||
|
script
|
||||||
|
{
|
||||||
|
var i = 5;
|
||||||
|
|
||||||
|
while (i > 0)
|
||||||
|
{
|
||||||
|
my_routine(10 + (i * 5));
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
program
|
program
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,6 +43,17 @@ _edje_embryo_fn_emit(Embryo_Program *ep, Embryo_Cell *params)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* routines to export:
|
||||||
|
*
|
||||||
|
* glob_match()
|
||||||
|
* strcmp()
|
||||||
|
* strcpy()
|
||||||
|
* strlen()
|
||||||
|
* rand()
|
||||||
|
* time()
|
||||||
|
* ... more to come
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
_edje_embryo_script_init(Edje *ed)
|
_edje_embryo_script_init(Edje *ed)
|
||||||
{
|
{
|
||||||
|
@ -58,18 +69,6 @@ _edje_embryo_script_init(Edje *ed)
|
||||||
embryo_program_native_call_add(ep, "emit", _edje_embryo_fn_emit);
|
embryo_program_native_call_add(ep, "emit", _edje_embryo_fn_emit);
|
||||||
|
|
||||||
embryo_program_vm_push(ep); /* neew a new vm to run in */
|
embryo_program_vm_push(ep); /* neew a new vm to run in */
|
||||||
/* by default always call main() to init stuff */
|
|
||||||
if (embryo_program_run(ep, EMBRYO_FUNCTION_MAIN) != EMBRYO_PROGRAM_OK)
|
|
||||||
/* FIXME: debugging hack!!!! */
|
|
||||||
{
|
|
||||||
printf("EDJE DEBUG: Run of main() failed. Reason:\n");
|
|
||||||
printf("%s\n", embryo_error_string_get(embryo_program_error_get(ep)));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("EDJE DEBUG: main() returned %i\n",
|
|
||||||
embryo_program_return_value_get(ep));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue