[uim-commit] r1366 - trunk/xim
ekato at freedesktop.org
ekato at freedesktop.org
Wed Aug 31 09:38:34 PDT 2005
Author: ekato
Date: 2005-08-31 09:38:28 -0700 (Wed, 31 Aug 2005)
New Revision: 1366
Modified:
trunk/xim/ximic.cpp
trunk/xim/ximserver.cpp
trunk/xim/ximserver.h
Log:
* xim/ximserver.cpp (InputContext::~InputContext) : Cosmetic
change.
(InputContext::focusOut) : Improve behavior of
a caret-state-indicator.
(InputContext::clear_pe_stat) : New. Renamed from
clear_preedit() to avoid confusion.
(InputContext::clear_preedit) : Really clear preedit.
(InputContext::~InputContext) : Follow the rename of
clear_preedit().
(InputContext::clear_cb) : Ditto.
(InputContext::clear) : Ditto.
* xim/ximic.cpp (XimIC::unsetFocus) : Update comment following the
changes in InputContext::focusOut().
* xim/ximserver.h (class InputContext) : Add clear_pe_stat().
Change protected to private since this class doesn't have any
derived class.
Modified: trunk/xim/ximic.cpp
===================================================================
--- trunk/xim/ximic.cpp 2005-08-31 12:23:57 UTC (rev 1365)
+++ trunk/xim/ximic.cpp 2005-08-31 16:38:28 UTC (rev 1366)
@@ -407,6 +407,9 @@
}
}
+// Note that the sequence of XIM_SET_IC_FOCUS and XIM_UNSET_FOCUS
+// events is not consistent. Be careful about hiding caret state and
+// candidate window.
void XimIC::unsetFocus()
{
if (!mIsActive)
@@ -415,14 +418,6 @@
mIsActive = false;
nrActiveIC--;
m_kkContext->focusOut();
- // Since the sequence of XIM_SET_IC_FOCUS and XIM_UNSET_FOCUS
- // events is not consistent, unsetting focus of candidate window
- // is now handled in XimIC::setFocus() and focus_in message from
- // helper application.
- //
- // if (mConvdisp && m_kkContext->hasActiveCandwin()) {
- // mConvdisp->unset_focus();
- // }
}
void XimIC::OnKeyEvent(keyEventX e)
Modified: trunk/xim/ximserver.cpp
===================================================================
--- trunk/xim/ximserver.cpp 2005-08-31 12:23:57 UTC (rev 1365)
+++ trunk/xim/ximserver.cpp 2005-08-31 16:38:28 UTC (rev 1366)
@@ -331,7 +331,7 @@
mFocusedContext = NULL;
if (mConvdisp)
- mConvdisp->set_pe(0);
+ mConvdisp->set_pe(NULL);
delete m_pe;
uim_release_context(mUc);
@@ -477,6 +477,13 @@
InputContext::focusOut()
{
uim_helper_client_focus_out(mUc);
+ if (mFocusedContext == this) {
+ Canddisp *disp = canddisp_singleton();
+ if (isCaretStateShown())
+ disp->hide_caret_state();
+ if (hasActiveCandwin())
+ disp->hide();
+ }
}
XimServer *
@@ -497,7 +504,7 @@
InputContext *ic = (InputContext *)ptr;
XimIC *xic = ic->get_ic();
- clear_cb(ptr);
+ ic->clear_pe_stat();
ic->update_preedit();
xic->commit_string(str);
}
@@ -505,7 +512,7 @@
void InputContext::clear_cb(void *ptr)
{
InputContext *ic = (InputContext *)ptr;
- ic->clear_preedit();
+ ic->clear_pe_stat();
}
void InputContext::pushback_cb(void *ptr, int attr, const char *str)
@@ -560,11 +567,18 @@
ic->update_prop_label(str);
}
-void InputContext::clear_preedit()
+void InputContext::clear_pe_stat()
{
m_pe->clear();
}
+void InputContext::clear_preedit()
+{
+ clear_pe_stat();
+ if (mConvdisp)
+ mConvdisp->clear_preedit();
+}
+
uString InputContext::get_preedit_string()
{
uString str;
@@ -640,11 +654,10 @@
return mCandwinActive;
}
+// reset
void InputContext::clear()
{
clear_preedit();
- if (mConvdisp)
- mConvdisp->clear_preedit();
candidate_deactivate();
uim_reset_context(mUc);
}
Modified: trunk/xim/ximserver.h
===================================================================
--- trunk/xim/ximserver.h 2005-08-31 12:23:57 UTC (rev 1365)
+++ trunk/xim/ximserver.h 2005-08-31 16:38:28 UTC (rev 1366)
@@ -194,15 +194,15 @@
static void update_prop_label_cb(void *ptr, const char *str);
static InputContext *focusedContext();
static void deletefocusedContext();
-protected:
+private:
void commit_string(char *);
+ void clear_pe_stat();
+
XimIC *mXic;
XimServer *mServer;
pe_stat *m_pe;
Convdisp *mConvdisp;
uim_context mUc;
-private:
- static InputContext *mFocusedContext;
bool mCandwinActive;
int mDisplayLimit;
int mNumPage;
@@ -212,6 +212,8 @@
char *mEngineName;
char *mLocaleName;
bool mCaretStateShown;
+private:
+ static InputContext *mFocusedContext;
};
class Locale {
More information about the uim-commit
mailing list