diff options
author | Cheng-Lung Sung <clsung@FreeBSD.org> | 2011-11-11 15:38:55 +0000 |
---|---|---|
committer | Cheng-Lung Sung <clsung@FreeBSD.org> | 2011-11-11 15:38:55 +0000 |
commit | 46d27fe6b705d8628093668af410b7fd05852837 (patch) | |
tree | f0a704d1550fa0329cb92c5c30a730f772b7433b | |
parent | d0ad49aad300ccb082feeffb19f08456113878f0 (diff) | |
download | ports-46d27fe6b705d8628093668af410b7fd05852837.tar.gz ports-46d27fe6b705d8628093668af410b7fd05852837.zip |
Notes
-rw-r--r-- | chinese/sunpinyin/Makefile | 1 | ||||
-rw-r--r-- | chinese/sunpinyin/files/patch-2.0.4-compatible | 88 | ||||
-rw-r--r-- | chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp | 16 | ||||
-rw-r--r-- | chinese/sunpinyin/files/patch-xdg | 29 |
4 files changed, 134 insertions, 0 deletions
diff --git a/chinese/sunpinyin/Makefile b/chinese/sunpinyin/Makefile index 107dd9fb138b..48e23e5e7c61 100644 --- a/chinese/sunpinyin/Makefile +++ b/chinese/sunpinyin/Makefile @@ -7,6 +7,7 @@ PORTNAME= sunpinyin PORTVERSION= 2.0.3 +PORTREVISION= 1 CATEGORIES= chinese devel MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}:1 \ http://open-gram.googlecode.com/files/:2 diff --git a/chinese/sunpinyin/files/patch-2.0.4-compatible b/chinese/sunpinyin/files/patch-2.0.4-compatible new file mode 100644 index 000000000000..677c0f9859e3 --- /dev/null +++ b/chinese/sunpinyin/files/patch-2.0.4-compatible @@ -0,0 +1,88 @@ +--- src/ime-core/imi_view_classic.h.orig 2011-02-17 21:39:52.000000000 -0600 ++++ src/ime-core/imi_view_classic.h 2011-11-10 23:00:20.374788681 -0600 +@@ -61,6 +61,9 @@ public: + virtual int onCandidatePageRequest(int pgno, bool relative); + virtual int onCandidateSelectRequest(int index); + ++ void makeSelection(int candiIdx, unsigned& mask); ++ void deleteCandidate(int candiIdx, unsigned& mask); ++ + private: + unsigned m_cursorFrIdx; + unsigned m_candiFrIdx; +@@ -75,8 +78,6 @@ private: + inline void _erase (bool backward, unsigned& mask); + + inline void _getCandidates (); +- inline void _makeSelection (int candiIdx, unsigned& mask); +- inline void _deleteCandidate (int candiIdx, unsigned& mask); + + inline void _commitChar (TWCHAR ch); + inline void _commitString (const wstring& wstr); +--- src/ime-core/imi_view_classic.cpp.orig 2011-02-17 21:39:52.000000000 -0600 ++++ src/ime-core/imi_view_classic.cpp 2011-11-10 23:01:01.213605402 -0600 +@@ -168,7 +168,7 @@ CIMIClassicView::onKeyEvent(const CKeyEv + !m_pIC->isEmpty ()) { + changeMasks |= KEYEVENT_USED; + unsigned sel = (keyvalue == '0'? 9: keyvalue-'1'); +- _deleteCandidate (sel, changeMasks); ++ deleteCandidate (sel, changeMasks); + goto PROCESSED; + + } else if ((modifiers & (IM_CTRL_MASK | IM_ALT_MASK | IM_SUPER_MASK | IM_RELEASE_MASK)) == 0) { +@@ -177,7 +177,7 @@ CIMIClassicView::onKeyEvent(const CKeyEv + if (!m_pIC->isEmpty ()) { + changeMasks |= KEYEVENT_USED; + unsigned sel = (keyvalue == '0'? 9: keyvalue-'1'); +- _makeSelection (sel, changeMasks); ++ makeSelection (sel, changeMasks); + } else { + m_numeric_mode = true; + } +@@ -216,7 +216,7 @@ CIMIClassicView::onKeyEvent(const CKeyEv + } else if (keycode == IM_VK_SPACE) { + if (!m_pIC->isEmpty ()) { + changeMasks |= KEYEVENT_USED; +- _makeSelection (0, changeMasks); ++ makeSelection (0, changeMasks); + } else { + wstring wstr = (m_pIC->fullPuncOp()) (keyvalue); + if (wstr.size()) { +@@ -327,7 +327,7 @@ CIMIClassicView::onCandidateSelectReques + unsigned changeMasks = 0; + + if (!m_pIC->isEmpty()) +- _makeSelection(index, changeMasks); ++ makeSelection(index, changeMasks); + + updateWindows(changeMasks); + return 0; +@@ -612,7 +612,7 @@ CIMIClassicView::_moveEnd (unsigned& mas + } + + void +-CIMIClassicView::_makeSelection (int candiIdx, unsigned& mask) ++CIMIClassicView::makeSelection (int candiIdx, unsigned& mask) + { + candiIdx += m_candiPageFirst; + if (!m_tailSentence.empty ()) --candiIdx; +@@ -655,7 +655,7 @@ CIMIClassicView::_makeSelection (int can + } + + void +-CIMIClassicView::_deleteCandidate (int candiIdx, unsigned& mask) ++CIMIClassicView::deleteCandidate (int candiIdx, unsigned& mask) + { + candiIdx += m_candiPageFirst; + if (!m_tailSentence.empty ()) --candiIdx; +--- src/ime-core/imi_view.h.orig 2011-02-17 21:39:52.000000000 -0600 ++++ src/ime-core/imi_view.h 2011-11-10 23:05:14.515633839 -0600 +@@ -188,7 +188,7 @@ public: + CIMIWinHandler* getWinHandler(void) {return m_pWinHandler;} + + void setHotkeyProfile (CHotkeyProfile *prof) { m_pHotkeyProfile = prof;} +- void setCandiWindowSize (unsigned size) {m_candiWindowSize = size<10? size: 10;} ++ void setCandiWindowSize (unsigned size) {m_candiWindowSize = size;} + CHotkeyProfile* getHotkeyProfile() { return m_pHotkeyProfile; } + unsigned getCandiWindowSize() { return m_candiWindowSize; } + diff --git a/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp b/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp new file mode 100644 index 000000000000..1cd423900bc4 --- /dev/null +++ b/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp @@ -0,0 +1,16 @@ +--- ./src/ime-core/imi_winHandler.cpp~ 2011-02-17 21:39:52.000000000 -0600 ++++ ./src/ime-core/imi_winHandler.cpp 2011-11-11 02:29:45.163309361 -0600 +@@ -85,6 +85,7 @@ CIMIWinHandler::throwBackKey(unsigned ke + void + CIMIWinHandler::updateStatus(int key, int value) + { ++#ifdef DEBUG + switch (key) { + case STATUS_ID_CN: + printf("CN status is "); break; +@@ -99,4 +100,5 @@ CIMIWinHandler::updateStatus(int key, in + + printf("%d\n", value); + fflush(stdout); ++#endif + } diff --git a/chinese/sunpinyin/files/patch-xdg b/chinese/sunpinyin/files/patch-xdg new file mode 100644 index 000000000000..69361e1e22e8 --- /dev/null +++ b/chinese/sunpinyin/files/patch-xdg @@ -0,0 +1,29 @@ +diff -uNr src/ime-core/imi_options.cpp src/ime-core/imi_options.cpp +--- src/ime-core/imi_options.cpp 2010-09-22 13:14:32.876000000 +0800 ++++ src/ime-core/imi_options.cpp 2010-09-22 13:21:48.181000000 +0800 +@@ -73,8 +73,11 @@ + + if (!m_user_data_dir.size()) { + char path[256]; +- const char *home = getenv ("HOME"); +- snprintf (path, sizeof(path), "%s/%s", home, SUNPINYIN_USERDATA_DIR_PREFIX); ++ const char *home = getenv ("XDG_CONFIG_HOME"); ++ if(home == NULL) ++ snprintf (path, sizeof(path), "%s/.config/%s", getenv("HOME"), SUNPINYIN_USERDATA_DIR_PREFIX); ++ else ++ snprintf (path, sizeof(path), "%s/%s", home, SUNPINYIN_USERDATA_DIR_PREFIX); + m_user_data_dir = path; + } + +diff -uNr src/ime-core/imi_options.h src/ime-core/imi_options.h +--- src/ime-core/imi_options.h 2010-09-22 13:14:35.883000000 +0800 ++++ src/ime-core/imi_options.h 2010-09-22 13:15:20.760000002 +0800 +@@ -50,7 +50,7 @@ + #include "pinyin/shuangpin_seg.h" + + #ifndef SUNPINYIN_USERDATA_DIR_PREFIX +-#define SUNPINYIN_USERDATA_DIR_PREFIX ".sunpinyin" ++#define SUNPINYIN_USERDATA_DIR_PREFIX "sunpinyin" + #endif + + struct CSimplifiedChinesePolicy : public IConfigurable |