begin to integrate lua ext.
authorPeng Wu <alexepico@gmail.com>
Tue, 4 May 2010 05:37:29 +0000 (13:37 +0800)
committerPeng Wu <alexepico@gmail.com>
Wed, 19 May 2010 02:09:32 +0000 (10:09 +0800)
src/ExtEditor.h
src/Makefile.am

index cd04787..78d1d66 100644 (file)
@@ -3,6 +3,13 @@
 #define __PY_EXT_EDITOR__
 
 #include <glib.h>
+extern "C" {
+#include <lua.h>
+#include <lualib.h>
+#include <lauxlib.h>
+#include "lua-plugin.h"
+}
+#include <string>
 #include "Editor.h"
 
 namespace PY {
@@ -20,7 +27,15 @@ public:
     virtual void reset (void);
     virtual void candidateClicked (guint index, guint button, guint state);
 
+    int load_lua_script(std::string filename);
+    void reset_lua_state();
+
 private:
+    Pointer<IBusEnginePlugin> m_lua_plugin;
+    lua_command_t * m_current_command;
+    std::string m_input;
+
+    LookupTable m_lookup_table;
 };
 
 };
index 29a1d01..d15d5aa 100644 (file)
@@ -118,10 +118,14 @@ ibus_engine_pinyin_CXXFLAGS = \
        -DGETTEXT_PACKAGE=\"@GETTEXT_PACKAGE@\" \
        -DPKGDATADIR=\"$(pkgdatadir)\" \
        -DLIBEXECDIR=\"$(libexecdir)\" \
+       -I../lua/ \
        $(NULL)
+
 ibus_engine_pinyin_LDADD = \
        @IBUS_LIBS@ \
        @SQLITE_LIBS@ \
+       -L../lua/ \
+       -lpylua \
        $(NULL)
 
 if HAVE_LIBUUID