Actually return the map source.
authoronefang <onefang@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 11 Nov 2011 16:34:14 +0000 (16:34 +0000)
committeronefang <onefang@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 11 Nov 2011 16:34:14 +0000 (16:34 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@65070 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/examples/lua_script.edc
src/lib/edje_lua2.c

index f9f90ea..60743b5 100644 (file)
@@ -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.
index eeb4d01..72ef037 100644 (file)
@@ -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;
 }