summaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorPeng Wu <epico@dhcp-65-116.nay.redhat.com>2010-04-13 16:31:03 +0800
committerPeng Wu <alexepico@gmail.com>2010-05-19 10:09:32 +0800
commitaae2c566368ddd45a60b47a4b571f845d7a19b01 (patch)
treeedc1110908e5692cd3427c0af4b7a4f6cd27b52e /lua
parentc3bc5bd52879a85a7a6bfd4e2baefbe7cf37bc01 (diff)
downloadibus-libpinyin-aae2c566368ddd45a60b47a4b571f845d7a19b01.tar.gz
ibus-libpinyin-aae2c566368ddd45a60b47a4b571f845d7a19b01.tar.xz
ibus-libpinyin-aae2c566368ddd45a60b47a4b571f845d7a19b01.zip
re-factor lua-plugin interface.
Diffstat (limited to 'lua')
-rw-r--r--lua/lua-plugin.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/lua/lua-plugin.h b/lua/lua-plugin.h
index 084fe15..6284f02 100644
--- a/lua/lua-plugin.h
+++ b/lua/lua-plugin.h
@@ -15,6 +15,16 @@ typedef struct{
const char * help; /* optional. */
} lua_command_t;
+typedef struct{
+ const char * lua_function_name;
+ const char * description;
+ /*< private, skip it, and register it into Special Table directly with * wildcard. >*/
+ /*
+ * list of input_trigger_strings;
+ * list of candidate_trigger_strings;
+ */
+} lua_trigger_t;
+
/*
* Type macros.
*/
@@ -52,24 +62,37 @@ GType ibus_engine_plugin_get_type(void);
IBusEnginePlugin * ibus_engine_plugin_new();
/**
+ * add a lua_command_t to plugin.
+ */
+gboolean ibus_engine_plugin_add_command(IBusEnginePlugin * plugin, lua_command_t * command);
+
+/**
* retrieve all available lua plugin commands.
* return array of command informations of type lua_command_t.
*/
-GArray * ibus_engine_plugin_ime_get_available_commands(IBusEnginePlugin * plugin);
+GArray * ibus_engine_plugin_get_available_commands(IBusEnginePlugin * plugin);
+
+/**
+ * Lookup a special command in ime lua extension.
+ * command must be an 2-char long string.
+ * return the matched command.
+ */
+lua_command_t * ibus_engine_plugin_lookup_command(IBusEnginePlugin * plugin, const char * command);
/**
- * retval int: only support string or string array.
+ * retval int: returns the number of results,
+ * only support string or string array.
*/
-int ibus_engine_plugin_ime_call(IBusEnginePlugin * plugin, const lua_command_t * command, const char * argument /*optional, maybe NULL.*/);
+int ibus_engine_plugin_call(IBusEnginePlugin * plugin, const lua_command_t * command, const char * argument /*optional, maybe NULL.*/);
/**
* retrieve the retval string value. (value has been copied.)
*/
-const char * ibus_engine_plugin_ime_get_retval(IBusEnginePlugin * plugin);
+const char * ibus_engine_plugin_get_retval(IBusEnginePlugin * plugin);
/**
* retrieve the array of string values. (string values have been copied.)
*/
-GArray * ibus_engine_plugin_ime_get_retvals(IBusEnginePlugin * plugin);
+GArray * ibus_engine_plugin_get_retvals(IBusEnginePlugin * plugin);
/*< private >*/