Hello community, here is the log from the commit of package ibus-rime for openSUSE:Factory checked in at 2013-07-07 22:18:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ibus-rime (Old) and /work/SRC/openSUSE:Factory/.ibus-rime.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ibus-rime" Changes: -------- --- /work/SRC/openSUSE:Factory/ibus-rime/ibus-rime.changes 2012-10-23 21:24:52.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.ibus-rime.new/ibus-rime.changes 2013-07-07 22:18:16.000000000 +0200 @@ -1,0 +2,10 @@ +Sat Jul 6 11:46:21 CST 2013 - hillw...@linuxfans.org + +- Update to 0.9.9 + * support static linking librime and its dependencies. + * support changing conversion mode with Caps Lock. + * add 'Sync data' button. + * in Chinese mode, display the name of schema on status bar. + * display notifications about deployment result. + +------------------------------------------------------------------- Old: ---- ibus-rime-0.9.4.tar.gz New: ---- ibus-rime-0.9.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ibus-rime.spec ++++++ --- /var/tmp/diff_new_pack.6nANJt/_old 2013-07-07 22:18:17.000000000 +0200 +++ /var/tmp/diff_new_pack.6nANJt/_new 2013-07-07 22:18:17.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package ibus-rime # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: ibus-rime -Version: 0.9.4 +Version: 0.9.9 Release: 0 Summary: IBus rime License: GPL-3.0 @@ -31,8 +31,12 @@ BuildRequires: ibus-devel BuildRequires: libkyotocabinet-devel BuildRequires: libnotify-devel -BuildRequires: librime-devel +BuildRequires: librime-devel >= 0.9.8 +%if 0%{?suse_version} > 1230 +BuildRequires: libyaml-cpp0_5 +%else BuildRequires: libyaml-cpp0_3 +%endif BuildRequires: opencc BuildRequires: opencc-devel ++++++ ibus-rime-0.9.4.tar.gz -> ibus-rime-0.9.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/.gitignore new/ibus-rime/.gitignore --- old/ibus-rime/.gitignore 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/.gitignore 2013-05-05 16:38:34.000000000 +0200 @@ -1,5 +1,6 @@ build data +lib package *~ .*.swp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/.gitmodules new/ibus-rime/.gitmodules --- old/ibus-rime/.gitmodules 1970-01-01 01:00:00.000000000 +0100 +++ new/ibus-rime/.gitmodules 2013-05-05 16:38:34.000000000 +0200 @@ -0,0 +1,6 @@ +[submodule "librime"] + path = librime + url = g...@github.com:lotem/librime.git +[submodule "brise"] + path = brise + url = g...@github.com:lotem/brise.git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/CMakeLists.txt new/ibus-rime/CMakeLists.txt --- old/ibus-rime/CMakeLists.txt 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/CMakeLists.txt 2013-05-05 16:38:34.000000000 +0200 @@ -1,6 +1,8 @@ project(ibus-rime) cmake_minimum_required(VERSION 2.8) +option(BUILD_STATIC "Build Rime using static libraries" OFF) + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) include(${CMAKE_ROOT}/Modules/FindPkgConfig.cmake) @@ -28,6 +30,15 @@ message(STATUS "Precompiler macro RIME_DATA_DIR is set to \"${RIME_DATA_DIR}\"") add_definitions(-DRIME_DATA_DIR="${RIME_DATA_DIR}") +set(RIME_DEPS "") + +if(BUILD_STATIC) + link_directories(${PROJECT_SOURCE_DIR}/lib) + set(RIME_DEPS ${RIME_DEPS} m stdc++ pthread z + libboost_filesystem-mt.a libboost_regex-mt.a libboost_signals-mt.a libboost_system-mt.a libboost_thread-mt.a + libglog.a libkyotocabinet.a libopencc.a libyaml-cpp.a) +endif(BUILD_STATIC) + aux_source_directory(. IBUS_RIME_SRC) add_executable(ibus-engine-rime ${IBUS_RIME_SRC}) -target_link_libraries(ibus-engine-rime ${IBus_LIBRARIES} ${LIBNOTIFY_LIBRARIES} ${Rime_LIBRARIES}) +target_link_libraries(ibus-engine-rime ${IBus_LIBRARIES} ${LIBNOTIFY_LIBRARIES} ${Rime_LIBRARIES} ${RIME_DEPS}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/ChangeLog new/ibus-rime/ChangeLog --- old/ibus-rime/ChangeLog 1970-01-01 01:00:00.000000000 +0100 +++ new/ibus-rime/ChangeLog 2013-05-05 16:38:34.000000000 +0200 @@ -0,0 +1,44 @@ +2013-05-05 GONG Chen <chen....@gmail.com> + + * brise: update to version 0.22 + * librime: update to version 0.9.9 + + * Makefile: support static linking librime and its dependencies. + + - Rime 0.9.9 release. + +2013-02-02 GONG Chen <chen....@gmail.com> + + - Rime 0.9.8 release. + +2013-01-16 GONG Chen <chen....@gmail.com> + + * rime_engine.c(ibus_rime_process_key_event): + support changing conversion mode with Caps Lock. + + * librime: updated to version 0.9.7. + + - Rime 0.9.7 release. + +2013-01-12 GONG Chen <chen....@gmail.com> + + * rime_engine.c: add 'Sync data' button. + in Chinese mode, display the name of schema on status bar. + + * rime_main.c: display notifications about deployment result. + + - Rime 0.9.6 release. + +2012-09-26 GONG Chen <chen....@gmail.com> + + * new dependency: brise. + + - Rime 0.9.4 release. + +2012-07-08 GONG Chen <chen....@gmail.com> + + * UI: new Rime logo. + * UI: add Chinese/ascii mode indicator, and Deploy button to status bar. + * UI: show notification when deploying Rime. + + - Rime 0.9.2 release. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/Makefile new/ibus-rime/Makefile --- old/ibus-rime/Makefile 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/Makefile 2013-05-05 16:38:34.000000000 +0200 @@ -11,6 +11,11 @@ (cd build; cmake -DCMAKE_BUILD_TYPE=Release .. && make) @echo ':)' +ibus-engine-rime-static: + mkdir -p build + (cd build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON .. && make) + @echo ':)' + install: mkdir -p $(sharedir)/ibus/component cp rime.xml $(sharedir)/ibus/component/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/README new/ibus-rime/README --- old/ibus-rime/README 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/README 2013-05-05 16:38:34.000000000 +0200 @@ -1,48 +1,18 @@ ibus-rime: Rime Input Method Engine for Linux/IBus -Manual Installation -=================== +project home: http://code.google.com/p/rimeime/ +installation: http://code.google.com/p/rimeime/wiki/RimeWithIBus -Prerequisites -------------- - -To build la rime, you need these tools and libraries: - - * cmake >= 2.8 - * ibus >= 1.0 - * boost >= 1.46 - * gtest (optional) - * kyotocabinet 1.2 - * opencc 0.3 - * yaml-cpp 0.3 - -Build and install ibus-rime ---------------------------- - -You need both librime and ibus-rime packages. - -``` -tar xzf librime-*.tar.gz -tar xzf ibus-rime-*.tar.gz -cd ibus-rime -# do this as normal user -./install.sh -``` - - -Configure IBus --------------- - * restart IBus - * add 'Rime' to the input method list in IBus Preferences - -Configure Rime --------------- -http://code.google.com/p/rimeime/wiki/CustomizationGuide - -After making some changes, click the ⟲ (Deploy) button on the language panel. - -It may take some time to rebuild dictionaries, depending on what has been changed. -Rime will come back to work as soon as the deployment is finished. -If it doesn't, see ~/.ibus/rime/rime.log for error messages. - -Thank you. +build dependencies: + - pkg-config + - cmake>=2.8 + - librime>=0.9.8 (development package) + - libibus-1.0 (development package) + - libnotify (development package) + +runtime dependencies: + - brise>=0.18 + - librime>=0.9.8 + - ibus + - libibus-1.0 + - libnotify diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/install-static.sh new/ibus-rime/install-static.sh --- old/ibus-rime/install-static.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/ibus-rime/install-static.sh 2013-05-05 16:38:34.000000000 +0200 @@ -0,0 +1,15 @@ +if [ ! -e librime -a -e ../librime ]; then ln -s ../librime; fi +if [ ! -e brise -a -e ../brise ]; then ln -s ../brise; fi + +if [ ! -e lib ]; then ln -s librime/thirdparty/lib; fi +if [ ! -e lib/libyaml-cpp.a ]; then (cd librime; make thirdparty) || exit 1; fi + +(cd librime; make librime-static && sudo make -C build-static install) || exit 1 + +(cd brise; make && sudo make install) || exit 1 + +make clean && make ibus-engine-rime-static && sudo make install || exit 1 + +if [ "$1" == '--restart' ]; then + ibus-daemon -drx +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/install.sh new/ibus-rime/install.sh --- old/ibus-rime/install.sh 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/install.sh 2013-05-05 16:38:34.000000000 +0200 @@ -1,3 +1,11 @@ -(cd ../librime; make && sudo make install) || exit 1 -(cd ../brise; make && sudo make install) || exit 1 -make clean && make && sudo make install && ibus-daemon -drx +if [ ! -e librime -a -e ../librime ]; then ln -s ../librime; fi +if [ ! -e brise -a -e ../brise ]; then ln -s ../brise; fi + +(cd librime; make && sudo make install) || exit 1 +(cd brise; make && sudo make install) || exit 1 + +make clean && make && sudo make install || exit 1 + +if [ "$1" == '--restart' ]; then + ibus-daemon -drx +fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/brise/ChangeLog new/ibus-rime/package/archlinux/brise/ChangeLog --- old/ibus-rime/package/archlinux/brise/ChangeLog 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/brise/ChangeLog 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -2012-09-25 GONG Chen <chen....@gmail.com> - - * 0.13-1 : - Brise 0.13 release. - - * install data files from a separate package. - * update: luna_pinyin, terra_pinyin, jyutping tables. - * update: essay database. - * new schema: emoji. - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/brise/PKGBUILD new/ibus-rime/package/archlinux/brise/PKGBUILD --- old/ibus-rime/package/archlinux/brise/PKGBUILD 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/brise/PKGBUILD 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -# Maintainer: GONG Chen <chen dot sst at gmail dot com> -pkgname=brise -pkgver=0.13 -pkgrel=1 -pkgdesc="Rime schema repository" -arch=('any') -url="http://code.google.com/p/rimeime/" -license=('GPL3') -depends=() -makedepends=('cmake' 'librime>=0.9.3') -provides=('librime-data') -conflicts=('librime<0.9.3' 'ibus-rime<0.9.3') -changelog=ChangeLog -source=(http://rimeime.googlecode.com/files/$pkgname-$pkgver.tar.gz) - -build() { - cd "${srcdir}/$pkgname" - make -} - -package() { - cd "${srcdir}/$pkgname" - make DESTDIR="$pkgdir" install -} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/ibus-rime/ChangeLog new/ibus-rime/package/archlinux/ibus-rime/ChangeLog --- old/ibus-rime/package/archlinux/ibus-rime/ChangeLog 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/ibus-rime/ChangeLog 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ -2012-09-26 GONG Chen <chen....@gmail.com> - - * 0.9.4-1 : - Rime 0.9.4 release. - - * update PKGBUILD. - -2012-09-25 GONG Chen <chen....@gmail.com> - - * 0.9.3-1 : - Rime 0.9.3 release. - - * new dependency: brise. - * logging with google-glog. - -2012-07-08 GONG Chen <chen....@gmail.com> - - * 0.9.2-1 : - Rime 0.9.2 release. - - * UI: new Rime logo. - * UI: add Chinese/ascii mode indicator, and Deploy button to status bar. - * UI: show notification when deploying Rime. - - * package: use the shared copy of rime-data distributed with librime package. - -2012-05-06 GONG Chen <chen....@gmail.com> - - * 0.9.1-1 : - Revised Rime 0.9 API. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/ibus-rime/PKGBUILD new/ibus-rime/package/archlinux/ibus-rime/PKGBUILD --- old/ibus-rime/package/archlinux/ibus-rime/PKGBUILD 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/ibus-rime/PKGBUILD 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -# Maintainer: GONG Chen <chen dot sst at gmail dot com> -# Contributor: 網軍總司令 -pkgname=ibus-rime -pkgver=0.9.4 -pkgrel=1 -pkgdesc="Rime input method engine for ibus" -arch=('i686' 'x86_64') -url="http://code.google.com/p/rimeime/" -license=('GPL3') -depends=('ibus' 'libnotify' 'librime>=0.9.3' 'brise') -makedepends=('cmake') -install=ibus-rime.install -changelog=ChangeLog -source=(http://rimeime.googlecode.com/files/$pkgname-$pkgver.tar.gz) - -build() { - cd "${srcdir}/$pkgname" - make -} - -package() { - cd "${srcdir}/$pkgname" - make DESTDIR="$pkgdir" install -} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/ibus-rime/ibus-rime.install new/ibus-rime/package/archlinux/ibus-rime/ibus-rime.install --- old/ibus-rime/package/archlinux/ibus-rime/ibus-rime.install 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/ibus-rime/ibus-rime.install 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -pre_upgrade() { - rm /usr/share/ibus-rime/*.bin || true -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/librime/ChangeLog new/ibus-rime/package/archlinux/librime/ChangeLog --- old/ibus-rime/package/archlinux/librime/ChangeLog 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/librime/ChangeLog 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -2012-09-26 GONG Chen <chen....@gmail.com> - - * 0.9.4-1 : - Rime 0.9.4 release. - - * document new dependency 'google-glog'. - * fix x64 build. - -2012-09-25 GONG Chen <chen....@gmail.com> - - * 0.9.3-1 : - Rime 0.9.3 release. - - * user dictionary for table input method. - * automatically build schema dependencies. - * logging with google-glog. - * install data files from a separate package: brise. - * new API: accessing schema list. - * new API: enabling/disabling soft cursor in preedit string. - -2012-07-08 GONG Chen <chen....@gmail.com> - - * 0.9.2-1 : - Rime 0.9.2 release. - - * chord-typing support: combine multiple keys to compose a syllable at once. - * configuration: global page_size setting. - * inline mode: extend the API to support inline mode. - * table translator: add option to filter candidates by character set. - * user dictionary: automatic recovery for corrupted databases. - * user dictionary: fixed a bug that was responsible for missing user phrases. - - * rime_deployer: a utility program to prepare Rime's workspace. - * rime_dict_manager: a utility program to import/export user dictionaries. - - * librime package: include 'brise', a collection of preset schemata in the package. - * new schema: Middle Chinese Phonetic Transcription. - * new schema: IPA input method in X-SAMPA. - - -2012-05-06 GONG Chen <chen....@gmail.com> - - * 0.9.1-1 : - Revised Rime 0.9 API. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/archlinux/librime/PKGBUILD new/ibus-rime/package/archlinux/librime/PKGBUILD --- old/ibus-rime/package/archlinux/librime/PKGBUILD 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/archlinux/librime/PKGBUILD 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -# Maintainer: GONG Chen <chen dot sst at gmail dot com> -# Contributor: 網軍總司令 -pkgname=librime -pkgver=0.9.4 -pkgrel=2 -pkgdesc="Rime input method engine" -arch=('i686' 'x86_64') -url="http://code.google.com/p/rimeime/" -license=('GPL3') -depends=('boost>=1.46' 'google-glog' 'kyotocabinet' 'opencc' 'yaml-cpp') -optdepends=('brise: Rime schema repository') -makedepends=('cmake') -changelog=ChangeLog -source=(http://rimeime.googlecode.com/files/$pkgname-$pkgver.tar.gz) - -build() { - cd "${srcdir}/$pkgname" - make -} - -package() { - cd "${srcdir}/$pkgname" - make DESTDIR="$pkgdir" install -} - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/package/package.sh new/ibus-rime/package/package.sh --- old/ibus-rime/package/package.sh 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/package/package.sh 2013-05-05 16:38:34.000000000 +0200 @@ -9,13 +9,17 @@ cd temp for x in brise librime ibus-rime; do if [ -d $x ]; then rm -Rf $x; fi - git clone ../../../$x && rm -Rf $x/.git + if [ -d ../../$x ]; then + git clone ../../$x && rm -Rf $x/.git + else + git clone ../../../$x && rm -Rf $x/.git + fi done tar czvf ../brise-$brise_version.tar.gz brise/ tar czvf ../librime-$rime_version.tar.gz librime/ -tar czvf ../ibus-rime-$rime_version.tar.gz ibus-rime/ +tar czvf ../ibus-rime-$rime_version.tar.gz ibus-rime/ --exclude=brise --exclude=librime cd .. rm -Rf temp -echo +echo echo 'built:' -ls *-$brise_version.tar.gz *-$rime_version.tar.gz +ls brise-$brise_version.tar.gz *rime-$rime_version.tar.gz diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/rime_engine.c new/ibus-rime/rime_engine.c --- old/ibus-rime/rime_engine.c 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/rime_engine.c 2013-05-05 16:38:34.000000000 +0200 @@ -3,6 +3,9 @@ #include "rime_engine.h" #include "rime_settings.h" +// TODO: +#define _(x) (x) + typedef struct _IBusRimeEngine IBusRimeEngine; typedef struct _IBusRimeEngineClass IBusRimeEngineClass; @@ -64,7 +67,7 @@ { IBusObjectClass *ibus_object_class = IBUS_OBJECT_CLASS (klass); IBusEngineClass *engine_class = IBUS_ENGINE_CLASS (klass); - + ibus_object_class->destroy = (IBusObjectDestroyFunc) ibus_rime_engine_destroy; engine_class->process_key_event = ibus_rime_engine_process_key_event; @@ -111,7 +114,7 @@ NULL); ibus_prop_list_append(rime->props, prop); text = ibus_text_new_from_static_string("⟲"); - tips = ibus_text_new_from_static_string("Deploy"); + tips = ibus_text_new_from_static_string(_("Deploy")); prop = ibus_property_new("deploy", PROP_TYPE_NORMAL, text, @@ -122,6 +125,18 @@ PROP_STATE_UNCHECKED, NULL); ibus_prop_list_append(rime->props, prop); + text = ibus_text_new_from_static_string("⇅"); + tips = ibus_text_new_from_static_string(_("Sync data")); + prop = ibus_property_new("sync", + PROP_TYPE_NORMAL, + text, + NULL, + tips, + TRUE, + TRUE, + PROP_STATE_UNCHECKED, + NULL); + ibus_prop_list_append(rime->props, prop); } static void @@ -182,39 +197,50 @@ } } -static void ibus_rime_engine_update(IBusRimeEngine *rime) +static void ibus_rime_update_status(IBusRimeEngine *rime, + RimeStatus *status) { - // update properties - - gboolean is_disabled = TRUE; - gboolean is_ascii_mode = FALSE; - - RimeStatus status = {0}; - RIME_STRUCT_INIT(RimeStatus, status); - if (RimeGetStatus(rime->session_id, &status)) { - is_disabled = status.is_disabled; - is_ascii_mode = status.is_ascii_mode; - RimeFreeStatus(&status); - } - IBusProperty* prop = ibus_prop_list_get(rime->props, 0); if (prop) { IBusText* text; - if (is_disabled) { + if (!status || status->is_disabled) { text = ibus_text_new_from_static_string("⌛"); } - else if (is_ascii_mode) { + else if (status->is_ascii_mode) { text = ibus_text_new_from_static_string("A"); } else { - text = ibus_text_new_from_static_string("中"); + /* schema_name is ".default" in switcher */ + if (status->schema_name && + status->schema_name[0] != '.') { + text = ibus_text_new_from_string(status->schema_name); + } + else { + text = ibus_text_new_from_static_string("中"); + } } ibus_property_set_label(prop, text); ibus_engine_update_property((IBusEngine *)rime, prop); } +} + +static void ibus_rime_engine_update(IBusRimeEngine *rime) +{ + // update properties + + RimeStatus status = {0}; + RIME_STRUCT_INIT(RimeStatus, status); + if (RimeGetStatus(rime->session_id, &status)) { + ibus_rime_update_status(rime, &status); + RimeFreeStatus(&status); + } + else { + ibus_rime_update_status(rime, NULL); + } + // commit text - + RimeCommit commit = {0}; if (RimeGetCommit(rime->session_id, &commit)) { IBusText *text; @@ -222,7 +248,7 @@ ibus_engine_commit_text((IBusEngine *)rime, text); // the text object will be released by ibus RimeFreeCommit(&commit); } - + // begin updating UI RimeContext context = {0}; @@ -333,11 +359,11 @@ } // end updating UI - + RimeFreeContext(&context); } -static gboolean +static gboolean ibus_rime_engine_process_key_event (IBusEngine *engine, guint keyval, guint keycode, @@ -345,7 +371,8 @@ { IBusRimeEngine *rime = (IBusRimeEngine *)engine; - modifiers &= (IBUS_RELEASE_MASK | IBUS_CONTROL_MASK | IBUS_MOD1_MASK); + modifiers &= (IBUS_RELEASE_MASK | IBUS_LOCK_MASK | IBUS_SHIFT_MASK | + IBUS_CONTROL_MASK | IBUS_MOD1_MASK | IBUS_SUPER_MASK); if (!RimeFindSession(rime->session_id)) { //rime->session_id = RimeCreateSession(); @@ -370,5 +397,16 @@ ibus_rime_start(TRUE); ibus_rime_engine_update((IBusRimeEngine *)engine); } + else if (!strcmp("sync", prop_name)) { + // in the case a maintenance thread has already been started + // by RimeStartMaintenance(); the following call to RimeSyncUserData + // will queue data synching tasks for execution in the working + // maintenance thread, and will return False. + // however, there is still chance that the working maintenance thread + // happens to be quitting when new tasks are added, thus leaving newly + // added tasks undone... + RimeSyncUserData(); + ibus_rime_engine_update((IBusRimeEngine *)engine); + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/rime_main.c new/ibus-rime/rime_main.c --- old/ibus-rime/rime_main.c 2012-09-26 07:03:25.000000000 +0200 +++ new/ibus-rime/rime_main.c 2013-05-05 16:38:34.000000000 +0200 @@ -10,13 +10,14 @@ #include <rime_api.h> #include "rime_engine.h" #include "rime_settings.h" +#include "rime_version.h" // TODO: #define _(x) (x) #define DISTRIBUTION_NAME _("Rime") #define DISTRIBUTION_CODE_NAME "ibus-rime" -#define DISTRIBUTION_VERSION "0.9.4" +#define DISTRIBUTION_VERSION RIME_VERSION #define IBUS_RIME_INSTALL_PREFIX "/usr" #define IBUS_RIME_SHARED_DATA_DIR IBUS_RIME_INSTALL_PREFIX "/share/rime-data" @@ -35,6 +36,32 @@ return path; } + +static void show_message(const char* summary, const char* details) { + NotifyNotification* notice = notify_notification_new(summary, details, NULL); + notify_notification_show(notice, NULL); + g_object_unref(notice); +} + +static void notification_handler(void* context_object, + RimeSessionId session_id, + const char* message_type, + const char* message_value) { + if (!strcmp(message_type, "deploy")) { + if (!strcmp(message_value, "start")) { + show_message(_("Rime is under maintenance ..."), NULL); + } + else if (!strcmp(message_value, "success")) { + show_message(_("Rime is ready."), NULL); + } + else if (!strcmp(message_value, "failure")) { + show_message(_("Rime has encountered an error."), + _("See /tmp/rime.ibus.ERROR for details.")); + } + return; + } +} + void ibus_rime_start(gboolean full_check) { char user_data_dir[512] = {0}; char old_user_data_dir[512] = {0}; @@ -48,6 +75,7 @@ g_mkdir_with_parents(user_data_dir, 0700); } } + RimeSetNotificationHandler(notification_handler, NULL); RimeTraits ibus_rime_traits; ibus_rime_traits.shared_data_dir = IBUS_RIME_SHARED_DATA_DIR; ibus_rime_traits.user_data_dir = user_data_dir; @@ -55,11 +83,7 @@ ibus_rime_traits.distribution_code_name = DISTRIBUTION_CODE_NAME; ibus_rime_traits.distribution_version = DISTRIBUTION_VERSION; RimeInitialize(&ibus_rime_traits); - if (RimeStartMaintenance((Bool)full_check)) { - NotifyNotification* notice = notify_notification_new("Deploying La Rime.", NULL, NULL); - notify_notification_show(notice, NULL); - g_object_unref(notice); - } + RimeStartMaintenance((Bool)full_check); } static void ibus_disconnect_cb(IBusBus *bus, gpointer user_data) { @@ -92,7 +116,7 @@ IBusFactory *factory = ibus_factory_new(ibus_bus_get_connection(bus)); g_object_ref_sink(factory); - + ibus_factory_add_engine(factory, "rime", IBUS_TYPE_RIME_ENGINE); if (!ibus_bus_request_name(bus, "com.googlecode.rimeime.Rime", 0)) { g_error("error requesting bus name"); @@ -110,7 +134,7 @@ ibus_rime_start(full_check); ibus_main(); - + RimeFinalize(); notify_uninit(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ibus-rime/rime_version.h new/ibus-rime/rime_version.h --- old/ibus-rime/rime_version.h 1970-01-01 01:00:00.000000000 +0100 +++ new/ibus-rime/rime_version.h 2013-05-05 16:38:34.000000000 +0200 @@ -0,0 +1,6 @@ +#ifndef RIME_VERSION_H_ +#define RIME_VERSION_H_ + +#define RIME_VERSION "0.9.9" + +#endif // RIME_VERSION_H_ -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org