Evas filters: Fix some parsing errors
authorJean-Philippe Andre <jp.andre@samsung.com>
Fri, 9 May 2014 07:07:41 +0000 (16:07 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Fri, 9 May 2014 07:57:39 +0000 (16:57 +0900)
src/lib/evas/filters/evas_filter_parser.c

index d535748bfcd97cddfcb7770f5f9d638f649dbeae..8b3f6e7937064aa4a38c9608178f1c43dfe5e5a1 100644 (file)
@@ -9,11 +9,11 @@
 # define LUA52 1
 #endif
 
-//#ifdef DEBUG
+#ifdef DEBUG
 # define FILTERS_DEBUG
-//#endif
+#endif
 
-#define FILTERS_LEGACY_COMPAT
+//#define FILTERS_LEGACY_COMPAT
 
 #define EVAS_FILTER_MODE_GROW   (EVAS_FILTER_MODE_LAST+1)
 #define EVAS_FILTER_MODE_BUFFER (EVAS_FILTER_MODE_LAST+2)
@@ -1884,7 +1884,7 @@ _lua_state_create(Evas_Filter_Program *pgm)
       { EINA_TRUE, "enabled" },
       { EINA_FALSE, "off" },
       { EINA_FALSE, "no" },
-      { EINA_FALSE, "disnable" },
+      { EINA_FALSE, "disable" },
       { EINA_FALSE, "disabled" }
    };
 
@@ -1894,6 +1894,17 @@ _lua_state_create(Evas_Filter_Program *pgm)
         lua_setglobal(L, booleans[k].name);
      }
 
+   // Buffers. Should be input & output only.
+   {
+      Buffer *buf;
+
+      EINA_INLIST_FOREACH(pgm->buffers, buf)
+        {
+           lua_pushstring(L, buf->name);
+           lua_setglobal(L, buf->name);
+        }
+   }
+
    // Register proxies
    if (pgm->proxies)
      {
@@ -2061,6 +2072,7 @@ evas_filter_program_parse(Evas_Filter_Program *pgm, const char *str)
    if (ok) ok = !lua_pcall(L, 0, LUA_MULTRET, 0);
    lua_close(L);
 
+   ok &= (pgm->instructions != NULL);
    pgm->valid = ok;
    pgm->padding_calc = EINA_FALSE;