SunPinyin for Mac Leopard (Intel) Updated
主要的更新包括:
- 加入了自定义的候选窗口(下一步要支持自定义颜色和字体)
- 加入了菜单与首选项对话框的中文本地化
- 修正了一个crash的bug

主要的更新包括:

This blog copyright 2009 by yongsun
You are viewing the entry SunPinyin for Mac Leopard (Intel) Updated
2008 2009 beijing c++ china corpus crf crf++ d700 dbus fp geometry gnu google ibus iconv indiana input-method interview ips l10n lambda linker mac maxent mercurial nikon nlp opensolaris party pkg planet.os.o python ruby samp scim solaris stardict static_constructor sunpinyin sunstudio techdays tip tips x11 xvm zfs 三聚氰胺 分词 小小

Thanks for the porting work, one question here.
I follow your procedure upto rename those *.i386 files. but how can I enable it ? I can select all the Traditional and Simplified Chinese input methods from "International" panel.
I haven't try to reboot the OS yet.
imac:Resources tj_yang$ uname -a
Darwin imac.test.net 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar 4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386
imac:Resources tj_yang$
mac:Resources tj_yang$ find /Library/Input\ Methods/ -exec ls -ld {} \;
drwxrwxr-x 4 root admin 136 May 4 16:19 /Library/Input Methods/
-rw-rw-r--@ 1 tj_yang admin 6148 May 4 16:27 /Library/Input Methods//.DS_Store
drwxr-xr-x 3 tj_yang admin 102 May 4 16:16 /Library/Input Methods//SunPinyin.app
drwxr-xr-x 6 tj_yang admin 204 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents
-rw-r--r-- 1 tj_yang admin 1246 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Info.plist
drwxr-xr-x 3 tj_yang admin 102 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/MacOS
-rwxr-xr-x 1 tj_yang admin 437152 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/MacOS/SunPinyin
-rw-r--r-- 1 tj_yang admin 8 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/PkgInfo
drwxr-xr-x 8 tj_yang admin 272 May 4 16:17 /Library/Input Methods//SunPinyin.app/Contents/Resources
drwxr-xr-x 5 tj_yang admin 170 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj
-rw-r--r-- 1 tj_yang admin 624 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/InfoPlist.strings
drwxr-xr-x 5 tj_yang admin 170 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/MainMenu.nib
-rw-r--r-- 1 tj_yang admin 968 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
-rw-r--r-- 1 tj_yang admin 558 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/MainMenu.nib/info.nib
-rw-r--r-- 1 tj_yang admin 2594 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
drwxr-xr-x 5 tj_yang admin 170 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/preferences.nib
-rw-r--r-- 1 tj_yang admin 447 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/preferences.nib/classes.nib
-rw-r--r-- 1 tj_yang admin 556 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/preferences.nib/info.nib
-rw-r--r-- 1 tj_yang admin 9349 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/English.lproj/preferences.nib/keyedobjects.nib
-rw-r--r--@ 1 tj_yang staff 24377496 May 4 16:14 /Library/Input Methods//SunPinyin.app/Contents/Resources/lm_sc.t3g
-rw-r--r-- 1 tj_yang admin 457 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/preferences.plist
-rw-r--r--@ 1 tj_yang staff 6786852 May 4 16:14 /Library/Input Methods//SunPinyin.app/Contents/Resources/pydict_sc.bin
-rw-r--r-- 1 tj_yang admin 2936 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/SunPinyin.tiff
drwxr-xr-x 4 tj_yang admin 136 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj
drwxr-xr-x 5 tj_yang admin 170 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/MainMenu.nib
-rw-r--r-- 1 tj_yang admin 968 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/MainMenu.nib/classes.nib
-rw-r--r-- 1 tj_yang admin 558 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/MainMenu.nib/info.nib
-rw-r--r-- 1 tj_yang admin 2602 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/MainMenu.nib/keyedobjects.nib
drwxr-xr-x 5 tj_yang admin 170 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/preferences.nib
-rw-r--r-- 1 tj_yang admin 447 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/preferences.nib/classes.nib
-rw-r--r-- 1 tj_yang admin 556 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/preferences.nib/info.nib
-rw-r--r-- 1 tj_yang admin 9300 May 4 06:10 /Library/Input Methods//SunPinyin.app/Contents/Resources/zh_CN.lproj/preferences.nib/keyedobjects.nib
imac:Resources tj_yang$
发表于 T.J. Yang 在 2008年05月05日, 05:40 上午 CST #
>I haven't try to reboot the OS yet.Su
Reboot did the trick to have SunPinyin shown as a selectable item in "International"
So the question turn into, "is there a command to refresh "International" without rebooting" ?
tj
发表于 T.J. Yang 在 2008年05月05日, 06:01 上午 CST #
How do I download the source code ?
I tried following wrong command
[tjyang@fc6 docs]$ hg clone ssh://anon@src.opensolaris.org/source/xref/nv-g11n/inputmethod/ myinput
remote: ssh: connect to host src.opensolaris.org port 22: Connection timed out
abort: no suitable response from remote hg!
[tjyang@fc6 docs]$
发表于 T.J. Yang 在 2008年05月05日, 06:34 上午 CST #
Hi, T.J.Yang,
Thank you so much for trying the porting!
currently, you have to re-login to make the newly installed input method shown in the "International" IM list, and then enable it.
And the repository path is 'ssh://anon@hg.opensolaris.org/hg/nv-g11n/inputmethod', you may refer to http://www.opensolaris.org/os/project/input-method/repository. It would take some time to clone the repository ;)
发表于 Yong Sun 在 2008年05月05日, 09:50 上午 CST #
TJ, btw, you could download the latest repository snapshot, http://www.opensolaris.org/os/project/input-method/files/inputmethod-repo-snapshot-080506.tar.bz2, and then download the large data files.
发表于 Yong Sun 在 2008年05月05日, 10:00 上午 CST #
hg clone ssh://anon@hg.opensolaris.org/hg/nv-g11n/inputmethod inputmethod
cp inputmethod/sunpinyin/ime/data/lm_sc.t3g.i386 inputmethod/sunpinyin/ime/data/lm_sc.t3g
cp inputmethod/sunpinyin/ime/data/pydict_sc.bin.i386 inputmethod/sunpinyin/ime/data/pydict_sc.bin
cd inputmethod/sunpinyin/ime/wrapper/macos
perl -pi.bak -e 's!^#import "i!#import "../../src/i!' SunPinyinApplicationDelegate.h SunPinyinInputController.h imi_imkitwin.h
with above include path fix, the errors went down to 84 from 109, in xcode 3.1 beta.
发表于 T.J. Yang 在 2008年05月06日, 01:20 上午 CST #
Hi, TJ,
You need to run the autogen.sh script to do the configuration first, and it requires some m4 macro files (such as gettext and glib2) that you could install via MacPorts (macports.org), $ /opt/local/bin/port install glib2, (maybe glib2 is not sufficient, you could install gtk2 later), and export ACLOCAL_FLAGS=-I/opt/local/share/aclocal before you launch autogen.sh. The configuration will create symbol links of lm_sc.t3g and pydict_sc.bin for you, so you don't need to copy them in 'data' dir.
After that, you could open the Xcode project, and build the SunPinyin.app.
发表于 Yong Sun 在 2008年05月06日, 07:02 上午 CST #
Hi Sun
Is there any way to build it into x86_64 binary? It seems like most of the Carbon API can't be supported in 64-bit.
发表于 Bjartskular Phoenix 在 2008年05月11日, 11:39 下午 CST #
Hi, Phoenix, the IMKit framework on Leopard does not require you to build the x86_64 binary. The IMEs are not directly loaded by application, it's a IPC model, so that the 64bits application could talk with the 32bits input method.
发表于 Yong Sun 在 2008年05月12日, 08:30 上午 CST #