From 6d9f0ed3dc885ebf2df41652bbf65dc18ed25c83 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Fri, 11 Nov 2011 16:34:14 +0000 Subject: [PATCH] Actually return the map source. SVN revision: 65070 --- legacy/edje/src/examples/lua_script.edc | 4 ++-- legacy/edje/src/lib/edje_lua2.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/legacy/edje/src/examples/lua_script.edc b/legacy/edje/src/examples/lua_script.edc index f9f90eaea3..60743b59b8 100644 --- a/legacy/edje/src/examples/lua_script.edc +++ b/legacy/edje/src/examples/lua_script.edc @@ -142,7 +142,7 @@ collections { D.text:show(); --// Fun with maps! - D.map = edje.map(4); + D.map = edje.map(4); --// 4 is the only supported map size at the moment. --// These all do the same thing. --// Note, lua likes to start at 1, C (and thus evas) at 0. I choose to agree with C. D.map:coord(0, 50, 50, 0); @@ -202,7 +202,7 @@ collections { print("lua::map enabled"); end ---// D.rect2:map_source(D.rect); --// Don't think this is actually implemented in evas. + D.rect2:map_source(D.rect); --// Don't think this is actually implemented in evas. --// D.map:dup(); --// D.map:size(); --// perhaps overide the # operator? For now it's only gonna return 4 anyway. diff --git a/legacy/edje/src/lib/edje_lua2.c b/legacy/edje/src/lib/edje_lua2.c index eeb4d012cf..72ef03763b 100644 --- a/legacy/edje/src/lib/edje_lua2.c +++ b/legacy/edje/src/lib/edje_lua2.c @@ -2184,6 +2184,8 @@ _elua_obj_map_source(lua_State *L) { Edje_Lua_Obj *obj = (Edje_Lua_Obj *)lua_touserdata(L, 1); Edje_Lua_Evas_Object *elo = (Edje_Lua_Evas_Object *)obj; + Evas_Object *o; + Edje_Lua_Evas_Object *elo2; int n; if (!obj) return 0; @@ -2201,8 +2203,9 @@ _elua_obj_map_source(lua_State *L) evas_object_map_source_set(elo->evas_obj, source->evas_obj); } -// FIXME: return this evas object. -// evas_object_map_source_get(elo->evas_obj); + if (!(o = evas_object_map_source_get(elo->evas_obj))) return 0; + if (!(elo2 = evas_object_data_get(o, ELO))) return 0; + _elua_ref_get(L, elo2); return 1; }