From 419bd778771ae100be0402de0795b71052cbd58e Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 28 Mar 2004 06:21:52 +0000 Subject: [PATCH] remove that debug... dont need that. SVN revision: 9515 --- legacy/edje/data/src/e_logo.edc | 10 --------- legacy/edje/data/src/test.edc | 35 +++++++++++++++++++++++++++++++ legacy/edje/src/lib/edje_embryo.c | 23 ++++++++++---------- 3 files changed, 46 insertions(+), 22 deletions(-) diff --git a/legacy/edje/data/src/e_logo.edc b/legacy/edje/data/src/e_logo.edc index f2090133d4..6ef21853ee 100644 --- a/legacy/edje/data/src/e_logo.edc +++ b/legacy/edje/data/src/e_logo.edc @@ -143,16 +143,6 @@ collections { item: "My Data" "The string to attach to this data"; item: "The Key" "String data attached to the key"; } - script { - - main() - { - tst(); - emit("Flabby", "Pants"); - return 7; - } - - } parts { part { name: "background"; diff --git a/legacy/edje/data/src/test.edc b/legacy/edje/data/src/test.edc index 57db43b07a..46bb0d329a 100644 --- a/legacy/edje/data/src/test.edc +++ b/legacy/edje/data/src/test.edc @@ -40,6 +40,23 @@ collections item: "My Data" "The string to attach to this data"; 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 { part @@ -196,6 +213,24 @@ collections action: STATE_SET "default" 0.0; 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 { diff --git a/legacy/edje/src/lib/edje_embryo.c b/legacy/edje/src/lib/edje_embryo.c index 1980f993e5..d852cab1e5 100644 --- a/legacy/edje/src/lib/edje_embryo.c +++ b/legacy/edje/src/lib/edje_embryo.c @@ -43,6 +43,17 @@ _edje_embryo_fn_emit(Embryo_Program *ep, Embryo_Cell *params) return 0; } +/* routines to export: + * + * glob_match() + * strcmp() + * strcpy() + * strlen() + * rand() + * time() + * ... more to come + */ + void _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_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