static void ob_collections_group(void);
static void st_collections_group_name(void);
static void st_collections_group_script_only(void);
-static void st_collections_group_lua_script_only(void);
static void st_collections_group_alias(void);
static void st_collections_group_min(void);
static void st_collections_group_max(void);
static void st_collections_group_programs_program_api(void);
static void ob_collections_group_programs_program_script(void);
-static void ob_collections_group_programs_program_lua_script(void);
/*****/
{"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.name", st_collections_group_name},
{"collections.group.script_only", st_collections_group_script_only},
- {"collections.group.lua_script_only", st_collections_group_lua_script_only},
+ {"collections.group.lua_script_only", st_collections_group_script_only},
{"collections.group.alias", st_collections_group_alias},
{"collections.group.min", st_collections_group_min},
{"collections.group.max", st_collections_group_max},
{"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.description.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.parts.part.description.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.part.description.programs", NULL}, /* dup */
{"collections.group.parts.part.description.programs.set", ob_images_set}, /* dup */
{"collections.group.parts.part.description.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.programs.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.description.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.parts.part.description.programs.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.part.description.script", ob_collections_group_script}, /* dup */
- {"collections.group.parts.part.description.lua_script", ob_collections_group_lua_script}, /* dup */
{"collections.group.parts.part.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.parts.part.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.part.programs", NULL}, /* dup */
{"collections.group.parts.part.programs.set", ob_images_set}, /* dup */
{"collections.group.parts.part.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.programs.fonts", NULL}, /* dup */
{"collections.group.parts.part.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.parts.part.programs.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.part.script", ob_collections_group_script}, /* dup */
- {"collections.group.parts.part.lua_script", ob_collections_group_lua_script}, /* dup */
{"collections.group.parts.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.parts.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.programs", NULL}, /* dup */
{"collections.group.parts.programs.set", ob_images_set}, /* dup */
{"collections.group.parts.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.programs.fonts", NULL}, /* dup */
{"collections.group.parts.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.parts.programs.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.script", ob_collections_group_script}, /* dup */
- {"collections.group.parts.lua_script", ob_collections_group_lua_script}, /* dup */
{"collections.group.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.program.script", ob_collections_group_programs_program_script}, /* dup */
- {"collections.group.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.programs", NULL},
{"collections.group.programs.set", ob_images_set}, /* dup */
{"collections.group.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.programs.fonts", NULL}, /* dup */
{"collections.group.programs.program", ob_collections_group_programs_program},
{"collections.group.programs.program.script", ob_collections_group_programs_program_script},
- {"collections.group.programs.program.lua_script", ob_collections_group_programs_program_lua_script},
- {"collections.group.programs.script", ob_collections_group_script}, /* dup */
- {"collections.group.programs.lua_script", ob_collections_group_lua_script} /* dup */
+ {"collections.group.programs.script", ob_collections_group_script} /* dup */
};
/*****/
check_arg_count(1);
pc = eina_list_data_get(eina_list_last(edje_collections));
- pc->script_only = parse_bool(0);
-}
-
-static void
-st_collections_group_lua_script_only(void)
-{
- Edje_Part_Collection *pc;
-
- check_arg_count(1);
-
- pc = eina_list_data_get(eina_list_last(edje_collections));
pc->lua_script_only = parse_bool(0);
}
"DRAG_VAL_STEP", EDJE_ACTION_TYPE_DRAG_VAL_STEP,
"DRAG_VAL_PAGE", EDJE_ACTION_TYPE_DRAG_VAL_PAGE,
"SCRIPT", EDJE_ACTION_TYPE_SCRIPT,
- "LUA_SCRIPT", EDJE_ACTION_TYPE_LUA_SCRIPT,
"FOCUS_SET", EDJE_ACTION_TYPE_FOCUS_SET,
"FOCUS_OBJECT", EDJE_ACTION_TYPE_FOCUS_OBJECT,
"PARAM_COPY", EDJE_ACTION_TYPE_PARAM_COPY,
/* this is implicitly set by script {} so this is here just for
* completeness */
break;
- case EDJE_ACTION_TYPE_LUA_SCRIPT:
- /* this is implicitly set by lua_script {} so this is here just for
- * completeness */
- break;
case EDJE_ACTION_TYPE_FOCUS_OBJECT:
case EDJE_ACTION_TYPE_FOCUS_SET:
check_arg_count(1);
}
}
}
-
-static void
-ob_collections_group_programs_program_lua_script(void)
-{
- Edje_Part_Collection *pc;
- Code *cd;
-
- pc = eina_list_data_get(eina_list_last(edje_collections));
- cd = eina_list_data_get(eina_list_last(codes));
-
- if (!is_verbatim()) track_verbatim(1);
- else
- {
- char *s;
-
- s = get_verbatim();
- if (s)
- {
- Code_Program *cp;
-
- cp = mem_alloc(SZ(Code_Program));
- cp->l1 = get_verbatim_line1();
- cp->l2 = get_verbatim_line2();
- cp->script = s;
- if (cd->shared && !cd->is_lua)
- {
- ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
- progname, file_in, line - 1);
- exit(-1);
- }
- cd->is_lua = 1;
- cd->programs = eina_list_append(cd->programs, cp);
- data_queue_anonymous_lookup(pc, current_program, &(cp->id));
- set_verbatim(NULL, 0, 0);
- current_program->action = EDJE_ACTION_TYPE_LUA_SCRIPT;
- }
- }
-}
/**
@page edcref
</table>
typedef struct _Edje_Lua_Script_Writer_Struct Edje_Lua_Script_Writer_Struct;
-struct _Edje_Lua_Script_Writer_Struct {
+struct _Edje_Lua_Script_Writer_Struct
+{
char *buf;
int size;
};
#ifdef LUA_BINARY
static int
-_edje_lua_script_writer (lua_State *L __UNUSED__, const void* chunk_buf, size_t chunk_size, void* _data)
+_edje_lua_script_writer(lua_State *L __UNUSED__, const void *chunk_buf, size_t chunk_size, void *_data)
{
Edje_Lua_Script_Writer_Struct *data;
void *old;
{
EDJE_MESSAGE_NONE = 0,
- EDJE_MESSAGE_SIGNAL = 1, /* DONT USE THIS */
+ EDJE_MESSAGE_SIGNAL = 1, /* DONT USE THIS */
- EDJE_MESSAGE_STRING = 2,
- EDJE_MESSAGE_INT = 3,
- EDJE_MESSAGE_FLOAT = 4,
+ EDJE_MESSAGE_STRING = 2,
+ EDJE_MESSAGE_INT = 3,
+ EDJE_MESSAGE_FLOAT = 4,
- EDJE_MESSAGE_STRING_SET = 5,
- EDJE_MESSAGE_INT_SET = 6,
- EDJE_MESSAGE_FLOAT_SET = 7,
+ EDJE_MESSAGE_STRING_SET = 5,
+ EDJE_MESSAGE_INT_SET = 6,
+ EDJE_MESSAGE_FLOAT_SET = 7,
- EDJE_MESSAGE_STRING_INT = 8,
- EDJE_MESSAGE_STRING_FLOAT = 9,
+ EDJE_MESSAGE_STRING_INT = 8,
+ EDJE_MESSAGE_STRING_FLOAT = 9,
- EDJE_MESSAGE_STRING_INT_SET = 10,
- EDJE_MESSAGE_STRING_FLOAT_SET = 11
+ EDJE_MESSAGE_STRING_INT_SET = 10,
+ EDJE_MESSAGE_STRING_FLOAT_SET = 11
};
typedef enum _Edje_Message_Type Edje_Message_Type;
EDJE_ACTION_TYPE_DRAG_VAL_PAGE = 6,
EDJE_ACTION_TYPE_SCRIPT = 7,
EDJE_ACTION_TYPE_FOCUS_SET = 8,
- EDJE_ACTION_TYPE_LUA_SCRIPT = 9,
+ EDJE_ACTION_TYPE_RESERVED00 = 9,
EDJE_ACTION_TYPE_FOCUS_OBJECT = 10,
EDJE_ACTION_TYPE_PARAM_COPY = 11,
EDJE_ACTION_TYPE_PARAM_SET = 12,
enum
{
EDJE_DRAG_DIR_NONE = 0,
- EDJE_DRAG_DIR_X = 1,
- EDJE_DRAG_DIR_Y = 2,
- EDJE_DRAG_DIR_XY = 3
+ EDJE_DRAG_DIR_X = 1,
+ EDJE_DRAG_DIR_Y = 2,
+ EDJE_DRAG_DIR_XY = 3
};
enum
{
EDJE_LOAD_ERROR_NONE = 0,
- EDJE_LOAD_ERROR_GENERIC = 1,
- EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2,
- EDJE_LOAD_ERROR_PERMISSION_DENIED = 3,
- EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4,
- EDJE_LOAD_ERROR_CORRUPT_FILE = 5,
- EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6,
- EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7,
- EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8,
- EDJE_LOAD_ERROR_RECURSIVE_REFERENCE = 9
+ EDJE_LOAD_ERROR_GENERIC = 1,
+ EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2,
+ EDJE_LOAD_ERROR_PERMISSION_DENIED = 3,
+ EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4,
+ EDJE_LOAD_ERROR_CORRUPT_FILE = 5,
+ EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6,
+ EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7,
+ EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8,
+ EDJE_LOAD_ERROR_RECURSIVE_REFERENCE = 9
};
enum _Edje_External_Param_Type
{
const char *name;
Edje_External_Param_Type type;
- union
- {
- struct
- {
- int def, min, max, step;
- } i;
- struct
- {
- double def, min, max, step;
- } d;
- struct
- {
- const char *def;
- const char *accept_fmt;
- const char *deny_fmt;
- } s;
- struct
- {
- int def;
- const char *false_str;
- const char *true_str;
- } b;
- struct
- {
- const char *def;
- const char **choices; /* NULL terminated array */
- } c;
- } info;
+ union {
+ struct {
+ int def, min, max, step;
+ } i;
+ struct {
+ double def, min, max, step;
+ } d;
+ struct {
+ const char *def;
+ const char *accept_fmt;
+ const char *deny_fmt;
+ } s;
+ struct {
+ int def;
+ const char *false_str;
+ const char *true_str;
+ } b;
+ struct {
+ const char *def;
+ const char **choices; /* NULL terminated array */
+ } c;
+ } info;
};
typedef struct _Edje_External_Param_Info Edje_External_Param_Info;
if (data)
{
-#ifdef LUA2
_edje_lua2_script_load(edc, data, size);
-#else
- int err_code;
-
- //printf("lua chunk size: %d\n", size);
- _edje_lua_new_reg(_edje_lua_state_get(), -1, edc); // gets freed in 'edje_load::_edje_collectoin_free'
-
- if ((err_code = luaL_loadbuffer(_edje_lua_state_get(), data, size, "edje_lua_script")))
- {
- if (err_code == LUA_ERRSYNTAX)
- ERR("lua load syntax error: %s", lua_tostring(_edje_lua_state_get(), -1));
- else if (err_code == LUA_ERRMEM)
- ERR("lua load memory allocation error: %s", lua_tostring(_edje_lua_state_get(), -1));
- }
- if (lua_pcall(_edje_lua_state_get(), 0, 0, 0))
- ERR("lua call error: %s", lua_tostring(_edje_lua_state_get(), -1));
-#endif
free(data);
}
if (rp->custom)
{
-#ifdef LUA2
// xxx: lua2
-#else
- if (ed->L)
- {
- _edje_lua_get_reg(ed->L, rp->custom->description);
- _edje_lua_free_reg(ed->L, lua_touserdata(ed->L, -1)); // created in edje_lua.c::_edje_lua_part_fn_custom_state
- lua_pop(ed->L, 1);
- _edje_lua_free_reg(ed->L, rp->custom->description); // created in edje_lua.c::_edje_lua_part_fn_custom_state
- }
-#endif
_edje_collection_free_part_description_clean(rp->part->type,
rp->custom->description,
ed->file->free_strings);
}
}
if (ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_shutdown(ed);
-#else
- _edje_lua_free_reg(ed->L, ed); // created in edje_lua.c::_edje_lua_script_fn_new/_edje_lua_group_fn_new
- _edje_lua_free_reg(ed->L, ed->L); // created in edje_program.c::_edje_program_run/edje_lua_script_only.c::_edje_lua_script_only_init
- _edje_lua_free_thread(ed, ed->L); // created in edje_program.c::_edje_program_run/edje_lua_script_only.c::_edje_lua_script_only_init
- ed->L = NULL;
-#endif
- }
+ _edje_lua2_script_shutdown(ed);
if (ed->table_parts) free(ed->table_parts);
ed->table_parts = NULL;
ed->table_parts_size = 0;
}
#endif
if (ec->script) embryo_program_free(ec->script);
-#ifdef LUA2
_edje_lua2_script_unload(ec);
-#endif
/* Destroy all part and description. */
eina_mempool_del(ce->mp.RECTANGLE);
#include "edje_private.h"
+#if 0
+/////////////////////////////////////////////////////////////////////////////
+// the below is deprecated and here for reference only until removed. look
+// at edje_lua2.c for the active workign code
+/////////////////////////////////////////////////////////////////////////////
+
#include <lauxlib.h>
#include <lualib.h>
-#ifndef LUA2
-
#define EDJE_LUA_GET 1
#define EDJE_LUA_SET 2
#define EDJE_LUA_FN 3
Ledje = NULL;
}
-#endif // not LUA2
+#endif
#include "edje_private.h"
//--------------------------------------------------------------------------//
-#ifdef LUA2
#define MAX_LUA_MEM (4 * (1024 * 1024))
_elua_table_ptr_set(L, _elua_key, ed);
- snprintf(buf, sizeof(buf), "lua_scripts/%i", ed->collection->id);
+ snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", ed->collection->id);
data = eet_read(ed->file->ef, buf, &size);
if (data)
L = lstate;
lua_gc(L, LUA_GCCOLLECT, 0);
}
-
-#endif
_edje_lua_script_only_init(Edje *ed)
{
if (ed->collection)
- {
-#ifdef LUA2
- _edje_lua2_script_init(ed);
-#else
- ed->L = _edje_lua_new_thread(ed, _edje_lua_state_get()); // freed in _edje_lua_script_only_shutdown
- _edje_lua_new_reg(ed->L, -1, ed->L); // freed in _edje_lua_script_only_shutdown
- lua_pop(ed->L, 1); /* thread */
-
- lua_State *L = ed->L;
- _edje_lua_script_fn_new(ed);
- lua_pop(L, 1); /* script */
-
- lua_getglobal(L, "init");
- if (!lua_isnil (L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX); /* set function environment from collection thread to edje object thread */
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
-
- if ((err_code = lua_pcall(L, 1, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop(L, 1);
-#endif
- }
+ _edje_lua2_script_init(ed);
}
void
_edje_lua_script_only_shutdown(Edje *ed)
{
if (ed->collection && ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_func_shutdown(ed);
-#else
- lua_State *L = ed->L;
- lua_getglobal(L, "shutdown");
- if (!lua_isnil (L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX);
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
-
- if ((err_code = lua_pcall(L, 1, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop (L, 1);
-#endif
- }
+ _edje_lua2_script_func_shutdown(ed);
}
void
_edje_lua_script_only_show(Edje * ed)
{
if (ed->collection && ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_func_show(ed);
-#else
- lua_State *L = ed->L;
- lua_getglobal(L, "show");
- if (!lua_isnil (L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX);
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
-
- if ((err_code = lua_pcall(L, 1, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop (L, 1);
-#endif
- }
+ _edje_lua2_script_func_show(ed);
}
void
_edje_lua_script_only_hide(Edje * ed)
{
if (ed->collection && ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_func_hide(ed);
-#else
- lua_State *L = ed->L;
- lua_getglobal(L, "hide");
- if (!lua_isnil (L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX);
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
-
- if ((err_code = lua_pcall(L, 1, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop (L, 1);
-#endif
- }
+ _edje_lua2_script_func_hide(ed);
}
void
_edje_lua_script_only_move(Edje * ed)
{
if (ed->collection && ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_func_move(ed);
-#else
- lua_State *L = ed->L;
- lua_getglobal(L, "move");
- if (!lua_isnil (L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX);
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
- lua_pushnumber(L, ed->x);
- lua_pushnumber(L, ed->y);
-
- if ((err_code = lua_pcall(L, 3, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop (L, 1);
-#endif
- }
+ _edje_lua2_script_func_move(ed);
}
void
_edje_lua_script_only_resize(Edje * ed)
{
if (ed->collection && ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_func_resize(ed);
-#else
- lua_State *L = ed->L;
- lua_getglobal(L, "resize");
- if (!lua_isnil (L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX);
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
- lua_pushnumber(L, ed->w);
- lua_pushnumber(L, ed->h);
-
- if ((err_code = lua_pcall(L, 3, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop (L, 1);
-#endif
- }
+ _edje_lua2_script_func_resize(ed);
}
void
_edje_lua_script_only_message(Edje * ed, Edje_Message * em)
{
if (ed->collection && ed->L)
- {
-#ifdef LUA2
- _edje_lua2_script_func_message(ed, em);
-#else
- lua_State *L = ed->L;
- lua_getglobal(L, "message");
- if (!lua_isnil (L, -1))
- {
- int nargs = 3;
- int err_code;
- int count;
- int i;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX);
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
- lua_pushnumber(L, em->type);
- lua_pushnumber(L, em->id);
- switch (em->type)
- {
- case EDJE_MESSAGE_NONE:
- break;
- case EDJE_MESSAGE_SIGNAL:
- break;
- case EDJE_MESSAGE_STRING:
- lua_pushstring(L, ((Edje_Message_String *) em->msg)->str);
- nargs += 1;
- break;
- case EDJE_MESSAGE_INT:
- lua_pushnumber(L, ((Edje_Message_Int *) em->msg)->val);
- nargs += 1;
- break;
- case EDJE_MESSAGE_FLOAT:
- lua_pushnumber(L, ((Edje_Message_Float *) em->msg)->val);
- nargs += 1;
- break;
- case EDJE_MESSAGE_STRING_SET:
- count = ((Edje_Message_String_Set *) em->msg)->count;
- lua_createtable(L, count, 0);
- for (i = 0; i < count; i++)
- {
- lua_pushstring(L, ((Edje_Message_String_Set *) em->msg)->str[i]);
- lua_rawseti(L, -2, i + 1);
- }
- nargs += 1;
- break;
- case EDJE_MESSAGE_INT_SET:
- count = ((Edje_Message_Int_Set *) em->msg)->count;
- lua_createtable(L, count, 0);
- for (i = 0; i < count; i++)
- {
- lua_pushnumber(L, ((Edje_Message_Int_Set *) em->msg)->val[i]);
- lua_rawseti(L, -2, i + 1);
- }
- nargs += 1;
- break;
- case EDJE_MESSAGE_FLOAT_SET:
- count = ((Edje_Message_Float_Set *) em->msg)->count;
- lua_createtable(L, count, 0);
- for (i = 0; i < count; i++)
- {
- lua_pushnumber(L, ((Edje_Message_Float_Set *) em->msg)->val[i]);
- lua_rawseti(L, -2, i + 1);
- }
- nargs += 1;
- break;
- case EDJE_MESSAGE_STRING_INT:
- lua_pushstring(L, ((Edje_Message_String_Int *) em->msg)->str);
- lua_pushnumber(L, ((Edje_Message_String_Int *) em->msg)->val);
- nargs += 2;
- break;
- case EDJE_MESSAGE_STRING_FLOAT:
- lua_pushstring(L, ((Edje_Message_String_Float *) em->msg)->str);
- lua_pushnumber(L, ((Edje_Message_String_Float *) em->msg)->val);
- nargs += 2;
- break;
- case EDJE_MESSAGE_STRING_INT_SET:
- lua_pushstring(L, ((Edje_Message_String_Int_Set *) em->msg)->str);
- count = ((Edje_Message_String_Int_Set *) em->msg)->count;
- lua_createtable(L, count, 0);
- for (i = 0; i < count; i++)
- {
- lua_pushnumber(L, ((Edje_Message_String_Int_Set *) em->msg)->val[i]);
- lua_rawseti(L, -2, i + 1);
- }
- nargs += 2;
- break;
- case EDJE_MESSAGE_STRING_FLOAT_SET:
- lua_pushstring(L, ((Edje_Message_String_Float_Set *) em->msg)->str);
- count = ((Edje_Message_String_Float_Set *) em->msg)->count;
- lua_createtable(L, count, 0);
- for (i = 0; i < count; i++)
- {
- lua_pushnumber(L, ((Edje_Message_String_Float_Set *) em->msg)->val[i]);
- lua_rawseti(L, -2, i + 1);
- }
- nargs += 2;
- break;
- default:
- break;
- }
-
- if ((err_code = lua_pcall(L, nargs, 0, 0)))
- _edje_lua_error(L, err_code);
- }
- else
- lua_pop (L, 1);
-#endif
- }
+ _edje_lua2_script_func_message(ed, em);
}
_edje_box_init();
_edje_external_init();
_edje_module_init();
-#ifndef LUA2
- _edje_lua_init();
-#endif
_edje_message_init();
_edje_real_part_mp = eina_mempool_add("chained_mempool",
_edje_real_part_state_mp = NULL;
_edje_real_part_mp = NULL;
_edje_message_shutdown();
-#ifndef LUA2
- _edje_lua_shutdown();
-#endif
_edje_module_shutdown();
_edje_external_shutdown();
_edje_box_shutdown();
_edje_real_part_mp = NULL;
_edje_message_shutdown();
-#ifndef LUA2
- _edje_lua_shutdown();
-#endif
_edje_module_shutdown();
_edje_external_shutdown();
_edje_box_shutdown();
EAPI void _edje_program_insert(Edje_Part_Collection *ed, Edje_Program *p);
EAPI void _edje_program_remove(Edje_Part_Collection *ed, Edje_Program *p);
-// new lua stuff - supercedes the old
-#define LUA2 1
-
-#ifdef LUA2
void _edje_lua2_error_full(const char *file, const char *fnc, int line, lua_State *L, int err_code);
#define _edje_lua2_error(L, err_code) _edje_lua2_error_full(__FILE__, __FUNCTION__, __LINE__, L, err_code)
void _edje_lua2_script_init(Edje *ed);
void _edje_lua2_script_func_resize(Edje *ed);
void _edje_lua2_script_func_message(Edje *ed, Edje_Message *em);
void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src);
-#endif
const char *edje_string_get(const Edje_String *es);
const char *edje_string_id_get(const Edje_String *es);
if (_edje_block_break(ed)) goto break_prog;
_edje_recalc_do(ed);
}
- else if (pr->action == EDJE_ACTION_TYPE_LUA_SCRIPT)
- {
- //printf ("running Lua program script %i\n", pr->id);
-
-// _edje_emit(ed, "program,start", pr->name);
- if (_edje_block_break(ed)) goto break_prog;
-
-#ifdef LUA2
- _edje_lua2_script_init(ed);
-#else
- if (!ed->L) /* private state does not yet exist, create it */
- {
- ed->L = _edje_lua_new_thread(ed, _edje_lua_state_get());
- }
- lua_State *L = ed->L;
- lua_pushnumber(L, pr->id);
- lua_gettable(L, LUA_GLOBALSINDEX);
- if (!lua_isnil(L, -1))
- {
- int err_code;
-
- lua_pushvalue(L, LUA_GLOBALSINDEX); /* set function environment from collection thread to edje object thread */
- lua_setfenv(L, -2);
- _edje_lua_get_reg(L, ed);
- if (lua_isnil(L, -1)) /* group object does not yet exist, create it */
- {
- lua_pop(L, 1);
- _edje_lua_group_fn_new (ed);
- }
- lua_pushstring(L, ssig);
- lua_pushstring(L, ssrc);
-
- if ((err_code = lua_pcall(L, 3, 0, 0)))
- _edje_lua_error(L, err_code);
- }
-#endif
- // _edje_emit(ed, "program,stop", pr->name);
- if (_edje_block_break(ed)) goto break_prog;
- _edje_recalc_do(ed);
- }
else if (pr->action == EDJE_ACTION_TYPE_FOCUS_SET)
{
if (!pr->targets)
_edje_block(ed);
_edje_ref(ed);
_edje_freeze(ed);
-#ifdef LUA2
+
if (ed->collection && ed->L)
_edje_lua2_script_func_signal(ed, sig, src);
-#endif
+
if (ed->collection)
{
#ifdef EDJE_PROGRAM_CACHE