Added Lua function edje.version().
authoronefang <onefang@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 8 Jan 2012 14:37:11 +0000 (14:37 +0000)
committeronefang <onefang@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 8 Jan 2012 14:37:11 +0000 (14:37 +0000)
Also cleaned up the changelog date from my last commit.  Oops.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@66977 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

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

index 505ce25..e10dbf7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
        * Unswallow object that are about to be swallowed if necessary.
        * Add EDJE_ASPECT_PREFER_SOURCE.
 
-2011-11-07  David Seikel (onefang)
+2012-01-07  David Seikel (onefang)
 
        * Lua: Calling non exstent functions no longer crashes scripts.
           This is so that future scripts will still work with old libraries,
           and lets us add the "host can provide Lua API" feature soon.
 
+2012-01-09  David Seikel (onefang)
+
+       * Lua: Added edje.version().
+
diff --git a/NEWS b/NEWS
index 875a566..da4348c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Additions:
 
     * "recalc" smart callback for object size changes
     * EDJE_ASPECT_PREFER_SOURCE.
+    * edje.version() Lua function.
 
 Improvements:
     * speedup load time of Edje file.
index 2f2ea74..23c2926 100644 (file)
@@ -104,6 +104,10 @@ collections {
          print("lua::init ... " .. D.val);
          edje.echo("lua::echo('hello world')");
 
+         --// How to check the edje version.
+         version = edje.version();
+         print("The edje version number is " .. version.major .. "." .. version.minor);
+
          --// actually add the timer to call mycb in 1.23 sec
          D.tim = edje.timer(1.23, mycb);
          D.tra = edje.transition(5.0, mycb3);
index 2dbcb08..1320b16 100644 (file)
@@ -614,6 +614,7 @@ static int _elua_echo(lua_State *L);
 static int _elua_date(lua_State *L);
 static int _elua_looptime(lua_State *L);
 static int _elua_seconds(lua_State *L);
+static int _elua_version(lua_State *L);
 
 static int _elua_objgeom(lua_State *L);
 static int _elua_objpos(lua_State *L);
@@ -649,6 +650,7 @@ static const struct luaL_reg _elua_edje_funcs [] =
      {"date",         _elua_date}, // get date in a table
      {"looptime",     _elua_looptime}, // get loop time
      {"seconds",      _elua_seconds}, // get seconds
+     {"version",      _elua_version}, // edje version
 
    // query edje - size, pos
      {"geom",         _elua_objgeom}, // get while edje object geometry in canvas
@@ -801,6 +803,25 @@ _elua_seconds(lua_State *L)  // Stack usage [-0, +1, -]
    return 1;
 }
 
+/**
+@page luaref
+@subsubsection edje_version edje:version()
+
+Retrieves the current edje version number.
+
+@returns A table with these fields:
+    - integer major: The edje version major number.
+    - integer minor: The edje version minor number.
+
+@since 1.2.0
+*/
+static int
+_elua_version(lua_State *L)                                                // Stack usage [-4, +5, em]
+{
+   _elua_ret(L, "%major %minor", EDJE_VERSION_MAJOR, EDJE_VERSION_MINOR);  // Stack usage [-4, +5, em]
+    return 1;
+}
+
 //-------------
 /**
 @page luaref