Hello community, here is the log from the commit of package fcitx-hangul for openSUSE:Factory checked in at 2012-12-14 06:38:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx-hangul (Old) and /work/SRC/openSUSE:Factory/.fcitx-hangul.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx-hangul", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx-hangul/fcitx-hangul.changes 2012-09-20 15:27:46.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.fcitx-hangul.new/fcitx-hangul.changes 2012-12-14 06:38:47.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Dec 12 03:55:26 UTC 2012 - [email protected] + +- update version 0.2.0 + * fix of many incorrect behavior. + +------------------------------------------------------------------- Old: ---- fcitx-hangul-0.1.2.tar.bz2 New: ---- fcitx-hangul-0.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx-hangul.spec ++++++ --- /var/tmp/diff_new_pack.EF3we7/_old 2012-12-14 06:38:49.000000000 +0100 +++ /var/tmp/diff_new_pack.EF3we7/_new 2012-12-14 06:38:49.000000000 +0100 @@ -16,7 +16,7 @@ # Name: fcitx-hangul -Version: 0.1.2 +Version: 0.2.0 Release: 0 License: GPL-2.0 Summary: Hangul Module for Fcitx IM Framework @@ -50,7 +50,7 @@ %install pushd build -%make_install +make DESTDIR=%{buildroot} install popd # Fix wrong-icon-size ++++++ fcitx-hangul-0.1.2.tar.bz2 -> fcitx-hangul-0.2.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-hangul-0.1.2/data/CMakeLists.txt new/fcitx-hangul-0.2.0/data/CMakeLists.txt --- old/fcitx-hangul-0.1.2/data/CMakeLists.txt 2012-09-02 08:45:01.000000000 +0200 +++ new/fcitx-hangul-0.2.0/data/CMakeLists.txt 2012-12-10 02:13:32.000000000 +0100 @@ -3,7 +3,7 @@ fcitx_add_inputmethod_conf_file(hangul.conf) install(FILES symbol.txt DESTINATION ${FCITX4_PREFIX}/share/fcitx/hangul/) -install(FILES hangul.png DESTINATION ${FCITX4_PREFIX}/share/fcitx/skin/default/) +install(FILES hangul.png DESTINATION ${FCITX4_PREFIX}/share/fcitx/skin/imicon/) install(FILES hangul.png RENAME fcitx-hangul.png DESTINATION share/icons/hicolor/64x64/apps/) install(FILES hanja_active.png RENAME fcitx-hanja-active.png DESTINATION share/icons/hicolor/64x64/status/) install(FILES hanja_inactive.png RENAME fcitx-hanja-inactive.png DESTINATION share/icons/hicolor/64x64/status/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-hangul-0.1.2/po/zh_CN.po new/fcitx-hangul-0.2.0/po/zh_CN.po --- old/fcitx-hangul-0.1.2/po/zh_CN.po 2012-09-02 08:45:01.000000000 +0200 +++ new/fcitx-hangul-0.2.0/po/zh_CN.po 2012-12-10 02:13:32.000000000 +0100 @@ -4,20 +4,22 @@ # # Translators: # Christopher Meng <[email protected]>, 2012. -# Weng Xuetian <[email protected]>, 2010, 2011, 2012. +# marguerite su <[email protected]>, 2012. +# <[email protected]>, 2012. +# Weng Xuetian <[email protected]>, 2010-2012. msgid "" msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-03-16 17:05+0800\n" -"PO-Revision-Date: 2012-08-23 03:54+0000\n" -"Last-Translator: Christopher Meng <[email protected]>\n" +"PO-Revision-Date: 2012-09-20 03:06+0000\n" +"Last-Translator: csslayer <[email protected]>\n" "Language-Team: Chinese (China) <[email protected]>\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0\n" +"Plural-Forms: nplurals=1; plural=0;\n" #: unknown msgid "Ahnmatae" @@ -25,7 +27,7 @@ #: /home/saber/Develop/fcitx-hangul/data/fcitx-hangul.desc:25 msgid "Auto Reorder" -msgstr "" +msgstr "自动排序" #: unknown msgid "Dubeolsik" @@ -92,4 +94,4 @@ #: /home/saber/Develop/fcitx-hangul/data/fcitx-hangul.desc:30 msgid "Word Commit" -msgstr "" +msgstr "单词提交" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-hangul-0.1.2/src/config.c new/fcitx-hangul-0.2.0/src/config.c --- old/fcitx-hangul-0.1.2/src/config.c 2012-09-02 08:45:01.000000000 +0200 +++ new/fcitx-hangul-0.2.0/src/config.c 2012-12-10 02:13:32.000000000 +0100 @@ -27,4 +27,4 @@ CONFIG_BINDING_REGISTER("Hangul", "HanjaMode", hanjaMode) CONFIG_BINDING_REGISTER("Hangul", "AutoReorder", autoReorder) CONFIG_BINDING_REGISTER("Hangul", "WordCommit", wordCommit) -CONFIG_BINDING_END() +CONFIG_BINDING_END() \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-hangul-0.1.2/src/eim.c new/fcitx-hangul-0.2.0/src/eim.c --- old/fcitx-hangul-0.1.2/src/eim.c 2012-09-02 08:45:01.000000000 +0200 +++ new/fcitx-hangul-0.2.0/src/eim.c 2012-12-10 02:13:32.000000000 +0100 @@ -62,16 +62,23 @@ static void SaveHangulConfig(FcitxHangulConfig* fs); static void ConfigHangul(FcitxHangul* hangul); static void FcitxHangulUpdatePreedit(FcitxHangul* hangul); -static void FcitxHangulUpdateLookupTable(FcitxHangul* hangul); +static void FcitxHangulCleanLookupTable(FcitxHangul* hangul); +static void FcitxHangulUpdateLookupTable(FcitxHangul* hangul, boolean checkSurrounding); static void FcitxHangulFlush(FcitxHangul* hangul); static void FcitxHangulToggleHanja(void* arg); static boolean FcitxHangulGetHanja(void* arg); static void FcitxHangulResetEvent(void* arg); static char* FcitxHangulUcs4ToUtf8(FcitxHangul* hangul, const ucschar* ucsstr, int length); static void FcitxHangulUpdateHanjaStatus(FcitxHangul* hangul); -static void FcitxHangulUpdateSurroundingText(void* arg); -size_t ucs4_strlen(const ucschar* str) +static inline void FcitxHangulFreeHanjaList(FcitxHangul* hangul) { + if (hangul->hanjaList) { + hanja_list_delete (hangul->hanjaList); + hangul->hanjaList = NULL; + } +} + +static inline size_t ucs4_strlen(const ucschar* str) { size_t len = 0; while(*str) { @@ -131,6 +138,9 @@ FcitxHangul* hangul = (FcitxHangul*) arg; ustring_clear(hangul->preedit); hangul_ic_reset(hangul->ic); + if (hangul->hanjaList) { + FcitxHangulCleanLookupTable(hangul); + } } /** @@ -146,11 +156,13 @@ FcitxHangul* hangul = (FcitxHangul*) arg; if (FcitxHotkeyIsHotKey(sym, state, hangul->fh.hkHanjaMode)) { - FcitxUIUpdateStatus(hangul->owner, "hanja"); - if (hangul->fh.hkHanjaMode) - return IRV_DISPLAY_CANDWORDS; - else - return IRV_DO_NOTHING; + if (hangul->hanjaList == NULL) { + FcitxHangulUpdateLookupTable(hangul, true); + } + else { + FcitxHangulCleanLookupTable(hangul); + } + return IRV_DISPLAY_MESSAGE; } if (sym == FcitxKey_Shift_L || sym == FcitxKey_Shift_R) @@ -201,8 +213,8 @@ return FcitxCandidateWordChooseByIndex(FcitxInputStateGetCandidateList(input), 0); } - if (!hangul->fh.hanjaMode) { - return IRV_DONOT_PROCESS; + if (!hangul->fh.hanjaMode) { + FcitxHangulCleanLookupTable(hangul); } } @@ -288,6 +300,7 @@ FcitxMessages* preedit = FcitxInputStateGetPreedit(input); FcitxMessages* clientPreedit = FcitxInputStateGetClientPreedit(input); FcitxInstanceCleanInputWindowUp(hangul->owner); + FcitxInputStateSetShowCursor(input, true); const ucschar *hic_preedit = hangul_ic_get_preedit_string (hangul->ic); char* pre1 = FcitxHangulUcs4ToUtf8(hangul, ustring_begin(hangul->preedit), ustring_length(hangul->preedit)); @@ -295,20 +308,28 @@ FcitxInputContext* ic = FcitxInstanceGetCurrentIC(hangul->owner); FcitxProfile* profile = FcitxInstanceGetProfile(hangul->owner); + size_t preeditLen = 0; + + boolean clientPreeditNotAvail = (ic && ((ic->contextCaps & CAPACITY_PREEDIT) == 0 || !profile->bUsePreedit)); + if (pre1 && pre1[0] != 0) { - if (ic && ((ic->contextCaps & CAPACITY_PREEDIT) == 0 || !profile->bUsePreedit)) + size_t len1 = strlen(pre1); + if (clientPreeditNotAvail) FcitxMessagesAddMessageAtLast(preedit, MSG_INPUT, "%s", pre1); FcitxMessagesAddMessageAtLast(clientPreedit, MSG_INPUT, "%s", pre1); + preeditLen += len1; } if (pre2 && pre2[0] != '\0') { - if (ic && ((ic->contextCaps & CAPACITY_PREEDIT) == 0 || !profile->bUsePreedit)) + size_t len2 = strlen(pre2); + if (clientPreeditNotAvail) FcitxMessagesAddMessageAtLast(preedit, MSG_INPUT | MSG_HIGHLIGHT, "%s", pre2); FcitxMessagesAddMessageAtLast(clientPreedit, MSG_INPUT | MSG_HIGHLIGHT, "%s", pre2); + preeditLen += len2; } - FcitxInputStateSetCursorPos(input, 0); - FcitxInputStateSetClientCursorPos(input, 0); + FcitxInputStateSetCursorPos(input, clientPreeditNotAvail ? preeditLen : 0); + FcitxInputStateSetClientCursorPos(input, preeditLen); if (pre1) free(pre1); @@ -389,7 +410,12 @@ return substring; } -void FcitxHangulUpdateLookupTable(FcitxHangul* hangul) +void FcitxHangulCleanLookupTable(FcitxHangul* hangul) { + FcitxInstanceCleanInputWindowDown(hangul->owner); + FcitxHangulFreeHanjaList(hangul); +} + +void FcitxHangulUpdateLookupTable(FcitxHangul* hangul, boolean checkSurrounding) { char* surroundingStr = NULL; char* utf8; @@ -400,10 +426,7 @@ unsigned int cursorPos; unsigned int anchorPos; - if (hangul->hanjaList != NULL) { - hanja_list_delete (hangul->hanjaList); - hangul->hanjaList = NULL; - } + FcitxHangulFreeHanjaList(hangul); hic_preedit = hangul_ic_get_preedit_string (hangul->ic); @@ -430,14 +453,16 @@ lookupMethod = LOOKUP_METHOD_SUFFIX; } } else { - FcitxInstanceGetSurroundingText(hangul->owner, FcitxInstanceGetCurrentIC(hangul->owner), &surroundingStr, &cursorPos, &anchorPos); - if (cursorPos != anchorPos) { - // If we have selection in surrounding text, we use that. - hanjaKey = GetSubstring(surroundingStr, cursorPos, anchorPos); - lookupMethod = LOOKUP_METHOD_EXACT; - } else { - hanjaKey = GetSubstring (surroundingStr, (long) cursorPos - 64, cursorPos); - lookupMethod = LOOKUP_METHOD_SUFFIX; + if (checkSurrounding) { + FcitxInstanceGetSurroundingText(hangul->owner, FcitxInstanceGetCurrentIC(hangul->owner), &surroundingStr, &cursorPos, &anchorPos); + if (cursorPos != anchorPos) { + // If we have selection in surrounding text, we use that. + hanjaKey = GetSubstring(surroundingStr, cursorPos, anchorPos); + lookupMethod = LOOKUP_METHOD_EXACT; + } else { + hanjaKey = GetSubstring (surroundingStr, (long) cursorPos - 64, cursorPos); + lookupMethod = LOOKUP_METHOD_SUFFIX; + } } } @@ -485,7 +510,7 @@ { const ucschar *str; - FcitxInstanceCleanInputWindowDown(hangul->owner); + FcitxHangulCleanLookupTable(hangul); str = hangul_ic_flush (hangul->ic); @@ -524,7 +549,9 @@ FcitxHangulUpdatePreedit(hangul); if (hangul->fh.hanjaMode) { - FcitxHangulUpdateLookupTable(hangul); + FcitxHangulUpdateLookupTable(hangul, false); + } else { + FcitxHangulCleanLookupTable(hangul); } return IRV_DISPLAY_CANDWORDS; @@ -558,11 +585,13 @@ preedit_len = ustring_length(hangul->preedit); hic_preedit_len = ucs4_strlen (hic_preedit); + boolean surrounding = false; if (hangul->lastLookupMethod == LOOKUP_METHOD_PREFIX) { if (preedit_len == 0 && hic_preedit_len == 0) { /* remove surrounding_text */ if (key_len > 0) { FcitxInstanceDeleteSurroundingText (hangul->owner, FcitxInstanceGetCurrentIC(hangul->owner), -key_len , key_len); + surrounding = true; } } else { /* remove preedit text */ @@ -595,13 +624,21 @@ } /* remove surrounding_text */ - if (key_len > 0) { + if (LOOKUP_METHOD_EXACT != hangul->lastLookupMethod && key_len > 0) { FcitxInstanceDeleteSurroundingText (hangul->owner, FcitxInstanceGetCurrentIC(hangul->owner), -key_len , key_len); + surrounding = true; } } FcitxInstanceCommitString(hangul->owner, FcitxInstanceGetCurrentIC(hangul->owner), value); - return IRV_DISPLAY_CANDWORDS; + if (surrounding) { + FcitxInstanceCleanInputWindowUp(hangul->owner); + FcitxHangulCleanLookupTable(hangul); + return IRV_DISPLAY_MESSAGE; + } + else { + return IRV_DISPLAY_CANDWORDS; + } } /** @@ -636,7 +673,6 @@ free(path); - hangul->ic = hangul_ic_new(keyboard[hangul->fh.keyboardLayout]); hangul_ic_connect_callback (hangul->ic, "transition", FcitxHangulOnTransition, hangul); @@ -648,7 +684,6 @@ iface.DoInput = FcitxHangulDoInput; iface.GetCandWords = FcitxHangulGetCandWords; iface.ReloadConfig = ReloadConfigFcitxHangul; - iface.UpdateSurroundingText = FcitxHangulUpdateSurroundingText; FcitxInstanceRegisterIMv2(instance, hangul, @@ -697,6 +732,9 @@ else { FcitxUISetStatusString(hangul->owner, "hanja", "\xed\x95\x9c", _("Use Hangul")); } + FcitxHangulFlush(hangul); + FcitxHangulUpdatePreedit(hangul); + FcitxUIUpdateInputWindow(hangul->owner); } boolean FcitxHangulGetHanja(void* arg) @@ -785,11 +823,3 @@ FcitxUISetStatusVisable(hangul->owner, "hanja", true); } } - -void FcitxHangulUpdateSurroundingText(void* arg) -{ - FcitxHangul* hangul = (FcitxHangul*) arg; - FcitxInstanceCleanInputWindow(hangul->owner); - FcitxHangulGetCandWords(hangul); - FcitxUIUpdateInputWindow(hangul->owner); -} -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
