summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfujiwarat <takao.fujiwara1@gmail.com>2017-12-15 19:38:51 +0900
committerfujiwarat <takao.fujiwara1@gmail.com>2017-12-15 19:38:51 +0900
commitae039c727a89c8a27d5224adafb656a37d345d22 (patch)
treebf0db4dbea5a0e3a6beb1c0443b982a473240141
parent34e8b0ca96fb5c94405d413c01578282ea005397 (diff)
downloadibus-anthy-ae039c727a89c8a27d5224adafb656a37d345d22.tar.gz
Migrated DConf to GSettings
-rw-r--r--data/Makefile.am19
-rw-r--r--data/org.freedesktop.ibus.engine.anthy.gschema.xml.in1111
-rw-r--r--engine/python3/Makefile.am5
-rw-r--r--engine/python3/_config.py.in5
-rw-r--r--engine/python3/engine.py277
-rw-r--r--engine/python3/factory.py19
-rw-r--r--engine/python3/jastring.py20
-rw-r--r--engine/python3/kana.py56
-rw-r--r--engine/python3/romaji.py29
-rw-r--r--engine/python3/thumb.py86
-rw-r--r--setup/python3/Makefile.am15
-rw-r--r--setup/python3/anthyprefs.py335
-rw-r--r--setup/python3/anthyprefs.py.in1361
-rw-r--r--setup/python3/main.py602
-rw-r--r--setup/python3/prefs.py444
-rw-r--r--setup/python3/setup.ui134
16 files changed, 2170 insertions, 2348 deletions
diff --git a/data/Makefile.am b/data/Makefile.am
index 89d5ee0..5d5747e 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -2,8 +2,8 @@
#
# ibus-anthy - The Anthy engine for IBus
#
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2010-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2010-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -36,11 +36,25 @@ appdata_DATA = $(appdata_in_files:.xml.in=.xml)
appdatadir=$(datadir)/appdata
@INTLTOOL_XML_RULE@
+schemas_in_files = org.freedesktop.ibus.engine.anthy.gschema.xml.in
+schemas_DATA = $(schemas_in_files:.xml.in=.xml)
+schemasdir = $(datadir)/glib-2.0/schemas
+
CLEANFILES = \
$(appdata_DATA) \
+ $(schemas_DATA) \
emoji.t \
$(NULL)
+$(schemas_DATA): $(schemas_in_files)
+ $(SED) -e "s|\@ANTHY_ZIPCODE_FILE\@|$(ANTHY_ZIPCODE_FILE)|g" \
+ -e "s|\@KASUMI_EXEC_FILE\@|$(KASUMI_EXEC_FILE)|g" \
+ -e "s|\@KASUMI_ICON_FILE\@|$(KASUMI_ICON_FILE)|g" \
+ -e "s|\@ON_OFF_KEYS\@|$(ON_OFF_KEYS)|g" \
+ -e "s|\@pkgdatadir\@|$(pkgdatadir)|g" \
+ $< > $@
+
+
emoji.t: emoji-each.t emoji-emoji.t
@echo "Generate $@"; \
$(SED) -e '/^#/d' $(srcdir)/emoji-emoji.t > emoji-emoji.t.$$$$; \
@@ -63,6 +77,7 @@ endif
EXTRA_DIST = \
$(appdata_in_files) \
+ $(schemas_in_files) \
emoji-each.t \
emoji-emoji.t \
era.t \
diff --git a/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in b/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in
new file mode 100644
index 0000000..57436b3
--- /dev/null
+++ b/data/org.freedesktop.ibus.engine.anthy.gschema.xml.in
@@ -0,0 +1,1111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schemalist>
+ <schema path="/org/freedesktop/ibus/engine/anthy/common/"
+ id="org.freedesktop.ibus.engine.anthy.common">
+ <key name="input-mode" type="i">
+ <default>0</default>
+ <summary>Input Mode</summary>
+ <description></description>
+ </key>
+ <key name="typing-method" type="i">
+ <default>0</default>
+ <summary>Typing Mode</summary>
+ <description></description>
+ </key>
+ <key name="conversion-segment-mode" type="i">
+ <default>0</default>
+ <summary>Conversion Segment Mode</summary>
+ <description></description>
+ </key>
+ <key name="show-input-mode" type="b">
+ <default>true</default>
+ <summary>Show Input Mode</summary>
+ <description></description>
+ </key>
+ <key name="show-typing-method" type="b">
+ <default>false</default>
+ <summary>Show Typing Mode</summary>
+ <description></description>
+ </key>
+ <key name="show-segment-mode" type="b">
+ <default>false</default>
+ <summary>Show Segment Mode</summary>
+ <description></description>
+ </key>
+ <key name="show-dict-mode" type="b">
+ <default>true</default>
+ <summary>Show Dictionary Mode</summary>
+ <description></description>
+ </key>
+ <key name="show-dict-config" type="b">
+ <default>false</default>
+ <summary>Show Dictionary Configuration</summary>
+ <description></description>
+ </key>
+ <key name="show-preferences" type="b">
+ <default>true</default>
+ <summary>Show Preferences</summary>
+ <description></description>
+ </key>
+ <key name="period-style" type="i">
+ <default>0</default>
+ <summary>Period Style</summary>
+ <description></description>
+ </key>
+ <key name="symbol-style" type="i">
+ <default>1</default>
+ <summary>Symbol Style</summary>
+ <description></description>
+ </key>
+ <key name="ten-key-mode" type="i">
+ <default>1</default>
+ <summary>Ten Key Mode</summary>
+ <description></description>
+ </key>
+ <key name="behavior-on-focus-out" type="i">
+ <default>0</default>
+ <summary>Behavior on Focus out</summary>
+ <description></description>
+ </key>
+ <key name="behavior-on-period" type="i">
+ <default>0</default>
+ <summary>Behavior on Period</summary>
+ <description></description>
+ </key>
+ <key name="trigger-periods" type="s">
+ <default>',.、。,.'</default>
+ <summary>Trigger Periods</summary>
+ <description></description>
+ </key>
+ <key name="page-size" type="i">
+ <default>10</default>
+ <summary>Page Size</summary>
+ <description></description>
+ </key>
+ <key name="half-width-symbol" type="b">
+ <default>false</default>
+ <summary>Half Width Symbol</summary>
+ <description></description>
+ </key>
+ <key name="half-width-number" type="b">
+ <default>false</default>
+ <summary>Half Width Number</summary>
+ <description></description>
+ </key>
+ <key name="half-width-space" type="b">
+ <default>false</default>
+ <summary>Half Width Space</summary>
+ <description></description>
+ </key>
+ <key name="latin-with-shift" type="b">
+ <default>true</default>
+ <summary>Latin with Shift</summary>
+ <description></description>
+ </key>
+ <key name="shortcut-type" type="s">
+ <default>'default'</default>
+ <summary>Shortcut Type</summary>
+ <description></description>
+ </key>
+ <key name="dict-admin-command" type="as">
+ <default>['@KASUMI_EXEC_FILE@', 'kasumi']</default>
+ <summary>Dictionary Administration Command</summary>
+ <description></description>
+ </key>
+ <key name="add-word-command" type="as">
+ <default>['@KASUMI_EXEC_FILE@', 'kasumi', '-a']</default>
+ <summary>Add Word Command</summary>
+ <description></description>
+ </key>
+ <key name="dict-config-icon" type="s">
+ <default>'@KASUMI_ICON_FILE@'</default>
+ <summary>Dictionary configuration icon</summary>
+ <description></description>
+ </key>
+ <key name="keyboard-layouts" type="as">
+ <default>['default', 'jp', 'us',
+ 'jp[ctrl:swapcaps]', 'us[ctrl:swapcaps]',
+ 'jp[ctrl:swapcaps,compose:rctrl]',
+ 'us[ctrl:swapcaps,compose:rctrl]',
+ 'jp[japan:kana_lock]',
+ 'jp[japan:nicola_f_bs]',
+ 'jp[japan:nicola_f_bs,ctrl:swapcaps]',
+ 'jp[japan:hztg_escape]',
+ 'jp[japan:hztg_escape,ctrl:swapcaps]'
+ ]
+ </default>
+ <summary>Keyboard Layouts</summary>
+ <description></description>
+ </key>
+ </schema>
+ <schema path="/org/freedesktop/ibus/engine/anthy/romaji-typing-rule/"
+ id="org.freedesktop.ibus.engine.anthy.romaji-typing-rule">
+ <key name="method" type="s">
+ <default>'default'</default>
+ <summary>Method</summary>
+ <description></description>
+ </key>
+ <key name="list" type="a{sv}">
+ <!--
+ ##0 MS-IME
+ # http://www.filibeto.org/sun/lib/solaris10-docs/E19253-01/819-7844/appe-1-4/index.html
+ ##1 ATOK
+ # http://www.filibeto.org/sun/lib/solaris10-docs/E19253-01/819-7844/appe-1-3/index.html
+ ##2 Gairaigo http://ja.wikipedia.org/wiki/%E5%A4%96%E6%9D%A5%E8%AA%9E
+ ##3 ANSI/BSI Suggestions http://en.wikipedia.org/wiki/Katakana
+ ##4 Historical kana http://en.wikipedia.org/wiki/Romanization_of_Japanese
+ # Maybe we need a compatibility between MS-IME and ibus-anthy.
+ -->
+ <default>
+ {
+ 'default': &lt;{
+ 'minus' : &lt;'ー'&gt;,
+ 'a' : &lt;'あ'&gt;,
+ 'i' : &lt;'い'&gt;,
+ 'u' : &lt;'う'&gt;,
+ 'e' : &lt;'え'&gt;,
+ 'o' : &lt;'お'&gt;,
+ 'x-a' : &lt;'ぁ'&gt;,
+ 'x-i' : &lt;'ぃ'&gt;,
+ 'x-u' : &lt;'ぅ'&gt;,
+ 'x-e' : &lt;'ぇ'&gt;,
+ 'x-o' : &lt;'ぉ'&gt;,
+ 'l-a' : &lt;'ぁ'&gt;,
+ 'l-i' : &lt;'ぃ'&gt;,
+ 'l-u' : &lt;'ぅ'&gt;,
+ 'l-e' : &lt;'ぇ'&gt;,
+ 'l-o' : &lt;'ぉ'&gt;,
+ 'w-h-a' : &lt;'うぁ'&gt;,
+ 'w-h-i' : &lt;'うぃ'&gt;,
+ 'w-h-e' : &lt;'うぇ'&gt;,
+ 'w-h-o' : &lt;'うぉ'&gt;,
+ 'w-y-a' : &lt;'うゃ'&gt;, <!-- ##2 -->
+ 'w-y-u' : &lt;'うゅ'&gt;, <!-- ##2 -->
+ 'w-y-o' : &lt;'うょ'&gt;, <!-- ##2 -->
+ 'v-a' : &lt;'ヴぁ'&gt;,
+ 'v-i' : &lt;'ヴぃ'&gt;,
+ 'v-u' : &lt;'ヴ'&gt;,
+ 'v-e' : &lt;'ヴぇ'&gt;,
+ 'v-o' : &lt;'ヴぉ'&gt;,
+ 'v-y-a' : &lt;'ヴゃ'&gt;, <!-- ##2 -->
+ 'v-y-u' : &lt;'ヴゅ'&gt;, <!-- ##2 -->
+ 'v-y-e' : &lt;'ヴぃぇ'&gt;, <!-- ##2 -->
+ 'v-y-o' : &lt;'ヴょ'&gt;, <!-- ##2 -->
+ 'k-a' : &lt;'か'&gt;,
+ 'k-i' : &lt;'き'&gt;,
+ 'k-u' : &lt;'く'&gt;,
+ 'k-e' : &lt;'け'&gt;,
+ 'k-o' : &lt;'こ'&gt;,
+ 'l-k-a' : &lt;'ヵ'&gt;,
+ 'l-k-e' : &lt;'ヶ'&gt;,
+<!-- 'x-k-a' : &lt;'ゕ'&gt;, -->
+ 'x-k-a' : &lt;'ヵ'&gt;,
+<!-- 'x-k-e' : &lt;'ゖ'&gt;, -->
+ 'x-k-e' : &lt;'ヶ'&gt;,
+ 'g-a' : &lt;'が'&gt;,
+ 'g-i' : &lt;'ぎ'&gt;,
+ 'g-u' : &lt;'ぐ'&gt;,
+ 'g-e' : &lt;'げ'&gt;,
+ 'g-o' : &lt;'ご'&gt;,
+ 'k-y-a' : &lt;'きゃ'&gt;,
+ 'k-y-i' : &lt;'きぃ'&gt;,
+ 'k-y-u' : &lt;'きゅ'&gt;,
+ 'k-y-e' : &lt;'きぇ'&gt;,
+ 'k-y-o' : &lt;'きょ'&gt;,
+ 'k-w-a' : &lt;'くぁ'&gt;,
+ 'k-w-i' : &lt;'くぃ'&gt;, <!-- ##2 -->
+ 'k-w-u' : &lt;'くぅ'&gt;, <!-- ##2 -->
+ 'k-w-e' : &lt;'くぇ'&gt;, <!-- ##2 -->
+ 'k-w-o' : &lt;'くぉ'&gt;, <!-- ##2 -->
+ 'g-y-a' : &lt;'ぎゃ'&gt;,
+ 'g-y-i' : &lt;'ぎぃ'&gt;,
+ 'g-y-u' : &lt;'ぎゅ'&gt;,
+ 'g-y-e' : &lt;'ぎぇ'&gt;,
+ 'g-y-o' : &lt;'ぎょ'&gt;,
+ 'g-w-a' : &lt;'ぐぁ'&gt;,
+ 'g-w-i' : &lt;'ぐぃ'&gt;, <!-- ##2 -->
+ 'g-w-u' : &lt;'ぐぅ'&gt;, <!-- ##2 -->
+ 'g-w-e' : &lt;'ぐぇ'&gt;, <!-- ##2 -->
+ 'g-w-o' : &lt;'ぐぉ'&gt;, <!-- ##2 -->
+ 's-a' : &lt;'さ'&gt;,
+ 's-i' : &lt;'し'&gt;,
+ 's-u' : &lt;'す'&gt;,
+ 's-e' : &lt;'せ'&gt;,
+ 's-o' : &lt;'そ'&gt;,
+ 'z-a' : &lt;'ざ'&gt;,
+ 'z-i' : &lt;'じ'&gt;,
+ 'z-u' : &lt;'ず'&gt;,
+ 'z-e' : &lt;'ぜ'&gt;,
+ 'z-o' : &lt;'ぞ'&gt;,
+ 's-y-a' : &lt;'しゃ'&gt;,
+ 's-y-i' : &lt;'しぃ'&gt;,
+ 's-y-u' : &lt;'しゅ'&gt;,
+ 's-y-e' : &lt;'しぇ'&gt;,
+ 's-y-o' : &lt;'しょ'&gt;,
+ 's-h-a' : &lt;'しゃ'&gt;,
+ 's-h-i' : &lt;'し'&gt;,
+ 's-h-u' : &lt;'しゅ'&gt;,
+ 's-h-e' : &lt;'しぇ'&gt;,
+ 's-h-o' : &lt;'しょ'&gt;,
+ 'z-y-a' : &lt;'じゃ'&gt;,
+ 'z-y-i' : &lt;'じぃ'&gt;,
+ 'z-y-u' : &lt;'じゅ'&gt;,
+ 'z-y-e' : &lt;'じぇ'&gt;,
+ 'z-y-o' : &lt;'じょ'&gt;,
+ 'j-a' : &lt;'じゃ'&gt;,
+ 'j-y-a' : &lt;'じゃ'&gt;,
+ 'j-i' : &lt;'じ'&gt;,
+ 'j-y-i' : &lt;'じぃ'&gt;,
+ 'j-u' : &lt;'じゅ'&gt;,
+ 'j-y-u' : &lt;'じゅ'&gt;,
+ 'j-e' : &lt;'じぇ'&gt;,
+ 'j-y-e' : &lt;'じぇ'&gt;,
+ 'j-o' : &lt;'じょ'&gt;,
+ 'j-y-o' : &lt;'じょ'&gt;,
+ 's-w-i' : &lt;'すぅぃ'&gt;, <!-- ##2 -->
+ 's-w-e' : &lt;'すぇ'&gt;, <!-- ##2 -->
+ 'z-w-e' : &lt;'ずぇ'&gt;, <!-- ##2 -->
+ 't-a' : &lt;'た'&gt;,
+ 't-i' : &lt;'ち'&gt;,
+ 't-u' : &lt;'つ'&gt;,
+ 't-s-u' : &lt;'つ'&gt;,
+ 't-e' : &lt;'て'&gt;,
+ 't-o' : &lt;'と'&gt;,
+ 'd-a' : &lt;'だ'&gt;,
+ 'd-i' : &lt;'ぢ'&gt;,
+ 'd-u' : &lt;'づ'&gt;,
+ 'd-e' : &lt;'で'&gt;,
+ 'd-o' : &lt;'ど'&gt;,
+ 'x-t-u' : &lt;'っ'&gt;,
+ 'x-t-s-u' : &lt;'っ'&gt;,
+ 'l-t-u' : &lt;'っ'&gt;,
+ 'l-t-s-u' : &lt;'っ'&gt;,
+ 't-y-a' : &lt;'ちゃ'&gt;,
+ 't-y-i' : &lt;'ちぃ'&gt;,
+ 't-y-u' : &lt;'ちゅ'&gt;,
+ 't-y-e' : &lt;'ちぇ'&gt;,
+ 't-y-o' : &lt;'ちょ'&gt;,
+ 'c-y-a' : &lt;'ちゃ'&gt;,
+ 'c-y-i' : &lt;'ちぃ'&gt;,
+ 'c-y-u' : &lt;'ちゅ'&gt;,
+ 'c-y-e' : &lt;'ちぇ'&gt;,
+ 'c-y-o' : &lt;'ちょ'&gt;,
+ 'c-h-a' : &lt;'ちゃ'&gt;,
+ 'c-h-i' : &lt;'ち'&gt;,
+ 'c-h-u' : &lt;'ちゅ'&gt;,
+ 'c-h-e' : &lt;'ちぇ'&gt;,
+ 'c-h-o' : &lt;'ちょ'&gt;,
+ 'd-y-a' : &lt;'ぢゃ'&gt;,
+ 'd-y-i' : &lt;'ぢぃ'&gt;,
+ 'd-y-u' : &lt;'ぢゅ'&gt;,
+ 'd-y-e' : &lt;'ぢぇ'&gt;,
+ 'd-y-o' : &lt;'ぢょ'&gt;,
+ 't-s-a' : &lt;'つぁ'&gt;,
+ 't-s-i' : &lt;'つぃ'&gt;,
+ 't-s-e' : &lt;'つぇ'&gt;,
+ 't-s-o' : &lt;'つぉ'&gt;,
+ 't-s-y-a' : &lt;'つゃ'&gt;, <!-- ##3 -->
+ 't-s-y-u' : &lt;'つゅ'&gt;, <!-- ##3 -->
+ 't-s-y-e' : &lt;'つぃぇ'&gt;, <!-- ##3 -->
+ 't-s-y-o' : &lt;'つょ'&gt;, <!-- ##3 -->
+ 'd-z-a' : &lt;'づぁ'&gt;, <!-- ##3 -->
+ 'd-z-i' : &lt;'づぃ'&gt;, <!-- ##3 -->
+ 'd-z-u' : &lt;'づ'&gt;, <!-- ##4 -->
+ 'd-z-e' : &lt;'づぇ'&gt;, <!-- ##3 -->
+ 'd-z-o' : &lt;'づぉ'&gt;, <!-- ##3 -->
+ 'd-z-y-a' : &lt;'づゃ'&gt;, <!-- ##3 -->
+ 'd-z-y-u' : &lt;'づゅ'&gt;, <!-- ##3 -->
+ 'd-z-y-e' : &lt;'づぃぇ'&gt;, <!-- ##3 -->
+ 'd-z-y-o' : &lt;'づょ'&gt;, <!-- ##3 -->
+ 't-h-a' : &lt;'てゃ'&gt;,
+ 't-h-i' : &lt;'てぃ'&gt;,
+ 't-h-u' : &lt;'てゅ'&gt;,
+ 't-h-e' : &lt;'てぇ'&gt;,
+ 't-h-o' : &lt;'てょ'&gt;,
+ 't-w-u' : &lt;'とぅ'&gt;,
+ 'd-h-a' : &lt;'でゃ'&gt;,
+ 'd-h-i' : &lt;'でぃ'&gt;,
+ 'd-h-u' : &lt;'でゅ'&gt;,
+ 'd-h-e' : &lt;'でぇ'&gt;,
+ 'd-h-o' : &lt;'でょ'&gt;,
+ 'd-w-u' : &lt;'どぅ'&gt;,
+ 'n-a' : &lt;'な'&gt;,
+ 'n-i' : &lt;'に'&gt;,
+ 'n-u' : &lt;'ぬ'&gt;,
+ 'n-e' : &lt;'ね'&gt;,
+ 'n-o' : &lt;'の'&gt;,
+ 'n-y-a' : &lt;'にゃ'&gt;,
+ 'n-y-i' : &lt;'にぃ'&gt;,
+ 'n-y-u' : &lt;'にゅ'&gt;,
+ 'n-y-e' : &lt;'にぇ'&gt;,
+ 'n-y-o' : &lt;'にょ'&gt;,
+ 'h-a' : &lt;'は'&gt;,
+ 'h-i' : &lt;'ひ'&gt;,
+ 'h-u' : &lt;'ふ'&gt;,
+ 'h-e' : &lt;'へ'&gt;,
+ 'h-o' : &lt;'ほ'&gt;,
+ 'b-a' : &lt;'ば'&gt;,
+ 'b-i' : &lt;'び'&gt;,
+ 'b-u' : &lt;'ぶ'&gt;,
+ 'b-e' : &lt;'べ'&gt;,
+ 'b-o' : &lt;'ぼ'&gt;,
+ 'p-a' : &lt;'ぱ'&gt;,
+ 'p-i' : &lt;'ぴ'&gt;,
+ 'p-u' : &lt;'ぷ'&gt;,
+ 'p-e' : &lt;'ぺ'&gt;,
+ 'p-o' : &lt;'ぽ'&gt;,
+ 'h-y-a' : &lt;'ひゃ'&gt;,
+ 'h-y-i' : &lt;'ひぃ'&gt;,
+ 'h-y-u' : &lt;'ひゅ'&gt;,
+ 'h-y-e' : &lt;'ひぇ'&gt;,
+ 'h-y-o' : &lt;'ひょ'&gt;,
+ 'b-y-a' : &lt;'びゃ'&gt;,
+ 'b-y-i' : &lt;'びぃ'&gt;,
+ 'b-y-u' : &lt;'びゅ'&gt;,
+ 'b-y-e' : &lt;'びぇ'&gt;,
+ 'b-y-o' : &lt;'びょ'&gt;,
+ 'p-y-a' : &lt;'ぴゃ'&gt;,
+ 'p-y-i' : &lt;'ぴぃ'&gt;,
+ 'p-y-u' : &lt;'ぴゅ'&gt;,
+ 'p-y-e' : &lt;'ぴぇ'&gt;,
+ 'p-y-o' : &lt;'ぴょ'&gt;,
+ 'f-a' : &lt;'ふぁ'&gt;,
+ 'f-i' : &lt;'ふぃ'&gt;,
+ 'f-u' : &lt;'ふ'&gt;,
+ 'f-e' : &lt;'ふぇ'&gt;,
+ 'f-o' : &lt;'ふぉ'&gt;,
+ 'f-y-a' : &lt;'ふゃ'&gt;,
+ 'f-y-i' : &lt;'ふぃ'&gt;,
+ 'f-y-u' : &lt;'ふゅ'&gt;,
+ 'f-y-e' : &lt;'ふぇ'&gt;,
+ 'f-y-o' : &lt;'ふょ'&gt;,
+ 'b-w-a' : &lt;'ぶぁ'&gt;, <!-- ##2 -->
+ 'b-w-e' : &lt;'ぶぇ'&gt;, <!-- ##2 -->
+ 'b-w-o' : &lt;'ぶぉ'&gt;, <!-- ##2 -->
+ 'p-w-a' : &lt;'ぷぁ'&gt;, <!-- ##2 -->
+ 'p-w-e' : &lt;'ぷぇ'&gt;, <!-- ##2 -->
+ 'p-w-o' : &lt;'ぷぉ'&gt;, <!-- ##2 -->
+ 'm-a' : &lt;'ま'&gt;,
+ 'm-i' : &lt;'み'&gt;,
+ 'm-u' : &lt;'む'&gt;,
+ 'm-e' : &lt;'め'&gt;,
+ 'm-o' : &lt;'も'&gt;,
+ 'm-y-a' : &lt;'みゃ'&gt;,
+ 'm-y-i' : &lt;'みぃ'&gt;,
+ 'm-y-u' : &lt;'みゅ'&gt;,
+ 'm-y-e' : &lt;'みぇ'&gt;,
+ 'm-y-o' : &lt;'みょ'&gt;,
+ 'y-a' : &lt;'や'&gt;,
+ 'y-i' : &lt;'い'&gt;,
+ 'y-u' : &lt;'ゆ'&gt;,
+ 'y-e' : &lt;'いぇ'&gt;,
+ 'y-o' : &lt;'よ'&gt;,
+ 'l-y-a' : &lt;'ゃ'&gt;,
+ 'l-y-i' : &lt;'ぃ'&gt;,
+ 'l-y-u' : &lt;'ゅ'&gt;,
+ 'l-y-e' : &lt;'ぇ'&gt;,
+ 'l-y-o' : &lt;'ょ'&gt;,
+ 'x-y-a' : &lt;'ゃ'&gt;,
+ 'x-y-i' : &lt;'ぃ'&gt;,
+ 'x-y-u' : &lt;'ゅ'&gt;,
+ 'x-y-e' : &lt;'ぇ'&gt;,
+ 'x-y-o' : &lt;'ょ'&gt;,
+ 'r-a' : &lt;'ら'&gt;,
+ 'r-i' : &lt;'り'&gt;,
+ 'r-u' : &lt;'る'&gt;,
+ 'r-e' : &lt;'れ'&gt;,
+ 'r-o' : &lt;'ろ'&gt;,
+ 'r-y-a' : &lt;'りゃ'&gt;,
+ 'r-y-i' : &lt;'りぃ'&gt;,
+ 'r-y-u' : &lt;'りゅ'&gt;,
+ 'r-y-e' : &lt;'りぇ'&gt;,
+ 'r-y-o' : &lt;'りょ'&gt;,
+ 'w-a' : &lt;'わ'&gt;,
+ 'w-i' : &lt;'うぃ'&gt;,
+ 'w-u' : &lt;'う'&gt;,
+ 'w-e' : &lt;'うぇ'&gt;,
+ 'w-o' : &lt;'を'&gt;,
+ 'l-w-a' : &lt;'ゎ'&gt;,
+ 'x-w-a' : &lt;'ゎ'&gt;,
+ 'n-apostrophe' : &lt;'ん'&gt;,
+ 'n-n' : &lt;'ん'&gt;,
+ 'w-y-i' : &lt;'ゐ'&gt;,
+ 'w-y-e' : &lt;'ゑ'&gt;
+ }&gt;
+ }
+ </default>
+ <summary>List</summary>
+ <description></description>
+ </key>
+ </schema>
+ <schema path="/org/freedesktop/ibus/engine/anthy/kana-typing-rule/"
+ id="org.freedesktop.ibus.engine.anthy.kana-typing-rule">
+ <key name="method" type="s">
+ <default>'jp'</default>
+ <summary>Method</summary>
+ <description></description>
+ </key>
+ <key name="list" type="a{sv}">
+ <default>
+ {
+ 'jp': &lt;{
+ <!-- # no modifiers keys -->
+ '1' : &lt;'ぬ'&gt;,
+ '2' : &lt;'ふ'&gt;,
+ '3' : &lt;'あ'&gt;,
+ '4' : &lt;'う'&gt;,
+ '5' : &lt;'え'&gt;,
+ '6' : &lt;'お'&gt;,
+ '7' : &lt;'や'&gt;,
+ '8' : &lt;'ゆ'&gt;,
+ '9' : &lt;'よ'&gt;,
+ '0' : &lt;'わ'&gt;,
+ 'minus' : &lt;'ほ'&gt;,
+ 'asciicircum' : &lt;'へ'&gt;,
+
+ 'q' : &lt;'た'&gt;,
+ 'w' : &lt;'て'&gt;,
+ 'e' : &lt;'い'&gt;,
+ 'r' : &lt;'す'&gt;,
+ 't' : &lt;'か'&gt;,
+ 'y' : &lt;'ん'&gt;,
+ 'u' : &lt;'な'&gt;,
+ 'i' : &lt;'に'&gt;,
+ 'o' : &lt;'ら'&gt;,
+ 'p' : &lt;'せ'&gt;,
+ 'at' : &lt;'゛'&gt;,
+ 'bracketleft' : &lt;'゜'&gt;,
+
+ 'a' : &lt;'ち'&gt;,
+ 's' : &lt;'と'&gt;,
+ 'd' : &lt;'し'&gt;,
+ 'f' : &lt;'は'&gt;,
+ 'g' : &lt;'き'&gt;,
+ 'h' : &lt;'く'&gt;,
+ 'j' : &lt;'ま'&gt;,
+ 'k' : &lt;'の'&gt;,
+ 'l' : &lt;'り'&gt;,
+ 'semicolon' : &lt;'れ'&gt;,
+ 'colon' : &lt;'け'&gt;,
+ 'bracketright' : &lt;'む'&gt;,
+
+ 'z' : &lt;'つ'&gt;,
+ 'x' : &lt;'さ'&gt;,
+ 'c' : &lt;'そ'&gt;,
+ 'v' : &lt;'ひ'&gt;,
+ 'b' : &lt;'こ'&gt;,
+ 'n' : &lt;'み'&gt;,
+ 'm' : &lt;'も'&gt;,
+ 'comma' : &lt;'ね'&gt;,
+ 'period' : &lt;'る'&gt;,
+ 'slash' : &lt;'め'&gt;,
+<!-- 'backslash' : &lt;'ー'&gt;, -->
+ 'backslash' : &lt;'ろ'&gt;,
+
+ <!-- # shift modifiered keys -->
+ 'exclam' : &lt;'ぬ'&gt;,
+ 'quotedbl' : &lt;'ふ'&gt;,
+ 'numbersign' : &lt;'ぁ'&gt;,
+ 'dollar' : &lt;'ぅ'&gt;,
+ 'percent' : &lt;'ぇ'&gt;,
+ 'ampersand' : &lt;'ぉ'&gt;,
+ 'apostrophe' : &lt;'ゃ'&gt;,
+ 'parenleft' : &lt;'ゅ'&gt;,
+ 'parenright' : &lt;'ょ'&gt;,
+ 'asciitilde' : &lt;'を'&gt;,
+ 'equal' : &lt;'ゑ'&gt;,
+ 'bar' : &lt;'ー'&gt;,
+
+ 'largeq' : &lt;'た'&gt;,
+ 'largew' : &lt;'て'&gt;,
+ 'largee' : &lt;'ぃ'&gt;,
+ 'larger' : &lt;'す'&gt;,
+ 'larget' : &lt;'ヵ'&gt;,
+ 'largey' : &lt;'ん'&gt;,
+ 'largeu' : &lt;'な'&gt;,
+ 'largei' : &lt;'に'&gt;,
+ 'largeo' : &lt;'ら'&gt;,
+ 'largep' : &lt;'せ'&gt;,
+ 'grave' : &lt;'゛'&gt;,
+
+ 'braceleft' : &lt;'「'&gt;,
+
+ 'largea' : &lt;'ち'&gt;,
+ 'larges' : &lt;'と'&gt;,
+ 'larged' : &lt;'し'&gt;,
+ 'largef' : &lt;'ゎ'&gt;,
+ 'largeg' : &lt;'き'&gt;,
+ 'largeh' : &lt;'く'&gt;,
+ 'largej' : &lt;'ま'&gt;,
+ 'largek' : &lt;'の'&gt;,
+ 'largel' : &lt;'り'&gt;,
+ 'plus' : &lt;'れ'&gt;,
+ 'asterisk' : &lt;'ヶ'&gt;,
+
+ 'braceright' : &lt;'」'&gt;,
+
+ 'largez' : &lt;'っ'&gt;,
+ 'largex' : &lt;'さ'&gt;,
+ 'largec' : &lt;'そ'&gt;,
+ 'largev' : &lt;'ゐ'&gt;,
+ 'largeb' : &lt;'こ'&gt;,
+ 'largen' : &lt;'み'&gt;,
+ 'largem' : &lt;'も'&gt;,
+ 'less' : &lt;'、'&gt;,
+ 'greater' : &lt;'。'&gt;,
+
+ 'question' : &lt;'・'&gt;,
+ 'underscore' : &lt;'ろ'&gt;,
+
+ 'yen' : &lt;'ー'&gt;
+ }&gt;,
+ 'us': &lt;{
+ <!-- # no modifiers keys -->
+ 'grave' : &lt;'ろ'&gt;,
+ '1' : &lt;'ぬ'&gt;,
+ '2' : &lt;'ふ'&gt;,
+ '3' : &lt;'あ'&gt;,
+ '4' : &lt;'う'&gt;,
+ '5' : &lt;'え'&gt;,
+ '6' : &lt;'お'&gt;,
+ '7' : &lt;'や'&gt;,
+ '8' : &lt;'ゆ'&gt;,
+ '9' : &lt;'よ'&gt;,
+ '0' : &lt;'わ'&gt;,
+ 'minus' : &lt;'ほ'&gt;,
+ 'equal' : &lt;'へ'&gt;,
+
+ 'q' : &lt;'た'&gt;,
+ 'w' : &lt;'て'&gt;,
+ 'e' : &lt;'い'&gt;,
+ 'r' : &lt;'す'&gt;,
+ 't' : &lt;'か'&gt;,
+ 'y' : &lt;'ん'&gt;,
+ 'u' : &lt;'な'&gt;,
+ 'i' : &lt;'に'&gt;,
+ 'o' : &lt;'ら'&gt;,
+ 'p' : &lt;'せ'&gt;,
+ 'bracketleft' : &lt;'゛'&gt;,
+ 'bracketright' : &lt;'゜'&gt;,
+<!-- 'backslash' : &lt;'ー'&gt;, -->
+ 'backslash' : &lt;'む'&gt;,
+
+ 'a' : &lt;'ち'&gt;,
+ 's' : &lt;'と'&gt;,
+ 'd' : &lt;'し'&gt;,
+ 'f' : &lt;'は'&gt;,
+ 'g' : &lt;'き'&gt;,
+ 'h' : &lt;'く'&gt;,
+ 'j' : &lt;'ま'&gt;,
+ 'k' : &lt;'の'&gt;,
+ 'l' : &lt;'り'&gt;,
+ 'semicolon' : &lt;'れ'&gt;,
+ 'apostrophe' : &lt;'け'&gt;,
+
+ 'z' : &lt;'つ'&gt;,
+ 'x' : &lt;'さ'&gt;,
+ 'c' : &lt;'そ'&gt;,
+ 'v' : &lt;'ひ'&gt;,
+ 'b' : &lt;'こ'&gt;,
+ 'n' : &lt;'み'&gt;,
+ 'm' : &lt;'も'&gt;,
+ 'comma' : &lt;'ね'&gt;,
+ 'period' : &lt;'る'&gt;,
+ 'slash' : &lt;'め'&gt;,
+
+ <!-- # shift modifiered keys -->
+ 'asciitilde' : &lt;'ろ'&gt;,
+ 'exclam' : &lt;'ぬ'&gt;,
+ 'at' : &lt;'ふ'&gt;,
+ 'numbersign' : &lt;'ぁ'&gt;,
+ 'dollar' : &lt;'ぅ'&gt;,
+ 'percent' : &lt;'ぇ'&gt;,
+ 'asciicircum' : &lt;'ぉ'&gt;,
+ 'ampersand' : &lt;'ゃ'&gt;,
+ 'asterisk' : &lt;'ゅ'&gt;,
+ 'parenleft' : &lt;'ょ'&gt;,
+ 'parenright' : &lt;'を'&gt;,
+ 'underscore' : &lt;'ー'&gt;,
+ 'plus' : &lt;'ゑ'&gt;,
+
+ 'largeq' : &lt;'た'&gt;,
+ 'largew' : &lt;'て'&gt;,
+ 'largee' : &lt;'ぃ'&gt;,
+ 'larger' : &lt;'す'&gt;,
+ 'larget' : &lt;'ヵ'&gt;,
+ 'largey' : &lt;'ん'&gt;,
+ 'largeu' : &lt;'な'&gt;,
+ 'largei' : &lt;'に'&gt;,
+ 'largeo' : &lt;'ら'&gt;,
+ 'largep' : &lt;'せ'&gt;,
+ 'braceleft' : &lt;'「'&gt;,
+
+ 'braceright' : &lt;'」'&gt;,
+
+ 'bar' : &lt;'む'&gt;,
+
+ 'largea' : &lt;'ち'&gt;,
+ 'larges' : &lt;'と'&gt;,
+ 'larged' : &lt;'し'&gt;,
+ 'largef' : &lt;'ゎ'&gt;,
+ 'largeg' : &lt;'き'&gt;,
+ 'largeh' : &lt;'く'&gt;,
+ 'largej' : &lt;'ま'&gt;,
+ 'largek' : &lt;'の'&gt;,
+ 'largel' : &lt;'り'&gt;,
+ 'colon' : &lt;'れ'&gt;,
+ 'quotedbl' : &lt;'ヶ'&gt;,
+
+ 'largez' : &lt;'っ'&gt;,
+ 'largex' : &lt;'さ'&gt;,
+ 'largec' : &lt;'そ'&gt;,
+ 'largev' : &lt;'ゐ'&gt;,
+ 'largeb' : &lt;'こ'&gt;,
+ 'largen' : &lt;'み'&gt;,
+ 'largem' : &lt;'も'&gt;,
+ 'less' : &lt;'、'&gt;,
+ 'greater' : &lt;'。'&gt;,
+
+ 'question' : &lt;'・'&gt;
+ }&gt;
+ }
+ </default>
+ <summary>List</summary>
+ <description></description>
+ </key>
+ </schema>
+ <schema path="/org/freedesktop/ibus/engine/anthy/thumb/"
+ id="org.freedesktop.ibus.engine.anthy.thumb">
+ <key name="keyboard-layout-mode" type="b">
+ <default>true</default>
+ <summary>Keyboard Layout Mode</summary>
+ <description></description>
+ </key>
+ <key name="keyboard-layout" type="i">
+ <default>0</default>
+ <summary>Keyboard Layout</summary>
+ <description></description>
+ </key>
+ <key name="fmv-extension" type="i">
+ <default>2</default>
+ <summary>FMV Extension</summary>
+ <description></description>
+ </key>
+ <key name="handakuten" type="b">
+ <default>false</default>
+ <summary>FMV Extension</summary>
+ <description></description>
+ </key>
+ <key name="rs" type="s">
+ <default>'Henkan'</default>
+ <summary>Right S</summary>
+ <description></description>
+ </key>
+ <key name="ls" type="s">
+ <default>'Muhenkan'</default>
+ <summary>Left S</summary>
+ <description></description>
+ </key>
+ <key name="t1" type="i">
+ <default>100</default>
+ <summary>T1</summary>
+ <description></description>
+ </key>
+ <key name="t2" type="i">
+ <default>75</default>
+ <summary>T2</summary>
+ <description></description>
+ </key>
+ </schema>
+ <schema path="/org/freedesktop/ibus/engine/anthy/thumb-typing-rule/"
+ id="org.freedesktop.ibus.engine.anthy.thumb-typing-rule">
+ <key name="method" type="s">
+ <default>'base'</default>
+ <summary>Method</summary>
+ <description></description>
+ </key>
+ <key name="list" type="a{sv}">
+ <default>
+ {
+ 'base': &lt;{
+ 'q' : &lt;['。', '', 'ぁ']&gt;,
+ 'w' : &lt;['か', 'が', 'え']&gt;,
+ 'e' : &lt;['た', 'だ', 'り']&gt;,
+ 'r' : &lt;['こ', 'ご', 'ゃ']&gt;,
+ 't' : &lt;['さ', 'ざ', 'れ']&gt;,
+
+ 'y' : &lt;['ら', 'よ', 'ぱ']&gt;,
+ 'u' : &lt;['ち', 'に', 'ぢ']&gt;,
+ 'i' : &lt;['く', 'る', 'ぐ']&gt;,
+ 'o' : &lt;['つ', 'ま', 'づ']&gt;,
+ 'p' : &lt;[',', 'ぇ', 'ぴ']&gt;,
+ 'at' : &lt;['、', '', '']&gt;,
+ 'bracketleft' : &lt;['゛', '゜', '']&gt;,
+
+ 'a' : &lt;['う', '', 'を']&gt;,
+ 's' : &lt;['し', 'じ', 'あ']&gt;,
+ 'd' : &lt;['て', 'で', 'な']&gt;,
+ 'f' : &lt;['け', 'げ', 'ゅ']&gt;,
+ 'g' : &lt;['せ', 'ぜ', 'も']&gt;,
+
+ 'h' : &lt;['は', 'み', 'ば']&gt;,
+ 'j' : &lt;['と', 'お', 'ど']&gt;,
+ 'k' : &lt;['き', 'の', 'ぎ']&gt;,
+ 'l' : &lt;['い', 'ょ', 'ぽ']&gt;,
+ 'semicolon' : &lt;['ん', 'っ', '']&gt;,
+
+ 'z' : &lt;['.', '', 'ぅ']&gt;,
+ 'x' : &lt;['ひ', 'び', 'ー']&gt;,
+ 'c' : &lt;['す', 'ず', 'ろ']&gt;,
+ 'v' : &lt;['ふ', 'ぶ', 'や']&gt;,
+ 'b' : &lt;['へ', 'べ', 'ぃ']&gt;,
+
+ 'n' : &lt;['め', 'ぬ', 'ぷ']&gt;,
+ 'm' : &lt;['そ', 'ゆ', 'ぞ']&gt;,
+ 'comma' : &lt;['ね', 'む', 'ぺ']&gt;,
+ 'period' : &lt;['ほ', 'わ', 'ぼ']&gt;,
+ 'slash' : &lt;['・', 'ぉ', '']&gt;,
+
+ '1' : &lt;['1', '', '?']&gt;,
+ '2' : &lt;['2', '', '/']&gt;,
+ '4' : &lt;['4', '', '「']&gt;,
+ '5' : &lt;['5', '', '」']&gt;,
+
+ '6' : &lt;['6', '[', '']&gt;,
+ '7' : &lt;['7', ']', '']&gt;,
+ '8' : &lt;['8', '(', '']&gt;,
+ '9' : &lt;['9', ')', '']&gt;,
+ 'backslash' : &lt;['¥', '', '']&gt;
+ }&gt;,
+ 'nicola-j-table': &lt;{
+ 'colon' : &lt;[':', '', '']&gt;,
+ 'at' : &lt;['、', '', '']&gt;,
+ 'bracketleft' : &lt;['゛', '゜', '']&gt;,
+ 'bracketright' : &lt;['」', '', '']&gt;,
+ '8' : &lt;['8', '(', '']&gt;,
+ '9' : &lt;['9', ')', '']&gt;,
+ '0' : &lt;['0', '', '']&gt;
+ }&gt;,
+ 'nicola-a-table': &lt;{
+ 'colon' : &lt;[':', '', '']&gt;,
+ 'at' : &lt;['@', '', '']&gt;,
+ 'bracketleft' : &lt;['、', '', '']&gt;,
+ 'bracketright' : &lt;['゛', '゜', '']&gt;,
+ '8' : &lt;['8', '', '']&gt;,
+ '9' : &lt;['9', '(', '']&gt;,
+ '0' : &lt;['0', ')', '']&gt;
+ }&gt;,
+ 'nicola-f-table': &lt;{
+ 'colon' : &lt;['、', '', '']&gt;,
+ 'at' : &lt;['@', '', '']&gt;,
+ 'bracketleft' : &lt;['゛', '゜', '']&gt;,
+ 'bracketright' : &lt;['」', '', '']&gt;,
+ '8' : &lt;['8', '(', '']&gt;,
+ '9' : &lt;['9', ')', '']&gt;,
+ '0' : &lt;['0', '', '']&gt;
+ }&gt;,
+ 'kb231-j-fmv-table': &lt;{
+ '3' : &lt;['3', '', '~']&gt;,
+ '0' : &lt;['0', '『', '']&gt;,
+ 'minus' : &lt;['-', '』', '']&gt;,
+ 'equal' : &lt;['=', '', '']&gt;
+ }&gt;,
+ 'kb231-a-fmv-table': &lt;{
+ '3' : &lt;['3', '', '~']&gt;,
+ '0' : &lt;['0', ')', '']&gt;,
+ 'minus' : &lt;['-', '『', '']&gt;,
+ 'equal' : &lt;['=', '』', '']&gt;
+ }&gt;,
+ 'kb231-f-fmv-table': &lt;{
+ '3' : &lt;['3', '', '~']&gt;,
+ '0' : &lt;['0', '『', '']&gt;,
+ 'minus' : &lt;['-', '』', '']&gt;,
+ 'equal' : &lt;['=', '', '']&gt;
+ }&gt;,
+ 'kb611-j-fmv-table': &lt;{
+ 'grave' : &lt;['‘', '', '']&gt;,
+ 'asciicircum' : &lt;['々', '£', '']&gt;,
+ 'colon' : &lt;[':', '', '']&gt;,
+ 'at' : &lt;['、', '¢', '']&gt;,
+ 'bracketleft' : &lt;['゛', '゜', '']&gt;,
+ <!-- # keysyms are same and keycodes depend on the platforms. -->
+<!-- '¥' : &lt;[u'¥', u'¬', u'']&gt;, -->
+ 'backslash' : &lt;['¥', '¦', '']&gt;
+ }&gt;,
+ 'kb611-a-fmv-table': &lt;{
+ 'grave' : &lt;['々', '', '£']&gt;,
+ 'colon' : &lt;[':', '', '']&gt;,
+ 'at' : &lt;['@', '', '']&gt;,
+ 'bracketleft' : &lt;['、', '¢', '']&gt;,
+<!-- '¥' : &lt;[u'¥', u'¬', u'']&gt;, -->
+ 'backslash' : &lt;['¥', '¦', '']&gt;
+ }&gt;,
+ 'kb611-f-fmv-table': &lt;{
+ 'grave' : &lt;['‘', '', '']&gt;,
+ 'asciicircum' : &lt;['々', '£', '']&gt;,
+ 'colon' : &lt;['、', '¢', '']&gt;,
+ 'at' : &lt;['@', '', '']&gt;,
+ 'bracketleft' : &lt;['゛', '゜', '']&gt;,
+<!-- '¥' : &lt;[u'¥', u'¬', u'']&gt;, -->
+ 'backslash' : &lt;['¥', '¦', '']&gt;
+ }&gt;
+ }
+ </default>
+ <summary>List</summary>
+ <description></description>
+ </key>
+ </schema>
+ <schema path="/org/freedesktop/ibus/engine/anthy/dict/"
+ id="org.freedesktop.ibus.engine.anthy.dict">
+ <key name="template" type="v">
+ <default>
+ &lt;('template', '', '', '', false, 300, false, true, false, 'utf-8')&gt;
+ </default>
+ <summary>Template Dictionary</summary>
+ <description></description>
+ </key>
+ <key name="list" type="av">
+ <!-- key type="a(sssbi)" name="dict-items" -->
+ <!-- default>[]</default -->
+ <default>
+ [
+ &lt;('embedded', '般', 'General', '', true, 0, true, true, false, 'utf-8')&gt;,
+ &lt;('zipcode', '〒', 'Zip Code Conversion', '', true, -1, false, true, false, 'utf-8')&gt;,
+ &lt;('symbol', '記', 'Symbol', '', true, -1, true, false, false, 'utf-8')&gt;,
+ &lt;('oldchar', '旧', 'Old Character Style', '', true, -1, false, true, false, 'utf-8')&gt;,
+ &lt;('era', '年', 'Era', '', true, -1, false, true, false, 'utf-8')&gt;,
+ &lt;('emoji', '😊', 'Emoji', '', true, -1, false, true, false, 'utf-8')&gt;
+ ]
+ </default>
+ <summary>Lists</summary>
+ <description></description>
+ </key>
+ <key name="files" type="a{sv}">
+ <default>
+ {
+ 'oldchar': &lt;['@pkgdatadir@/dicts/oldchar.t']&gt;,
+ 'era': &lt;['@pkgdatadir@/dicts/era.t']&gt;,
+ 'zipcode': &lt;['@pkgdatadir@/dicts/zipcode.t']&gt;,
+ 'symbol': &lt;['@pkgdatadir@/dicts/symbol.t']&gt;,
+ 'emoji': &lt;['@pkgdatadir@/dicts/emoji.t']&gt;
+ }
+ </default>
+ <summary>Files</summary>
+ <description></description>
+ </key>
+ <key name="order" type="as">
+ <default>[]</default>
+ <summary>Order</summary>
+ <description></description>
+ </key>
+ </schema>
+ <schema path="/org/freedesktop/ibus/engine/anthy/shortcut/"
+ id="org.freedesktop.ibus.engine.anthy.shortcut">
+ <key name="default" type="a{sv}">
+ <default>
+ {
+ 'on_off': &lt;[@ON_OFF_KEYS@]&gt;,
+ 'circle_input_mode': &lt;['Ctrl+comma', 'Ctrl+less']&gt;,
+ <!-- # Removed Hiragana_Katakana key in circle_kana_mode
+ for latin_with_shift.
+ -->
+ 'circle_kana_mode': &lt;['Ctrl+period', 'Ctrl+greater']&gt;,
+<!-- 'cancel_pseudo_ascii_mode_key': &lt;['Escape']&gt;, -->
+ 'circle_typing_method': &lt;['Alt+Romaji', 'Ctrl+slash']&gt;,
+ 'circle_dict_method': &lt;['Alt+Henkan']&gt;,
+
+ 'insert_space': &lt;['space']&gt;,
+ 'insert_alternate_space': &lt;['Shift+space']&gt;,
+ 'backspace': &lt;['BackSpace', 'Ctrl+H']&gt;,
+ 'delete': &lt;['Delete', 'Ctrl+D']&gt;,
+ 'commit': &lt;['Return', 'KP_Enter', 'Ctrl+J', 'Ctrl+M']&gt;,
+ 'convert': &lt;['space', 'KP_Space', 'Henkan']&gt;,
+ 'predict': &lt;['Tab', 'ISO_Left_Tab']&gt;,
+ 'cancel': &lt;['Escape', 'Ctrl+G']&gt;,
+ 'reconvert': &lt;['Shift+Henkan']&gt;,
+
+ 'move_caret_first': &lt;['Ctrl+A', 'Home']&gt;,
+ 'move_caret_last': &lt;['Ctrl+E', 'End']&gt;,
+ 'move_caret_forward': &lt;['Right', 'Ctrl+F']&gt;,
+ 'move_caret_backward': &lt;['Left', 'Ctrl+B']&gt;,
+
+ 'select_first_segment': &lt;['Ctrl+A', 'Home']&gt;,
+ 'select_last_segment': &lt;['Ctrl+E', 'End']&gt;,
+ 'select_next_segment': &lt;['Right', 'Ctrl+F']&gt;,
+ 'select_prev_segment': &lt;['Left', 'Ctrl+B']&gt;,
+ 'shrink_segment': &lt;['Shift+Left', 'Ctrl+I']&gt;,
+ 'expand_segment': &lt;['Shift+Right', 'Ctrl+O']&gt;,
+ 'commit_first_segment': &lt;['Shift+Down']&gt;,
+ 'commit_selected_segment': &lt;['Ctrl+Down']&gt;,
+
+ 'select_first_candidate': &lt;['Home']&gt;,
+ 'select_last_candidate': &lt;['End']&gt;,
+ 'select_next_candidate': &lt;['space', 'KP_Space', 'Tab', 'ISO_Left_Tab', 'Henkan', 'Down', 'KP_Add', 'Ctrl+N']&gt;,
+ 'select_prev_candidate': &lt;['Shift+Tab', 'Shift+ISO_Left_Tab', 'Up', 'KP_Subtract', 'Ctrl+P']&gt;,
+ 'candidates_page_up': &lt;['Page_Up']&gt;,
+ 'candidates_page_down': &lt;['Page_Down', 'KP_Tab']&gt;,
+
+ 'select_candidates_1': &lt;['1']&gt;,
+ 'select_candidates_2': &lt;['2']&gt;,
+ 'select_candidates_3': &lt;['3']&gt;,
+ 'select_candidates_4': &lt;['4']&gt;,
+ 'select_candidates_5': &lt;['5']&gt;,
+ 'select_candidates_6': &lt;['6']&gt;,
+ 'select_candidates_7': &lt;['7']&gt;,
+ 'select_candidates_8': &lt;['8']&gt;,
+ 'select_candidates_9': &lt;['9']&gt;,
+ 'select_candidates_0': &lt;['0']&gt;,
+
+ 'convert_to_char_type_forward': &lt;['Muhenkan']&gt;,
+ 'convert_to_hiragana': &lt;['F6']&gt;,
+ 'convert_to_katakana': &lt;['F7']&gt;,
+ 'convert_to_half': &lt;['F8']&gt;,
+ 'convert_to_half_katakana': &lt;['Shift+F8']&gt;,
+ 'convert_to_wide_latin': &lt;['F9']&gt;,
+ 'convert_to_latin': &lt;['F10']&gt;,
+ 'convert_to_hiragana_all': &lt;['Shift+F6']&gt;,
+ 'convert_to_katakana_all': &lt;['Shift+F7']&gt;,
+ 'convert_to_wide_latin_all': &lt;['Shift+F9']&gt;,
+ 'convert_to_latin_all': &lt;['Shift+F10']&gt;,
+
+ 'dict_admin': &lt;['F11']&gt;,
+ 'add_word': &lt;['F12']&gt;,
+
+ 'hiragana_for_latin_with_shift': &lt;['Hiragana_Katakana']&gt;
+ }
+ </default>
+ <summary>Default</summary>
+ <description></description>
+ </key>
+ <key name="atok" type="a{sv}">
+ <default>
+ {
+ 'on_off': &lt;['Henkan', 'Eisu_toggle', 'Zenkaku_Hankaku']&gt;,
+ 'circle_input_mode': &lt;['F10']&gt;,
+ 'hiragana_mode': &lt;['Hiragana_Katakana']&gt;,
+ 'katakana_mode': &lt;['Shift+Hiragana_Katakana']&gt;,
+ 'circle_typing_method': &lt;['Romaji', 'Alt+Romaji']&gt;,
+ 'circle_dict_method': &lt;['Alt+Henkan']&gt;,
+ 'convert': &lt;['space', 'Henkan', 'Shift+space', 'Shift+Henkan']&gt;,
+ 'predict': &lt;['Tab']&gt;,
+ 'cancel': &lt;['Escape', 'BackSpace', 'Ctrl+H', 'Ctrl+bracketleft']&gt;,
+ 'commit': &lt;['Return', 'Ctrl+M']&gt;,
+ 'reconvert': &lt;['Shift+Henkan']&gt;,
+
+ 'insert_space': &lt;['space']&gt;,
+ 'insert_alternate_space': &lt;['Shift+space']&gt;,
+ 'backspace': &lt;['BackSpace', 'Ctrl+H']&gt;,
+ 'delete': &lt;['Delete', 'Ctrl+G']&gt;,
+
+ 'move_caret_backward': &lt;['Left', 'Ctrl+K']&gt;,
+ 'move_caret_forward': &lt;['Right', 'Ctrl+L']&gt;,
+ 'move_caret_first': &lt;['Ctrl+Left']&gt;,
+ 'move_caret_last': &lt;['Ctrl+Right']&gt;,
+
+ 'select_prev_segment': &lt;['Shift+Left']&gt;,
+ 'select_next_segment': &lt;['Shift+Right']&gt;,
+ 'select_first_segment': &lt;['Ctrl+Left']&gt;,
+ 'select_last_segment': &lt;['Ctrl+Right']&gt;,
+ 'expand_segment': &lt;['Right', 'Ctrl+L']&gt;,
+ 'shrink_segment': &lt;['Left', 'Ctrl+K']&gt;,
+ 'commit_selected_segment': &lt;['Down', 'Ctrl+N']&gt;,
+
+ 'candidates_page_up': &lt;['Shift+Henkan', 'Page_Up']&gt;,
+ 'candidates_page_down': &lt;['Henkan', 'Page_Down']&gt;,
+ 'select_next_candidate': &lt;['space', 'Tab', 'Henkan', 'Shift+space', 'Shift+Henkan']&gt;,
+ 'select_prev_candidate': &lt;['Up']&gt;,
+
+ 'select_candidates_1': &lt;['1']&gt;,
+ 'select_candidates_2': &lt;['2']&gt;,
+ 'select_candidates_3': &lt;['3']&gt;,
+ 'select_candidates_4': &lt;['4']&gt;,
+ 'select_candidates_5': &lt;['5']&gt;,
+ 'select_candidates_6': &lt;['6']&gt;,
+ 'select_candidates_7': &lt;['7']&gt;,
+ 'select_candidates_8': &lt;['8']&gt;,
+ 'select_candidates_9': &lt;['9']&gt;,
+ 'select_candidates_0': &lt;['0']&gt;,
+
+ 'convert_to_hiragana': &lt;['F6', 'Ctrl+U']&gt;,
+ 'convert_to_katakana': &lt;['F7', 'Ctrl+I']&gt;,
+ 'convert_to_half': &lt;['F8', 'Ctrl+O']&gt;,
+ 'convert_to_half_katakana': &lt;['Shift+F8']&gt;,
+ 'convert_to_wide_latin': &lt;['F9', 'Ctrl+P']&gt;,
+ 'convert_to_latin': &lt;['F10', 'Ctrl+at']&gt;,
+ 'convert_to_hiragana_all': &lt;['Shift+F6']&gt;,
+ 'convert_to_katakana_all': &lt;['Shift+F7']&gt;,
+ 'convert_to_wide_latin_all': &lt;['Shift+F9']&gt;,
+ 'convert_to_latin_all': &lt;['Shift+F10']&gt;,
+
+ 'dict_admin': &lt;['F11']&gt;,
+ 'add_word': &lt;['Ctrl+F7']&gt;,
+
+ 'hiragana_for_latin_with_shift': &lt;['Ctrl+J']&gt;
+ }
+ </default>
+ <summary>ATOK</summary>
+ <description></description>
+ </key>
+ <key name="wnn" type="a{sv}">
+ <default>
+ {
+ 'on_off': &lt;['Shift+space']&gt;,
+ 'convert': &lt;['space']&gt;,
+ 'predict': &lt;['Ctrl+Q']&gt;,
+ 'cancel': &lt;['Escape', 'Ctrl+G', 'Alt+Down', 'Muhenkan']&gt;,
+ 'commit': &lt;['Ctrl+L', 'Ctrl+M', 'Ctrl+J', 'Return']&gt;,
+ 'insert_space': &lt;['space']&gt;,
+ 'backspace': &lt;['Ctrl+H', 'BackSpace']&gt;,
+ 'delete': &lt;['Ctrl+D', 'Delete']&gt;,
+ 'circle_dict_method': &lt;['Alt+Henkan']&gt;,
+
+ 'move_caret_backward': &lt;['Ctrl+B', 'Left']&gt;,
+ 'move_caret_forward': &lt;['Ctrl+F', 'Right']&gt;,
+ 'move_caret_first': &lt;['Ctrl+A', 'Alt+Left']&gt;,
+ 'move_caret_last': &lt;['Ctrl+E', 'Alt+Right']&gt;,
+
+ 'select_prev_segment': &lt;['Ctrl+B', 'Left']&gt;,
+ 'select_next_segment': &lt;['Ctrl+F', 'Right']&gt;,
+ 'select_first_segment': &lt;['Ctrl+A', 'Alt+Left']&gt;,
+ 'select_last_segment': &lt;['Ctrl+E', 'Alt+Right']&gt;,
+ 'expand_segment': &lt;['Ctrl+O', 'F14']&gt;,
+ 'shrink_segment': &lt;['Ctrl+I', 'F13']&gt;,
+
+ 'candidates_page_up': &lt;['Tab']&gt;,
+ 'candidates_page_down': &lt;['Shift+Tab']&gt;,
+ 'select_next_candidate': &lt;['space', 'Ctrl+Q', 'Ctrl+P', 'Down']&gt;,
+ 'select_prev_candidate': &lt;['Ctrl+N', 'Up']&gt;,
+
+ 'select_candidates_1': &lt;['1']&gt;,
+ 'select_candidates_2': &lt;['2']&gt;,
+ 'select_candidates_3': &lt;['3']&gt;,
+ 'select_candidates_4': &lt;['4']&gt;,
+ 'select_candidates_5': &lt;['5']&gt;,
+ 'select_candidates_6': &lt;['6']&gt;,
+ 'select_candidates_7': &lt;['7']&gt;,
+ 'select_candidates_8': &lt;['8']&gt;,
+ 'select_candidates_9': &lt;['9']&gt;,
+ 'select_candidates_0': &lt;['0']&gt;,
+
+ 'convert_to_hiragana': &lt;['F6']&gt;,
+ 'convert_to_katakana': &lt;['F7']&gt;,
+ 'convert_to_half': &lt;['F8']&gt;,
+ 'convert_to_wide_latin': &lt;['F9']&gt;,
+ 'convert_to_latin': &lt;['F10']&gt;,
+ 'convert_to_hiragana_all': &lt;['Shift+F6']&gt;,
+ 'convert_to_katakana_all': &lt;['Shift+F7']&gt;,
+ 'convert_to_half_all': &lt;['Shift+F8']&gt;,
+ 'convert_to_wide_latin_all': &lt;['Shift+F9']&gt;,
+ 'convert_to_latin_all': &lt;['Shift+F10']&gt;,
+
+ 'dict_admin': &lt;['F11']&gt;,
+ 'add_word': &lt;['F12']&gt;,
+
+ 'hiragana_for_latin_with_shift': &lt;['Hiragana_Katakana']&gt;
+ }
+ </default>
+ <summary>WNN</summary>
+ <description></description>
+ </key>
+ </schema>
+</schemalist>
diff --git a/engine/python3/Makefile.am b/engine/python3/Makefile.am
index 47a7574..ec9cdd6 100644
--- a/engine/python3/Makefile.am
+++ b/engine/python3/Makefile.am
@@ -3,8 +3,8 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -102,6 +102,7 @@ _config.py: _config.py.in
-e "s|\@LAYOUT\@|$(LAYOUT)|g" \
-e "s|\@SYMBOL_CHAR_INT\@|$(SYMBOL_CHAR_INT)|g" \
-e "s|\@ICON_PREFERENCE\@|$(ICON_PREFERENCE)|g" \
+ -e "s|\@VERSION\@|$(VERSION)|g" \
$< > $@
test:
diff --git a/engine/python3/_config.py.in b/engine/python3/_config.py.in
index ffb1bbe..a27f082 100644
--- a/engine/python3/_config.py.in
+++ b/engine/python3/_config.py.in
@@ -4,8 +4,8 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,4 +27,5 @@ LOCALEDIR = '@datadir@/locale'
LAYOUT = '@LAYOUT@'
SYMBOL_CHAR = chr(@SYMBOL_CHAR_INT@)
ICON_PREFERENCE = '@ICON_PREFERENCE@'
+VERSION = '@VERSION@'
DEBUG = False
diff --git a/engine/python3/engine.py b/engine/python3/engine.py
index 243eecd..f150a9f 100644
--- a/engine/python3/engine.py
+++ b/engine/python3/engine.py
@@ -157,7 +157,7 @@ class Engine(IBus.EngineSimple):
# cursor_pos=0,
# cursor_visible=True,
# round=True)
- size = self.__prefs.get_value('common', 'page_size')
+ size = self.__prefs.get_value('common', 'page-size')
self.__lookup_table = IBus.LookupTable.new(page_size=size,
cursor_pos=0,
cursor_visible=True,
@@ -179,10 +179,6 @@ class Engine(IBus.EngineSimple):
# use reset to init values
self.__reset()
- ibus_config = bus.get_config()
- if ibus_config != None:
- ibus_config.connect('value-changed',
- self.__config_value_changed_cb)
def __ibus_check_version(self, v):
major = IBus.MAJOR_VERSION
@@ -280,7 +276,7 @@ class Engine(IBus.EngineSimple):
# the engine keeps the class method in the memory.
Engine.__input_mode = INPUT_MODE_HIRAGANA
Engine.__input_mode = self.__prefs.get_value('common',
- 'input_mode')
+ 'input-mode')
if not self.__prefs.get_value('common', 'show-input-mode'):
return
@@ -373,7 +369,7 @@ class Engine(IBus.EngineSimple):
if Engine.__typing_mode == None:
Engine.__typing_mode = jastring.TYPING_MODE_ROMAJI
Engine.__typing_mode = self.__prefs.get_value('common',
- 'typing_method')
+ 'typing-method')
if not self.__prefs.get_value('common', 'show-typing-method'):
return
@@ -441,7 +437,7 @@ class Engine(IBus.EngineSimple):
if Engine.__segment_mode == None:
Engine.__segment_mode = SEGMENT_DEFAULT
Engine.__segment_mode = self.__prefs.get_value('common',
- 'conversion_segment_mode')
+ 'conversion-segment-mode')
if not self.__prefs.get_value('common', 'show-segment-mode'):
return
@@ -521,8 +517,8 @@ class Engine(IBus.EngineSimple):
if not self.__prefs.get_value('common', 'show-dict-mode'):
return
- short_label = self.__prefs.get_value('dict/file/embedded',
- 'short_label')
+ dicts = self.__prefs.get_value('dict', 'list')
+ short_label = dicts['embedded'].short_label
label = _("%(description)s (%(symbol)s)") % \
{ 'description' : _("Dictionary mode"), 'symbol' : short_label }
dict_mode_prop = IBus.Property(key='DictMode',
@@ -538,8 +534,7 @@ class Engine(IBus.EngineSimple):
self.__prop_dict['DictMode'] = dict_mode_prop
props = IBus.PropList()
- long_label = self.__prefs.get_value('dict/file/embedded',
- 'long_label')
+ long_label = dicts['embedded'].long_label
props.append(IBus.Property(key='DictMode.embedded',
prop_type=IBus.PropType.RADIO,
# if long_label is UTF-8
@@ -550,23 +545,31 @@ class Engine(IBus.EngineSimple):
visible=True,
state=IBus.PropState.UNCHECKED,
sub_props=None))
- for file in self.__prefs.get_value('dict', 'files'):
- if not self.__link_dict_file(file):
- continue
- id = self.__get_dict_id_from_file(file)
- section = 'dict/file/' + id
- if not self.__prefs.get_value(section, 'single'):
- continue
+ order = self.__prefs.get_value('dict', 'order')
+ if len(order) == 0:
+ order = list(self.__prefs.get_value('dict', 'files').keys())
+ files = self.__prefs.get_value('dict', 'files')
+ dicts = self.__prefs.get_value('dict', 'list')
+ for id in order:
+ dict_item = dicts[id]
+ is_cont = False
+ for file in files[id]:
+ if not self.__link_dict_file(dict_item, file):
+ is_cont = True
+ break
+ if is_cont:
+ continue
+ if not dict_item.single:
+ continue
key = 'DictMode.' + id
- long_label = self.__prefs.get_value(section, 'long_label')
+ long_label = dict_item.long_label
# ibus-config 'value-changed' signal updated dict/files but
# not dict/file/new yet.
if long_label == None:
continue
- if 'is_system' in self.__prefs.keys(section) and \
- self.__prefs.get_value(section, 'is_system'):
+ if dict_item.is_system:
uni_long_label = _(long_label)
else:
uni_long_label = long_label
@@ -607,8 +610,8 @@ class Engine(IBus.EngineSimple):
if not self.__prefs.get_value('common', 'show-dict-config'):
return
- admin_command = self.__prefs.get_value('common', 'dict_admin_command')
- icon_path = self.__prefs.get_value('common', 'dict_config_icon')
+ admin_command = self.__prefs.get_value('common', 'dict-admin-command')
+ icon_path = self.__prefs.get_value('common', 'dict-config-icon')
if not path.exists(admin_command[0]):
return
@@ -669,20 +672,28 @@ class Engine(IBus.EngineSimple):
return clipboard_text
def __get_single_dict_files(self):
+ order = self.__prefs.get_value('dict', 'order')
+ if len(order) == 0:
+ order = list(self.__prefs.get_value('dict', 'files').keys())
files = self.__prefs.get_value('dict', 'files')
+ dicts = self.__prefs.get_value('dict', 'list')
single_files = []
- for file in files:
- if not path.exists(file):
- continue
- id = self.__get_dict_id_from_file(file)
- section = 'dict/file/' + id
- if self.__prefs.get_value(section, 'single'):
- single_files.append(file)
+ for id in order:
+ for file in files[id]:
+ if not path.exists(file):
+ continue
+ dict_item = dicts[id]
+ if dict_item.single:
+ single_files.append(file)
return single_files
def __remove_dict_files(self):
- for file in self.__prefs.get_value('dict', 'files'):
- self.__remove_dict_file(file)
+ dicts = self.__prefs.get_value('dict', 'list')
+ files = self.__prefs.get_value('dict', 'files')
+ for id in files.keys():
+ dict_item = dicts[id]
+ for file in files[id]:
+ self.__remove_dict_file(dict_item, file)
def update_preedit(self, string, attrs, cursor_pos, visible):
text = IBus.Text.new_from_string(string)
@@ -694,7 +705,7 @@ class Engine(IBus.EngineSimple):
attr.get_start_index(),
attr.get_end_index())
i += 1
- mode = self.__prefs.get_value('common', 'behavior_on_focus_out')
+ mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
if self.__has_update_preedit_text_with_mode and mode == 1:
self.update_preedit_text_with_mode(text,
cursor_pos, visible,
@@ -1011,8 +1022,8 @@ class Engine(IBus.EngineSimple):
self.__context.do_set_personality(str(dict_name))
prop = self.__prop_dict['DictMode']
- section = 'dict/file/' + id
- symbol = self.__prefs.get_value(section, 'short_label')
+ dicts = self.__prefs.get_value('dict', 'list')
+ symbol = dicts[id].short_label
label = _("%(description)s (%(symbol)s)") % \
{ 'description' : _("Dictionary mode"), 'symbol' : symbol }
prop.set_symbol(IBus.Text.new_from_string(symbol))
@@ -1028,19 +1039,19 @@ class Engine(IBus.EngineSimple):
def do_focus_in(self):
self.register_properties(self.__prop_list)
self.__refresh_typing_mode_property()
- mode = self.__prefs.get_value('common', 'behavior_on_focus_out')
+ mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
if mode == 2:
self.__update_input_chars()
# self.__reset()
# self.__invalidate()
- size = self.__prefs.get_value('common', 'page_size')
+ size = self.__prefs.get_value('common', 'page-size')
if size != self.__lookup_table.get_page_size():
self.__lookup_table.set_page_size(size)
def do_focus_out(self):
if self.__has_input_purpose:
self.__input_purpose = 0
- mode = self.__prefs.get_value('common', 'behavior_on_focus_out')
+ mode = self.__prefs.get_value('common', 'behavior-on-focus-out')
if mode == 0 or mode == 1:
self.__reset()
self.__invalidate()
@@ -1641,11 +1652,12 @@ class Engine(IBus.EngineSimple):
#=======================================================================
@classmethod
- def CONFIG_RELOADED(cls, bus):
+ def CONFIG_RELOADED(cls):
if config.DEBUG:
print('RELOADED')
if not cls.__prefs:
- cls.__prefs = AnthyPrefs(bus)
+ cls.__prefs = AnthyPrefs()
+ cls.__prefs.connect('changed', cls.CONFIG_VALUE_CHANGED)
cls._init_prefs()
cls.__keybind = cls._mk_keybind()
@@ -1653,69 +1665,46 @@ class Engine(IBus.EngineSimple):
jastring.JaString.SET_PREFS(cls.__prefs)
@classmethod
- def CONFIG_VALUE_CHANGED(cls, bus, section, name, variant):
+ def CONFIG_VALUE_CHANGED(cls, prefs, section, key, variant):
if config.DEBUG:
- print('VALUE_CHAMGED =', section, name, variant)
-
- if not section.startswith('engine/anthy'):
- # This value is used for IBus.config.set_value only.
- return
-
- # The key was deleted by dconf.
- # test case: update /desktop/ibus/engine/anthy/thumb/ls
- # and reset the key with dconf direclty.
- if variant.get_type_string() == '()':
- cls.__prefs.undo_item(section, name)
- return
-
- value = cls.__prefs.variant_to_value(variant)
- base_sec = section[len(cls.__prefs._prefix) + 1:]
- sec = cls._get_shortcut_type()
- if base_sec == sec:
- cmd = '_Engine__cmd_' + name
- old = cls.__prefs.get_value(sec, name)
- value = value if value != [''] else []
- for s in set(old).difference(value):
- cls.__keybind.get(cls._s_to_key(s), []).remove(cmd)
-
- keys = cls.__prefs.keys(sec)
- for s in set(value).difference(old):
- cls.__keybind.setdefault(cls._s_to_key(s), []).append(cmd)
- cls.__keybind.get(cls._s_to_key(s)).sort(
- key = lambda a: keys.index(a[13:]))
- cls.__prefs.set_value(sec, name, value)
- elif base_sec == 'common':
- cls.__prefs.set_value(base_sec, name, value)
- if name == 'shortcut_type':
+ print('VALUE_CHAMGED =', section, key, variant)
+ if section == 'shortcut':
+ cls.__keybind = cls._mk_keybind()
+ elif section == 'common':
+ if key == 'shortcut-type':
cls.__keybind = cls._mk_keybind()
- if name == 'latin_with_shift':
+ elif key == 'latin-with-shift':
+ value = prefs.get_value(section, key)
cls.__latin_with_shift = value
- jastring.JaString.RESET(cls.__prefs, base_sec, name, value)
- elif base_sec.startswith('kana_typing_rule'):
- jastring.JaString.RESET(cls.__prefs, base_sec, name, value)
+ jastring.JaString.RESET(cls.__prefs, section, key, value)
+ elif section == 'kana-typing-rule':
+ value = prefs.get_value(section, key)
+ jastring.JaString.RESET(cls.__prefs, section, key, value)
+
@classmethod
def _init_prefs(cls):
prefs = cls.__prefs
- value = prefs.get_value('common', 'latin_with_shift')
+ value = prefs.get_value('common', 'latin-with-shift')
cls.__latin_with_shift = value
@classmethod
def _mk_keybind(cls):
keybind = {}
sec = cls._get_shortcut_type()
- for k in cls.__prefs.keys(sec):
+ shortcuts = cls.__prefs.get_value('shortcut', sec)
+ for k in shortcuts.keys():
cmd = '_Engine__cmd_' + k
- for s in cls.__prefs.get_value(sec, k):
+ for s in shortcuts[k]:
keybind.setdefault(cls._s_to_key(s), []).append(cmd)
return keybind
@classmethod
def _get_shortcut_type(cls):
try:
- t = 'shortcut/' + cls.__prefs.get_value('common', 'shortcut_type')
+ t = cls.__prefs.get_value('common', 'shortcut-type')
except:
- t = 'shortcut/default'
+ t = 'default'
return t
@classmethod
@@ -1781,9 +1770,9 @@ class Engine(IBus.EngineSimple):
self._MM = self._SS = 0
ret = self.__on_key_common(ord(keyval))
if (keyval in
- self.__prefs.get_value('common', 'trigger_periods')):
+ self.__prefs.get_value('common', 'trigger-periods')):
behavior = self.__prefs.get_value('common',
- 'behavior_on_period')
+ 'behavior-on-period')
if behavior == 1:
return self.__cmd_convert(keyval, state)
elif behavior == 2:
@@ -1822,7 +1811,7 @@ class Engine(IBus.EngineSimple):
IBus.ModifierType.RELEASE_MASK)
if keyval in KP_Table and self.__prefs.get_value('common',
- 'ten_key_mode'):
+ 'ten-key-mode'):
keyval = KP_Table[keyval]
if state & IBus.ModifierType.RELEASE_MASK:
@@ -1918,7 +1907,7 @@ class Engine(IBus.EngineSimple):
return False
if keyval in KP_Table and self.__prefs.get_value('common',
- 'ten_key_mode'):
+ 'ten-key-mode'):
keyval = KP_Table[keyval]
key = self._mk_key(keyval, state)
@@ -1952,9 +1941,9 @@ class Engine(IBus.EngineSimple):
ret = self.__on_key_common(keyval, state)
if (Engine.__input_mode != INPUT_MODE_LATIN and
chr(keyval) in
- self.__prefs.get_value('common', 'trigger_periods')):
+ self.__prefs.get_value('common', 'trigger-periods')):
behavior = self.__prefs.get_value('common',
- 'behavior_on_period')
+ 'behavior-on-period')
if behavior == 1:
return self.__cmd_convert(keyval, state)
elif behavior == 2:
@@ -2013,7 +2002,7 @@ class Engine(IBus.EngineSimple):
def __get_dict_id_from_file(self, file):
return self.__get_quoted_id(file)
- def __link_dict_file_with_id(self, file, id, link_mode):
+ def __link_dict_file_with_mode(self, id, file, link_mode):
if id == None:
return
if link_mode == LINK_DICT_EMBEDDED:
@@ -2044,7 +2033,7 @@ class Engine(IBus.EngineSimple):
if backup_dir != None:
os.chdir(backup_dir)
- def __remove_dict_file_with_id(self, file, id, link_mode):
+ def __remove_dict_file_with_mode(self, id, file, link_mode):
if id == None:
return
if link_mode == LINK_DICT_EMBEDDED:
@@ -2066,97 +2055,23 @@ class Engine(IBus.EngineSimple):
if backup_dir != None:
os.chdir(backup_dir)
- def __link_dict_file(self, file):
+ def __link_dict_file(self, dict_item, file):
if not path.exists(file):
printerr(file + ' does not exist')
return False
- id = self.__get_dict_id_from_file(file)
- section = 'dict/file/' + id
- if section not in self.__prefs.sections():
- self.__fetch_dict_values(section)
- if self.__prefs.get_value(section, 'embed'):
- self.__link_dict_file_with_id(file, id, LINK_DICT_EMBEDDED)
- if self.__prefs.get_value(section, 'single'):
- self.__link_dict_file_with_id(file, id, LINK_DICT_SINGLE)
+ id = dict_item.id
+ if dict_item.embed:
+ self.__link_dict_file_with_mode(id, file, LINK_DICT_EMBEDDED)
+ if dict_item.single:
+ self.__link_dict_file_with_mode(id, file, LINK_DICT_SINGLE)
return True
- def __remove_dict_file(self, file):
- id = self.__get_dict_id_from_file(file)
- section = 'dict/file/' + id
- if section not in self.__prefs.sections():
- self.__fetch_dict_values(section)
- if self.__prefs.get_value(section, 'embed'):
- self.__remove_dict_file_with_id(file, id, LINK_DICT_EMBEDDED)
- if self.__prefs.get_value(section, 'single'):
- self.__remove_dict_file_with_id(file, id, LINK_DICT_SINGLE)
-
- def __set_dict_files_value(self, base_sec, name, value):
- if name == 'files':
- str_list = []
- for file in value:
- str_list.append(self.__prefs.str(file))
- old_files = self.__prefs.get_value(base_sec, name)
- for file in old_files:
- if file in str_list:
- continue
- self.__remove_dict_file(file)
- for file in str_list:
- if file in old_files:
- continue
- self.__link_dict_file(file)
- self.__prefs.set_value(base_sec, name, str_list)
- else:
- self.__prefs.set_value(base_sec, name, value)
-
- def __fetch_dict_values(self, section):
- self.__prefs.set_new_section(section)
- self.__prefs.set_new_key(section, 'short_label')
- self.__prefs.set_no_key_warning(True)
- self.__prefs.fetch_item(section, 'short_label')
- self.__prefs.set_new_key(section, 'long_label')
- self.__prefs.fetch_item(section, 'long_label')
- self.__prefs.set_new_key(section, 'embed')
- self.__prefs.fetch_item(section, 'embed')
- self.__prefs.set_new_key(section, 'single')
- self.__prefs.fetch_item(section, 'single')
- self.__prefs.set_new_key(section, 'reverse')
- self.__prefs.fetch_item(section, 'reverse')
- self.__prefs.set_no_key_warning(False)
-
- def __config_value_changed_cb(self, ibus_config, section, name, variant):
- if config.DEBUG:
- print('VALUE_CHAMGED =', section, name, variant)
-
- if not section.startswith('engine/anthy'):
- # This value is used for IBus.config.set_value only.
- return
-
- # The key was deleted by dconf.
- # test case: update /desktop/ibus/engine/anthy/thumb/ls
- # and reset the key with dconf direclty.
- if variant.get_type_string() == '()':
- self.__prefs.undo_item(section, name)
- return
-
- value = self.__prefs.variant_to_value(variant)
- base_sec = section[len(self.__prefs._prefix) + 1:]
- sec = self._get_shortcut_type()
-
- if base_sec == 'thumb':
- self.__prefs.set_value(base_sec, name, value)
- self._reset_thumb()
- elif base_sec == 'dict':
- self.__set_dict_files_value(base_sec, name, value)
- self.__set_dict_mode_props(self.__prop_list, True)
- elif base_sec.startswith('dict/file/'):
- if base_sec not in self.__prefs.sections():
- self.__fetch_dict_values(base_sec)
- self.__prefs.set_value(base_sec, name, value)
- self.__set_dict_mode_props(self.__prop_list, True)
- elif base_sec:
- self.__prefs.set_value(base_sec, name, value)
- else:
- self.__prefs.set_value(section, name, value)
+ def __remove_dict_file(self, dict_item, file):
+ id = dict_item.id
+ if dict_item.embed:
+ self.__remove_dict_file_with_mode(id, file, LINK_DICT_EMBEDDED)
+ if dict_item.single:
+ self.__remove_dict_file_with_mode(id, file, LINK_DICT_SINGLE)
#mod_keys
def __set_input_mode(self, mode):
@@ -2287,7 +2202,7 @@ class Engine(IBus.EngineSimple):
def __cmd_insert_space(self, keyval, state):
if Engine.__input_mode == INPUT_MODE_LATIN:
return False
- if (self.__prefs.get_value('common', 'half_width_space') or
+ if (self.__prefs.get_value('common', 'half-width-space') or
Engine.__input_mode == INPUT_MODE_HALF_WIDTH_KATAKANA):
return self.__cmd_insert_half_space(keyval, state)
else:
@@ -2296,7 +2211,7 @@ class Engine(IBus.EngineSimple):
def __cmd_insert_alternate_space(self, keyval, state):
if Engine.__input_mode == INPUT_MODE_LATIN:
return False
- if (self.__prefs.get_value('common', 'half_width_space') or
+ if (self.__prefs.get_value('common', 'half-width-space') or
Engine.__input_mode == INPUT_MODE_HALF_WIDTH_KATAKANA):
return self.__cmd_insert_wide_space(keyval, state)
else:
@@ -2894,11 +2809,11 @@ class Engine(IBus.EngineSimple):
return True
def __start_dict_admin(self):
- command = self.__prefs.get_value('common', 'dict_admin_command')
+ command = self.__prefs.get_value('common', 'dict-admin-command')
os.spawnl(os.P_NOWAIT, *command)
def __start_add_word(self):
- command = self.__prefs.get_value('common', 'add_word_command')
+ command = self.__prefs.get_value('common', 'add-word-command')
os.spawnl(os.P_NOWAIT, *command)
def __start_setup(self):
diff --git a/engine/python3/factory.py b/engine/python3/factory.py
index 4d5cf9f..b7b1e89 100644
--- a/engine/python3/factory.py
+++ b/engine/python3/factory.py
@@ -4,8 +4,8 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -44,19 +44,11 @@ class EngineFactory(IBus.Factory):
def __init__(self, bus):
self.__bus = bus
- engine.Engine.CONFIG_RELOADED(bus)
+ engine.Engine.CONFIG_RELOADED()
super(EngineFactory, self).__init__(object_path=IBus.PATH_FACTORY,
connection=bus.get_connection())
self.__id = 0
- self.__config = self.__bus.get_config()
-
- if self.__config != None:
- self.__config.connect('value-changed',
- self.__config_value_changed_cb)
- else:
- print('ibus-config is not running or bus address is not correct.',
- file=sys.stderr)
bus.get_connection().signal_subscribe('org.freedesktop.DBus',
'org.freedesktop.DBus',
@@ -74,11 +66,8 @@ class EngineFactory(IBus.Factory):
return super(EngineFactory, self).do_create_engine(engine_name)
- def __config_value_changed_cb(self, config, section, name, value):
- engine.Engine.CONFIG_VALUE_CHANGED(self.__bus, section, name, value)
-
def __name_owner_changed_cb(self, connection, sender_name, object_path,
interface_name, signal_name, parameters,
user_data):
if signal_name == 'NameOwnerChanged':
- engine.Engine.CONFIG_RELOADED(self.__bus)
+ engine.Engine.CONFIG_RELOADED()
diff --git a/engine/python3/jastring.py b/engine/python3/jastring.py
index 255799d..b0572da 100644
--- a/engine/python3/jastring.py
+++ b/engine/python3/jastring.py
@@ -4,8 +4,8 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2014 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -78,13 +78,13 @@ class JaString:
cls._prefs = prefs
@classmethod
- def RESET(cls, prefs, section, name, value):
+ def RESET(cls, prefs, section, key, value):
cls._prefs = prefs
- if section.startswith('kana_typing_rule'):
+ if section == 'kana-typing-rule':
mode = TYPING_MODE_KANA
- kana.KanaSegment.RESET(prefs, section, name, value)
+ kana.KanaSegment.RESET(prefs, section, key, value)
cls._init_mode(mode)
- if section == 'common' and name == 'latin_with_shift':
+ if section == 'common' and key == 'latin-with-shift':
romaji.RomajiSegment.SET_LATIN_WITH_SHIFT(value)
def set_shift(self, shift):
@@ -241,10 +241,10 @@ class JaString:
self.__cursor = self.__cursor + 1
def _chk_text(self, s):
- period = self._prefs.get_value('common', 'period_style')
- symbol = self._prefs.get_value('common', 'symbol_style')
- half_symbol = self._prefs.get_value('common', 'half_width_symbol')
- half_number = self._prefs.get_value('common', 'half_width_number')
+ period = self._prefs.get_value('common', 'period-style')
+ symbol = self._prefs.get_value('common', 'symbol-style')
+ half_symbol = self._prefs.get_value('common', 'half-width-symbol')
+ half_number = self._prefs.get_value('common', 'half-width-number')
ret = ''
for c in s:
c = c if not period else PeriodTable.get(c, c)
diff --git a/engine/python3/kana.py b/engine/python3/kana.py
index 10e1b96..db1b4c5 100644
--- a/engine/python3/kana.py
+++ b/engine/python3/kana.py
@@ -4,8 +4,8 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2014 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -30,8 +30,9 @@ _UNFINISHED_HIRAGANA = set('かきくけこさしすせそたちつてとはひ
class KanaSegment(segment.Segment):
_prefs = None
- _kana_typing_rule_section = None
+ _kana_typing_rule_method = None
_kana_voiced_consonant_rule = None
+ _kana_voiced_consonant_dict = None
def __init__(self, enchars='', jachars=''):
if not jachars:
@@ -42,24 +43,25 @@ class KanaSegment(segment.Segment):
def INIT_KANA_TYPING_RULE(cls, prefs):
cls._prefs = prefs
if prefs == None:
- cls._kana_typing_rule_section = None
+ cls._kana_typing_rule_method = None
return
- if cls._kana_typing_rule_section == None:
+ if cls._kana_typing_rule_method == None:
cls._init_kana_typing_method()
if cls._kana_voiced_consonant_rule == None and \
- cls._kana_typing_rule_section != None:
+ cls._kana_typing_rule_method != None:
cls._init_kana_voiced_consonant_rule()
@classmethod
def _init_kana_typing_method(cls, method=None):
prefs = cls._prefs
if method == None:
- method = prefs.get_value('kana_typing_rule', 'method')
+ method = prefs.get_value('kana-typing-rule', 'method')
if method == None:
method = 'jp'
- cls._kana_typing_rule_section = 'kana_typing_rule/' + method
- if cls._kana_typing_rule_section not in prefs.sections():
- cls._kana_typing_rule_section = None
+ cls._kana_typing_rule_method = method
+ keymap = prefs.get_value('kana-typing-rule', 'list')
+ if cls._kana_typing_rule_method not in keymap.keys():
+ cls._kana_typing_rule_method = None
@classmethod
def _init_kana_voiced_consonant_rule(cls):
@@ -70,9 +72,10 @@ class KanaSegment(segment.Segment):
# If the customized table provides U+309b with other chars,
# it needs to be detected dynamically.
cls._kana_voiced_consonant_rule = {}
- section = cls._kana_typing_rule_section
- for gkey in prefs.keys(section):
- value = prefs.get_value(section, gkey)
+ method = cls._kana_typing_rule_method
+ keymap = prefs.get_value('kana-typing-rule', 'list')[method]
+ for gkey in keymap.keys():
+ value = keymap[gkey]
key = prefs.typing_from_config_key(gkey)
if key == '':
continue
@@ -88,37 +91,26 @@ class KanaSegment(segment.Segment):
cls._kana_voiced_consonant_rule[rule] = voiced
@classmethod
- def RESET(cls, prefs, section, name, value):
+ def RESET(cls, prefs, section, key, value):
cls._prefs = prefs
- if section == 'kana_typing_rule' and name == 'method' and \
- value != None:
- cls._kana_typing_rule_section = None
- cls._kana_voiced_consonant_rule = None
- cls._init_kana_typing_method(value)
- elif section.startswith('kana_typing_rule/'):
- # Probably it's better to restart ibus by manual
- # instead of saving the emitted values from config.
+ if section == 'kana-typing-rule' and value != None:
+ cls._kana_typing_rule_method = None
cls._kana_voiced_consonant_rule = None
+ cls.INIT_KANA_TYPING_RULE(prefs)
def __get_kana_typing_rule(self, enchars, retval=None):
prefs = self._prefs
value = None
- section = self._kana_typing_rule_section
- if section != None:
+ method = self._kana_typing_rule_method
+ if method != None:
# Need to send Unicode to typing_to_config_key instead of UTF-8
# not to separate U+A5
gkey = prefs.typing_to_config_key(enchars)
if gkey == '':
return None
enchars = gkey
- if enchars in prefs.keys(section):
- value = prefs.str(prefs.str(prefs.get_value(section, enchars)))
- else:
- prefs.set_no_key_warning(True)
- value = prefs.get_value_direct(section, enchars)
- prefs.set_no_key_warning(False)
- if value != None:
- value = prefs.str(prefs.str(value))
+ keymap = prefs.get_value('kana-typing-rule', 'list')[method]
+ value = keymap.get(enchars)
if value == '':
value = None
if value == None:
diff --git a/engine/python3/romaji.py b/engine/python3/romaji.py
index d495120..6fc8d88 100644
--- a/engine/python3/romaji.py
+++ b/engine/python3/romaji.py
@@ -4,8 +4,8 @@
# ibus-anthy - The Anthy engine for IBus
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2010-2014 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2014 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,7 @@ def romaji_correction_rule_get(k, d):
class RomajiSegment(segment.Segment):
_prefs = None
- _romaji_typing_rule_section = None
+ _romaji_typing_rule_method = None
_latin_with_shift = True
_shift_mode = False
@@ -59,14 +59,15 @@ class RomajiSegment(segment.Segment):
def INIT_ROMAJI_TYPING_RULE(cls, prefs):
cls._prefs = prefs
if prefs == None:
- cls._romaji_typing_rule_section = None
+ cls._romaji_typing_rule_method = None
return
- method = prefs.get_value('romaji_typing_rule', 'method')
+ method = prefs.get_value('romaji-typing-rule', 'method')
if method == None:
method = 'default'
- cls._romaji_typing_rule_section = 'romaji_typing_rule/' + method
- if cls._romaji_typing_rule_section not in prefs.sections():
- cls._romaji_typing_rule_section = None
+ cls._romaji_typing_rule_method = method
+ keymap = prefs.get_value('romaji-typing-rule', 'list')
+ if cls._romaji_typing_rule_method not in keymap.keys():
+ cls._romaji_typing_rule_method = None
@classmethod
def SET_LATIN_WITH_SHIFT(cls, latin_with_shift):
@@ -76,19 +77,15 @@ class RomajiSegment(segment.Segment):
def __get_romaji_typing_rule(self, enchars, retval=None):
prefs = self._prefs
value = None
- section = self._romaji_typing_rule_section
- if section != None:
+ method = self._romaji_typing_rule_method
+ if method != None:
# Need to send Unicode to typing_to_config_key instead of UTF-8
# not to separate U+A5
gkey = prefs.typing_to_config_key(enchars)
if gkey == '':
return None
- if gkey in prefs.keys(section):
- value = prefs.get_value(section, gkey)
- else:
- prefs.set_no_key_warning(True)
- value = prefs.get_value_direct(section, gkey)
- prefs.set_no_key_warning(False)
+ keymap = prefs.get_value('romaji-typing-rule', 'list')[method]
+ value = keymap.get(gkey)
if value == '':
value = None
if value == None:
diff --git a/engine/python3/thumb.py b/engine/python3/thumb.py
index 9a5604e..e5fcec9 100644
--- a/engine/python3/thumb.py
+++ b/engine/python3/thumb.py
@@ -5,8 +5,8 @@
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -231,8 +231,7 @@ class ThumbShiftKeyboard:
self.__layout = 0
self.__fmv_extension = 2
self.__handakuten = False
- self.__thumb_typing_rule_section_base = None
- self.__thumb_typing_rule_section = None
+ self.__thumb_typing_rule_method = None
self.__init_thumb_typing_rule()
self.__init_layout_table()
if self.__prefs != None:
@@ -242,34 +241,27 @@ class ThumbShiftKeyboard:
def __init_thumb_typing_rule(self):
prefs = self.__prefs
if prefs == None:
- self.__thumb_typing_rule_section = None
+ self.__thumb_typing_rule_method = None
return
- method = prefs.get_value('thumb_typing_rule', 'method')
+ method = prefs.get_value('thumb-typing-rule', 'method')
if method == None:
method = _THUMB_BASIC_METHOD
- self.__thumb_typing_rule_section_base = 'thumb_typing_rule'
- self.__thumb_typing_rule_section = \
- self.__thumb_typing_rule_section_base + '/' + method
- if self.__thumb_typing_rule_section not in prefs.sections():
- self.__thumb_typing_rule_section = None
+ self.__thumb_typing_rule_method = method
+ keymap = prefs.get_value('thumb-typing-rule', 'list')
+ if self.__thumb_typing_rule_method not in keymap.keys():
+ self.__thumb_typing_rule_method = None
def __init_layout_table(self):
if self.__table != {}:
self.__table.clear()
if self.__r_table != {}:
self.__r_table.clear()
- section_base = self.__thumb_typing_rule_section_base
- section = self.__thumb_typing_rule_section
- if section != None:
+ method = self.__thumb_typing_rule_method
+ if method != None:
prefs = self.__prefs
- for k in prefs.keys(section):
- value = prefs.get_value(section, k)
- ch = prefs.typing_from_config_key(k)
- if ch == '':
- continue
- self.__set_bus_table(ch, value)
- for k in prefs.get_value(section_base, 'newkeys'):
- value = prefs.get_value_direct(section, k)
+ keymap = prefs.get_value('thumb-typing-rule', 'list')[method]
+ for k in keymap.keys():
+ value = keymap.get(k)
ch = prefs.typing_from_config_key(k)
if ch == '':
continue
@@ -310,19 +302,12 @@ class ThumbShiftKeyboard:
sub_table = f_table
if method == None or sub_table == None:
return
- section_base = self.__thumb_typing_rule_section_base
- section = self.__thumb_typing_rule_section
- sub_section = section_base + '/' + method
- if section != None:
+ method = self.__thumb_typing_rule_method
+ if method != None:
prefs = self.__prefs
- for k in prefs.keys(sub_section):
- value = prefs.get_value(sub_section, k)
- ch = prefs.typing_from_config_key(k)
- if ch == '':
- continue
- self.__set_bus_table(ch, value)
- for k in prefs.get_value(section_base, method + '_newkeys'):
- value = prefs.get_value_direct(sub_section, k)
+ keymap = prefs.get_value('thumb-typing-rule', 'list')[method]
+ for k in keymap.keys():
+ value = keymap.get(k)
ch = prefs.typing_from_config_key(k)
if ch == '':
continue
@@ -457,15 +442,15 @@ class ThumbShiftKeyboard:
return layout
def __reset_layout_and_handakuten(self):
- mode = self.__prefs.get_value('thumb', 'keyboard_layout_mode')
+ mode = self.__prefs.get_value('thumb', 'keyboard-layout-mode')
layout = 0
if mode == 1:
layout = self.__get_xkb_layout()
else:
- layout = self.__prefs.get_value('thumb', 'keyboard_layout')
+ layout = self.__prefs.get_value('thumb', 'keyboard-layout')
self.set_layout(layout)
- fmv_extension = self.__prefs.get_value('thumb', 'fmv_extension')
+ fmv_extension = self.__prefs.get_value('thumb', 'fmv-extension')
self.set_fmv_extension(fmv_extension)
handakuten = self.__prefs.get_value('thumb', 'handakuten')
self.set_handakuten(handakuten)
@@ -582,32 +567,25 @@ class ThumbShiftSegment(segment.Segment):
if prefs == None:
cls._thumb_typing_rule_section = None
return
- method = prefs.get_value('thumb_typing_rule', 'method')
+ method = prefs.get_value('thumb-typing-rule', 'method')
if method == None:
method = _THUMB_BASIC_METHOD
- cls._thumb_typing_rule_section_base = 'thumb_typing_rule'
- cls._thumb_typing_rule_section = \
- cls._thumb_typing_rule_section_base + '/' + method
- if cls._thumb_typing_rule_section not in prefs.sections():
- cls._thumb_typing_rule_section = None
+ cls._thumb_typing_rule_method = method
+ keymap = prefs.get_value('thumb-typing-rule', 'list')
+ if cls._thumb_typing_rule_method not in keymap.keys():
+ cls._thumb_typing_rule_method = None
cls._init_layout_table()
@classmethod
def _init_layout_table(cls):
if cls._r_table != {}:
cls._r_table.clear()
- section_base = cls._thumb_typing_rule_section_base
- section = cls._thumb_typing_rule_section
- if section != None:
+ method = cls._thumb_typing_rule_method
+ if method != None:
prefs = cls._prefs
- for k in prefs.keys(section):
- value = prefs.get_value(section, k)
- ch = prefs.typing_from_config_key(k)
- if ch == '':
- continue
- cls._set_bus_table(ch, value)
- for k in prefs.get_value(section_base, 'newkeys'):
- value = prefs.get_value_direct(section, k)
+ keymap = prefs.get_value('thumb-typing-rule', 'list')[method]
+ for k in keymap.keys():
+ value = keymap.get(k)
ch = prefs.typing_from_config_key(k)
if ch == '':
continue
diff --git a/setup/python3/Makefile.am b/setup/python3/Makefile.am
index 948f0a8..4e072e9 100644
--- a/setup/python3/Makefile.am
+++ b/setup/python3/Makefile.am
@@ -4,8 +4,8 @@
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,7 +37,6 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
BUILT_SOURCES = \
_config.py \
- anthyprefs.py \
$(NULL)
libexec_SCRIPTS = ibus-setup-anthy
@@ -82,15 +81,6 @@ ibus-setup-anthy: ibus-setup-anthy.in
-e "s|\@PYTHON\@|$(PYTHON)|g" \
$< > $@
-anthyprefs.py: anthyprefs.py.in
- sed -e "s|\@ANTHY_ZIPCODE_FILE\@|$(ANTHY_ZIPCODE_FILE)|g" \
- -e "s|\@KASUMI_EXEC_FILE\@|$(KASUMI_EXEC_FILE)|g" \
- -e "s|\@KASUMI_ICON_FILE\@|$(KASUMI_ICON_FILE)|g" \
- -e "s|\@ON_OFF_KEYS\@|$(ON_OFF_KEYS)|g" \
- -e "s|\@VERSION\@|$(VERSION)|g" \
- -e "s|\@pkgdatadir\@|$(pkgdatadir)|g" \
- $< > $@
-
_config.py: _config.py.in
sed -e "s|\@pkgdatadir\@|$(pkgdatadir)|g" \
-e "s|\@libexecdir\@|$(libexecdir)|g" \
@@ -98,6 +88,7 @@ _config.py: _config.py.in
-e "s|\@LAYOUT\@|$(LAYOUT)|g" \
-e "s|\@SYMBOL_CHAR_INT\@|$(SYMBOL_CHAR_INT)|g" \
-e "s|\@ICON_PREFERENCE\@|$(ICON_PREFERENCE)|g" \
+ -e "s|\@VERSION\@|$(VERSION)|g" \
$< > $@
# Need a time lag between .py and .py.in files to build .py files
diff --git a/setup/python3/anthyprefs.py b/setup/python3/anthyprefs.py
new file mode 100644
index 0000000..33b2a31
--- /dev/null
+++ b/setup/python3/anthyprefs.py
@@ -0,0 +1,335 @@
+# -*- coding: utf-8 -*-
+# vim:set noet ts=4:
+#
+# ibus-anthy - The Anthy engine for IBus
+#
+# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
+# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+import sys
+
+import _config as config
+from prefs import Prefs
+
+N_ = lambda a : a
+
+__all__ = ['AnthyPrefs']
+
+
+class AnthyPrefs(Prefs):
+ _char_to_config_key = None
+
+ def __init__(self):
+ super(AnthyPrefs, self).__init__()
+
+ def get_japanese_ordered_list(self):
+ return _japanese_ordered_list
+
+ def get_version(self):
+ return config.VERSION
+
+ # Convert gsettings key to typing sequences
+ # E.g. 'largea-bracketleft' to 'A['
+ def typing_from_config_key(self, gkeys):
+ retval = ''
+ for key in gkeys.split('-'):
+ if key in _supported_gsettings_key_chars:
+ retval += key
+ continue
+ try:
+ ch = _config_key_to_char[key]
+ except KeyError:
+ print('Not supported key in gsettings', gkeys, file=sys.stderr)
+ retval = ''
+ break
+ retval += ch
+ return retval
+
+ # Convert typing sequences to gsettings key.
+ # E.g. 'A[' to 'largea-bracketleft'
+ def typing_to_config_key(self, typing):
+ retval = ''
+ if self._char_to_config_key == None:
+ self._char_to_config_key = {}
+ for _key, _ch in list(_config_key_to_char.items()):
+ self._char_to_config_key[_ch] = _key
+ for ch in typing:
+ if ch in _supported_gsettings_key_chars:
+ if retval != '':
+ retval += '-'
+ retval += ch
+ continue
+ try:
+ key = self._char_to_config_key[ch]
+ except KeyError:
+ print('Not supported key in gsettings', typing, file=sys.stderr)
+ retval = ''
+ break
+ if retval != '':
+ retval += '-'
+ retval += key
+ return retval
+
+ def get_value(self, section, key):
+ not_sorted = super(AnthyPrefs, self).get_value(section, key)
+ if section == 'shortcut' and type(not_sorted) == dict:
+ retval = dict.fromkeys(_cmd_keys, [])
+ retval.update(not_sorted)
+ return retval
+ return not_sorted
+
+
+# Sad! dict.keys() doesn't return the saved order.
+# locale.strcoll() also just returns the Unicode code point.
+# Unicode order is wrong in Japanese large 'a' and small 'a'.
+# The workaround is to save the order here...
+_japanese_ordered_list = [
+ 'あ', 'い', 'う', 'え', 'お',
+ 'ぁ', 'ぃ', 'ぅ', 'ぇ', 'ぉ',
+ 'いぇ',
+ 'うぁ', 'うぃ', 'うぅ', 'うぇ', 'うぉ',
+ 'うゃ', 'うゅ', 'うょ',
+ 'か', 'き', 'く', 'け', 'こ',
+ 'ゕ', 'ゖ', 'ヵ', 'ヶ',
+ 'が', 'ぎ', 'ぐ', 'げ', 'ご',
+ 'きゃ', 'きぃ', 'きゅ', 'きぇ', 'きょ',
+ 'くぁ', 'くぃ', 'くぅ', 'くぇ', 'くぉ',
+ 'ぎゃ', 'ぎぃ', 'ぎゅ', 'ぎぇ', 'ぎょ',
+ 'ぐぁ', 'ぐぃ', 'ぐぅ', 'ぐぇ', 'ぐぉ',
+ 'さ', 'し', 'す', 'せ', 'そ',
+ 'ざ', 'じ', 'ず', 'ぜ', 'ぞ',
+ 'しゃ', 'しぃ', 'しゅ', 'しぇ', 'しょ',
+ 'じゃ', 'じぃ', 'じゅ', 'じぇ', 'じょ',
+ 'すぅぃ', 'すぇ',
+ 'ずぇ',
+ 'た', 'ち', 'つ', 'て', 'と',
+ 'だ', 'ぢ', 'づ', 'で', 'ど',
+ 'っ',
+ 'ちゃ', 'ちぃ', 'ちゅ', 'ちぇ', 'ちょ',
+ 'ぢぃ', 'ぢぇ',
+ 'ぢゃ', 'ぢゅ', 'ぢょ',
+ 'つぁ', 'つぃ', 'つぇ', 'つぉ',
+ 'つゃ', 'つぃぇ', 'つゅ', 'つょ',
+ 'づぁ', 'づぃ', 'づぇ', 'づぉ',
+ 'づゃ', 'づぃぇ', 'づゅ', 'づょ',
+ 'てぃ', 'てぇ',
+ 'てゃ', 'てゅ', 'てょ',
+ 'とぅ',
+ 'でぃ', 'でぇ',
+ 'でゃ', 'でゅ', 'でょ',
+ 'どぅ',
+ 'な', 'に', 'ぬ', 'ね', 'の',
+ 'にぃ', 'にぇ',
+ 'にゃ', 'にゅ', 'にょ',
+ 'は', 'ひ', 'ふ', 'へ', 'ほ',
+ 'ば', 'び', 'ぶ', 'べ', 'ぼ',
+ 'ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ',
+ 'ひぃ', 'ひぇ',
+ 'ひゃ', 'ひゅ', 'ひょ',
+ 'びぃ', 'びぇ',
+ 'びゃ', 'びゅ', 'びょ',
+ 'ぴぃ', 'ぴぇ',
+ 'ぴゃ', 'ぴゅ', 'ぴょ',
+ 'ふぁ', 'ふぃ', 'ふぇ', 'ふぉ',
+ 'ふゃ', 'ふゅ', 'ふょ',
+ 'ぶぁ', 'ぶぇ', 'ぶぉ',
+ 'ぷぁ', 'ぷぇ', 'ぷぉ',
+ 'ま', 'み', 'む', 'め', 'も',
+ 'みぃ', 'みぇ',
+ 'みゃ', 'みゅ', 'みょ',
+ 'や', 'ゆ', 'よ',
+ 'ゃ', 'ゅ', 'ょ',
+ 'ら', 'り', 'る', 'れ', 'ろ',
+ 'りぃ', 'りぇ',
+ 'りゃ', 'りゅ', 'りょ',
+ 'わ', 'を', 'ん',
+ 'ゎ',
+ 'ゐ', 'ゑ',
+ 'ー',
+ 'ヴぁ', 'ヴぃ', 'ヴ', 'ヴぇ', 'ヴぉ',
+ 'ヴゃ', 'ヴぃぇ', 'ヴゅ', 'ヴょ',
+]
+
+# http://git.gnome.org/browse/glib/tree/gio/glib-compile-schemas.c#n765
+# gsettings supports keys named by "abcdefghijklmnopqrstuvwxyz0123456789-"
+# and ibus-anthy uses '-' as the delimiter.
+_supported_gsettings_key_chars = "abcdefghijklmnopqrstuvwxyz0123456789"
+
+_config_key_to_char = {
+ # no modifiers keys
+ 'minus' : '-',
+ 'asciicircum' : '^',
+ 'at' : '@',
+ 'bracketleft' : '[',
+ 'semicolon' : ';',
+ 'colon' : ':',
+ 'bracketright' : ']',
+ 'comma' : ',',
+ 'period' : '.',
+ 'slash' : '/',
+ 'backslash' : '\\',
+
+ # shift modifiered keys
+ 'exclam' : '!',
+ 'quotedbl' : '"',
+ 'numbersign' : '#',
+ 'dollar' : '$',
+ 'percent' : '%',
+ 'ampersand' : '&',
+ 'apostrophe' : '\'',
+ 'parenleft' : '(',
+ 'parenright' : ')',
+ 'asciitilde' : '~',
+ 'equal' : '=',
+ 'bar' : '|',
+
+ 'largeq' : 'Q',
+ 'largew' : 'W',
+ 'largee' : 'E',
+ 'larger' : 'R',
+ 'larget' : 'T',
+ 'largey' : 'Y',
+ 'largeu' : 'U',
+ 'largei' : 'I',
+ 'largeo' : 'O',
+ 'largep' : 'P',
+ 'grave' : '`',
+
+ 'braceleft' : '{',
+
+ 'largea' : 'A',
+ 'larges' : 'S',
+ 'larged' : 'D',
+ 'largef' : 'F',
+ 'largeg' : 'G',
+ 'largeh' : 'H',
+ 'largej' : 'J',
+ 'largek' : 'K',
+ 'largel' : 'L',
+ 'plus' : '+',
+ 'asterisk' : '*',
+
+ 'braceright' : '}',
+
+ 'largez' : 'Z',
+ 'largex' : 'X',
+ 'largec' : 'C',
+ 'largev' : 'V',
+ 'largeb' : 'B',
+ 'largen' : 'N',
+ 'largem' : 'M',
+ 'less' : '<',
+ 'greater' : '>',
+
+ 'question' : '?',
+ 'underscore' : '_',
+
+ 'yen' : '¥',
+}
+
+_cmd_keys = [
+ 'on_off',
+ 'circle_input_mode',
+ 'circle_kana_mode',
+ 'circle_typing_method',
+ 'circle_dict_method',
+ 'latin_mode',
+ 'wide_latin_mode',
+ 'hiragana_mode',
+ 'katakana_mode',
+ 'half_katakana_mode',
+# 'cancel_pseudo_ascii_mode_key',
+
+ 'hiragana_for_latin_with_shift',
+
+ 'insert_space',
+ 'insert_alternate_space',
+ 'insert_half_space',
+ 'insert_wide_space',
+ 'backspace',
+ 'delete',
+ 'commit',
+ 'convert',
+ 'predict',
+ 'cancel',
+ 'cancel_all',
+ 'reconvert',
+# 'do_nothing',
+
+ 'select_first_candidate',
+ 'select_last_candidate',
+ 'select_next_candidate',
+ 'select_prev_candidate',
+ 'candidates_page_up',
+ 'candidates_page_down',
+
+ 'move_caret_first',
+ 'move_caret_last',
+ 'move_caret_forward',
+ 'move_caret_backward',
+
+ 'select_first_segment',
+ 'select_last_segment',
+ 'select_next_segment',
+ 'select_prev_segment',
+ 'shrink_segment',
+ 'expand_segment',
+ 'commit_first_segment',
+ 'commit_selected_segment',
+
+ 'select_candidates_1',
+ 'select_candidates_2',
+ 'select_candidates_3',
+ 'select_candidates_4',
+ 'select_candidates_5',
+ 'select_candidates_6',
+ 'select_candidates_7',
+ 'select_candidates_8',
+ 'select_candidates_9',
+ 'select_candidates_0',
+
+ 'convert_to_char_type_forward',
+ 'convert_to_char_type_backward',
+ 'convert_to_hiragana',
+ 'convert_to_katakana',
+ 'convert_to_half',
+ 'convert_to_half_katakana',
+ 'convert_to_wide_latin',
+ 'convert_to_latin',
+ 'convert_to_hiragana_all',
+ 'convert_to_katakana_all',
+ 'convert_to_half_all',
+ 'convert_to_half_katakana_all',
+ 'convert_to_wide_latin_all',
+ 'convert_to_latin_all',
+
+ 'dict_admin',
+ 'add_word',
+
+ 'start_setup',
+]
+
+_dummy_translatable_strings = [
+ N_('General'),
+ N_('Zip Code Conversion'),
+ N_('Symbol'),
+ N_('Old Character Style'),
+ N_('Era'),
+ N_('Emoji'),
+]
diff --git a/setup/python3/anthyprefs.py.in b/setup/python3/anthyprefs.py.in
deleted file mode 100644
index f397568..0000000
--- a/setup/python3/anthyprefs.py.in
+++ /dev/null
@@ -1,1361 +0,0 @@
-# -*- coding: utf-8 -*-
-# vim:set noet ts=4:
-#
-# ibus-anthy - The Anthy engine for IBus
-#
-# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
-# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
-# Copyright (c) 2010-2015 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2015 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-import sys
-
-from prefs import Prefs
-
-N_ = lambda a : a
-
-__all__ = ['AnthyPrefs']
-
-
-class AnthyPrefs(Prefs):
- _prefix = 'engine/anthy'
- _char_to_config_key = None
-
- def __init__(self, bus=None, config=None):
- super(AnthyPrefs, self).__init__(bus, config)
- if _config != None:
- self.default = _config
- self.set_no_key_warning(True)
- self.fetch_all()
- self.set_no_key_warning(False)
-
- def __update_key (self, section, old_key, new_key):
- file = __file__
- if __file__.find('/') >= 0:
- file = __file__[__file__.rindex('/') + 1:]
- warning_message = \
- '(' + file + ') ibus-anthy-WARNING **: ' \
- 'The key (' + old_key + ') will be removed in the future. ' \
- 'Currently the key (' + new_key + ') is used instead. ' \
- 'The ibus keys are defined in ' + \
- '/'.join(['/desktop/ibus', self._prefix, section]) + ' .'
-
- if not self.fetch_item(section, old_key, True):
- return
- print(warning_message, file=sys.stderr)
- if self.fetch_item(section, new_key, True):
- return
-
- self.fetch_item(section, old_key)
- value = self.get_value(section, old_key)
- self.set_value(section, new_key, value)
- self.commit_item(section, new_key)
- self.undo_item(section, new_key)
-
- def keys(self, section):
- if section.startswith('shortcut/'):
- return _cmd_keys
- return list(self.default[section].keys())
-
- def get_japanese_ordered_list(self):
- return _japanese_ordered_list
-
- def get_version(self):
- return '@VERSION@'
-
- # Convert typing sequences to gsettings key.
- # E.g. 'largea-bracketleft' to 'A['
- def typing_from_config_key(self, gkeys):
- retval = ''
- for key in gkeys.split('-'):
- if key in _supported_gsettings_key_chars:
- retval += key
- continue
- try:
- ch = _config_key_to_char[key]
- except KeyError:
- print('Not supported key in gsettings', gkeys, file=sys.stderr)
- retval = ''
- break
- retval += ch
- return retval
-
- # Convert typing sequences to gsettings key.
- # E.g. 'A[' to 'largea-bracketleft'
- def typing_to_config_key(self, typing):
- retval = ''
- if self._char_to_config_key == None:
- self._char_to_config_key = {}
- for _key, _ch in list(_config_key_to_char.items()):
- self._char_to_config_key[_ch] = _key
- for ch in typing:
- if ch in _supported_gsettings_key_chars:
- if retval != '':
- retval += '-'
- retval += ch
- continue
- try:
- key = self._char_to_config_key[ch]
- except KeyError:
- print('Not supported key in gsettings', typing, file=sys.stderr)
- retval = ''
- break
- if retval != '':
- retval += '-'
- retval += key
- return retval
-
-# Sad! dict.keys() doesn't return the saved order.
-# locale.strcoll() also just returns the Unicode code point.
-# Unicode order is wrong in Japanese large 'a' and small 'a'.
-# The workaround is to save the order here...
-_japanese_ordered_list = [
- 'あ', 'い', 'う', 'え', 'お',
- 'ぁ', 'ぃ', 'ぅ', 'ぇ', 'ぉ',
- 'いぇ',
- 'うぁ', 'うぃ', 'うぅ', 'うぇ', 'うぉ',
- 'うゃ', 'うゅ', 'うょ',
- 'か', 'き', 'く', 'け', 'こ',
- 'ゕ', 'ゖ', 'ヵ', 'ヶ',
- 'が', 'ぎ', 'ぐ', 'げ', 'ご',
- 'きゃ', 'きぃ', 'きゅ', 'きぇ', 'きょ',
- 'くぁ', 'くぃ', 'くぅ', 'くぇ', 'くぉ',
- 'ぎゃ', 'ぎぃ', 'ぎゅ', 'ぎぇ', 'ぎょ',
- 'ぐぁ', 'ぐぃ', 'ぐぅ', 'ぐぇ', 'ぐぉ',
- 'さ', 'し', 'す', 'せ', 'そ',
- 'ざ', 'じ', 'ず', 'ぜ', 'ぞ',
- 'しゃ', 'しぃ', 'しゅ', 'しぇ', 'しょ',
- 'じゃ', 'じぃ', 'じゅ', 'じぇ', 'じょ',
- 'すぅぃ', 'すぇ',
- 'ずぇ',
- 'た', 'ち', 'つ', 'て', 'と',
- 'だ', 'ぢ', 'づ', 'で', 'ど',
- 'っ',
- 'ちゃ', 'ちぃ', 'ちゅ', 'ちぇ', 'ちょ',
- 'ぢぃ', 'ぢぇ',
- 'ぢゃ', 'ぢゅ', 'ぢょ',
- 'つぁ', 'つぃ', 'つぇ', 'つぉ',
- 'つゃ', 'つぃぇ', 'つゅ', 'つょ',
- 'づぁ', 'づぃ', 'づぇ', 'づぉ',
- 'づゃ', 'づぃぇ', 'づゅ', 'づょ',
- 'てぃ', 'てぇ',
- 'てゃ', 'てゅ', 'てょ',
- 'とぅ',
- 'でぃ', 'でぇ',
- 'でゃ', 'でゅ', 'でょ',
- 'どぅ',
- 'な', 'に', 'ぬ', 'ね', 'の',
- 'にぃ', 'にぇ',
- 'にゃ', 'にゅ', 'にょ',
- 'は', 'ひ', 'ふ', 'へ', 'ほ',
- 'ば', 'び', 'ぶ', 'べ', 'ぼ',
- 'ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ',
- 'ひぃ', 'ひぇ',
- 'ひゃ', 'ひゅ', 'ひょ',
- 'びぃ', 'びぇ',
- 'びゃ', 'びゅ', 'びょ',
- 'ぴぃ', 'ぴぇ',
- 'ぴゃ', 'ぴゅ', 'ぴょ',
- 'ふぁ', 'ふぃ', 'ふぇ', 'ふぉ',
- 'ふゃ', 'ふゅ', 'ふょ',
- 'ぶぁ', 'ぶぇ', 'ぶぉ',
- 'ぷぁ', 'ぷぇ', 'ぷぉ',
- 'ま', 'み', 'む', 'め', 'も',
- 'みぃ', 'みぇ',
- 'みゃ', 'みゅ', 'みょ',
- 'や', 'ゆ', 'よ',
- 'ゃ', 'ゅ', 'ょ',
- 'ら', 'り', 'る', 'れ', 'ろ',
- 'りぃ', 'りぇ',
- 'りゃ', 'りゅ', 'りょ',
- 'わ', 'を', 'ん',
- 'ゎ',
- 'ゐ', 'ゑ',
- 'ー',
- 'ヴぁ', 'ヴぃ', 'ヴ', 'ヴぇ', 'ヴぉ',
- 'ヴゃ', 'ヴぃぇ', 'ヴゅ', 'ヴょ',
-]
-
-# http://git.gnome.org/browse/glib/tree/gio/glib-compile-schemas.c#n765
-# gsettings supports keys named by "abcdefghijklmnopqrstuvwxyz0123456789-"
-# and ibus-anthy uses '-' as the delimiter.
-_supported_gsettings_key_chars = "abcdefghijklmnopqrstuvwxyz0123456789"
-
-_config_key_to_char = {
- # no modifiers keys
- 'minus' : '-',
- 'asciicircum' : '^',
- 'at' : '@',
- 'bracketleft' : '[',
- 'semicolon' : ';',
- 'colon' : ':',
- 'bracketright' : ']',
- 'comma' : ',',
- 'period' : '.',
- 'slash' : '/',
- 'backslash' : '\\',
-
- # shift modifiered keys
- 'exclam' : '!',
- 'quotedbl' : '"',
- 'numbersign' : '#',
- 'dollar' : '$',
- 'percent' : '%',
- 'ampersand' : '&',
- 'apostrophe' : '\'',
- 'parenleft' : '(',
- 'parenright' : ')',
- 'asciitilde' : '~',
- 'equal' : '=',
- 'bar' : '|',
-
- 'largeq' : 'Q',
- 'largew' : 'W',
- 'largee' : 'E',
- 'larger' : 'R',
- 'larget' : 'T',
- 'largey' : 'Y',
- 'largeu' : 'U',
- 'largei' : 'I',
- 'largeo' : 'O',
- 'largep' : 'P',
- 'grave' : '`',
-
- 'braceleft' : '{',
-
- 'largea' : 'A',
- 'larges' : 'S',
- 'larged' : 'D',
- 'largef' : 'F',
- 'largeg' : 'G',
- 'largeh' : 'H',
- 'largej' : 'J',
- 'largek' : 'K',
- 'largel' : 'L',
- 'plus' : '+',
- 'asterisk' : '*',
-
- 'braceright' : '}',
-
- 'largez' : 'Z',
- 'largex' : 'X',
- 'largec' : 'C',
- 'largev' : 'V',
- 'largeb' : 'B',
- 'largen' : 'N',
- 'largem' : 'M',
- 'less' : '<',
- 'greater' : '>',
-
- 'question' : '?',
- 'underscore' : '_',
-
- 'yen' : '¥',
-}
-
-_cmd_keys = [
- 'on_off',
- 'circle_input_mode',
- 'circle_kana_mode',
- 'circle_typing_method',
- 'circle_dict_method',
- 'latin_mode',
- 'wide_latin_mode',
- 'hiragana_mode',
- 'katakana_mode',
- 'half_katakana_mode',
-# 'cancel_pseudo_ascii_mode_key',
-
- 'hiragana_for_latin_with_shift',
-
- 'insert_space',
- 'insert_alternate_space',
- 'insert_half_space',
- 'insert_wide_space',
- 'backspace',
- 'delete',
- 'commit',
- 'convert',
- 'predict',
- 'cancel',
- 'cancel_all',
- 'reconvert',
-# 'do_nothing',
-
- 'select_first_candidate',
- 'select_last_candidate',
- 'select_next_candidate',
- 'select_prev_candidate',
- 'candidates_page_up',
- 'candidates_page_down',
-
- 'move_caret_first',
- 'move_caret_last',
- 'move_caret_forward',
- 'move_caret_backward',
-
- 'select_first_segment',
- 'select_last_segment',
- 'select_next_segment',
- 'select_prev_segment',
- 'shrink_segment',
- 'expand_segment',
- 'commit_first_segment',
- 'commit_selected_segment',
-
- 'select_candidates_1',
- 'select_candidates_2',
- 'select_candidates_3',
- 'select_candidates_4',
- 'select_candidates_5',
- 'select_candidates_6',
- 'select_candidates_7',
- 'select_candidates_8',
- 'select_candidates_9',
- 'select_candidates_0',
-
- 'convert_to_char_type_forward',
- 'convert_to_char_type_backward',
- 'convert_to_hiragana',
- 'convert_to_katakana',
- 'convert_to_half',
- 'convert_to_half_katakana',
- 'convert_to_wide_latin',
- 'convert_to_latin',
- 'convert_to_hiragana_all',
- 'convert_to_katakana_all',
- 'convert_to_half_all',
- 'convert_to_half_katakana_all',
- 'convert_to_wide_latin_all',
- 'convert_to_latin_all',
-
- 'dict_admin',
- 'add_word',
-
- 'start_setup',
-]
-
-_config = {
- 'common': {
- 'input_mode': 0,
- 'typing_method': 0,
- 'conversion_segment_mode': 0,
-
- 'show-input-mode': True,
- 'show-typing-method': False,
- 'show-segment-mode': False,
- 'show-dict-mode': True,
- 'show-dict-config': False,
- 'show-preferences': True,
-
- 'period_style': 0,
- 'symbol_style': 1,
- 'ten_key_mode': 1,
- 'behavior_on_focus_out': 0,
- 'behavior_on_period': 0,
- 'trigger_periods': ',.、。,.',
-
- 'page_size': 10,
- 'half_width_symbol': False,
- 'half_width_number': False,
- 'half_width_space': False,
- 'latin_with_shift': True,
-
- 'shortcut_type': 'default',
-
- 'dict_admin_command': ['@KASUMI_EXEC_FILE@', 'kasumi'],
- 'add_word_command': ['@KASUMI_EXEC_FILE@', 'kasumi', '-a'],
- 'dict_config_icon': '@KASUMI_ICON_FILE@',
- 'keyboard_layouts': [
- 'default', 'jp', 'us',
- # XKB options requires ibus 1.5.
- 'jp[ctrl:swapcaps]', 'us[ctrl:swapcaps]',
- 'jp[ctrl:swapcaps,compose:rctrl]',
- 'us[ctrl:swapcaps,compose:rctrl]',
- 'jp[japan:kana_lock]',
- 'jp[japan:nicola_f_bs]',
- 'jp[japan:nicola_f_bs,ctrl:swapcaps]',
- 'jp[japan:hztg_escape]',
- 'jp[japan:hztg_escape,ctrl:swapcaps]',
- ],
- },
-
- 'romaji_typing_rule': {
- 'method': 'default',
- # The newkeys list is saved for every romaji_typing_rule/$method
- # so that prefs.get_value_direct() is not used.
- # prefs.fetch_section() doesn't get the keys if they exist
- # in gconf only.
- 'newkeys': [],
- },
-
- ##0 MS-IME
- # http://www.filibeto.org/sun/lib/solaris10-docs/E19253-01/819-7844/appe-1-4/index.html
- ##1 ATOK
- # http://www.filibeto.org/sun/lib/solaris10-docs/E19253-01/819-7844/appe-1-3/index.html
- ##2 Gairaigo http://ja.wikipedia.org/wiki/%E5%A4%96%E6%9D%A5%E8%AA%9E
- ##3 ANSI/BSI Suggestions http://en.wikipedia.org/wiki/Katakana
- ##4 Historical kana http://en.wikipedia.org/wiki/Romanization_of_Japanese
- # Maybe we need a compatibility between MS-IME and ibus-anthy.
- 'romaji_typing_rule/default': {
- 'minus' : 'ー',
- 'a' : 'あ',
- 'i' : 'い',
- 'u' : 'う',
- 'e' : 'え',
- 'o' : 'お',
- 'x-a' : 'ぁ',
- 'x-i' : 'ぃ',
- 'x-u' : 'ぅ',
- 'x-e' : 'ぇ',
- 'x-o' : 'ぉ',
- 'l-a' : 'ぁ',
- 'l-i' : 'ぃ',
- 'l-u' : 'ぅ',
- 'l-e' : 'ぇ',
- 'l-o' : 'ぉ',
- 'w-h-a' : 'うぁ',
- 'w-h-i' : 'うぃ',
- 'w-h-e' : 'うぇ',
- 'w-h-o' : 'うぉ',
- 'w-y-a' : 'うゃ', ##2
- 'w-y-u' : 'うゅ', ##2
- 'w-y-o' : 'うょ', ##2
- 'v-a' : 'ヴぁ',
- 'v-i' : 'ヴぃ',
- 'v-u' : 'ヴ',
- 'v-e' : 'ヴぇ',
- 'v-o' : 'ヴぉ',
- 'v-y-a' : 'ヴゃ', ##2
- 'v-y-u' : 'ヴゅ', ##2
- 'v-y-e' : 'ヴぃぇ', ##2
- 'v-y-o' : 'ヴょ', ##2
- 'k-a' : 'か',
- 'k-i' : 'き',
- 'k-u' : 'く',
- 'k-e' : 'け',
- 'k-o' : 'こ',
- 'l-k-a' : 'ヵ',
- 'l-k-e' : 'ヶ',
-# 'x-k-a' : 'ゕ',
- 'x-k-a' : 'ヵ',
-# 'x-k-e' : 'ゖ',
- 'x-k-e' : 'ヶ',
- 'g-a' : 'が',
- 'g-i' : 'ぎ',
- 'g-u' : 'ぐ',
- 'g-e' : 'げ',
- 'g-o' : 'ご',
- 'k-y-a' : 'きゃ',
- 'k-y-i' : 'きぃ',
- 'k-y-u' : 'きゅ',
- 'k-y-e' : 'きぇ',
- 'k-y-o' : 'きょ',
- 'k-w-a' : 'くぁ',
- 'k-w-i' : 'くぃ', ##2
- 'k-w-u' : 'くぅ', ##2
- 'k-w-e' : 'くぇ', ##2
- 'k-w-o' : 'くぉ', ##2
- 'g-y-a' : 'ぎゃ',
- 'g-y-i' : 'ぎぃ',
- 'g-y-u' : 'ぎゅ',
- 'g-y-e' : 'ぎぇ',
- 'g-y-o' : 'ぎょ',
- 'g-w-a' : 'ぐぁ',
- 'g-w-i' : 'ぐぃ', ##2
- 'g-w-u' : 'ぐぅ', ##2
- 'g-w-e' : 'ぐぇ', ##2
- 'g-w-o' : 'ぐぉ', ##2
- 's-a' : 'さ',
- 's-i' : 'し',
- 's-u' : 'す',
- 's-e' : 'せ',
- 's-o' : 'そ',
- 'z-a' : 'ざ',
- 'z-i' : 'じ',
- 'z-u' : 'ず',
- 'z-e' : 'ぜ',
- 'z-o' : 'ぞ',
- 's-y-a' : 'しゃ',
- 's-y-i' : 'しぃ',
- 's-y-u' : 'しゅ',
- 's-y-e' : 'しぇ',
- 's-y-o' : 'しょ',
- 's-h-a' : 'しゃ',
- 's-h-i' : 'し',
- 's-h-u' : 'しゅ',
- 's-h-e' : 'しぇ',
- 's-h-o' : 'しょ',
- 'z-y-a' : 'じゃ',
- 'z-y-i' : 'じぃ',
- 'z-y-u' : 'じゅ',
- 'z-y-e' : 'じぇ',
- 'z-y-o' : 'じょ',
- 'j-a' : 'じゃ',
- 'j-y-a' : 'じゃ',
- 'j-i' : 'じ',
- 'j-y-i' : 'じぃ',
- 'j-u' : 'じゅ',
- 'j-y-u' : 'じゅ',
- 'j-e' : 'じぇ',
- 'j-y-e' : 'じぇ',
- 'j-o' : 'じょ',
- 'j-y-o' : 'じょ',
- 's-w-i' : 'すぅぃ', ##2
- 's-w-e' : 'すぇ', ##2
- 'z-w-e' : 'ずぇ', ##2
- 't-a' : 'た',
- 't-i' : 'ち',
- 't-u' : 'つ',
- 't-s-u' : 'つ',
- 't-e' : 'て',
- 't-o' : 'と',
- 'd-a' : 'だ',
- 'd-i' : 'ぢ',
- 'd-u' : 'づ',
- 'd-e' : 'で',
- 'd-o' : 'ど',
- 'x-t-u' : 'っ',
- 'x-t-s-u' : 'っ',
- 'l-t-u' : 'っ',
- 'l-t-s-u' : 'っ',
- 't-y-a' : 'ちゃ',
- 't-y-i' : 'ちぃ',
- 't-y-u' : 'ちゅ',
- 't-y-e' : 'ちぇ',
- 't-y-o' : 'ちょ',
- 'c-y-a' : 'ちゃ',
- 'c-y-i' : 'ちぃ',
- 'c-y-u' : 'ちゅ',
- 'c-y-e' : 'ちぇ',
- 'c-y-o' : 'ちょ',
- 'c-h-a' : 'ちゃ',
- 'c-h-i' : 'ち',
- 'c-h-u' : 'ちゅ',
- 'c-h-e' : 'ちぇ',
- 'c-h-o' : 'ちょ',
- 'd-y-a' : 'ぢゃ',
- 'd-y-i' : 'ぢぃ',
- 'd-y-u' : 'ぢゅ',
- 'd-y-e' : 'ぢぇ',
- 'd-y-o' : 'ぢょ',
- 't-s-a' : 'つぁ',
- 't-s-i' : 'つぃ',
- 't-s-e' : 'つぇ',
- 't-s-o' : 'つぉ',
- 't-s-y-a' : 'つゃ', ##3
- 't-s-y-u' : 'つゅ', ##3
- 't-s-y-e' : 'つぃぇ', ##3
- 't-s-y-o' : 'つょ', ##3
- 'd-z-a' : 'づぁ', ##3
- 'd-z-i' : 'づぃ', ##3
- 'd-z-u' : 'づ', ##4
- 'd-z-e' : 'づぇ', ##3
- 'd-z-o' : 'づぉ', ##3
- 'd-z-y-a' : 'づゃ', ##3
- 'd-z-y-u' : 'づゅ', ##3
- 'd-z-y-e' : 'づぃぇ', ##3
- 'd-z-y-o' : 'づょ', ##3
- 't-h-a' : 'てゃ',
- 't-h-i' : 'てぃ',
- 't-h-u' : 'てゅ',
- 't-h-e' : 'てぇ',
- 't-h-o' : 'てょ',
- 't-w-u' : 'とぅ',
- 'd-h-a' : 'でゃ',
- 'd-h-i' : 'でぃ',
- 'd-h-u' : 'でゅ',
- 'd-h-e' : 'でぇ',
- 'd-h-o' : 'でょ',
- 'd-w-u' : 'どぅ',
- 'n-a' : 'な',
- 'n-i' : 'に',
- 'n-u' : 'ぬ',
- 'n-e' : 'ね',
- 'n-o' : 'の',
- 'n-y-a' : 'にゃ',
- 'n-y-i' : 'にぃ',
- 'n-y-u' : 'にゅ',
- 'n-y-e' : 'にぇ',
- 'n-y-o' : 'にょ',
- 'h-a' : 'は',
- 'h-i' : 'ひ',
- 'h-u' : 'ふ',
- 'h-e' : 'へ',
- 'h-o' : 'ほ',
- 'b-a' : 'ば',
- 'b-i' : 'び',
- 'b-u' : 'ぶ',
- 'b-e' : 'べ',
- 'b-o' : 'ぼ',
- 'p-a' : 'ぱ',
- 'p-i' : 'ぴ',
- 'p-u' : 'ぷ',
- 'p-e' : 'ぺ',
- 'p-o' : 'ぽ',
- 'h-y-a' : 'ひゃ',
- 'h-y-i' : 'ひぃ',
- 'h-y-u' : 'ひゅ',
- 'h-y-e' : 'ひぇ',
- 'h-y-o' : 'ひょ',
- 'b-y-a' : 'びゃ',
- 'b-y-i' : 'びぃ',
- 'b-y-u' : 'びゅ',
- 'b-y-e' : 'びぇ',
- 'b-y-o' : 'びょ',
- 'p-y-a' : 'ぴゃ',
- 'p-y-i' : 'ぴぃ',
- 'p-y-u' : 'ぴゅ',
- 'p-y-e' : 'ぴぇ',
- 'p-y-o' : 'ぴょ',
- 'f-a' : 'ふぁ',
- 'f-i' : 'ふぃ',
- 'f-u' : 'ふ',
- 'f-e' : 'ふぇ',
- 'f-o' : 'ふぉ',
- 'f-y-a' : 'ふゃ',
- 'f-y-i' : 'ふぃ',
- 'f-y-u' : 'ふゅ',
- 'f-y-e' : 'ふぇ',
- 'f-y-o' : 'ふょ',
- 'b-w-a' : 'ぶぁ', ##2
- 'b-w-e' : 'ぶぇ', ##2
- 'b-w-o' : 'ぶぉ', ##2
- 'p-w-a' : 'ぷぁ', ##2
- 'p-w-e' : 'ぷぇ', ##2
- 'p-w-o' : 'ぷぉ', ##2
- 'm-a' : 'ま',
- 'm-i' : 'み',
- 'm-u' : 'む',
- 'm-e' : 'め',
- 'm-o' : 'も',
- 'm-y-a' : 'みゃ',
- 'm-y-i' : 'みぃ',
- 'm-y-u' : 'みゅ',
- 'm-y-e' : 'みぇ',
- 'm-y-o' : 'みょ',
- 'y-a' : 'や',
- 'y-i' : 'い',
- 'y-u' : 'ゆ',
- 'y-e' : 'いぇ',
- 'y-o' : 'よ',
- 'l-y-a' : 'ゃ',
- 'l-y-i' : 'ぃ',
- 'l-y-u' : 'ゅ',
- 'l-y-e' : 'ぇ',
- 'l-y-o' : 'ょ',
- 'x-y-a' : 'ゃ',
- 'x-y-i' : 'ぃ',
- 'x-y-u' : 'ゅ',
- 'x-y-e' : 'ぇ',
- 'x-y-o' : 'ょ',
- 'r-a' : 'ら',
- 'r-i' : 'り',
- 'r-u' : 'る',
- 'r-e' : 'れ',
- 'r-o' : 'ろ',
- 'r-y-a' : 'りゃ',
- 'r-y-i' : 'りぃ',
- 'r-y-u' : 'りゅ',
- 'r-y-e' : 'りぇ',
- 'r-y-o' : 'りょ',
- 'w-a' : 'わ',
- 'w-i' : 'うぃ',
- 'w-u' : 'う',
- 'w-e' : 'うぇ',
- 'w-o' : 'を',
- 'l-w-a' : 'ゎ',
- 'x-w-a' : 'ゎ',
- 'n-apostrophe' : 'ん',
- 'n-n' : 'ん',
- 'w-y-i' : 'ゐ',
- 'w-y-e' : 'ゑ',
- },
-
- 'kana_typing_rule': {
- 'method': 'jp',
- 'newkeys': [],
- },
-
- 'kana_typing_rule/jp': {
- # no modifiers keys
- '1' : 'ぬ',
- '2' : 'ふ',
- '3' : 'あ',
- '4' : 'う',
- '5' : 'え',
- '6' : 'お',
- '7' : 'や',
- '8' : 'ゆ',
- '9' : 'よ',
- '0' : 'わ',
- 'minus' : 'ほ',
- 'asciicircum' : 'へ',
-
- 'q' : 'た',
- 'w' : 'て',
- 'e' : 'い',
- 'r' : 'す',
- 't' : 'か',
- 'y' : 'ん',
- 'u' : 'な',
- 'i' : 'に',
- 'o' : 'ら',
- 'p' : 'せ',
- 'at' : '゛',
- 'bracketleft' : '゜',
-
- 'a' : 'ち',
- 's' : 'と',
- 'd' : 'し',
- 'f' : 'は',
- 'g' : 'き',
- 'h' : 'く',
- 'j' : 'ま',
- 'k' : 'の',
- 'l' : 'り',
- 'semicolon' : 'れ',
- 'colon' : 'け',
- 'bracketright' : 'む',
-
- 'z' : 'つ',
- 'x' : 'さ',
- 'c' : 'そ',
- 'v' : 'ひ',
- 'b' : 'こ',
- 'n' : 'み',
- 'm' : 'も',
- 'comma' : 'ね',
- 'period' : 'る',
- 'slash' : 'め',
- # 'backslash' : 'ー',
- 'backslash' : 'ろ',
-
- # shift modifiered keys
- 'exclam' : 'ぬ',
- 'quotedbl' : 'ふ',
- 'numbersign' : 'ぁ',
- 'dollar' : 'ぅ',
- 'percent' : 'ぇ',
- 'ampersand' : 'ぉ',
- 'apostrophe' : 'ゃ',
- 'parenleft' : 'ゅ',
- 'parenright' : 'ょ',
- 'asciitilde' : 'を',
- 'equal' : 'ゑ',
- 'bar' : 'ー',
-
- 'largeq' : 'た',
- 'largew' : 'て',
- 'largee' : 'ぃ',
- 'larger' : 'す',
- 'larget' : 'ヵ',
- 'largey' : 'ん',
- 'largeu' : 'な',
- 'largei' : 'に',
- 'largeo' : 'ら',
- 'largep' : 'せ',
- 'grave' : '゛',
-
- 'braceleft' : '「',
-
- 'largea' : 'ち',
- 'larges' : 'と',
- 'larged' : 'し',
- 'largef' : 'ゎ',
- 'largeg' : 'き',
- 'largeh' : 'く',
- 'largej' : 'ま',
- 'largek' : 'の',
- 'largel' : 'り',
- 'plus' : 'れ',
- 'asterisk' : 'ヶ',
-
- 'braceright' : '」',
-
- 'largez' : 'っ',
- 'largex' : 'さ',
- 'largec' : 'そ',
- 'largev' : 'ゐ',
- 'largeb' : 'こ',
- 'largen' : 'み',
- 'largem' : 'も',
- 'less' : '、',
- 'greater' : '。',
-
- 'question' : '・',
- 'underscore' : 'ろ',
-
- 'yen' : 'ー',
- },
-
- 'kana_typing_rule/us': {
- # no modifiers keys
- 'grave' : 'ろ',
- '1' : 'ぬ',
- '2' : 'ふ',
- '3' : 'あ',
- '4' : 'う',
- '5' : 'え',
- '6' : 'お',
- '7' : 'や',
- '8' : 'ゆ',
- '9' : 'よ',
- '0' : 'わ',
- 'minus' : 'ほ',
- 'equal' : 'へ',
-
- 'q' : 'た',
- 'w' : 'て',
- 'e' : 'い',
- 'r' : 'す',
- 't' : 'か',
- 'y' : 'ん',
- 'u' : 'な',
- 'i' : 'に',
- 'o' : 'ら',
- 'p' : 'せ',
- 'bracketleft' : '゛',
- 'bracketright' : '゜',
- # 'backslash' : 'ー',
- 'backslash' : 'む',
-
- 'a' : 'ち',
- 's' : 'と',
- 'd' : 'し',
- 'f' : 'は',
- 'g' : 'き',
- 'h' : 'く',
- 'j' : 'ま',
- 'k' : 'の',
- 'l' : 'り',
- 'semicolon' : 'れ',
- 'apostrophe' : 'け',
-
- 'z' : 'つ',
- 'x' : 'さ',
- 'c' : 'そ',
- 'v' : 'ひ',
- 'b' : 'こ',
- 'n' : 'み',
- 'm' : 'も',
- 'comma' : 'ね',
- 'period' : 'る',
- 'slash' : 'め',
-
- # shift modifiered keys
- 'asciitilde' : 'ろ',
- 'exclam' : 'ぬ',
- 'at' : 'ふ',
- 'numbersign' : 'ぁ',
- 'dollar' : 'ぅ',
- 'percent' : 'ぇ',
- 'asciicircum' : 'ぉ',
- 'ampersand' : 'ゃ',
- 'asterisk' : 'ゅ',
- 'parenleft' : 'ょ',
- 'parenright' : 'を',
- 'underscore' : 'ー',
- 'plus' : 'ゑ',
-
- 'largeq' : 'た',
- 'largew' : 'て',
- 'largee' : 'ぃ',
- 'larger' : 'す',
- 'larget' : 'ヵ',
- 'largey' : 'ん',
- 'largeu' : 'な',
- 'largei' : 'に',
- 'largeo' : 'ら',
- 'largep' : 'せ',
- 'braceleft' : '「',
-
- 'braceright' : '」',
-
- 'bar' : 'む',
-
- 'largea' : 'ち',
- 'larges' : 'と',
- 'larged' : 'し',
- 'largef' : 'ゎ',
- 'largeg' : 'き',
- 'largeh' : 'く',
- 'largej' : 'ま',
- 'largek' : 'の',
- 'largel' : 'り',
- 'colon' : 'れ',
- 'quotedbl' : 'ヶ',
-
- 'largez' : 'っ',
- 'largex' : 'さ',
- 'largec' : 'そ',
- 'largev' : 'ゐ',
- 'largeb' : 'こ',
- 'largen' : 'み',
- 'largem' : 'も',
- 'less' : '、',
- 'greater' : '。',
-
- 'question' : '・',
- },
- 'thumb': {
- 'keyboard_layout_mode': True,
- 'keyboard_layout': 0,
- 'fmv_extension': 2,
- 'handakuten': False,
- 'rs': 'Henkan',
- 'ls': 'Muhenkan',
- 't1': 100,
- 't2': 75,
- },
-
- 'thumb_typing_rule': {
- 'method': 'base',
- 'newkeys': [],
- 'nicola_j_table_newkeys': [],
- 'nicola_a_table_newkeys': [],
- 'nicola_f_table_newkeys': [],
- 'kb231_j_fmv_table_newkeys': [],
- 'kb231_a_fmv_table_newkeys': [],
- 'kb231_f_fmv_table_newkeys': [],
- 'kb611_j_fmv_table_newkeys': [],
- 'kb611_a_fmv_table_newkeys': [],
- 'kb611_f_fmv_table_newkeys': [],
- },
-
- 'thumb_typing_rule/base': {
- 'q' : ['。', '', 'ぁ'],
- 'w' : ['か', 'が', 'え'],
- 'e' : ['た', 'だ', 'り'],
- 'r' : ['こ', 'ご', 'ゃ'],
- 't' : ['さ', 'ざ', 'れ'],
-
- 'y' : ['ら', 'よ', 'ぱ'],
- 'u' : ['ち', 'に', 'ぢ'],
- 'i' : ['く', 'る', 'ぐ'],
- 'o' : ['つ', 'ま', 'づ'],
- 'p' : [',', 'ぇ', 'ぴ'],
- 'at' : ['、', '', ''],
- 'bracketleft' : ['゛', '゜', ''],
-
- 'a' : ['う', '', 'を'],
- 's' : ['し', 'じ', 'あ'],
- 'd' : ['て', 'で', 'な'],
- 'f' : ['け', 'げ', 'ゅ'],
- 'g' : ['せ', 'ぜ', 'も'],
-
- 'h' : ['は', 'み', 'ば'],
- 'j' : ['と', 'お', 'ど'],
- 'k' : ['き', 'の', 'ぎ'],
- 'l' : ['い', 'ょ', 'ぽ'],
- 'semicolon' : ['ん', 'っ', ''],
-
- 'z' : ['.', '', 'ぅ'],
- 'x' : ['ひ', 'び', 'ー'],
- 'c' : ['す', 'ず', 'ろ'],
- 'v' : ['ふ', 'ぶ', 'や'],
- 'b' : ['へ', 'べ', 'ぃ'],
-
- 'n' : ['め', 'ぬ', 'ぷ'],
- 'm' : ['そ', 'ゆ', 'ぞ'],
- 'comma' : ['ね', 'む', 'ぺ'],
- 'period' : ['ほ', 'わ', 'ぼ'],
- 'slash' : ['・', 'ぉ', ''],
-
- '1' : ['1', '', '?'],
- '2' : ['2', '', '/'],
- '4' : ['4', '', '「'],
- '5' : ['5', '', '」'],
-
- '6' : ['6', '[', ''],
- '7' : ['7', ']', ''],
- '8' : ['8', '(', ''],
- '9' : ['9', ')', ''],
- 'backslash' : ['¥', '', ''],
- },
-
- 'thumb_typing_rule/nicola_j_table': {
- 'colon' : [':', '', ''],
- 'at' : ['、', '', ''],
- 'bracketleft' : ['゛', '゜', ''],
- 'bracketright' : ['」', '', ''],
- '8' : ['8', '(', ''],
- '9' : ['9', ')', ''],
- '0' : ['0', '', ''],
- },
-
- 'thumb_typing_rule/nicola_a_table': {
- 'colon' : [':', '', ''],
- 'at' : ['@', '', ''],
- 'bracketleft' : ['、', '', ''],
- 'bracketright' : ['゛', '゜', ''],
- '8' : ['8', '', ''],
- '9' : ['9', '(', ''],
- '0' : ['0', ')', ''],
- },
-
- 'thumb_typing_rule/nicola_f_table': {
- 'colon' : ['、', '', ''],
- 'at' : ['@', '', ''],
- 'bracketleft' : ['゛', '゜', ''],
- 'bracketright' : ['」', '', ''],
- '8' : ['8', '(', ''],
- '9' : ['9', ')', ''],
- '0' : ['0', '', ''],
- },
-
- 'thumb_typing_rule/kb231_j_fmv_table': {
- '3' : ['3', '', '~'],
- '0' : ['0', '『', ''],
- 'minus' : ['-', '』', ''],
- 'equal' : ['=', '', ''],
- },
-
- 'thumb_typing_rule/kb231_a_fmv_table': {
- '3' : ['3', '', '~'],
- '0' : ['0', ')', ''],
- 'minus' : ['-', '『', ''],
- 'equal' : ['=', '』', ''],
- },
-
- 'thumb_typing_rule/kb231_f_fmv_table': {
- '3' : ['3', '', '~'],
- '0' : ['0', '『', ''],
- 'minus' : ['-', '』', ''],
- 'equal' : ['=', '', ''],
- },
-
- 'thumb_typing_rule/kb611_j_fmv_table': {
- 'grave' : ['‘', '', ''],
- 'asciicircum' : ['々', '£', ''],
- 'colon' : [':', '', ''],
- 'at' : ['、', '¢', ''],
- 'bracketleft' : ['゛', '゜', ''],
- # keysyms are same and keycodes depend on the platforms.
- #'¥' : [u'¥', u'¬', u''],
- 'backslash' : ['¥', '¦', ''],
- },
-
- 'thumb_typing_rule/kb611_a_fmv_table': {
- 'grave' : ['々', '', '£'],
- 'colon' : [':', '', ''],
- 'at' : ['@', '', ''],
- 'bracketleft' : ['、', '¢', ''],
- #'¥' : [u'¥', u'¬', u''],
- 'backslash' : ['¥', '¦', ''],
- },
-
- 'thumb_typing_rule/kb611_f_fmv_table': {
- 'grave' : ['‘', '', ''],
- 'asciicircum' : ['々', '£', ''],
- 'colon' : ['、', '¢', ''],
- 'at' : ['@', '', ''],
- 'bracketleft' : ['゛', '゜', ''],
- #'¥' : [u'¥', u'¬', u''],
- 'backslash' : ['¥', '¦', ''],
- },
-
- 'dict': {
- 'zipcode': ['@pkgdatadir@/dicts/zipcode.t'],
- 'symbol': ['@pkgdatadir@/dicts/symbol.t'],
- 'oldchar': ['@pkgdatadir@/dicts/oldchar.t'],
- 'era': ['@pkgdatadir@/dicts/era.t'],
- 'emoji': ['@pkgdatadir@/dicts/emoji.t'],
- 'files': [
- '@pkgdatadir@/dicts/zipcode.t',
- '@pkgdatadir@/dicts/symbol.t',
- '@pkgdatadir@/dicts/oldchar.t',
- '@pkgdatadir@/dicts/era.t',
- '@pkgdatadir@/dicts/emoji.t',
- ],
- },
-
- 'dict/file/default': {
- 'embed': False,
- 'single': True,
- 'icon': None,
- 'short_label': None,
- 'long_label': None,
- 'preview_lines': 30,
- 'reverse': False,
- 'is_system': False,
- 'encoding': 'utf-8',
- },
-
- 'dict/file/embedded': {
- 'embed': True,
- 'single': True,
- 'icon': None,
- 'short_label': '般',
- 'long_label': N_("General"),
- 'preview_lines': 0,
- 'reverse': False,
- 'is_system': True,
- },
-
- 'dict/file/zipcode': {
- 'embed': False,
- 'single': True,
- 'icon': None,
- 'short_label': '〒',
- 'long_label': N_("Zip Code Conversion"),
- 'preview_lines': -1,
- 'reverse': False,
- 'is_system': True,
- },
-
- 'dict/file/symbol': {
- 'embed': True,
- 'single': False,
- 'icon': None,
- 'short_label': '記',
- 'long_label': N_("Symbol"),
- 'preview_lines': -1,
- 'reverse': False,
- 'is_system': True,
- },
-
- 'dict/file/oldchar': {
- 'embed': False,
- 'single': True,
- 'icon': None,
- 'short_label': '旧',
- 'long_label': N_("Old Character Style"),
- 'preview_lines': -1,
- 'reverse': False,
- 'is_system': True,
- },
- 'dict/file/era': {
- 'embed': False,
- 'single': True,
- 'icon': None,
- 'short_label': '年',
- 'long_label': N_("Era"),
- 'preview_lines': -1,
- 'reverse': False,
- 'is_system': True,
- },
- 'dict/file/emoji': {
- 'embed': False,
- 'single': True,
- 'icon': None,
- 'short_label': '😊',
- 'long_label': N_("Emoji"),
- 'preview_lines': -1,
- 'reverse': False,
- 'is_system': True,
- },
-}
-
-_shortcut_default = {
- 'on_off': [@ON_OFF_KEYS@],
- 'circle_input_mode': ['Ctrl+comma', 'Ctrl+less'],
- # Removed Hiragana_Katakana key in circle_kana_mode for latin_with_shift.
- 'circle_kana_mode': ['Ctrl+period', 'Ctrl+greater'],
-# 'cancel_pseudo_ascii_mode_key': ['Escape'],
- 'circle_typing_method': ['Alt+Romaji', 'Ctrl+slash'],
- 'circle_dict_method': ['Alt+Henkan'],
-
- 'insert_space': ['space'],
- 'insert_alternate_space': ['Shift+space'],
- 'backspace': ['BackSpace', 'Ctrl+H'],
- 'delete': ['Delete', 'Ctrl+D'],
- 'commit': ['Return', 'KP_Enter', 'Ctrl+J', 'Ctrl+M'],
- 'convert': ['space', 'KP_Space', 'Henkan'],
- 'predict': ['Tab', 'ISO_Left_Tab'],
- 'cancel': ['Escape', 'Ctrl+G'],
- 'reconvert': ['Shift+Henkan'],
-
- 'move_caret_first': ['Ctrl+A', 'Home'],
- 'move_caret_last': ['Ctrl+E', 'End'],
- 'move_caret_forward': ['Right', 'Ctrl+F'],
- 'move_caret_backward': ['Left', 'Ctrl+B'],
-
- 'select_first_segment': ['Ctrl+A', 'Home'],
- 'select_last_segment': ['Ctrl+E', 'End'],
- 'select_next_segment': ['Right', 'Ctrl+F'],
- 'select_prev_segment': ['Left', 'Ctrl+B'],
- 'shrink_segment': ['Shift+Left', 'Ctrl+I'],
- 'expand_segment': ['Shift+Right', 'Ctrl+O'],
- 'commit_first_segment': ['Shift+Down'],
- 'commit_selected_segment': ['Ctrl+Down'],
-
- 'select_first_candidate': ['Home'],
- 'select_last_candidate': ['End'],
- 'select_next_candidate': ['space', 'KP_Space', 'Tab', 'ISO_Left_Tab', 'Henkan', 'Down', 'KP_Add', 'Ctrl+N'],
- 'select_prev_candidate': ['Shift+Tab', 'Shift+ISO_Left_Tab', 'Up', 'KP_Subtract', 'Ctrl+P'],
- 'candidates_page_up': ['Page_Up'],
- 'candidates_page_down': ['Page_Down', 'KP_Tab'],
-
- 'select_candidates_1': ['1'],
- 'select_candidates_2': ['2'],
- 'select_candidates_3': ['3'],
- 'select_candidates_4': ['4'],
- 'select_candidates_5': ['5'],
- 'select_candidates_6': ['6'],
- 'select_candidates_7': ['7'],
- 'select_candidates_8': ['8'],
- 'select_candidates_9': ['9'],
- 'select_candidates_0': ['0'],
-
- 'convert_to_char_type_forward': ['Muhenkan'],
- 'convert_to_hiragana': ['F6'],
- 'convert_to_katakana': ['F7'],
- 'convert_to_half': ['F8'],
- 'convert_to_half_katakana': ['Shift+F8'],
- 'convert_to_wide_latin': ['F9'],
- 'convert_to_latin': ['F10'],
- 'convert_to_hiragana_all': ['Shift+F6'],
- 'convert_to_katakana_all': ['Shift+F7'],
- 'convert_to_wide_latin_all': ['Shift+F9'],
- 'convert_to_latin_all': ['Shift+F10'],
-
- 'dict_admin': ['F11'],
- 'add_word': ['F12'],
-
- 'hiragana_for_latin_with_shift': ['Hiragana_Katakana'],
-}
-
-_config['shortcut/default'] = dict.fromkeys(_cmd_keys, [])
-_config['shortcut/default'].update(_shortcut_default)
-
-_shortcut_atok = {
- 'on_off': ['Henkan', 'Eisu_toggle', 'Zenkaku_Hankaku'],
- 'circle_input_mode': ['F10'],
- 'hiragana_mode': ['Hiragana_Katakana'],
- 'katakana_mode': ['Shift+Hiragana_Katakana'],
- 'circle_typing_method': ['Romaji', 'Alt+Romaji'],
- 'circle_dict_method': ['Alt+Henkan'],
- 'convert': ['space', 'Henkan', 'Shift+space', 'Shift+Henkan'],
- 'predict': ['Tab'],
- 'cancel': ['Escape', 'BackSpace', 'Ctrl+H', 'Ctrl+bracketleft'],
- 'commit': ['Return', 'Ctrl+M'],
- 'reconvert': ['Shift+Henkan'],
-
- 'insert_space': ['space'],
- 'insert_alternate_space': ['Shift+space'],
- 'backspace': ['BackSpace', 'Ctrl+H'],
- 'delete': ['Delete', 'Ctrl+G'],
-
- 'move_caret_backward': ['Left', 'Ctrl+K'],
- 'move_caret_forward': ['Right', 'Ctrl+L'],
- 'move_caret_first': ['Ctrl+Left'],
- 'move_caret_last': ['Ctrl+Right'],
-
- 'select_prev_segment': ['Shift+Left'],
- 'select_next_segment': ['Shift+Right'],
- 'select_first_segment': ['Ctrl+Left'],
- 'select_last_segment': ['Ctrl+Right'],
- 'expand_segment': ['Right', 'Ctrl+L'],
- 'shrink_segment': ['Left', 'Ctrl+K'],
- 'commit_selected_segment': ['Down', 'Ctrl+N'],
-
- 'candidates_page_up': ['Shift+Henkan', 'Page_Up'],
- 'candidates_page_down': ['Henkan', 'Page_Down'],
- 'select_next_candidate': ['space', 'Tab', 'Henkan', 'Shift+space', 'Shift+Henkan'],
- 'select_prev_candidate': ['Up'],
-
- 'select_candidates_1': ['1'],
- 'select_candidates_2': ['2'],
- 'select_candidates_3': ['3'],
- 'select_candidates_4': ['4'],
- 'select_candidates_5': ['5'],
- 'select_candidates_6': ['6'],
- 'select_candidates_7': ['7'],
- 'select_candidates_8': ['8'],
- 'select_candidates_9': ['9'],
- 'select_candidates_0': ['0'],
-
- 'convert_to_hiragana': ['F6', 'Ctrl+U'],
- 'convert_to_katakana': ['F7', 'Ctrl+I'],
- 'convert_to_half': ['F8', 'Ctrl+O'],
- 'convert_to_half_katakana': ['Shift+F8'],
- 'convert_to_wide_latin': ['F9', 'Ctrl+P'],
- 'convert_to_latin': ['F10', 'Ctrl+at'],
- 'convert_to_hiragana_all': ['Shift+F6'],
- 'convert_to_katakana_all': ['Shift+F7'],
- 'convert_to_wide_latin_all': ['Shift+F9'],
- 'convert_to_latin_all': ['Shift+F10'],
-
- 'dict_admin': ['F11'],
- 'add_word': ['Ctrl+F7'],
-
- 'hiragana_for_latin_with_shift': ['Ctrl+J'],
-}
-
-_config['shortcut/atok'] = dict.fromkeys(_cmd_keys, [])
-_config['shortcut/atok'].update(_shortcut_atok)
-
-_shortcut_wnn = {
- 'on_off': ['Shift+space'],
- 'convert': ['space'],
- 'predict': ['Ctrl+Q'],
- 'cancel': ['Escape', 'Ctrl+G', 'Alt+Down', 'Muhenkan'],
- 'commit': ['Ctrl+L', 'Ctrl+M', 'Ctrl+J', 'Return'],
- 'insert_space': ['space'],
- 'backspace': ['Ctrl+H', 'BackSpace'],
- 'delete': ['Ctrl+D', 'Delete'],
- 'circle_dict_method': ['Alt+Henkan'],
-
- 'move_caret_backward': ['Ctrl+B', 'Left'],
- 'move_caret_forward': ['Ctrl+F', 'Right'],
- 'move_caret_first': ['Ctrl+A', 'Alt+Left'],
- 'move_caret_last': ['Ctrl+E', 'Alt+Right'],
-
- 'select_prev_segment': ['Ctrl+B', 'Left'],
- 'select_next_segment': ['Ctrl+F', 'Right'],
- 'select_first_segment': ['Ctrl+A', 'Alt+Left'],
- 'select_last_segment': ['Ctrl+E', 'Alt+Right'],
- 'expand_segment': ['Ctrl+O', 'F14'],
- 'shrink_segment': ['Ctrl+I', 'F13'],
-
- 'candidates_page_up': ['Tab'],
- 'candidates_page_down': ['Shift+Tab'],
- 'select_next_candidate': ['space', 'Ctrl+Q', 'Ctrl+P', 'Down'],
- 'select_prev_candidate': ['Ctrl+N', 'Up'],
-
- 'select_candidates_1': ['1'],
- 'select_candidates_2': ['2'],
- 'select_candidates_3': ['3'],
- 'select_candidates_4': ['4'],
- 'select_candidates_5': ['5'],
- 'select_candidates_6': ['6'],
- 'select_candidates_7': ['7'],
- 'select_candidates_8': ['8'],
- 'select_candidates_9': ['9'],
- 'select_candidates_0': ['0'],
-
- 'convert_to_hiragana': ['F6'],
- 'convert_to_katakana': ['F7'],
- 'convert_to_half': ['F8'],
- 'convert_to_wide_latin': ['F9'],
- 'convert_to_latin': ['F10'],
- 'convert_to_hiragana_all': ['Shift+F6'],
- 'convert_to_katakana_all': ['Shift+F7'],
- 'convert_to_half_all': ['Shift+F8'],
- 'convert_to_wide_latin_all': ['Shift+F9'],
- 'convert_to_latin_all': ['Shift+F10'],
-
- 'dict_admin': ['F11'],
- 'add_word': ['F12'],
-
- 'hiragana_for_latin_with_shift': ['Hiragana_Katakana'],
-}
-
-_config['shortcut/wnn'] = dict.fromkeys(_cmd_keys, [])
-_config['shortcut/wnn'].update(_shortcut_wnn)
-
diff --git a/setup/python3/main.py b/setup/python3/main.py
index 6346e43..e43c458 100644
--- a/setup/python3/main.py
+++ b/setup/python3/main.py
@@ -4,8 +4,8 @@
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -32,6 +32,7 @@ import gettext
from gettext import dgettext
from gi import require_version as gi_require_version
+gi_require_version('Gio', '2.0')
gi_require_version('GLib', '2.0')
gi_require_version('Gtk', '3.0')
gi_require_version('Gdk', '3.0')
@@ -39,6 +40,7 @@ gi_require_version('GdkX11', '3.0')
gi_require_version('Pango', '1.0')
gi_require_version('IBus', '1.0')
+from gi.repository import Gio
from gi.repository import GLib
# set_prgname before importing other modules to show the name in warning
@@ -76,6 +78,8 @@ class AnthySetup(object):
gettext.bindtextdomain(DOMAINNAME, config.LOCALEDIR)
gettext.bind_textdomain_codeset(DOMAINNAME, 'UTF-8')
+ self.__prefs = AnthyPrefs()
+
# IBus.Bus() calls ibus_bus_new().
# Gtk.Builder().add_from_file() also calls ibus_bus_new_async()
# via ibus_im_context_new().
@@ -143,13 +147,12 @@ class AnthySetup(object):
bus.connect('connected', self.__init_bus_connected)
def __init_bus_connected(self, bus):
- self.__config = bus.get_config()
builder = self.__builder
+ prefs = self.__prefs
self.__thumb_kb_layout_mode = None
self.__thumb_kb_layout = None
self.__japanese_ordered_dict = {}
- self.prefs = prefs = AnthyPrefs(None, self.__config)
# glade 'icon_name' property has a custom scaling and it seems
# to be difficult to show the complicated small icon in metacity.
@@ -164,17 +167,25 @@ class AnthySetup(object):
icon_path = 'ibus-anthy'
builder.get_object('main').set_icon_name(icon_path)
- for name in ['input_mode', 'typing_method', 'conversion_segment_mode',
- 'period_style', 'symbol_style', 'ten_key_mode',
- 'behavior_on_focus_out', 'behavior_on_period',
- 'half_width_symbol', 'half_width_number', 'half_width_space',
- 'latin_with_shift',
- 'thumb:keyboard_layout_mode', 'thumb:keyboard_layout',
- 'thumb:fmv_extension', 'thumb:handakuten']:
+ for name in ['input-mode', 'typing-method', 'conversion-segment-mode',
+ 'period-style', 'symbol-style', 'ten-key-mode',
+ 'behavior-on-focus-out', 'behavior-on-period',
+ 'half-width-symbol', 'half-width-number', 'half-width-space',
+ 'latin-with-shift',
+ 'thumb:keyboard-layout-mode', 'thumb:keyboard-layout',
+ 'thumb:fmv-extension', 'thumb:handakuten']:
section, key = self.__get_section_key(name)
- builder.get_object(name).set_active(prefs.get_value(section, key))
+ prefs.bind(section, key,
+ builder.get_object(name),
+ 'active',
+ Gio.SettingsBindFlags.DEFAULT)
+
+ prefs.bind('thumb', 'keyboard-layout-mode',
+ builder.get_object('thumb:keyboard-layout'),
+ 'sensitive',
+ Gio.SettingsBindFlags.INVERT_BOOLEAN)
- tv = builder.get_object('menu_visible:treeview')
+ tv = builder.get_object('menu-visible:treeview')
ls = Gtk.ListStore(str, bool, str)
tv.set_model(ls)
@@ -199,12 +210,14 @@ class AnthySetup(object):
self.__append_menus_in_model()
l = ['default', 'atok', 'wnn']
- s_type = prefs.get_value('common', 'shortcut_type')
+ s_type = prefs.get_value('common', 'shortcut-type')
s_type = s_type if s_type in l else 'default'
- builder.get_object('shortcut_type').set_active(l.index(s_type))
+ builder.get_object('shortcut-type').set_active(l.index(s_type))
- builder.get_object('page_size').set_value(prefs.get_value('common',
- 'page_size'))
+ prefs.bind('common', 'page-size',
+ builder.get_object('page-size').get_adjustment(),
+ 'value',
+ Gio.SettingsBindFlags.DEFAULT)
tv = builder.get_object('shortcut')
tv.append_column(Gtk.TreeViewColumn(_("Command"),
@@ -216,17 +229,17 @@ class AnthySetup(object):
tv.get_selection().connect_after('changed',
self.on_selection_changed, 0)
ls = Gtk.ListStore(str, str)
- sec = 'shortcut/' + s_type
- for k in self.prefs.keys(sec):
- ls.append([k, l_to_s(self.prefs.get_value(sec, k))])
+ shortcuts = self.__prefs.get_value('shortcut', s_type)
+ for k in shortcuts.keys():
+ ls.append([k, l_to_s(shortcuts[k])])
tv.set_model(ls)
self.__keymap = None
GLib.idle_add(self.__update_keymap_label,
priority = GLib.PRIORITY_LOW)
- self.__thumb_kb_layout_mode = builder.get_object('thumb:keyboard_layout_mode')
- self.__thumb_kb_layout = builder.get_object('thumb:keyboard_layout')
+ self.__thumb_kb_layout_mode = builder.get_object('thumb:keyboard-layout-mode')
+ self.__thumb_kb_layout = builder.get_object('thumb:keyboard-layout')
self.__set_thumb_kb_label()
for name in ['thumb:ls', 'thumb:rs']:
@@ -239,13 +252,13 @@ class AnthySetup(object):
self.on_selection_changed, 1)
tv.set_model(Gtk.ListStore(str))
- key = 'dict_admin_command'
+ key = 'dict-admin-command'
cli = self.__get_dict_cli_from_list(prefs.get_value('common', key))
- name = 'dict:entry_edit_dict_command'
+ name = 'dict:entry-edit-dict-command'
builder.get_object(name).set_text(cli)
- key = 'add_word_command'
+ key = 'add-word-command'
cli = self.__get_dict_cli_from_list(prefs.get_value('common', key))
- name = 'dict:entry_add_word_command'
+ name = 'dict:entry-add-word-command'
builder.get_object(name).set_text(cli)
tv = builder.get_object('dict:view')
@@ -301,7 +314,7 @@ class AnthySetup(object):
def __init_japanese_sort(self):
japanese_ordered_dict = {}
- japanese_ordered_list = self.prefs.get_japanese_ordered_list()
+ japanese_ordered_list = self.__prefs.get_japanese_ordered_list()
for index, c in enumerate(japanese_ordered_list):
japanese_ordered_dict[c] = index
self.__japanese_ordered_dict = japanese_ordered_dict;
@@ -309,7 +322,7 @@ class AnthySetup(object):
def __init_about_vbox(self, icon_path):
about_dialog = self.__builder.get_object('about_dialog')
about_vbox = self.__builder.get_object('about_vbox')
- about_dialog.set_version(self.prefs.get_version())
+ about_dialog.set_version(self.__prefs.get_version())
if icon_path != None:
if icon_path[0] == '/':
image = Gtk.Image.new_from_file(icon_path)
@@ -359,6 +372,20 @@ class AnthySetup(object):
dlg.run()
dlg.destroy()
+ def _get_shortcut_sec(self):
+ l = ['default', 'atok', 'wnn']
+ iter = self.__builder.get_object('shortcut-type').get_active_iter()
+ model = self.__builder.get_object('shortcut-type').get_model()
+ s_type = model[iter][0].lower()
+ return 'shortcut/' + (s_type if s_type in l else 'default')
+
+ def __get_shortcut_group(self):
+ l = ['default', 'atok', 'wnn']
+ iter = self.__builder.get_object('shortcut-type').get_active_iter()
+ model = self.__builder.get_object('shortcut-type').get_model()
+ s_type = model[iter][0].lower()
+ return s_type if s_type in l else 'default'
+
def __japanese_tuple_sort(self, a, b):
if a[1] == b[1]:
# http://docs.python.org/3.0/whatsnew/3.0.html#ordering-comparisons
@@ -381,26 +408,25 @@ class AnthySetup(object):
return (a[0] > b[0]) - (a[0] < b[0])
def __renderer_toggled_cb(self, renderer, path, model):
- prefs = self.prefs
+ prefs = self.__prefs
enabled = not model[path][1]
model[path][1] = enabled
key = model[path][0]
prefs.set_value('common', key, enabled)
- self.__builder.get_object('btn_apply').set_sensitive(True)
def __toggle_menu_visible_cell_cb(self, column, renderer, model, iter, id):
- l = self.__builder.get_object('menu_visible:treeview').get_model()
+ l = self.__builder.get_object('menu-visible:treeview').get_model()
active = l.get_value(iter, id)
renderer.set_property('active', active)
def __text_menu_visible_cell_cb(self, column, renderer, model, iter, id):
- l = self.__builder.get_object('menu_visible:treeview').get_model()
+ l = self.__builder.get_object('menu-visible:treeview').get_model()
text = l.get_value(iter, id)
renderer.set_property('text', text)
def __append_menus_in_model(self):
- prefs = self.prefs
- l = self.__builder.get_object('menu_visible:treeview').get_model()
+ prefs = self.__prefs
+ l = self.__builder.get_object('menu-visible:treeview').get_model()
l.append(['show-input-mode',
prefs.get_value('common', 'show-input-mode'),
_("Input mode")])
@@ -421,30 +447,20 @@ class AnthySetup(object):
_("Preferences - Anthy")])
def __get_romaji_treeview_custom_key_table(self, method):
- prefs = self.prefs
+ prefs = self.__prefs
rule = {}
ls = Gtk.ListStore(str, str, str)
tv = self.__builder.get_object('treeview_custom_key_table')
- section_base = 'romaji_typing_rule'
- section = section_base + '/' + prefs.str(method)
- for key in prefs.keys(section):
- key = prefs.str(key)
- value = prefs.get_value(section, key)
+ section = 'romaji-typing-rule'
+ keymap = prefs.get_value(section, 'list')[method]
+ for key in keymap.keys():
+ value = keymap[key]
ch = prefs.typing_from_config_key(key)
if ch == '':
continue
# config.set_value(key, None) is not supported.
if value != None and value != '':
- rule[ch] = prefs.str(value)
- for key in prefs.get_value(section_base, 'newkeys'):
- key = prefs.str(key)
- value = self.prefs.get_value_direct(section, key)
- ch = prefs.typing_from_config_key(key)
- if ch == '':
- continue
- # config.set_value(key, None) is not supported.
- if value != None and value != '':
- rule[ch] = prefs.str(value)
+ rule[ch] = value
for key, value in sorted(list(rule.items()), \
key = functools.cmp_to_key(self.__japanese_tuple_sort)):
ls.append(['romaji', key, value])
@@ -457,30 +473,20 @@ class AnthySetup(object):
return tv
def __get_kana_treeview_custom_key_table(self, method):
- prefs = self.prefs
+ prefs = self.__prefs
rule = {}
ls = Gtk.ListStore(str, str, str)
tv = self.__builder.get_object('treeview_custom_key_table')
- section_base = 'kana_typing_rule'
- section = section_base + '/' + prefs.str(method)
- for key in prefs.keys(section):
- key = prefs.str(key)
- value = prefs.get_value(section, key)
- ch = prefs.typing_from_config_key(key)
- if ch == '':
- continue
- # config.set_value(key, None) is not supported.
- if value != None and value != '':
- rule[ch] = prefs.str(value)
- for key in prefs.get_value(section_base, 'newkeys'):
- key = prefs.str(key)
- value = self.prefs.get_value_direct(section, key)
+ section = 'kana-typing-rule'
+ keymap = prefs.get_value(section, 'list')[method]
+ for key in keymap.keys():
+ value = keymap[key]
ch = prefs.typing_from_config_key(key)
if ch == '':
continue
# config.set_value(key, None) is not supported.
if value != None and value != '':
- rule[ch] = prefs.str(value)
+ rule[ch] = value
for key, value in sorted(list(rule.items()), \
key = functools.cmp_to_key(self.__japanese_tuple_sort)):
ls.append(['kana', key, value])
@@ -493,15 +499,14 @@ class AnthySetup(object):
return tv
def __get_thumb_treeview_custom_key_table(self, method):
- prefs = self.prefs
+ prefs = self.__prefs
rule = {}
ls = Gtk.ListStore(str, str, str, str, str)
tv = self.__builder.get_object('treeview_custom_key_table')
- section_base = 'thumb_typing_rule'
- section = section_base + '/' + prefs.str(method)
- for key in prefs.keys(section):
- key = prefs.str(key)
- value = prefs.get_value(section, key)
+ section = 'thumb-typing-rule'
+ keymap = prefs.get_value(section, 'list')[method]
+ for key in keymap.keys():
+ value = keymap[key]
ch = prefs.typing_from_config_key(key)
if ch == '':
continue
@@ -511,24 +516,9 @@ class AnthySetup(object):
(value[1] != None and value[1] != '') or \
(value[2] != None and value[2] != '')):
rule[ch] = {}
- rule[ch][0] = prefs.str(value[0])
- rule[ch][1] = prefs.str(value[1])
- rule[ch][2] = prefs.str(value[2])
- for key in prefs.get_value(section_base, 'newkeys'):
- key = prefs.str(key)
- value = self.prefs.get_value_direct(section, key)
- ch = prefs.typing_from_config_key(key)
- if ch == '':
- continue
- # config.set_value(key, None) is not supported.
- if value != None and len(value) == 3 and \
- ((value[0] != None and value[0] != '') or \
- (value[1] != None and value[1] != '') or \
- (value[2] != None and value[2] != '')):
- rule[ch] = {}
- rule[ch][0] = prefs.str(value[0])
- rule[ch][1] = prefs.str(value[1])
- rule[ch][2] = prefs.str(value[2])
+ rule[ch][0] = value[0]
+ rule[ch][1] = value[1]
+ rule[ch][2] = value[2]
for key, value in sorted(list(rule.items()), \
key = functools.cmp_to_key(self.__japanese_thumb_sort)):
ls.append(['thumb', key, value[0], value[2], value[1]])
@@ -614,7 +604,7 @@ class AnthySetup(object):
combobox.disconnect_by_func(self.on_cb_custom_key_table_changed)
def __run_dialog_custom_key_table(self, widget, mode):
- prefs = self.prefs
+ prefs = self.__prefs
dlg = self.__builder.get_object('dialog_custom_key_table')
dlg.set_transient_for(widget.get_toplevel())
label = self.__builder.get_object('label_custom_key_table')
@@ -638,15 +628,15 @@ class AnthySetup(object):
label.set_label(_("_Thumb Shift Key Table:"))
label_output.set_label(_("Single _Output Chars"))
list_labels = [['base', _("Base")],
- ['nicola_j_table', _("NICOLA-J key extension")],
- ['nicola_a_table', _("NICOLA-A key extension")],
- ['nicola_f_table', _("NICOLA-F key extension")],
- ['kb231_j_fmv_table', _("FMV KB231-J key extension")],
- ['kb231_a_fmv_table', _("FMV KB231-A key extension")],
- ['kb231_f_fmv_table', _("FMV KB231-F key extension")],
- ['kb611_j_fmv_table', _("FMV KB611-J key extension")],
- ['kb611_a_fmv_table', _("FMV KB611-A key extension")],
- ['kb611_f_fmv_table', _("FMV KB611-F key extension")],
+ ['nicola-j-table', _("NICOLA-J key extension")],
+ ['nicola-a-table', _("NICOLA-A key extension")],
+ ['nicola-f-table', _("NICOLA-F key extension")],
+ ['kb231-j-fmv-table', _("FMV KB231-J key extension")],
+ ['kb231-a-fmv-table', _("FMV KB231-A key extension")],
+ ['kb231-f-fmv-table', _("FMV KB231-F key extension")],
+ ['kb611-j-fmv-table', _("FMV KB611-J key extension")],
+ ['kb611-a-fmv-table', _("FMV KB611-A key extension")],
+ ['kb611-f-fmv-table', _("FMV KB611-F key extension")],
]
self.__show_dialog_custom_key_table_extention(mode)
ls = Gtk.ListStore(str, str)
@@ -660,17 +650,17 @@ class AnthySetup(object):
tv = None
if mode == 'romaji':
- method = prefs.get_value('romaji_typing_rule', 'method')
+ method = prefs.get_value('romaji-typing-rule', 'method')
if method == None:
method = 'default'
tv = self.__get_romaji_treeview_custom_key_table(method)
if mode == 'kana':
- method = prefs.get_value('kana_typing_rule', 'method')
+ method = prefs.get_value('kana-typing-rule', 'method')
if method == None:
method = 'jp'
tv = self.__get_kana_treeview_custom_key_table(method)
if mode == 'thumb':
- method = prefs.get_value('thumb_typing_rule', 'method')
+ method = prefs.get_value('thumb-typing-rule', 'method')
if method == None:
method = 'base'
tv = self.__get_thumb_treeview_custom_key_table(method)
@@ -698,7 +688,7 @@ class AnthySetup(object):
return
section, key = self.__get_section_key(
Gtk.Buildable.get_name(self.__thumb_kb_layout_mode))
- layout_mode = self.prefs.get_value(section, key)
+ layout_mode = self.__prefs.get_value(section, key)
if layout_mode:
self.__thumb_kb_layout.set_sensitive(False)
else:
@@ -735,60 +725,52 @@ class AnthySetup(object):
return id
def __get_dict_file_from_id(self, selected_id):
- files = self.prefs.get_value('dict', 'files')
- retval = None
-
- for file in files:
- id = self.__get_quoted_id(file)
- # The selected_id is already quoted.
- if selected_id == id:
- retval = file
- break
- return retval
+ files = self.__prefs.get_value('dict', 'files')
+ return files.get(selected_id, None)
def __is_system_dict_file_from_id(self, selected_id):
- prefs = self.prefs
- section = 'dict/file/' + selected_id
- key = 'is_system'
-
- if key not in prefs.keys(section):
- return False
- return prefs.get_value(section, key)
+ prefs = self.__prefs
+ dict_item = prefs.get_value('dict', 'list')[selected_id]
+ return dict_item.is_system
- def __append_dict_id_in_model(self, id, is_gettext):
- prefs = self.prefs
+ def __append_dict_id_in_model(self, id):
+ prefs = self.__prefs
section = 'dict/file/' + id
- # user value is dbus.String
- prefs.set_value(section, 'short_label',
- prefs.str(prefs.get_value(section, 'short_label')))
- prefs.set_value(section, 'long_label',
- prefs.str(prefs.get_value(section, 'long_label')))
- short_label = prefs.get_value(section, 'short_label')
- long_label = prefs.get_value(section, 'long_label')
- embed = prefs.get_value(section, 'embed')
- single = prefs.get_value(section, 'single')
- reverse = prefs.get_value(section, 'reverse')
- if is_gettext:
+ dicts = prefs.get_value('dict', 'list')
+ dict_item = dicts[id]
+ short_label = dict_item.short_label
+ long_label = dict_item.long_label
+ embed = dict_item.embed
+ single = dict_item.single
+ reverse = dict_item.reverse
+ if dict_item.is_system:
long_label = _(long_label)
l = self.__builder.get_object('dict:view').get_model()
l.append([id, short_label, long_label, embed, single, reverse])
def __append_dicts_in_model(self):
- prefs = self.prefs
- for file in prefs.get_value('dict', 'files'):
- if not path.exists(file):
+ prefs = self.__prefs
+ order = prefs.get_value('dict', 'order')
+ dict_files = prefs.get_value('dict', 'files')
+ if len(order) == 0:
+ order = list(dict_files.keys())
+ for id in order:
+ if id == 'embedded':
continue
- id = self.__get_quoted_id(file)
- section = 'dict/file/' + id
- if section not in prefs.sections():
- self.__fetch_dict_values(section)
- is_system_dict = self.__is_system_dict_file_from_id(id)
- self.__append_dict_id_in_model(id, is_system_dict)
+ files = dict_files[id]
+ for file in files:
+ if not path.exists(file):
+ continue
+ self.__append_dict_id_in_model(id)
def __append_user_dict_from_dialog(self, file, id, new):
- files = self.prefs.get_value('dict', 'files')
+ files_dict = self.__prefs.get_value('dict', 'files')
if new:
+ files = []
+ for v in files_dict.values():
+ for f in v:
+ files.append(f)
if file in files:
self.__run_message_dialog(_("Your choosed file has already been added: ") + file,
Gtk.MessageType.ERROR)
@@ -805,6 +787,8 @@ class AnthySetup(object):
self.__run_message_dialog(_("You cannot add dictionaries in the anthy private directory: " + file),
Gtk.MessageType.ERROR)
return
+ else:
+ file = files_dict[id][0]
if new:
id = self.__get_quoted_id(file)
@@ -822,15 +806,23 @@ class AnthySetup(object):
long_label = self.__builder.get_object('dict:long_entry').get_text()
if new:
- files.append(file)
- self.prefs.set_value('dict', 'files', files)
-
+ order = self.__prefs.get_value('dict', 'order')
+ if len(order) == 0:
+ order = list(self.__prefs.get_value('dict', 'files').keys())
+ order.append(id)
+ self.__prefs.set_value('dict', 'order', order)
+ self.__prefs.set_list_item('dict', 'files', id, [file])
+
+ filename = file
+ if filename.find('/') >=0:
+ filename = filename[filename.rindex('/') + 1:]
+ if filename.find('.') >=0:
+ filname = filename[:filename.rindex('.')]
if short_label == None or short_label == '':
- short_label = id[0]
+ short_label = filename[0]
if long_label == None or long_label == '':
- long_label = id
+ long_label = filename
self.__update_dict_values(new, id, short_label, long_label, embed, single, reverse)
- self.__builder.get_object('btn_apply').set_sensitive(True)
files = []
def __init_dict_chooser_dialog(self):
@@ -856,15 +848,13 @@ class AnthySetup(object):
if selected_id == None:
return None
- is_system_dict = self.__is_system_dict_file_from_id(selected_id)
-
- prefs = self.prefs
- section = 'dict/file/' + selected_id
- short_label = prefs.get_value(section, 'short_label')
- long_label = prefs.get_value(section, 'long_label')
- embed = prefs.get_value(section, 'embed')
- single = prefs.get_value(section, 'single')
- reverse = prefs.get_value(section, 'reverse')
+ dict_item = self.__prefs.get_value('dict', 'list')[selected_id]
+ short_label = dict_item.short_label
+ long_label = dict_item.long_label
+ embed = dict_item.embed
+ single = dict_item.single
+ reverse = dict_item.reverse
+ is_system_dict = dict_item.is_system
if len(short_label) > 1:
short_label = short_label[0]
@@ -885,56 +875,32 @@ class AnthySetup(object):
return selected_id
- def __fetch_dict_values(self, section):
- prefs = self.prefs
- prefs.set_new_section(section)
- prefs.set_new_key(section, 'short_label')
- prefs.fetch_item(section, 'short_label')
- # user value is dbus.String
- prefs.set_value(section, 'short_label',
- prefs.str(prefs.get_value(section, 'short_label')))
- prefs.set_new_key(section, 'long_label')
- prefs.fetch_item(section, 'long_label')
- prefs.set_value(section, 'long_label',
- prefs.str(prefs.get_value(section, 'long_label')))
- prefs.set_new_key(section, 'embed')
- prefs.fetch_item(section, 'embed')
- prefs.set_new_key(section, 'single')
- prefs.fetch_item(section, 'single')
- prefs.set_new_key(section, 'reverse')
- prefs.fetch_item(section, 'reverse')
-
def __update_dict_values(self, new, id, short_label, long_label, embed, single, reverse):
- prefs = self.prefs
- section = 'dict/file/' + id
- if section not in prefs.sections():
- prefs.set_new_section(section)
-
- is_system_dict = self.__is_system_dict_file_from_id(id)
- if is_system_dict:
- if 'short_label' in prefs.keys(section):
- short_label = prefs.get_value(section, 'short_label')
- if 'long_label' in prefs.keys(section):
- long_label = prefs.get_value(section, 'long_label')
+ prefs = self.__prefs
if new:
+ dict_item = prefs.get_value('dict', 'template')
+ dict_item.id = id
+ dict_item.short_label = short_label
+ dict_item.long_label = long_label
+ dict_item.embed = embed
+ dict_item.single = single
+ dict_item.reverse = reverse
l = self.__builder.get_object('dict:view').get_model()
l.append([id, short_label, long_label, embed, single, reverse])
else:
+ dict_item = prefs.get_value('dict', 'list')[id]
+ if not dict_item.is_system:
+ dict_item.short_label = short_label
+ dict_item.long_label = long_label
+ dict_item.embed = embed
+ dict_item.single = single
+ dict_item.reverse = reverse
l, i = self.__builder.get_object('dict:view').get_selection().get_selected()
if i :
l[i] = [id, short_label, long_label, embed, single, reverse]
- key = 'short_label'
- prefs.set_value(section, key, short_label)
- key = 'long_label'
- prefs.set_value(section, key, long_label)
- key = 'embed'
- prefs.set_value(section, key, embed)
- key = 'single'
- prefs.set_value(section, key, single)
- key = 'reverse'
- prefs.set_value(section, key, reverse)
+ prefs.set_list_item('dict', 'list', id, dict_item)
def __text_cell_data_cb(self, column, renderer, model, iter, id):
l = self.__builder.get_object('dict:view').get_model()
@@ -1098,13 +1064,13 @@ class AnthySetup(object):
def __update_keymap_label(self):
self.__resync_engine_file()
- prefs = self.prefs
+ prefs = self.__prefs
keymap = self.__get_keymap()
if keymap == None:
return
if keymap == '':
keymap = 'default'
- keymap_list = prefs.get_value('common', 'keyboard_layouts')
+ keymap_list = prefs.get_value('common', 'keyboard-layouts')
if keymap != None and not keymap in keymap_list:
keymap_list.append(keymap)
index = -1
@@ -1124,11 +1090,6 @@ class AnthySetup(object):
self.on_cb_keymap_changed,
0)
- def __save_preferences(self):
- self.prefs.commit_all()
- if self.__keymap != None:
- self.__save_keymap()
-
def __search_and_mark(self, buffer, text, start, end, onetime, forward):
if forward:
match = start.forward_search(text, 0, end)
@@ -1211,51 +1172,12 @@ class AnthySetup(object):
button = self.__builder.get_object('button_remove_custom_key')
button.set_sensitive(True)
- def on_main_delete(self, widget, event):
- self.on_btn_cancel_clicked(widget)
+ def on_main_quit(self, widget, event):
+ Gtk.main_quit()
return True
- def on_btn_ok_clicked(self, widget):
- if self.__builder.get_object('btn_apply').get_state() == \
- Gtk.StateType.INSENSITIVE:
- Gtk.main_quit()
- return True
- dlg = self.__builder.get_object('quit_check')
- dlg.set_transient_for(widget.get_toplevel())
- dlg.set_markup('<big><b>%s</b></big>' % _("Confirmation"))
- dlg.format_secondary_text(
- _("You are about to close the setup dialog, is that OK?"))
- id = dlg.run()
- dlg.hide()
- if id == Gtk.ResponseType.YES:
- self.__save_preferences()
- Gtk.main_quit()
- return True
-
- def on_btn_cancel_clicked(self, widget):
- if self.__builder.get_object('btn_apply').get_state() == \
- Gtk.StateType.INSENSITIVE:
- Gtk.main_quit()
- return True
- dlg = self.__builder.get_object('quit_check_without_save')
- dlg.set_transient_for(widget.get_toplevel())
- dlg.set_markup('<big><b>%s</b></big>' % _("Notice!"))
- dlg.format_secondary_text(
- _("You are about to close the setup dialog without saving your changes, is that OK?"))
- id = dlg.run()
- dlg.hide()
- if id == Gtk.ResponseType.YES:
- Gtk.main_quit()
- return True
-
- def on_btn_apply_clicked(self, widget):
- self.__save_preferences()
- widget.set_sensitive(False)
-
- def on_cb_changed(self, widget):
- section, key = self.__get_section_key(Gtk.Buildable.get_name(widget))
- self.prefs.set_value(section, key, widget.get_active())
- self.__builder.get_object('btn_apply').set_sensitive(True)
+ def on_btn_close_clicked(self, widget):
+ Gtk.main_quit()
def on_cb_keymap_changed(self, widget, id):
it = widget.get_active()
@@ -1266,10 +1188,11 @@ class AnthySetup(object):
if self.__keymap == keymap:
return
self.__keymap = keymap
- self.__builder.get_object('btn_apply').set_sensitive(True)
+ self.__save_keymap()
+ self.__keymap = None
def on_cb_custom_key_table_changed(self, widget, user_data):
- prefs = self.prefs
+ prefs = self.__prefs
tv = self.__builder.get_object('treeview_custom_key_table')
mode = user_data
id = widget.get_active()
@@ -1283,27 +1206,12 @@ class AnthySetup(object):
if mode == 'romaji':
tv = self.__get_romaji_treeview_custom_key_table(method)
elif mode == 'kana':
- prefs.set_value('kana_typing_rule', 'method', method)
- self.__builder.get_object('btn_apply').set_sensitive(True)
+ prefs.set_value('kana-typing-rule', 'method', method)
tv = self.__get_kana_treeview_custom_key_table(method)
elif mode == 'thumb':
# thumb uses all tables so do not save the method.
tv = self.__get_thumb_treeview_custom_key_table(method)
- def on_sb_changed(self, widget):
- section, key = self.__get_section_key(Gtk.Buildable.get_name(widget))
- self.prefs.set_value(section, key, widget.get_value_as_int())
- self.__builder.get_object('btn_apply').set_sensitive(True)
-
- def on_ck_toggled(self, widget):
- section, key = self.__get_section_key(Gtk.Buildable.get_name(widget))
- self.prefs.set_value(section, key, widget.get_active())
- self.__builder.get_object('btn_apply').set_sensitive(True)
- if self.__thumb_kb_layout_mode and \
- Gtk.Buildable.get_name(widget) == \
- Gtk.Buildable.get_name(self.__thumb_kb_layout_mode):
- self.__set_thumb_kb_label()
-
def on_btn_edit_clicked(self, widget):
ls, it = self.__builder.get_object('shortcut').get_selection().get_selected()
m = self.__builder.get_object('es:treeview').get_model()
@@ -1320,19 +1228,20 @@ class AnthySetup(object):
if id == Gtk.ResponseType.OK:
new = l_to_s([m[i][0] for i in range(len(m))])
if new != ls.get(it, 1)[0]:
- sec = self._get_shortcut_sec()
- self.prefs.set_value(sec, ls.get(it, 0)[0], s_to_l(new))
+ group = self.__get_shortcut_group()
+ self.__prefs.set_list_item('shortcut', group,
+ ls.get(it, 0)[0], s_to_l(new))
ls.set(it, 1, new)
- self.__builder.get_object('btn_apply').set_sensitive(True)
def on_btn_default_clicked(self, widget):
ls, it = self.__builder.get_object('shortcut').get_selection().get_selected()
- sec = self._get_shortcut_sec()
- new = l_to_s(self.prefs.default[sec][ls.get(it, 0)[0]])
+ group = self.__get_shortcut_group()
+ shortcuts = self.__prefs.get_default_value('shortcut', group)
+ new = l_to_s(shortcuts[ls.get(it, 0)[0]])
if new != ls.get(it, 1)[0]:
- self.prefs.set_value(sec, ls.get(it, 0)[0], s_to_l(new))
+ self.__prefs.set_list_item('shortcut', group,
+ ls.get(it, 0)[0], s_to_l(new))
ls.set(it, 1, new)
- self.__builder.get_object('btn_apply').set_sensitive(True)
def on_btn_romaji_custom_table_clicked(self, widget):
self.__run_dialog_custom_key_table(widget, 'romaji')
@@ -1344,7 +1253,7 @@ class AnthySetup(object):
self.__run_dialog_custom_key_table(widget, 'thumb')
def on_btn_add_custom_key(self, widget, user_data):
- prefs = self.prefs
+ prefs = self.__prefs
input = self.__builder.get_object('entry_input_custom_key')
output = self.__builder.get_object('entry_output_custom_key')
left = self.__builder.get_object('entry_left_thumb_shift_custom_key')
@@ -1375,43 +1284,33 @@ class AnthySetup(object):
return
if type == 'romaji':
- section_base = 'romaji_typing_rule'
+ section = 'romaji-typing-rule'
model.append([type, key, value])
elif type == 'kana':
- section_base = 'kana_typing_rule'
+ section = 'kana-typing-rule'
model.append([type, key, value])
elif type == 'thumb':
- section_base = 'thumb_typing_rule'
+ section = 'thumb-typing-rule'
model.append([type, key, value, left_text, right_text])
- if section_base == None:
+ if section == None:
self.__run_message_dialog(_("Your custom key is not assigned in any sections. Maybe a bug."))
return
gkey = prefs.typing_to_config_key(key)
if gkey == '':
return
key = gkey
- section = section_base + '/' + method
- if key not in prefs.keys(section):
- # ibus does not support gconf_client_all_entries().
- # prefs.fetch_section() doesn't get the keys if they exist
- # in gconf only.
- # Use newkeys for that way.
- newkeys = prefs.get_value(section_base, 'newkeys')
- if key not in newkeys:
- newkeys.append(key)
- prefs.set_value(section_base, 'newkeys', newkeys)
if type != 'thumb':
- prefs.set_value(section, key, value)
+ prefs.set_list_item(section, 'list', (method, key), value)
else:
- prefs.set_value(section, key, [value, right_text, left_text])
+ prefs.set_list_item(section, 'list',
+ (method, key), [value, right_text, left_text])
left.set_text('')
right.set_text('')
input.set_text('')
output.set_text('')
- self.__builder.get_object('btn_apply').set_sensitive(True)
def on_btn_remove_custom_key(self, widget, user_data):
- prefs = self.prefs
+ prefs = self.__prefs
combobox = self.__builder.get_object('combobox_custom_key_table')
id = combobox.get_active()
model_combobox = combobox.get_model()
@@ -1422,31 +1321,21 @@ class AnthySetup(object):
key = l[i][1]
section_base = None
if type == 'romaji':
- section_base = 'romaji_typing_rule'
+ section = 'romaji-typing-rule'
elif type == 'kana':
- section_base = 'kana_typing_rule'
+ section = 'kana-typing-rule'
elif type == 'thumb':
- section_base = 'thumb_typing_rule'
- if section_base == None:
+ section = 'thumb-typing-rule'
+ if section == None:
self.__run_message_dialog(_("Your custom key is not assigned in any sections. Maybe a bug."))
return
- section = section_base + '/' + method
- newkeys = prefs.get_value(section_base, 'newkeys')
gkey = prefs.typing_to_config_key(key)
if gkey == '':
return
key = gkey
- if key in newkeys:
- newkeys.remove(key)
- prefs.set_value(section_base, 'newkeys', newkeys)
- # config.set_value(key, None) is not supported.
- if type != 'thumb':
- prefs.set_value(section, key, '')
- else:
- prefs.set_value(section, key, ['', '', ''])
+ prefs.delete_list_item(section, 'list', (method, key))
l.remove(i)
widget.set_sensitive(False)
- self.__builder.get_object('btn_apply').set_sensitive(True)
def on_btn_thumb_key_clicked(self, widget):
if Gtk.Buildable.get_name(widget) == 'thumb:button_ls':
@@ -1481,18 +1370,17 @@ class AnthySetup(object):
new = l[i][0]
if new != text:
section, key = self.__get_section_key(entry)
- self.prefs.set_value(section, key, new)
+ self.__prefs.set_value(section, key, new)
self.__builder.get_object(entry).set_text(new)
- self.__builder.get_object('btn_apply').set_sensitive(True)
def on_btn_dict_command_clicked(self, widget):
if Gtk.Buildable.get_name(widget) == 'dict:btn_edit_dict_command':
- key = 'dict_admin_command'
+ key = 'dict-admin-command'
elif Gtk.Buildable.get_name(widget) == 'dict:btn_add_word_command':
- key = 'add_word_command'
+ key = 'add-word-command'
else:
return
- command = self.prefs.get_value('common', key)
+ command = self.__prefs.get_value('common', key)
if not path.exists(command[0]):
self.__run_message_dialog(_("Your file does not exist: ") + command[0],
Gtk.MessageType.ERROR)
@@ -1553,17 +1441,19 @@ class AnthySetup(object):
if selected_id == None:
return
- if self.__is_system_dict_file_from_id(selected_id):
+ dict_item = self.__prefs.get_value('dict', 'list')[selected_id]
+ if dict_item.is_system:
self.__run_message_dialog(_("You cannot delete the system dictionary."),
Gtk.MessageType.ERROR)
return
file = self.__get_dict_file_from_id(selected_id)
if file != None:
- files = self.prefs.get_value('dict', 'files')
- files.remove(file)
- self.prefs.set_value('dict', 'files', files)
- self.__builder.get_object('btn_apply').set_sensitive(True)
+ order = self.__prefs.get_value('dict', 'order')
+ order.remove(selected_id)
+ order = self.__prefs.set_value('dict', 'order', order)
+ self.__prefs.delete_list_item('dict', 'files', selected_id)
+ self.__prefs.delete_list_item('dict', 'list', selected_id)
l.remove(i)
return
@@ -1575,32 +1465,25 @@ class AnthySetup(object):
if selected_id == None:
return
+ print('test', selected_id)
dict_file = self.__get_dict_file_from_id(selected_id)
if dict_file == None:
self.__run_message_dialog(_("Your file is not good."),
Gtk.MessageType.ERROR)
return
- if not path.exists(dict_file):
+ if not path.exists(dict_file[0]):
self.__run_message_dialog(_("Your file does not exist: ") + dict_file,
Gtk.MessageType.ERROR)
return
- if dict_file == None:
- return
-
# The selected id is already quoted.
- section = 'dict/file/' + selected_id
- if 'preview_lines' not in self.prefs.keys(section):
- section = 'dict/file/default'
- nline = self.prefs.get_value(section, 'preview_lines')
-
- section = 'dict/file/' + selected_id
- if 'encoding' not in self.prefs.keys(section):
- section = 'dict/file/default'
- encoding = self.prefs.get_value(section, 'encoding')
+ dicts = self.__prefs.get_value('dict', 'list')
+ dict_item = dicts[selected_id]
+ nline = dict_item.preview_lines
+ encoding = dict_item.encoding
lines = '';
- for i, line in enumerate(list(codecs.open(dict_file, 'r', 'utf-8'))):
+ for i, line in enumerate(list(codecs.open(dict_file[0], 'r', 'utf-8'))):
if nline >= 0 and i >= nline:
break;
lines = lines + line
@@ -1645,7 +1528,6 @@ class AnthySetup(object):
dlg.destroy()
def on_btn_dict_order_clicked(self, widget):
- dict_file = None
l, it = self.__builder.get_object('dict:view').get_selection().get_selected()
if not it:
@@ -1666,45 +1548,35 @@ class AnthySetup(object):
if next_it:
l.swap(it, next_it)
- dict_file = self.__get_dict_file_from_id(selected_id)
- files = self.prefs.get_value('dict', 'files')
+ order = self.__prefs.get_value('dict', 'order')
+ if len(order) == 0:
+ order = list(self.__prefs.get_value('dict', 'files').keys())
+ i = order.index(selected_id)
- if dict_file == None:
- return
-
- i = files.index(dict_file)
if Gtk.Buildable.get_name(widget) == 'dict:btn_up':
if i <= 0:
return
next_i = i - 1
elif Gtk.Buildable.get_name(widget) == 'dict:btn_down':
- if i + 1 >= len(dict_file):
+ if i + 1 >= len(order):
return
next_i = i + 1
- f = files[i]
- files[i] = files[next_i]
- files[next_i] = f
- self.prefs.set_value('dict', 'files', files)
- self.__builder.get_object('btn_apply').set_sensitive(True)
-
- def _get_shortcut_sec(self):
- l = ['default', 'atok', 'wnn']
- iter = self.__builder.get_object('shortcut_type').get_active_iter()
- model = self.__builder.get_object('shortcut_type').get_model()
- s_type = model[iter][0].lower()
- return 'shortcut/' + (s_type if s_type in l else 'default')
+ f = order[i]
+ order[i] = order[next_i]
+ order[next_i] = f
+ self.__prefs.set_value('dict', 'order', order)
def on_shortcut_type_changed(self, widget):
ls = self.__builder.get_object('shortcut').get_model()
ls.clear()
- sec = self._get_shortcut_sec()
- for k in self.prefs.keys(sec):
- ls.append([k, l_to_s(self.prefs.get_value(sec, k))])
+ group = self.__get_shortcut_group()
+ shortcuts = self.__prefs.get_value('shortcut', group)
+ for k in shortcuts.keys():
+ ls.append([k, l_to_s(shortcuts[k])])
section, key = self.__get_section_key(Gtk.Buildable.get_name(widget))
- self.prefs.set_value(section, key, sec[len('shortcut/'):])
- self.__builder.get_object('btn_apply').set_sensitive(True)
+ self.__prefs.set_value(section, key, group)
def on_shortcut_key_release_event(self, widget, event):
if event.hardware_keycode in [36, 65]:
@@ -1749,7 +1621,9 @@ class AnthySetup(object):
if not widget.get_text():
return
list = widget.get_text().split()
- if list[0][0] == '/':
+ if len(list) == 0:
+ return
+ elif list[0][0] == '/':
if len(list) == 1:
list.append(list[0][list[0].rfind('/') + 1:])
else:
@@ -1760,14 +1634,14 @@ class AnthySetup(object):
else:
list.insert(0, '/usr/bin/' + list[0])
list[1] = list[1][list[1].rfind('/') + 1:]
- if Gtk.Buildable.get_name(widget) == 'dict:entry_edit_dict_command':
- key = 'dict_admin_command'
- elif Gtk.Buildable.get_name(widget) == 'dict:entry_add_word_command':
- key = 'add_word_command'
+ if Gtk.Buildable.get_name(widget) == 'dict:entry-edit-dict-command':
+ key = 'dict-admin-command'
+ elif Gtk.Buildable.get_name(widget) == 'dict:entry-add-word-command':
+ key = 'add-word-command'
else:
return
- self.prefs.set_value('common', key, list)
- self.__builder.get_object('btn_apply').set_sensitive(True)
+ print('test', key, list)
+ self.__prefs.set_value('common', key, list)
def on_es_entry_changed(self, widget):
if not widget.get_text():
diff --git a/setup/python3/prefs.py b/setup/python3/prefs.py
index 269e353..0509ecb 100644
--- a/setup/python3/prefs.py
+++ b/setup/python3/prefs.py
@@ -4,8 +4,8 @@
#
# Copyright (c) 2007-2008 Peng Huang <shawn.p.huang@gmail.com>
# Copyright (c) 2009 Hideaki ABE <abe.sendai@gmail.com>
-# Copyright (c) 2010-2016 Takao Fujiwara <takao.fujiwara1@gmail.com>
-# Copyright (c) 2007-2016 Red Hat, Inc.
+# Copyright (c) 2010-2017 Takao Fujiwara <takao.fujiwara1@gmail.com>
+# Copyright (c) 2007-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -24,39 +24,101 @@
import sys
from gi import require_version as gi_require_version
+gi_require_version('Gio', '2.0')
gi_require_version('GLib', '2.0')
gi_require_version('IBus', '1.0')
+from gi.repository import Gio
from gi.repository import GLib
+from gi.repository import GObject
from gi.repository import IBus
-class Prefs(object):
- _prefix = 'engine/dummy'
-
- def __init__(self, bus=None, config=None):
- self.default = {}
- self.modified = {}
- self.new = {}
- self.__no_key_warning = False
-
- # self._config is used by AnthyPrefs .
- self._config = config if config else \
- bus.get_config() if bus else \
- IBus.Bus().get_config()
-
- # ibus_config_get_values enhances the performance.
- self.__has_config_get_values = False
-
- if self._config != None:
- self.__has_config_get_values = hasattr(self._config, 'get_values')
- else:
- self.printerr(
- 'ibus-config is not running or bus address is not correct.')
-
- def __log_handler(self, domain, level, message, data):
- if not data:
- return
- GLib.log_default_handler(domain, level, message, '')
+class DictItem():
+ def __init__(self,
+ id='',
+ short_label='',
+ long_label='',
+ icon='',
+ is_system=False,
+ preview_lines=-1,
+ embed=False,
+ single=True,
+ reverse=False,
+ encoding='utf-8'):
+ self.id = id
+ self.short_label = short_label
+ self.long_label = long_label
+ self.icon = icon
+ self.is_system = is_system
+ self.preview_lines = preview_lines
+ self.embed = embed
+ self.single = single
+ self.reverse = reverse
+ self.encoding = encoding
+
+ def __str__(self):
+ retval = ('id:', self.id,
+ 'short-label:', self.short_label,
+ 'long-label:', self.long_label,
+ 'icon:', self.icon,
+ 'is-system:', self.is_system,
+ 'preview-lines:', self.preview_lines,
+ 'embed:', self.embed,
+ 'single:', self.single,
+ 'reverse:', self.reverse,
+ 'encoding:', self.encoding)
+ return str(retval)
+
+ @classmethod
+ def serialize(cls, dict_item):
+ builder = GLib.VariantBuilder(GLib.VariantType('r'))
+ builder.add_value(GLib.Variant.new_string(dict_item.id))
+ builder.add_value(GLib.Variant.new_string(dict_item.short_label))
+ builder.add_value(GLib.Variant.new_string(dict_item.long_label))
+ builder.add_value(GLib.Variant.new_string(dict_item.icon))
+ builder.add_value(GLib.Variant.new_boolean(dict_item.is_system))
+ builder.add_value(GLib.Variant.new_int32(dict_item.preview_lines))
+ builder.add_value(GLib.Variant.new_boolean(dict_item.embed))
+ builder.add_value(GLib.Variant.new_boolean(dict_item.single))
+ builder.add_value(GLib.Variant.new_boolean(dict_item.reverse))
+ builder.add_value(GLib.Variant.new_string(dict_item.encoding))
+ return builder.end()
+
+class Prefs(GObject.GObject):
+ __gsignals__ = {
+ 'changed' : (
+ GObject.SignalFlags.RUN_FIRST,
+ None,
+ (str, str, GLib.Variant)),
+ }
+
+ def __init__(self):
+ super(Prefs, self).__init__()
+ self.__cache = {}
+ self.__settings = {}
+ self.__schema_prefix = 'org.freedesktop.ibus.engine.anthy.'
+ self.__schema_sections = ['common',
+ 'shortcut',
+ 'romaji-typing-rule',
+ 'kana-typing-rule',
+ 'thumb-typing-rule',
+ 'thumb',
+ 'dict']
+ for section in self.__schema_sections:
+ self.__settings[section] = Gio.Settings(
+ schema=self.__schema_prefix + section)
+ self.__settings[section].connect('changed',
+ self.__settings_on_changed)
+
+ def __settings_on_changed(self, settings, key):
+ section = settings.props.schema[len(self.__schema_prefix):]
+ variant_value = self.__settings[section].get_value(key)
+ variant_key = self.__cache.get(section)
+ if variant_key == None:
+ variant_key = {}
+ variant_key[key] = variant_value
+ self.__cache[section] = variant_key
+ self.emit('changed', section, key, variant_value)
def variant_to_value(self, variant):
if type(variant) != GLib.Variant:
@@ -68,7 +130,9 @@ class Prefs(object):
return variant.get_int32()
elif type_string == 'b':
return variant.get_boolean()
- elif type_string == 'as':
+ elif type_string == 'v':
+ return variant.unpack()
+ elif len(type_string) > 0 and type_string[0] == 'a':
# Use unpack() instead of dup_strv() in python.
# In the latest pygobject3 3.3.4 or later, g_variant_dup_strv
# returns the allocated strv but in the previous release,
@@ -79,193 +143,165 @@ class Prefs(object):
sys.abrt()
return variant
- def set_no_key_warning(self, no_key_warning):
- if no_key_warning and hasattr(IBus, 'unset_log_handler'):
- self.__no_key_warning = True
- else:
- self.__no_key_warning = False
-
- def keys(self, section):
- return list(self.default[section].keys())
-
- def sections(self):
- return list(self.default.keys())
-
- def set_new_section(self, section):
- self.default.setdefault(section, {})
+ def variant_from_value(self, value):
+ variant = None
+ if type(value) == str:
+ variant = GLib.Variant.new_string(value)
+ elif type(value) == int:
+ variant = GLib.Variant.new_int32(value)
+ elif type(value) == bool:
+ variant = GLib.Variant.new_boolean(value)
+ elif type(value) == list:
+ variant = GLib.Variant.new_strv(value)
+ if variant == None:
+ self.printerr('Unknown value type: %s' % type(value))
+ return variant
- def set_new_key(self, section, key):
- self.default[section].setdefault(key)
+ def get_variant(self, section, key):
+ variant_key = self.__cache.get(section)
+ if variant_key != None:
+ variant_value = variant_key.get(key)
+ if variant_value != None:
+ return variant_value
+ variant_value = self.__settings[section].get_value(key)
+ if variant_key == None:
+ variant_key = {}
+ variant_key[key] = variant_value
+ self.__cache[section] = variant_key
+ return variant_value
+
+ def get_default_variant(self, section, key):
+ return self.__settings[section].get_default_value(key)
+
+ def get_readable_value(self, section, key, variant):
+ value = self.variant_to_value(variant)
+ if section == 'dict' and key == 'list':
+ dicts = {}
+ for item in value:
+ dict_item = DictItem(*item)
+ dicts[dict_item.id] = dict_item
+ value = dicts
+ if section == 'dict' and key == 'template':
+ value = DictItem(*value)
+ return value
def get_value(self, section, key):
- try:
- return self.new[section][key]
- except:
- try:
- return self.modified[section][key]
- except:
- return self.default[section][key]
+ variant = self.get_variant(section, key)
+ return self.get_readable_value(section, key, variant)
- def get_value_direct(self, section, key, default=None):
- if self._config == None:
- return default
+ def get_default_value(self, section, key):
+ variant = self.get_default_variant(section, key)
+ return self.get_readable_value(section, key, variant)
- s = section
- section = '/'.join(
- [s for s in '/'.join([self._prefix, section]).split('/') if s])
- try:
- if self.__no_key_warning:
- IBus.set_log_handler(False)
- variant = self._config.get_value(section, key)
- if self.__no_key_warning:
- IBus.unset_log_handler()
- return self.variant_to_value(variant)
- except:
- return default
+ def set_variant(self, section, key, variant):
+ self.__settings[section].set_value(key, variant)
+ self.__settings[section].apply()
def set_value(self, section, key, value):
- if section not in self.sections():
- self.set_new_section(section)
- if key not in self.keys(section):
- self.set_new_key(section, key)
- self.default[section][key]
- self.new.setdefault(section, {})[key] = value
-
- def fetch_all(self):
- for s in self.sections():
- self.fetch_section(s)
-
- def fetch_section(self, section):
- if self._config == None:
+ variant = self.variant_from_value(value)
+ if variant == None:
return
+ self.set_variant(section, key, variant)
- if not self.__has_config_get_values:
- for k in self.keys(section):
- self.fetch_item(section, k)
+ def set_list_item(self, section, key, item, values):
+ variant = self.get_variant(section, key)
+ if variant == None:
+ printerrr('%s:%s does not exist' % (section, key))
return
-
- s = '/'.join(
- [s for s in '/'.join([self._prefix, section]).split('/') if s])
- variant = self._config.get_values(s)
- for key in list(variant.keys()):
- v = variant[key]
- self.modified.setdefault(section, {})[key] = v if v != [''] else []
- # FIXME: ibus-dconf converts the keys.
- if section == 'common':
- self.fetch_item(section, 'show-input-mode')
- self.fetch_item(section, 'show-typing-method')
- self.fetch_item(section, 'show-segment-mode')
- self.fetch_item(section, 'show-dict-mode')
- self.fetch_item(section, 'show-dict-config')
- self.fetch_item(section, 'show-preferences')
-
- def fetch_item(self, section, key, readonly=False):
- if self._config == None:
+ if section == 'shortcut':
+ variant_dict = GLib.VariantDict(variant)
+ array = []
+ for value in values:
+ array.append(GLib.Variant.new_string(value))
+ varray = GLib.Variant.new_array(GLib.VariantType('s'), array)
+ variant_dict.insert_value(item, varray)
+ # GVariantDict uses GHashTable internally and
+ # GVariantDict.end() does not support the order.
+ self.set_variant(section, key, variant_dict.end())
+ return
+ if section == 'romaji-typing-rule' or \
+ section == 'kana-typing-rule' or \
+ section == 'thumb-typing-rule':
+ (method, keymap_key) = item
+ variant_dict = GLib.VariantDict(variant)
+ keymap = variant_dict.lookup_value(method, None)
+ keymap_dict = GLib.VariantDict(keymap)
+ if section == 'thumb-typing-rule':
+ array = []
+ for value in values:
+ array.append(GLib.Variant.new_string(value))
+ vvalue = GLib.Variant.new_array(GLib.VariantType('s'), array)
+ else:
+ vvalue = GLib.Variant.new_string(values)
+ keymap_dict.insert_value(keymap_key, vvalue)
+ keymap = keymap_dict.end()
+ variant_dict.insert_value(method, keymap)
+ self.set_variant(section, key, variant_dict.end())
+ return
+ if section == 'dict' and key == 'files':
+ variant_dict = GLib.VariantDict(variant)
+ array = []
+ for value in values:
+ array.append(GLib.Variant.new_string(value))
+ varray = GLib.Variant.new_array(GLib.VariantType('s'), array)
+ variant_dict.insert_value(item, varray)
+ self.set_variant(section, key, variant_dict.end())
+ return
+ if section == 'dict' and key == 'list':
+ array = []
+ has_item = False
+ for v in variant:
+ dict_item = DictItem(*v)
+ if dict_item.id == values.id:
+ array.append(GLib.Variant.new_variant(
+ DictItem.serialize(values)))
+ has_item = True
+ else:
+ array.append(GLib.Variant.new_variant(
+ DictItem.serialize(dict_item)))
+ if not has_item:
+ array.append(GLib.Variant.new_variant(DictItem.serialize(values)))
+ varray = GLib.Variant.new_array(GLib.VariantType('v'), array)
+ self.set_variant(section, key, varray)
return
- s = '/'.join(
- [s for s in '/'.join([self._prefix, section]).split('/') if s])
- try:
- v = None
- # gobject-introspection has a bug.
- # https://bugzilla.gnome.org/show_bug.cgi?id=670509
- # GLib.log_set_handler("IBUS", GLib.LogLevelFlags.LEVEL_MASK,
- # self.__log_handler, False)
- if self.__no_key_warning:
- IBus.set_log_handler(False)
- variant = self._config.get_value(s, key)
- if self.__no_key_warning:
- IBus.unset_log_handler()
- v = self.variant_to_value(variant)
- except:
- v = None
- if readonly:
- return v != None
- if v != None:
- self.modified.setdefault(section, {})[key] = v if v != [''] else []
- return True
-
- def commit_all(self):
- for s in list(self.new.keys()):
- self.commit_section(s)
-
- def commit_section(self, section):
- if section in self.new:
- for k in list(self.new[section].keys()):
- self.commit_item(section, k)
-
- def commit_item(self, section, key):
- if section in self.new and key in self.new[section]:
- s = '/'.join(
- [s for s in '/'.join([self._prefix, section]).split('/') if s])
- v = self.new[section][key]
- if v == []:
- v = ['']
- variant = None
- if type(v) == str:
- variant = GLib.Variant.new_string(v)
- elif type(v) == int:
- variant = GLib.Variant.new_int32(v)
- elif type(v) == bool:
- variant = GLib.Variant.new_boolean(v)
- elif type(v) == list:
- variant = GLib.Variant.new_strv(v)
- if variant == None:
- self.printerr('Unknown value type: %s' % type(v))
- sys.abrt()
- if self._config != None:
- self._config.set_value(s, key, variant)
- self.modified.setdefault(section, {})[key] = v
- del(self.new[section][key])
-
- def undo_all(self):
- self.new.clear()
-
- def undo_section(self, section):
- try:
- del(self.new[section])
- except:
- pass
-
- def undo_item(self, section, key):
- try:
- del(self.new[section][key])
- except:
- pass
-
- def set_default_all(self):
- for s in self.sections():
- self.set_default_section(s)
-
- def set_default_section(self, section):
- for k in self.keys(section):
- self.set_default_item(section, k)
-
- def set_default_item(self, section, key):
- try:
- if key in self.modified[section] or key in self.new[section]:
- self.new[section][key] = self.default[section][key]
- except:
- pass
-
- # Convert DBus.String to str
- # sys.getdefaultencoding() == 'utf-8' with pygtk2 but
- # sys.getdefaultencoding() == 'ascii' with gi gtk3
- # so the simple str(unicode_string) causes an error and need to use
- # unicode_string.encode('utf-8') instead.
- def str(self, uni):
- if uni == None:
- return None
- if type(uni) == str:
- return uni
- return str(uni)
+ def delete_list_item(self, section, key, item):
+ variant = self.get_variant(section, key)
+ if variant == None:
+ printerrr('%s:%s does not exist' % (section, key))
+ return
+ if section == 'romaji-typing-rule' or \
+ section == 'kana-typing-rule' or \
+ section == 'thumb-typing-rule':
+ (method, keymap_key) = item
+ variant_dict = GLib.VariantDict(variant)
+ keymap = variant_dict.lookup_value(method, None)
+ keymap_dict = GLib.VariantDict(keymap)
+ keymap_dict.remove(keymap_key)
+ keymap = keymap_dict.end()
+ variant_dict.insert_value(method, keymap)
+ self.set_variant(section, key, variant_dict.end())
+ return
+ if section == 'dict' and key == 'files':
+ variant_dict = GLib.VariantDict(variant)
+ variant_dict.remove(item)
+ self.set_variant(section, key, variant_dict.end())
+ return
+ if section == 'dict' and key == 'list':
+ array = []
+ for v in variant:
+ dict_item = DictItem(*v)
+ if dict_item.id == item:
+ continue
+ else:
+ array.append(GLib.Variant.new_variant(
+ DictItem.serialize(dict_item)))
+ varray = GLib.Variant.new_array(GLib.VariantType('v'), array)
+ self.set_variant(section, key, varray)
+ return
- # The simple unicode(string) causes an error and need to use
- # unicode(string, 'utf-8') instead.
- def unicode(self, string):
- if string == None:
- return None
- return string
+ def bind(self, section, key, object, property, flags):
+ self.__settings[section].bind(key, object, property, flags)
# If the parent process exited, the std io/out/error will be lost.
@staticmethod
diff --git a/setup/python3/setup.ui b/setup/python3/setup.ui
index f0acbc6..61d9325 100644
--- a/setup/python3/setup.ui
+++ b/setup/python3/setup.ui
@@ -196,7 +196,7 @@
<property name="visible">False</property>
<property name="title" translatable="yes">Setup - IBus-Anthy</property>
<property name="type_hint">dialog</property>
- <signal handler="on_main_delete" name="delete_event"/>
+ <signal handler="on_main_quit" name="delete_event"/>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
@@ -232,7 +232,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Input Mode:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">input_mode</property>
+ <property name="mnemonic_widget">input-mode</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@@ -240,9 +240,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="input_mode">
+ <object class="GtkComboBox" id="input-mode">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model1</property>
<child>
<object class="GtkCellRendererText" id="renderer1"/>
@@ -263,7 +262,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Typing Method:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">typing_method</property>
+ <property name="mnemonic_widget">typing-method</property>
</object>
<packing>
<property name="top_attach">1</property>
@@ -273,9 +272,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="typing_method">
+ <object class="GtkComboBox" id="typing-method">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model2</property>
<child>
<object class="GtkCellRendererText" id="renderer2"/>
@@ -298,7 +296,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Conversion _Mode:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">conversion_segment_mode</property>
+ <property name="mnemonic_widget">conversion-segment-mode</property>
</object>
<packing>
<property name="top_attach">2</property>
@@ -308,9 +306,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="conversion_segment_mode">
+ <object class="GtkComboBox" id="conversion-segment-mode">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model3</property>
<child>
<object class="GtkCellRendererText" id="renderer3"/>
@@ -366,7 +363,7 @@
<property name="vscrollbar_policy">automatic</property>
<property name="shadow_type">in</property>
<child>
- <object class="GtkTreeView" id="menu_visible:treeview">
+ <object class="GtkTreeView" id="menu-visible:treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
@@ -430,7 +427,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Period Style:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">period_style</property>
+ <property name="mnemonic_widget">period-style</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@@ -443,7 +440,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Symbo_l Style:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">symbol_style</property>
+ <property name="mnemonic_widget">symbol-style</property>
</object>
<packing>
<property name="top_attach">1</property>
@@ -458,7 +455,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Numpad _Key Type:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">ten_key_mode</property>
+ <property name="mnemonic_widget">ten-key-mode</property>
</object>
<packing>
<property name="top_attach">2</property>
@@ -468,9 +465,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="ten_key_mode">
+ <object class="GtkComboBox" id="ten-key-mode">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model4</property>
<child>
<object class="GtkCellRendererText" id="renderer4"/>
@@ -488,9 +484,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="symbol_style">
+ <object class="GtkComboBox" id="symbol-style">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model5</property>
<child>
<object class="GtkCellRendererText" id="renderer5"/>
@@ -508,9 +503,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="period_style">
+ <object class="GtkComboBox" id="period-style">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model6</property>
<child>
<object class="GtkCellRendererText" id="renderer6"/>
@@ -531,7 +525,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">_Behavior on Period:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">behavior_on_period</property>
+ <property name="mnemonic_widget">behavior-on-period</property>
</object>
<packing>
<property name="top_attach">3</property>
@@ -546,7 +540,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Behavior on _Focus Out:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">behavior_on_focus_out</property>
+ <property name="mnemonic_widget">behavior-on-focus-out</property>
</object>
<packing>
<property name="top_attach">4</property>
@@ -556,9 +550,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="behavior_on_period">
+ <object class="GtkComboBox" id="behavior-on-period">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model7</property>
<child>
<object class="GtkCellRendererText" id="renderer7"/>
@@ -576,9 +569,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="behavior_on_focus_out">
+ <object class="GtkComboBox" id="behavior-on-focus-out">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model8</property>
<child>
<object class="GtkCellRendererText" id="renderer8"/>
@@ -636,7 +628,7 @@
<property name="xalign">0</property>
<property name="label" translatable="yes">Candidate _Window Page Size:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">page_size</property>
+ <property name="mnemonic_widget">page-size</property>
</object>
<packing>
<property name="expand">False</property>
@@ -645,12 +637,11 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="page_size">
+ <object class="GtkSpinButton" id="page-size">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">adjustment1</property>
<property name="climb_rate">0.97999999999999998</property>
- <signal handler="on_sb_changed" name="value_changed"/>
</object>
<packing>
<property name="expand">False</property>
@@ -664,14 +655,13 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="half_width_symbol">
+ <object class="GtkCheckButton" id="half-width-symbol">
<property name="label" translatable="yes">Convert _symbols with the one column width</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal handler="on_ck_toggled" name="toggled"/>
<accelerator key="S" modifiers="GDK_MOD1_MASK" signal="grab_focus"/>
</object>
<packing>
@@ -681,14 +671,13 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="half_width_number">
+ <object class="GtkCheckButton" id="half-width-number">
<property name="label" translatable="yes">Convert _numbers with the one column width</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal handler="on_ck_toggled" name="toggled"/>
<accelerator key="N" modifiers="GDK_MOD1_MASK" signal="grab_focus"/>
</object>
<packing>
@@ -698,14 +687,13 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="half_width_space">
+ <object class="GtkCheckButton" id="half-width-space">
<property name="label" translatable="yes">Con_vert spaces with the one column width</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal handler="on_ck_toggled" name="toggled"/>
<accelerator key="v" modifiers="GDK_MOD1_MASK" signal="activate"/>
</object>
<packing>
@@ -715,14 +703,13 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="latin_with_shift">
+ <object class="GtkCheckButton" id="latin-with-shift">
<property name="label" translatable="yes">Swi_tch “Hiragana” and “Latin” with Shift key and Hiragana–Katakana key in preedit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal handler="on_ck_toggled" name="toggled"/>
<accelerator key="t" modifiers="GDK_MOD1_MASK" signal="activate"/>
</object>
<packing>
@@ -777,7 +764,7 @@
<property name="label" translatable="yes">_Shortcut Type:</property>
<property name="use_underline">True</property>
<property name="wrap_mode">word-char</property>
- <property name="mnemonic_widget">shortcut_type</property>
+ <property name="mnemonic_widget">shortcut-type</property>
</object>
<packing>
<property name="expand">False</property>
@@ -787,7 +774,7 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="shortcut_type">
+ <object class="GtkComboBox" id="shortcut-type">
<property name="visible">True</property>
<signal handler="on_shortcut_type_changed" name="changed"/>
<property name="model">model9</property>
@@ -1271,7 +1258,7 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="thumb:keyboard_layout_mode">
+ <object class="GtkCheckButton" id="thumb:keyboard-layout-mode">
<property name="label" translatable="yes">Adjust _input method layout to system keyboard layout</property>
<property name="tooltip_text" translatable="yes">Adjust IM layout to XKB layout</property>
<property name="visible">True</property>
@@ -1279,7 +1266,6 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal handler="on_ck_toggled" name="toggled"/>
<accelerator key="I" modifiers="GDK_MOD1_MASK" signal="grab_focus"/>
</object>
<packing>
@@ -1299,7 +1285,7 @@
<property name="xalign">0</property>
<property name="use_underline">True</property>
<property name="label" translatable="yes">Input _Method Layout:</property>
- <property name="mnemonic_widget">thumb:keyboard_layout</property>
+ <property name="mnemonic_widget">thumb:keyboard-layout</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1308,9 +1294,8 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="thumb:keyboard_layout">
+ <object class="GtkComboBox" id="thumb:keyboard-layout">
<property name="visible">True</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model51</property>
<child>
<object class="GtkCellRendererText" id="renderer10"/>
@@ -1378,7 +1363,7 @@
<property name="xalign">0</property>
<property name="use_underline">True</property>
<property name="label" translatable="yes">_Additional Key Arrangement:</property>
- <property name="mnemonic_widget">thumb:fmv_extension</property>
+ <property name="mnemonic_widget">thumb:fmv-extension</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1387,10 +1372,9 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="thumb:fmv_extension">
+ <object class="GtkComboBox" id="thumb:fmv-extension">
<property name="visible">True</property>
<property name="tooltip_text" translatable="yes">'&#xFF5E;', '&#x300E;', '&#xA2;', '&#xA3;' and so on can be output with Thumb Shift key</property>
- <signal handler="on_cb_changed" name="changed"/>
<property name="model">model11</property>
<child>
<object class="GtkCellRendererText" id="renderer11"/>
@@ -1457,7 +1441,6 @@
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
- <signal handler="on_ck_toggled" name="toggled"/>
<accelerator key="E" modifiers="GDK_MOD1_MASK" signal="grab_focus"/>
</object>
<packing>
@@ -1576,7 +1559,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">_Edit Dictionary Command:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">dict:entry_edit_dict_command</property>
+ <property name="mnemonic_widget">dict:entry-edit-dict-command</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@@ -1587,7 +1570,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="dict:entry_edit_dict_command">
+ <object class="GtkEntry" id="dict:entry-edit-dict-command">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@@ -1627,7 +1610,7 @@
<property name="visible">True</property>
<property name="label" translatable="yes">_Add Word Command:</property>
<property name="use_underline">True</property>
- <property name="mnemonic_widget">dict:entry_add_word_command</property>
+ <property name="mnemonic_widget">dict:entry-add-word-command</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
@@ -1640,7 +1623,7 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="dict:entry_add_word_command">
+ <object class="GtkEntry" id="dict:entry-add-word-command">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
@@ -1921,15 +1904,14 @@
<property name="orientation">horizontal</property>
<property name="layout_style">end</property>
<child>
- <object class="GtkButton" id="btn_apply">
- <property name="label" translatable="yes">_Apply</property>
+ <object class="GtkButton" id="btn_close">
+ <property name="label" translatable="yes">_Close</property>
<property name="use_underline">True</property>
<property name="visible">True</property>
- <property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
- <signal handler="on_btn_apply_clicked" name="clicked"/>
+ <signal handler="on_btn_close_clicked" name="clicked"/>
</object>
<packing>
<property name="expand">False</property>
@@ -1937,38 +1919,6 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="btn_cancel">
- <property name="label" translatable="yes">_Cancel</property>
- <property name="use_underline">True</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <signal handler="on_btn_cancel_clicked" name="clicked"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="btn_ok">
- <property name="label" translatable="yes">_OK</property>
- <property name="use_underline">True</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <signal handler="on_btn_ok_clicked" name="clicked"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -1979,9 +1929,7 @@
</object>
</child>
<action-widgets>
- <action-widget response="-10">btn_apply</action-widget>
- <action-widget response="-6">btn_cancel</action-widget>
- <action-widget response="-5">btn_ok</action-widget>
+ <action-widget response="-5">btn_close</action-widget>
</action-widgets>
</object>
<object class="GtkDialog" id="edit_shortcut">
@@ -2762,8 +2710,8 @@
<property name="program-name">IBus-Anthy</property>
<property name="copyright">Copyright © 2007–2008 Peng Huang
Copyright © 2009 Hideaki ABE
-Copyright © 2009–2016 Takao Fujiwara
-Copyright © 2007–2016 Red Hat, Inc.</property>
+Copyright © 2009–2017 Takao Fujiwara
+Copyright © 2007–2017 Red Hat, Inc.</property>
<property name="comments" translatable="yes">The Anthy engine for the IBus input platform</property>
<property name="license">GPL</property>
<property name="website">https://github.com/ibus/ibus/wiki</property>