summaryrefslogtreecommitdiffstats
path: root/lua/lua-plugin.h
diff options
context:
space:
mode:
authorPeng Wu <epico@dhcp-65-116.nay.redhat.com>2010-04-01 16:34:21 +0800
committerPeng Wu <alexepico@gmail.com>2010-05-19 10:09:32 +0800
commit113f004efdbf39ef37a1758b862117b38ba4fedf (patch)
tree8fae614299d6c21e6600cebffeacce8e9b468604 /lua/lua-plugin.h
parent870473405c70bb592d80cbe291acf1470dc5468e (diff)
downloadibus-libpinyin-113f004efdbf39ef37a1758b862117b38ba4fedf.tar.gz
ibus-libpinyin-113f004efdbf39ef37a1758b862117b38ba4fedf.tar.xz
ibus-libpinyin-113f004efdbf39ef37a1758b862117b38ba4fedf.zip
begin lua-plugin integration.
Diffstat (limited to 'lua/lua-plugin.h')
-rw-r--r--lua/lua-plugin.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/lua/lua-plugin.h b/lua/lua-plugin.h
index b2fe8e5..2ffdeed 100644
--- a/lua/lua-plugin.h
+++ b/lua/lua-plugin.h
@@ -5,6 +5,34 @@ int lua_plugin_init(lua_State * L);
int lua_plugin_fini(lua_State * L);
#define LUA_IMELIBNAME "ime"
-LUALIB_API int (luaopen_ime) (lua_State *L);
+LUALIB_API int (luaopen_ime) (lua_State * L);
+
+typedef struct{
+ const char * command_name;
+ const char * lua_function_name;
+ const char * description;
+ const char * leading; /* optional, default "digit". */
+ const char * help; /* optional. */
+} lua_command_t;
+
+/**
+ * retrieve all available lua plugin commands.
+ * return array of command informations of type lua_command_t.
+ */
+GArray * lua_plugin_ime_get_available_commands(lua_State * L);
+
+/**
+ * retval int: only support string or string array.
+ */
+int lua_plugin_ime_call(lua_State * L, const lua_command_t * command, const char * argument /*optional, maybe NULL.*/);
+
+/**
+ * retrieve the retval string value. (value has been copied.)
+ */
+const char * lua_plugin_ime_get_retval(lua_State * L);
+/**
+ * retrieve the array of string values. (string values have been copied.)
+ */
+GArray * lua_plugin_ime_get_retvals(lua_State * L);
#endif