[arch-commits] Commit in fcitx/trunk (2 files)
Felix Yan
fyan at nymeria.archlinux.org
Fri Mar 28 15:37:21 UTC 2014
Date: Friday, March 28, 2014 @ 16:37:21
Author: fyan
Revision: 108550
upgpkg: fcitx 4.2.8.3-3
- add upstream patch
Added:
fcitx/trunk/add-a-context-variable-to-disable-punc.patch
Modified:
fcitx/trunk/PKGBUILD
----------------------------------------------+
PKGBUILD | 22 +++++----
add-a-context-variable-to-disable-punc.patch | 59 +++++++++++++++++++++++++
2 files changed, 73 insertions(+), 8 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2014-03-28 15:28:52 UTC (rev 108549)
+++ PKGBUILD 2014-03-28 15:37:21 UTC (rev 108550)
@@ -6,17 +6,22 @@
pkgbase=fcitx
pkgname=('fcitx' 'fcitx-gtk2' 'fcitx-gtk3' 'fcitx-qt4')
pkgver=4.2.8.3
-pkgrel=2
+pkgrel=3
groups=('fcitx-im')
arch=('i686' 'x86_64')
url="http://fcitx-im.org"
license=('GPL')
-makedepends=('cmake' 'doxygen' 'gtk2' 'gtk3' 'qt4' 'icu' 'mesa' \
- 'iso-codes' 'gobject-introspection' 'libxkbfile')
-source=(http://download.fcitx-im.org/$pkgbase/$pkgbase-${pkgver}_dict.tar.xz)
+makedepends=('cmake' 'doxygen' 'gtk2' 'gtk3' 'qt4' 'icu' 'mesa' 'opencc' \
+ 'iso-codes' 'gobject-introspection' 'libxkbfile' 'enchant')
+source=(http://download.fcitx-im.org/$pkgbase/$pkgbase-${pkgver}_dict.tar.xz
+ add-a-context-variable-to-disable-punc.patch)
+prepare() {
+ cd ${pkgbase}-${pkgver}
+ patch -p1 -i ../add-a-context-variable-to-disable-punc.patch
+}
+
build() {
- cd "$srcdir"
mkdir -p build
cd build
@@ -36,7 +41,7 @@
}
check() {
- cd "${srcdir}/build"
+ cd build
make test
}
@@ -73,7 +78,7 @@
'gettext: for fcitx-po-parser')
install=fcitx.install
- cd "${srcdir}/build"
+ cd build
make DESTDIR="${pkgdir}" install
rm -r "${pkgdir}/usr/lib/"{gtk-2.0,gtk-3.0,qt4}
@@ -119,4 +124,5 @@
make DESTDIR="${pkgdir}" install
}
-sha512sums=('93c7aa5209f344e1e89addb1dca7a76cde884e4467c0db5f79e758ea8ffb0fe1207ba1c507fb6574fe8223fa873ed5d1dd44835b70cf9254f5149df8e242e92d')
+sha512sums=('93c7aa5209f344e1e89addb1dca7a76cde884e4467c0db5f79e758ea8ffb0fe1207ba1c507fb6574fe8223fa873ed5d1dd44835b70cf9254f5149df8e242e92d'
+ 'ceb4d1b768f2f0c90c5bcde2c00a713883bed28d0e0e1f00a00c685020794d296045690cd55939127d0e204851248fe107e8a277571a8f7dbafde0eed29c340d')
Added: add-a-context-variable-to-disable-punc.patch
===================================================================
--- add-a-context-variable-to-disable-punc.patch (rev 0)
+++ add-a-context-variable-to-disable-punc.patch 2014-03-28 15:37:21 UTC (rev 108550)
@@ -0,0 +1,59 @@
+From: Xuetian Weng <wengxt at gmail.com>
+Date: Tue, 11 Mar 2014 00:13:43 +0800
+Subject: add a context variable to disable punc
+
+---
+ src/lib/fcitx/context.h | 2 ++
+ src/module/punc/punc.c | 12 ++++++++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/src/lib/fcitx/context.h b/src/lib/fcitx/context.h
+index 32115af..05f0f91 100644
+--- a/src/lib/fcitx/context.h
++++ b/src/lib/fcitx/context.h
+@@ -70,6 +70,8 @@ extern "C" {
+ #define CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT "CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT"
+ /** disable auto first candidate highlight */
+ #define CONTEXT_DISABLE_FULLWIDTH "CONTEXT_DISABLE_FULLWIDTH"
++ /** disable punc module */
++ #define CONTEXT_DISABLE_PUNC "CONTEXT_DISABLE_PUNC"
+
+ /**
+ * @brief register a new global context variable
+diff --git a/src/module/punc/punc.c b/src/module/punc/punc.c
+index be6dec3..3327f9c 100644
+--- a/src/module/punc/punc.c
++++ b/src/module/punc/punc.c
+@@ -154,6 +154,8 @@ void* PuncCreate(FcitxInstance* instance)
+ PuncWhichCopy, PuncWhichFree,
+ puncState);
+
++ FcitxInstanceRegisterWatchableContext(instance, CONTEXT_DISABLE_PUNC, FCT_Boolean, FCF_ResetOnInputMethodChange);
++
+ FcitxPuncAddFunctions(instance);
+ return puncState;
+ }
+@@ -250,6 +252,11 @@ boolean PuncPreFilter(void* arg, FcitxKeySym sym, unsigned int state,
+ {
+ FCITX_UNUSED(retVal);
+ FcitxPuncState *puncState = (FcitxPuncState*)arg;
++ boolean disablePunc = FcitxInstanceGetContextBoolean(
++ puncState->owner, CONTEXT_DISABLE_PUNC);
++ if (disablePunc)
++ return false;
++
+ if (FcitxHotkeyIsHotKeySimple(sym, state) &&
+ !FcitxHotkeyIsHotKeyDigit(sym, state) && !IsHotKeyPunc(sym, state))
+ puncState->bLastIsNumber = false;
+@@ -269,6 +276,11 @@ boolean ProcessPunc(void* arg, FcitxKeySym sym, unsigned int state, INPUT_RETURN
+ if (*retVal != IRV_TO_PROCESS)
+ return false;
+
++ boolean disablePunc = FcitxInstanceGetContextBoolean(
++ puncState->owner, CONTEXT_DISABLE_PUNC);
++ if (disablePunc)
++ return false;
++
+ FcitxCandidateWordList *candList = FcitxInputStateGetCandidateList(input);
+ if (FcitxCandidateWordGetListSize(candList) != 0) {
+ if (FcitxCandidateWordGetHasGoneToNextPage(candList) &&
More information about the arch-commits
mailing list