Hello community, here is the log from the commit of package fcitx-rime for openSUSE:Factory checked in at 2013-11-20 10:25:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fcitx-rime (Old) and /work/SRC/openSUSE:Factory/.fcitx-rime.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fcitx-rime" Changes: -------- --- /work/SRC/openSUSE:Factory/fcitx-rime/fcitx-rime.changes 2013-07-25 13:20:40.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.fcitx-rime.new/fcitx-rime.changes 2013-11-20 10:25:19.000000000 +0100 @@ -1,0 +2,6 @@ +Mon Nov 18 10:12:59 UTC 2013 - [email protected] + +- update version 0.3.0 + * compatibility for rime 1.0 release. + +------------------------------------------------------------------- Old: ---- fcitx-rime-0.2.2.tar.xz New: ---- fcitx-rime-0.3.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fcitx-rime.spec ++++++ --- /var/tmp/diff_new_pack.T6mjmG/_old 2013-11-20 10:25:20.000000000 +0100 +++ /var/tmp/diff_new_pack.T6mjmG/_new 2013-11-20 10:25:20.000000000 +0100 @@ -17,7 +17,7 @@ Name: fcitx-rime -Version: 0.2.2 +Version: 0.3.0 Release: 0 Summary: Rime input engine support for Fcitx License: GPL-2.0+ ++++++ fcitx-rime-0.2.2.tar.xz -> fcitx-rime-0.3.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/CMakeLists.txt new/fcitx-rime-0.3.0/CMakeLists.txt --- old/fcitx-rime-0.2.2/CMakeLists.txt 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/CMakeLists.txt 2013-11-10 14:11:24.000000000 +0100 @@ -6,7 +6,7 @@ include(FindPkgConfig) find_package(Fcitx 4.2.8.1 REQUIRED) -find_package(Rime REQUIRED) +pkg_check_modules(RIME "rime>=1.0.0" REQUIRED) if(NOT DEFINED RIME_DATA_DIR) find_package(Brise REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/README.md new/fcitx-rime-0.3.0/README.md --- old/fcitx-rime-0.2.2/README.md 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/README.md 2013-11-10 14:11:24.000000000 +0100 @@ -31,8 +31,6 @@ *gcc-c++ -*intltool - *fcitx-devel with all three skins some distro like openSUSE split a fcitx-skin-classic and a fcitx-skin-dark, so you need them. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/CMakeLists.txt new/fcitx-rime-0.3.0/po/CMakeLists.txt --- old/fcitx-rime-0.2.2/po/CMakeLists.txt 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/po/CMakeLists.txt 2013-11-10 14:11:24.000000000 +0100 @@ -1,4 +1,4 @@ -set(PO_LANGS de zh_CN zh_TW ja) +set(PO_LANGS de zh_CN zh_TW ja vi) foreach(lang ${PO_LANGS}) fcitx_translate_add_po_file("${lang}" "${lang}.po") endforeach() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/de.po new/fcitx-rime-0.3.0/po/de.po --- old/fcitx-rime-0.2.2/po/de.po 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/po/de.po 2013-11-10 14:11:24.000000000 +0100 @@ -1,42 +1,48 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: # mar well <[email protected]>, 2013 msgid "" msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-07-07 12:02-0400\n" -"PO-Revision-Date: 2013-05-22 06:28+0000\n" -"Last-Translator: mar well <[email protected]>\n" -"Language-Team: German (http://www.transifex.com/projects/p/fcitx/language/" -"de/)\n" -"Language: de\n" +"POT-Creation-Date: 2013-07-28 12:02-0400\n" +"PO-Revision-Date: 2013-07-28 16:09+0000\n" +"Last-Translator: Xuetian Weng <[email protected]>\n" +"Language-Team: German (http://www.transifex.com/projects/p/fcitx/language/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/fcitx-rime.c:107 src/fcitx-rime.c:108 -msgid "Deploy" -msgstr "Deploy" +#: src/fcitx-rime.c:54 +msgid "Rime is under maintenance ..." +msgstr "" + +#: src/fcitx-rime.c:56 +msgid "Rime is ready." +msgstr "" + +#: src/fcitx-rime.c:58 +msgid "Rime has encountered an error. See /tmp/rime.fcitx.ERROR for details." +msgstr "" -#: src/fcitx-rime.c:87 src/fcitx-rime.conf.in:3 src/rime.conf.in:3 +#: src/fcitx-rime.c:64 src/fcitx-rime.c:114 src/fcitx-rime.conf.in:3 +#: src/rime.conf.in:3 msgid "Rime" msgstr "Rime" -#: src/fcitx-rime.conf.in:4 -msgid "Rime Wrapper For Fcitx" -msgstr "Rime Wrapper für Fcitx" +#: src/fcitx-rime.c:134 src/fcitx-rime.c:135 +msgid "Deploy" +msgstr "Deploy" -#: src/fcitx-rime.c:116 src/fcitx-rime.c:117 +#: src/fcitx-rime.c:143 src/fcitx-rime.c:144 msgid "Synchronize" msgstr "Synchronisieren" -#~ msgid "⇅ Synchronize" -#~ msgstr "⇅ Synchronisieren" - -#~ msgid "⟲ Deploy" -#~ msgstr "⟲ Deploy" +#: src/fcitx-rime.conf.in:4 +msgid "Rime Wrapper For Fcitx" +msgstr "Rime Wrapper für Fcitx" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/fcitx-rime.pot new/fcitx-rime-0.3.0/po/fcitx-rime.pot --- old/fcitx-rime-0.2.2/po/fcitx-rime.pot 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/po/fcitx-rime.pot 2013-11-10 14:11:24.000000000 +0100 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-07-07 12:02-0400\n" +"POT-Creation-Date: 2013-07-28 12:02-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <[email protected]>\n" @@ -17,15 +17,28 @@ "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -#: src/fcitx-rime.c:87 src/fcitx-rime.conf.in:3 src/rime.conf.in:3 +#: src/fcitx-rime.c:54 +msgid "Rime is under maintenance ..." +msgstr "" + +#: src/fcitx-rime.c:56 +msgid "Rime is ready." +msgstr "" + +#: src/fcitx-rime.c:58 +msgid "Rime has encountered an error. See /tmp/rime.fcitx.ERROR for details." +msgstr "" + +#: src/fcitx-rime.c:64 src/fcitx-rime.c:114 src/fcitx-rime.conf.in:3 +#: src/rime.conf.in:3 msgid "Rime" msgstr "" -#: src/fcitx-rime.c:107 src/fcitx-rime.c:108 +#: src/fcitx-rime.c:134 src/fcitx-rime.c:135 msgid "Deploy" msgstr "" -#: src/fcitx-rime.c:116 src/fcitx-rime.c:117 +#: src/fcitx-rime.c:143 src/fcitx-rime.c:144 msgid "Synchronize" msgstr "" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/ja.po new/fcitx-rime-0.3.0/po/ja.po --- old/fcitx-rime-0.2.2/po/ja.po 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/po/ja.po 2013-11-10 14:11:24.000000000 +0100 @@ -1,42 +1,49 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: # しろう, 2013 +# しろう, 2013 msgid "" msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-07-07 12:02-0400\n" -"PO-Revision-Date: 2013-04-29 10:18+0000\n" -"Last-Translator: Xuetian Weng <[email protected]>\n" -"Language-Team: Japanese (http://www.transifex.com/projects/p/fcitx/language/" -"ja/)\n" -"Language: ja\n" +"POT-Creation-Date: 2013-07-28 12:02-0400\n" +"PO-Revision-Date: 2013-08-07 15:01+0000\n" +"Last-Translator: しろう\n" +"Language-Team: Japanese (http://www.transifex.com/projects/p/fcitx/language/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: src/fcitx-rime.c:107 src/fcitx-rime.c:108 -msgid "Deploy" -msgstr "デプロイ" +#: src/fcitx-rime.c:54 +msgid "Rime is under maintenance ..." +msgstr "Rimeはメンテナンス中です..." + +#: src/fcitx-rime.c:56 +msgid "Rime is ready." +msgstr "Rimeの準備ができました。" + +#: src/fcitx-rime.c:58 +msgid "Rime has encountered an error. See /tmp/rime.fcitx.ERROR for details." +msgstr "Rimeでエラーが起こりました。より詳しくは /tmp/rime.fcitx.ERROR を見てください。" -#: src/fcitx-rime.c:87 src/fcitx-rime.conf.in:3 src/rime.conf.in:3 +#: src/fcitx-rime.c:64 src/fcitx-rime.c:114 src/fcitx-rime.conf.in:3 +#: src/rime.conf.in:3 msgid "Rime" msgstr "Rime" -#: src/fcitx-rime.conf.in:4 -msgid "Rime Wrapper For Fcitx" -msgstr "Fcitx 用 Rime ラッパー" +#: src/fcitx-rime.c:134 src/fcitx-rime.c:135 +msgid "Deploy" +msgstr "デプロイ" -#: src/fcitx-rime.c:116 src/fcitx-rime.c:117 +#: src/fcitx-rime.c:143 src/fcitx-rime.c:144 msgid "Synchronize" msgstr "同期" -#~ msgid "⇅ Synchronize" -#~ msgstr "⇅ 同期" - -#~ msgid "⟲ Deploy" -#~ msgstr "⟲ デプロイ" +#: src/fcitx-rime.conf.in:4 +msgid "Rime Wrapper For Fcitx" +msgstr "Fcitx 用 Rime ラッパー" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/vi.po new/fcitx-rime-0.3.0/po/vi.po --- old/fcitx-rime-0.2.2/po/vi.po 1970-01-01 01:00:00.000000000 +0100 +++ new/fcitx-rime-0.3.0/po/vi.po 2013-11-10 14:11:24.000000000 +0100 @@ -0,0 +1,48 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Translators: +# bizover, 2013 +msgid "" +msgstr "" +"Project-Id-Version: fcitx\n" +"Report-Msgid-Bugs-To: [email protected]\n" +"POT-Creation-Date: 2013-07-28 12:02-0400\n" +"PO-Revision-Date: 2013-07-30 14:58+0000\n" +"Last-Translator: bizover\n" +"Language-Team: Vietnamese (http://www.transifex.com/projects/p/fcitx/language/vi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: vi\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: src/fcitx-rime.c:54 +msgid "Rime is under maintenance ..." +msgstr "Rime đang bảo trì..." + +#: src/fcitx-rime.c:56 +msgid "Rime is ready." +msgstr "Rime sẵn sàng," + +#: src/fcitx-rime.c:58 +msgid "Rime has encountered an error. See /tmp/rime.fcitx.ERROR for details." +msgstr "Rime gặp lỗi. Xem ở /tmp/rime.fcitx.ERROR để biết chi tiết." + +#: src/fcitx-rime.c:64 src/fcitx-rime.c:114 src/fcitx-rime.conf.in:3 +#: src/rime.conf.in:3 +msgid "Rime" +msgstr "Rime" + +#: src/fcitx-rime.c:134 src/fcitx-rime.c:135 +msgid "Deploy" +msgstr "Triển khai" + +#: src/fcitx-rime.c:143 src/fcitx-rime.c:144 +msgid "Synchronize" +msgstr "Đồng bộ hóa" + +#: src/fcitx-rime.conf.in:4 +msgid "Rime Wrapper For Fcitx" +msgstr "Bộ Wrapper cho Fcitx" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/zh_CN.po new/fcitx-rime-0.3.0/po/zh_CN.po --- old/fcitx-rime-0.2.2/po/zh_CN.po 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/po/zh_CN.po 2013-11-10 14:11:24.000000000 +0100 @@ -1,41 +1,49 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: # Xuetian Weng <[email protected]>, 2012-2013 +# wwj402 <[email protected]>, 2013 msgid "" msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-07-07 12:02-0400\n" -"PO-Revision-Date: 2013-04-29 10:18+0000\n" -"Last-Translator: Xuetian Weng <[email protected]>\n" -"Language-Team: Chinese (China) <[email protected]>\n" -"Language: zh_CN\n" +"POT-Creation-Date: 2013-07-28 12:02-0400\n" +"PO-Revision-Date: 2013-08-07 15:38+0000\n" +"Last-Translator: wwj402 <[email protected]>\n" +"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/fcitx/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: zh_CN\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: src/fcitx-rime.c:107 src/fcitx-rime.c:108 -msgid "Deploy" -msgstr "重新部署" +#: src/fcitx-rime.c:54 +msgid "Rime is under maintenance ..." +msgstr "Rime 正在维护中..." + +#: src/fcitx-rime.c:56 +msgid "Rime is ready." +msgstr "Rime 就绪。" + +#: src/fcitx-rime.c:58 +msgid "Rime has encountered an error. See /tmp/rime.fcitx.ERROR for details." +msgstr "Rime 出现了一个错误。请参阅/tmp/rime.fcitx.ERROR中细节。" -#: src/fcitx-rime.c:87 src/fcitx-rime.conf.in:3 src/rime.conf.in:3 +#: src/fcitx-rime.c:64 src/fcitx-rime.c:114 src/fcitx-rime.conf.in:3 +#: src/rime.conf.in:3 msgid "Rime" msgstr "中州韻" -#: src/fcitx-rime.conf.in:4 -msgid "Rime Wrapper For Fcitx" -msgstr "Fcitx 的中州韻封装" +#: src/fcitx-rime.c:134 src/fcitx-rime.c:135 +msgid "Deploy" +msgstr "重新部署" -#: src/fcitx-rime.c:116 src/fcitx-rime.c:117 +#: src/fcitx-rime.c:143 src/fcitx-rime.c:144 msgid "Synchronize" msgstr "同步" -#~ msgid "⇅ Synchronize" -#~ msgstr "⇅ 同步" - -#~ msgid "⟲ Deploy" -#~ msgstr "⟲ 重新部署" +#: src/fcitx-rime.conf.in:4 +msgid "Rime Wrapper For Fcitx" +msgstr "Fcitx 的中州韻封装" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/po/zh_TW.po new/fcitx-rime-0.3.0/po/zh_TW.po --- old/fcitx-rime-0.2.2/po/zh_TW.po 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/po/zh_TW.po 2013-11-10 14:11:24.000000000 +0100 @@ -1,41 +1,47 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: msgid "" msgstr "" "Project-Id-Version: fcitx\n" "Report-Msgid-Bugs-To: [email protected]\n" -"POT-Creation-Date: 2013-07-07 12:02-0400\n" -"PO-Revision-Date: 2013-04-29 10:18+0000\n" +"POT-Creation-Date: 2013-07-28 12:02-0400\n" +"PO-Revision-Date: 2013-07-28 16:09+0000\n" "Last-Translator: Xuetian Weng <[email protected]>\n" -"Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/fcitx/" -"language/zh_TW/)\n" -"Language: zh_TW\n" +"Language-Team: Chinese (Taiwan) (http://www.transifex.com/projects/p/fcitx/language/zh_TW/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: zh_TW\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: src/fcitx-rime.c:107 src/fcitx-rime.c:108 -msgid "Deploy" -msgstr "重新部署" +#: src/fcitx-rime.c:54 +msgid "Rime is under maintenance ..." +msgstr "" + +#: src/fcitx-rime.c:56 +msgid "Rime is ready." +msgstr "" + +#: src/fcitx-rime.c:58 +msgid "Rime has encountered an error. See /tmp/rime.fcitx.ERROR for details." +msgstr "" -#: src/fcitx-rime.c:87 src/fcitx-rime.conf.in:3 src/rime.conf.in:3 +#: src/fcitx-rime.c:64 src/fcitx-rime.c:114 src/fcitx-rime.conf.in:3 +#: src/rime.conf.in:3 msgid "Rime" msgstr "中州韻" -#: src/fcitx-rime.conf.in:4 -msgid "Rime Wrapper For Fcitx" -msgstr "Fcitx 的中州韻封裝" +#: src/fcitx-rime.c:134 src/fcitx-rime.c:135 +msgid "Deploy" +msgstr "重新部署" -#: src/fcitx-rime.c:116 src/fcitx-rime.c:117 +#: src/fcitx-rime.c:143 src/fcitx-rime.c:144 msgid "Synchronize" msgstr "同步" -#~ msgid "⇅ Synchronize" -#~ msgstr "⇅ 同步" - -#~ msgid "⟲ Deploy" -#~ msgstr "⟲ 重新部署" +#: src/fcitx-rime.conf.in:4 +msgid "Rime Wrapper For Fcitx" +msgstr "Fcitx 的中州韻封裝" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/src/CMakeLists.txt new/fcitx-rime-0.3.0/src/CMakeLists.txt --- old/fcitx-rime-0.2.2/src/CMakeLists.txt 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/src/CMakeLists.txt 2013-11-10 14:11:24.000000000 +0100 @@ -2,12 +2,12 @@ include_directories(${FCITX4_FCITX_INCLUDE_DIRS}) include_directories(${FCITX4_FCITX_CONFIG_INCLUDE_DIRS}) include_directories(${FCITX4_FCITX_UTILS_INCLUDE_DIRS}) - -include_directories(${Rime_INCLUDE_DIR}) +include_directories(${RIME_INCLUDE_DIRS}) +link_directories(${RIME_LIBRARY_DIRS}) set(FCITX_RIME_SRC fcitx-rime.c) fcitx_add_addon_full(rime SOURCES ${FCITX_RIME_SRC} IM_CONFIG rime.conf - LINK_LIBS ${Rime_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + LINK_LIBS ${RIME_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fcitx-rime-0.2.2/src/fcitx-rime.c new/fcitx-rime-0.3.0/src/fcitx-rime.c --- old/fcitx-rime-0.2.2/src/fcitx-rime.c 2013-07-16 17:29:54.000000000 +0200 +++ new/fcitx-rime-0.3.0/src/fcitx-rime.c 2013-11-10 14:11:24.000000000 +0100 @@ -3,6 +3,7 @@ #include <fcitx/candidate.h> #include <fcitx/hook.h> #include <fcitx-config/xdg.h> +#include <fcitx/module/freedesktop-notify/fcitx-freedesktop-notify.h> #include <libintl.h> #include <rime_api.h> @@ -12,6 +13,8 @@ FcitxInstance* owner; RimeSessionId session_id; char* iconname; + RimeApi* api; + boolean firstRun; } FcitxRime; static void* FcitxRimeCreate(FcitxInstance* instance); @@ -41,6 +44,29 @@ FCITX_EXPORT_API int ABI_VERSION = FCITX_ABI_VERSION; +void FcitxRimeNotificationHandler(void* context_object, + RimeSessionId session_id, + const char* message_type, + const char* message_value) +{ + const char* message = NULL; + FcitxRime* rime = (FcitxRime*) context_object; + if (!strcmp(message_type, "deploy")) { + if (!strcmp(message_value, "start")) { + message = _("Rime is under maintenance ..."); + } else if (!strcmp(message_value, "success")) { + message = _("Rime is ready."); + } else if (!strcmp(message_value, "failure")) { + message = _("Rime has encountered an error. " + "See /tmp/rime.fcitx.ERROR for details."); + } + } + + if (message) { + FcitxFreeDesktopNotifyShowAddonTip(rime->owner, "fcitx-rime-deploy", "fcitx-rime-deploy", _("Rime"), message); + } +} + static void FcitxRimeStart(FcitxRime* rime, boolean fullcheck) { char* user_path = NULL; @@ -51,24 +77,35 @@ //char* shared_data_dir = fcitx_utils_get_fcitx_path_with_filename("pkgdatadir", "rime"); const char* shared_data_dir = RIME_DATA_DIR; - RimeTraits fcitx_rime_traits; + RIME_STRUCT(RimeTraits, fcitx_rime_traits); fcitx_rime_traits.shared_data_dir = shared_data_dir; + fcitx_rime_traits.app_name = "rime.fcitx-rime"; fcitx_rime_traits.user_data_dir = user_path; fcitx_rime_traits.distribution_name = "Rime"; fcitx_rime_traits.distribution_code_name = "fcitx-rime"; - fcitx_rime_traits.distribution_version = "0.1"; - RimeInitialize(&fcitx_rime_traits); - if (RimeStartMaintenance(fullcheck)) { - // TODO: notification... - } + fcitx_rime_traits.distribution_version = "0.2.3"; + if (rime->firstRun) { + rime->api->setup(&fcitx_rime_traits); + rime->firstRun = false; + } + rime->api->initialize(&fcitx_rime_traits); + rime->api->set_notification_handler(FcitxRimeNotificationHandler, rime); + rime->api->start_maintenance(fullcheck); - rime->session_id = RimeCreateSession(); + rime->session_id = rime->api->create_session(); } static void* FcitxRimeCreate(FcitxInstance* instance) { FcitxRime* rime = (FcitxRime*) fcitx_utils_malloc0(sizeof(FcitxRime)); rime->owner = instance; + rime->api = rime_get_api(); + rime->firstRun = true; + if (!rime->api) { + free(rime); + return NULL; + } + FcitxRimeStart(rime, false); FcitxIMIFace iface; @@ -134,11 +171,12 @@ { FcitxRime* rime = (FcitxRime*) arg; if (rime->session_id) { - RimeDestroySession(rime->session_id); + rime->api->destroy_session(rime->session_id); rime->session_id = 0; } fcitx_utils_free(rime->iconname); - RimeFinalize(); + rime->api->finalize(); + free(rime); } boolean FcitxRimeInit(void* arg) @@ -159,11 +197,15 @@ void FcitxRimeReset(void* arg) { FcitxRime* rime = (FcitxRime*) arg; - if (!RimeFindSession(rime->session_id)) { - rime->session_id = RimeCreateSession(); + + if (rime->api->is_maintenance_mode()) { + return; + } + if (!rime->api->find_session(rime->session_id)) { + rime->session_id = rime->api->create_session(); } if (rime->session_id) { - RimeProcessKey(rime->session_id, FcitxKey_Escape, 0); + rime->api->process_key(rime->session_id, FcitxKey_Escape, 0); } } @@ -186,9 +228,15 @@ void FcitxRimeUpdateStatus(FcitxRime* rime) { - RimeStatus status = {0}; - RIME_STRUCT_INIT(RimeStatus, status); - if (RimeGetStatus(rime->session_id, &status)) { + if (rime->api->is_maintenance_mode()) { + return; + } + if (!rime->api->find_session(rime->session_id)) { + rime->session_id = rime->api->create_session(); + } + + RIME_STRUCT(RimeStatus, status); + if (rime->api->get_status(rime->session_id, &status)) { char* text = ""; if (status.is_disabled) { text = "\xe2\x8c\x9b"; @@ -201,7 +249,7 @@ text = "中"; } FcitxUISetStatusString(rime->owner, "rime-enzh", text, text); - RimeFreeStatus(&status); + rime->api->free_status(&status); } } @@ -226,19 +274,22 @@ { FcitxRime *rime = (FcitxRime *)arg; - if (!RimeFindSession(rime->session_id)) { - rime->session_id = RimeCreateSession(); + if (rime->api->is_maintenance_mode()) { + return IRV_TO_PROCESS; + } + if (!rime->api->find_session(rime->session_id)) { + rime->session_id = rime->api->create_session(); } if (!rime->session_id) { // service disabled return IRV_TO_PROCESS; } - boolean result = RimeProcessKey(rime->session_id, sym, state); + boolean result = rime->api->process_key(rime->session_id, sym, state); - RimeCommit commit = {0}; - if (RimeGetCommit(rime->session_id, &commit)) { + RIME_STRUCT(RimeCommit, commit); + if (rime->api->get_commit(rime->session_id, &commit)) { FcitxInputContext* ic = FcitxInstanceGetCurrentIC(rime->owner); FcitxInstanceCommitString(rime->owner, ic, commit.text); - RimeFreeCommit(&commit); + rime->api->free_commit(&commit); } FcitxRimeUpdateStatus(rime); @@ -254,16 +305,15 @@ INPUT_RETURN_VALUE FcitxRimeGetCandWord(void* arg, FcitxCandidateWord* candWord) { - RimeContext context = {0}; FcitxRime *rime = (FcitxRime *)arg; - RIME_STRUCT_INIT(RimeContext, context); + RIME_STRUCT(RimeContext, context); INPUT_RETURN_VALUE retVal = IRV_TO_PROCESS; - if (RimeGetContext(rime->session_id, &context)) { + if (rime->api->get_context(rime->session_id, &context)) { if (context.menu.num_candidates) { int i = *(int*) candWord->priv; const char* digit = DIGIT_STR_CHOOSE; - int num_select_keys = strlen(context.menu.select_keys); + int num_select_keys = context.menu.select_keys ? strlen(context.menu.select_keys) : 0; FcitxKeySym sym = FcitxKey_None; if (i < 10) { if (i < num_select_keys) @@ -272,12 +322,13 @@ sym = digit[i]; } if (sym != FcitxKey_None) { - boolean result = RimeProcessKey(rime->session_id, sym, 0); - RimeCommit commit = {0}; - if (RimeGetCommit(rime->session_id, &commit)) { + boolean result = rime->api->process_key(rime->session_id, sym, 0); + + RIME_STRUCT(RimeCommit, commit); + if (rime->api->get_commit(rime->session_id, &commit)) { FcitxInputContext* ic = FcitxInstanceGetCurrentIC(rime->owner); FcitxInstanceCommitString(rime->owner, ic, commit.text); - RimeFreeCommit(&commit); + rime->api->free_commit(&commit); } if (!result) { FcitxRimeGetCandWords(rime); @@ -288,9 +339,9 @@ retVal = IRV_DISPLAY_CANDWORDS; } } + rime->api->free_context(&context); } - RimeFreeContext(&context); return retVal; } @@ -301,11 +352,13 @@ FcitxInputState *input = FcitxInstanceGetInputState(rime->owner); FcitxInstanceCleanInputWindow(rime->owner); - RimeContext context = {0}; - RIME_STRUCT_INIT(RimeContext, context); - if (!RimeGetContext(rime->session_id, &context) || - context.composition.length == 0) { - RimeFreeContext(&context); + RIME_STRUCT(RimeContext, context); + if (!rime->api->get_context(rime->session_id, &context)) { + return IRV_DISPLAY_CANDWORDS; + } + + if (context.composition.length == 0) { + rime->api->free_context(&context); return IRV_DISPLAY_CANDWORDS; } @@ -351,7 +404,7 @@ char strChoose[11]; strChoose[10] = '\0'; FcitxCandidateWordSetPageSize(candList, 10); - int num_select_keys = strlen(context.menu.select_keys); + int num_select_keys = context.menu.select_keys ? strlen(context.menu.select_keys) : 0; int i; for (i = 0; i < context.menu.num_candidates; ++i) { FcitxCandidateWord candWord; @@ -383,7 +436,7 @@ FcitxCandidateWordSetOverridePaging(candList, context.menu.page_no != 0, !context.menu.is_last_page, NULL, NULL, NULL); } - RimeFreeContext(&context); + rime->api->free_context(&context); return IRV_DISPLAY_CANDWORDS; } @@ -391,10 +444,10 @@ { FcitxRime* rime = (FcitxRime*) arg; if (rime->session_id) { - RimeDestroySession(rime->session_id); + rime->api->destroy_session(rime->session_id); rime->session_id = 0; } - RimeFinalize(); + rime->api->finalize(); FcitxRimeStart(rime, false); FcitxRimeUpdateStatus(rime); @@ -403,9 +456,8 @@ static const char* FcitxRimeGetIMIcon(void* arg) { FcitxRime* rime = (FcitxRime*) arg; - RimeStatus status = {0}; - RIME_STRUCT_INIT(RimeStatus, status); - if (RimeGetStatus(rime->session_id, &status)) { + RIME_STRUCT(RimeStatus, status); + if (rime->api->get_status(rime->session_id, &status)) { char* text = ""; if (status.is_disabled) { text = "@rime-disabled"; @@ -418,7 +470,7 @@ } else { text = "@rime-im"; } - RimeFreeStatus(&status); + rime->api->free_status(&status); return text; } @@ -459,17 +511,18 @@ void FcitxRimeToggleSync(void* arg) { - RimeSyncUserData(); + FcitxRime* rime = (FcitxRime*) arg; + rime->api->sync_user_data(); } void FcitxRimeToggleDeploy(void* arg) { FcitxRime* rime = (FcitxRime*) arg; if (rime->session_id) { - RimeDestroySession(rime->session_id); + rime->api->sync_user_data(rime->session_id); rime->session_id = 0; } - RimeFinalize(); + rime->api->finalize(); FcitxRimeStart(rime, true); FcitxRimeUpdateStatus(rime); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
