From 233b0a7bc8f74d2e14996364998db8ef3c2e747b Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 5 May 2010 11:18:10 +0800 Subject: [PATCH] add comments --- src/ExtEditor.cc | 25 +++++++++++++++++++++---- src/ExtEditor.h | 5 +++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/ExtEditor.cc b/src/ExtEditor.cc index c8cbd88..daefb93 100644 --- a/src/ExtEditor.cc +++ b/src/ExtEditor.cc @@ -30,8 +30,9 @@ ExtEditor::resetLuaState() gboolean ExtEditor::processKeyEvent (guint keyval, guint keycode, guint modifiers) { - - return FALSE; + /* Remember the input string. */ + /* Deal other staff with updateStateFromInput(). */ + return false; } void @@ -70,8 +71,24 @@ ExtEditor::candidateClicked (guint index, guint button, guint state) } bool -ExtEditor::updateStateFromInput(){ - return true; +ExtEditor::fillCommandCandidates() +{ + return true; +} + +bool +ExtEditor::updateStateFromInput() +{ + /* Do parse and candidates update here. */ + /* prefix i double check here. */ + /* Check m_input len, and update auxiliary string meanwhile. + * 1. only "i", dispatch to fillCommandCandidates(void). + * 2. "i" with one charactor, + * dispatch to fillCommandCandidates(std::string). + * 3. "i" with two charactor or more, + * dispatch to fillCommand(std::string, const char * argument). + */ + return true; } }; diff --git a/src/ExtEditor.h b/src/ExtEditor.h index 15d4b32..9994a32 100644 --- a/src/ExtEditor.h +++ b/src/ExtEditor.h @@ -33,6 +33,11 @@ public: private: bool updateStateFromInput(); + /* Fill lookup table, and update preedit string. */ + bool fillCommandCandidates(); + bool fillCommandCandidates(std::string prefix); + bool fillCommand(std::string command_name, const char * argument); + Pointer m_lua_plugin; std::string m_input; -- 2.7.4