Update uim-mozc.patch
Update to r242.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Nobuhiro Iwamatsu
12 years ago
0 | From 02ae723697b09c3cf86d0d4595849bc2f3e0fe3f Mon Sep 17 00:00:00 2001 | |
0 | From 17ade5618602a04753c960a90603d6663b2578ec Mon Sep 17 00:00:00 2001 | |
1 | 1 | From: Nobuhiro Iwamatsu <iwamatsu@debian.org> |
2 | Date: Tue, 15 Mar 2011 01:04:04 +0900 | |
3 | Subject: [PATCH] Add uim-mozc r222 | |
2 | Date: Tue, 31 May 2011 08:47:27 +0900 | |
3 | Subject: [PATCH] Add uim-mozc r242 | |
4 | 4 | |
5 | 5 | Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org> |
6 | 6 | --- |
7 | 7 | unix/uim/key_translator.cc | 436 +++++++++++++++++ |
8 | 8 | unix/uim/key_translator.h | 111 +++++ |
9 | 9 | unix/uim/mozc.cc | 992 ++++++++++++++++++++++++++++++++++++++ |
10 | unix/uim/scm/mozc-custom.scm | 259 ++++++++++ | |
10 | unix/uim/scm/mozc-custom.scm | 392 +++++++++++++++ | |
11 | 11 | unix/uim/scm/mozc-key-custom.scm | 74 +++ |
12 | unix/uim/scm/mozc.scm | 352 ++++++++++++++ | |
12 | unix/uim/scm/mozc.scm | 512 ++++++++++++++++++++ | |
13 | 13 | unix/uim/uim.gyp | 82 ++++ |
14 | 7 files changed, 2306 insertions(+), 0 deletions(-) | |
14 | 7 files changed, 2599 insertions(+), 0 deletions(-) | |
15 | 15 | create mode 100644 unix/uim/key_translator.cc |
16 | 16 | create mode 100644 unix/uim/key_translator.h |
17 | 17 | create mode 100644 unix/uim/mozc.cc |
22 | 22 | |
23 | 23 | diff --git a/unix/uim/key_translator.cc b/unix/uim/key_translator.cc |
24 | 24 | new file mode 100644 |
25 | index 0000000..ae1cd2d | |
25 | index 0000000..6020923 | |
26 | 26 | --- /dev/null |
27 | 27 | +++ b/unix/uim/key_translator.cc |
28 | 28 | @@ -0,0 +1,436 @@ |
29 | 29 | +// Copyright 2010, Google Inc. |
30 | +// Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
30 | +// Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
31 | 31 | +// All rights reserved. |
32 | 32 | +// |
33 | 33 | +// Redistribution and use in source and binary forms, with or without |
464 | 464 | +} // namespace mozc |
465 | 465 | diff --git a/unix/uim/key_translator.h b/unix/uim/key_translator.h |
466 | 466 | new file mode 100644 |
467 | index 0000000..be58c9b | |
467 | index 0000000..fbcc365 | |
468 | 468 | --- /dev/null |
469 | 469 | +++ b/unix/uim/key_translator.h |
470 | 470 | @@ -0,0 +1,111 @@ |
471 | 471 | +// Copyright 2010, Google Inc. |
472 | +// Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
472 | +// Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
473 | 473 | +// All rights reserved. |
474 | 474 | +// |
475 | 475 | +// Redistribution and use in source and binary forms, with or without |
581 | 581 | +#endif // MOZC_UNIX_UIM_KEY_TRANSLATOR_H_ |
582 | 582 | diff --git a/unix/uim/mozc.cc b/unix/uim/mozc.cc |
583 | 583 | new file mode 100644 |
584 | index 0000000..80d54fa | |
584 | index 0000000..7a96cb5 | |
585 | 585 | --- /dev/null |
586 | 586 | +++ b/unix/uim/mozc.cc |
587 | 587 | @@ -0,0 +1,992 @@ |
588 | 588 | +/* |
589 | 589 | + |
590 | + Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
590 | + Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
591 | 591 | + |
592 | 592 | + All rights reserved. |
593 | 593 | + |
1579 | 1579 | +} |
1580 | 1580 | diff --git a/unix/uim/scm/mozc-custom.scm b/unix/uim/scm/mozc-custom.scm |
1581 | 1581 | new file mode 100644 |
1582 | index 0000000..d2cea8c | |
1582 | index 0000000..b283970 | |
1583 | 1583 | --- /dev/null |
1584 | 1584 | +++ b/unix/uim/scm/mozc-custom.scm |
1585 | @@ -0,0 +1,259 @@ | |
1585 | @@ -0,0 +1,392 @@ | |
1586 | 1586 | +;;; |
1587 | +;;; Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
1587 | +;;; Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
1588 | 1588 | +;;; |
1589 | 1589 | +;;; All rights reserved. |
1590 | 1590 | +;;; |
1695 | 1695 | + (N_ "Kana") |
1696 | 1696 | + (N_ "Kana input mode")))) |
1697 | 1697 | + |
1698 | +(define mozc-tool-indication-alist | |
1699 | + (list | |
1700 | + (list 'action_mozc_tool_selector | |
1701 | + 'mozc_tool_selector | |
1702 | + "T" | |
1703 | + (N_ "MozcTool selector") | |
1704 | + (N_ "MozcTool selector")) | |
1705 | + (list 'action_mozc_tool_about_dialog | |
1706 | + 'mozc_tool_about_dialog | |
1707 | + "A" | |
1708 | + (N_ "About") | |
1709 | + (N_ "About")) | |
1710 | + (list 'action_mozc_tool_config_dialog | |
1711 | + 'mozc_tool_config_dialog | |
1712 | + "C" | |
1713 | + (N_ "Config dialog") | |
1714 | + (N_ "Config dialog")) | |
1715 | + (list 'action_mozc_tool_dictionary_tool | |
1716 | + 'mozc_tool_dictionary_tool | |
1717 | + "D" | |
1718 | + (N_ "Dictionary tool") | |
1719 | + (N_ "Dictionary tool")) | |
1720 | + (list 'action_mozc_tool_word_register_dialog | |
1721 | + 'mozc_tool_word_register_dialog | |
1722 | + "W" | |
1723 | + (N_ "Word register dialog") | |
1724 | + (N_ "Word register dialog")) | |
1725 | + (list 'action_mozc_tool_character_palette | |
1726 | + 'mozc_tool_character_palette | |
1727 | + "P" | |
1728 | + (N_ "Character palette") | |
1729 | + (N_ "Character palette")) | |
1730 | + (list 'action_mozc_tool_hand_writing | |
1731 | + 'mozc_tool_hand_writing | |
1732 | + "H" | |
1733 | + (N_ "Hand writing") | |
1734 | + (N_ "Hand writing")))) | |
1735 | + | |
1736 | + | |
1698 | 1737 | +;;; Buttons |
1699 | 1738 | + |
1700 | 1739 | +(define-custom 'mozc-widgets '(widget_mozc_input_mode |
1701 | + widget_mozc_kana_input_method) | |
1740 | + widget_mozc_kana_input_method | |
1741 | + widget_mozc_tool) | |
1702 | 1742 | + '(mozc toolbar) |
1703 | 1743 | + (list 'ordered-list |
1704 | 1744 | + (list 'widget_mozc_input_mode |
1706 | 1746 | + (_ "Input mode")) |
1707 | 1747 | + (list 'widget_mozc_kana_input_method |
1708 | 1748 | + (_ "Kana input method") |
1709 | + (_ "Kana input method"))) | |
1749 | + (_ "Kana input method")) | |
1750 | + (list 'widget_mozc_tool | |
1751 | + (_ "Mozc tool") | |
1752 | + (_ "Mozc tool"))) | |
1710 | 1753 | + (_ "Enabled toolbar buttons") |
1711 | 1754 | + (_ "long description will be here.")) |
1712 | 1755 | + |
1822 | 1865 | + 'custom-set-hooks |
1823 | 1866 | + (lambda () |
1824 | 1867 | + (mozc-configure-widgets))) |
1868 | + | |
1869 | + | |
1870 | +;;; Mozc tool | |
1871 | +(define-custom 'mozc-tool-actions | |
1872 | + (map car mozc-tool-indication-alist) | |
1873 | + '(mozc toolbar) | |
1874 | + (cons 'ordered-list | |
1875 | + (map indication-alist-entry-extract-choice | |
1876 | + mozc-tool-indication-alist)) | |
1877 | + (N_ "Mozc tool menu items") | |
1878 | + (N_ "long description will be here.")) | |
1879 | + | |
1880 | + | |
1881 | + | |
1825 | 1882 | + |
1826 | 1883 | + |
1827 | 1884 | +(define-custom 'mozc-use-with-vi? #f |
1842 | 1899 | + (N_ "Keyboard type for kana input method") |
1843 | 1900 | + (N_ "long description will be here.")) |
1844 | 1901 | + |
1902 | + | |
1903 | +(define-custom-group 'mozc-tool | |
1904 | + (N_ "MozcTool") | |
1905 | + (N_ "MozcTool settings")) | |
1906 | + | |
1907 | +(define-custom 'mozc-tool-about-dialog-cmd "/usr/lib/mozc/mozc_tool" | |
1908 | + '(mozc-tool) | |
1909 | + '(pathname regular-file) | |
1910 | + (N_ "Path of about dialog command") | |
1911 | + (N_ "long description will be here.")) | |
1912 | + | |
1913 | +(define-custom 'mozc-tool-about-dialog-cmd-option "--mode=about_dialog" | |
1914 | + '(mozc-tool) | |
1915 | + '(pathname regular-file) | |
1916 | + (N_ "Option for about dialog command") | |
1917 | + (N_ "long description will be here.")) | |
1918 | + | |
1919 | +(define-custom 'mozc-tool-config-dialog-cmd "/usr/lib/mozc/mozc_tool" | |
1920 | + '(mozc-tool) | |
1921 | + '(pathname regular-file) | |
1922 | + (N_ "Path of config dialog command") | |
1923 | + (N_ "long description will be here.")) | |
1924 | + | |
1925 | +(define-custom 'mozc-tool-config-dialog-cmd-option "--mode=config_dialog" | |
1926 | + '(mozc-tool) | |
1927 | + '(pathname regular-file) | |
1928 | + (N_ "Option for config dialog command") | |
1929 | + (N_ "long description will be here.")) | |
1930 | + | |
1931 | +(define-custom 'mozc-tool-dictionary-tool-cmd "/usr/lib/mozc/mozc_tool" | |
1932 | + '(mozc-tool) | |
1933 | + '(pathname regular-file) | |
1934 | + (N_ "Path of dictionary tool command") | |
1935 | + (N_ "long description will be here.")) | |
1936 | + | |
1937 | +(define-custom 'mozc-tool-dictionary-tool-cmd-option "--mode=dictionary_tool" | |
1938 | + '(mozc-tool) | |
1939 | + '(pathname regular-file) | |
1940 | + (N_ "Option for dictionary tool command") | |
1941 | + (N_ "long description will be here.")) | |
1942 | + | |
1943 | +(define-custom 'mozc-tool-word-register-dialog-cmd "/usr/lib/mozc/mozc_tool" | |
1944 | + '(mozc-tool) | |
1945 | + '(pathname regular-file) | |
1946 | + (N_ "Path of word register dialog command") | |
1947 | + (N_ "long description will be here.")) | |
1948 | + | |
1949 | +(define-custom 'mozc-tool-word-register-dialog-cmd-option "--mode=word_register_dialog" | |
1950 | + '(mozc-tool) | |
1951 | + '(pathname regular-file) | |
1952 | + (N_ "Option for word register dialog command") | |
1953 | + (N_ "long description will be here.")) | |
1954 | + | |
1955 | +(define-custom 'mozc-tool-character-palette-cmd "/usr/lib/mozc/mozc_tool" | |
1956 | + '(mozc-tool) | |
1957 | + '(pathname regular-file) | |
1958 | + (N_ "Path of character palette command") | |
1959 | + (N_ "long description will be here.")) | |
1960 | + | |
1961 | +(define-custom 'mozc-tool-character-palette-cmd-option "--mode=character_palette" | |
1962 | + '(mozc-tool) | |
1963 | + '(pathname regular-file) | |
1964 | + (N_ "Option for character palette command") | |
1965 | + (N_ "long description will be here.")) | |
1966 | + | |
1967 | +(define-custom 'mozc-tool-hand-writing-cmd "/usr/lib/mozc/mozc_tool" | |
1968 | + '(mozc-tool) | |
1969 | + '(pathname regular-file) | |
1970 | + (N_ "Path of hand writing command") | |
1971 | + (N_ "long description will be here.")) | |
1972 | + | |
1973 | +(define-custom 'mozc-tool-hand-writing-cmd-option "--mode=hand_writing" | |
1974 | + '(mozc-tool) | |
1975 | + '(pathname regular-file) | |
1976 | + (N_ "Option for hand writing command") | |
1977 | + (N_ "long description will be here.")) | |
1845 | 1978 | diff --git a/unix/uim/scm/mozc-key-custom.scm b/unix/uim/scm/mozc-key-custom.scm |
1846 | 1979 | new file mode 100644 |
1847 | index 0000000..553fe1f | |
1980 | index 0000000..fbc94ae | |
1848 | 1981 | --- /dev/null |
1849 | 1982 | +++ b/unix/uim/scm/mozc-key-custom.scm |
1850 | 1983 | @@ -0,0 +1,74 @@ |
1851 | 1984 | +;;; |
1852 | +;;; Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
1985 | +;;; Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
1853 | 1986 | +;;; |
1854 | 1987 | +;;; All rights reserved. |
1855 | 1988 | +;;; |
1924 | 2057 | + (_ "long description will be here")) |
1925 | 2058 | diff --git a/unix/uim/scm/mozc.scm b/unix/uim/scm/mozc.scm |
1926 | 2059 | new file mode 100644 |
1927 | index 0000000..41f34f9 | |
2060 | index 0000000..619b5b5 | |
1928 | 2061 | --- /dev/null |
1929 | 2062 | +++ b/unix/uim/scm/mozc.scm |
1930 | @@ -0,0 +1,352 @@ | |
2063 | @@ -0,0 +1,512 @@ | |
1931 | 2064 | +;;; |
1932 | +;;; Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
2065 | +;;; Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
1933 | 2066 | +;;; |
1934 | 2067 | +;;; All rights reserved. |
1935 | 2068 | +;;; |
1959 | 2092 | +;;;; |
1960 | 2093 | + |
1961 | 2094 | +(require "util.scm") |
2095 | +(require "process.scm") | |
1962 | 2096 | +(require "japanese.scm") |
1963 | 2097 | +(require-custom "generic-key-custom.scm") |
1964 | 2098 | +(require-custom "mozc-custom.scm") |
1978 | 2112 | + |
1979 | 2113 | +(define mozc-prepare-input-mode-activation |
1980 | 2114 | + (lambda (mc new-mode) |
1981 | + (mozc-lib-set-input-mode mc (mozc-context-mc-id mc) new-mode))) | |
2115 | + (let ((mid (mozc-context-mc-id mc))) | |
2116 | + (if mid | |
2117 | + (mozc-lib-set-input-mode mc mid new-mode) | |
2118 | + #f)))) | |
1982 | 2119 | + |
1983 | 2120 | +(define mozc-prepare-input-rule-activation |
1984 | 2121 | + (lambda (mc new-rule) |
1985 | + (mozc-lib-set-input-rule mc (mozc-context-mc-id mc) new-rule))) | |
2122 | + (let ((mid (mozc-context-mc-id mc))) | |
2123 | + (if mid | |
2124 | + (mozc-lib-set-input-rule mc mid new-rule) | |
2125 | + #f)))) | |
2126 | + | |
2127 | +(define (mozc-run-process file . args) | |
2128 | + (let-optionals* args ((argv (list file))) | |
2129 | + (let ((pid (process-fork))) | |
2130 | + (cond ((< pid 0) | |
2131 | + (begin | |
2132 | + (uim-notify-fatal (N_ "cannot fork")) | |
2133 | + #f)) | |
2134 | + ((= 0 pid) ;; child | |
2135 | + (let ((pid2 (process-fork))) | |
2136 | + (cond ((< pid2 0) | |
2137 | + (begin | |
2138 | + (uim-notify-fatal (N_ "cannot fork")) | |
2139 | + #f)) | |
2140 | + ((= 0 pid2) | |
2141 | + (if (= (process-execute file argv) -1) | |
2142 | + (uim-notify-fatal (format (N_ "cannot execute ~a") file))) | |
2143 | + (_exit 0)) | |
2144 | + (else | |
2145 | + (_exit 0))))) | |
2146 | + (else | |
2147 | + (process-waitpid pid 0) | |
2148 | + pid))))) | |
2149 | + | |
2150 | +(define mozc-tool-activate | |
2151 | + (lambda (mc option) | |
2152 | + (case option | |
2153 | + ((mozc-tool-about-dialog) | |
2154 | + (mozc-run-process mozc-tool-about-dialog-cmd (list mozc-tool-about-dialog-cmd mozc-tool-about-dialog-cmd-option))) | |
2155 | + ((mozc-tool-config-dialog) | |
2156 | + (mozc-run-process mozc-tool-config-dialog-cmd (list mozc-tool-config-dialog-cmd mozc-tool-config-dialog-cmd-option))) | |
2157 | + ((mozc-tool-dictionary-tool) | |
2158 | + (mozc-run-process mozc-tool-dictionary-tool-cmd (list mozc-tool-dictionary-tool-cmd mozc-tool-dictionary-tool-cmd-option))) | |
2159 | + ((mozc-tool-word-register-dialog) | |
2160 | + (mozc-run-process mozc-tool-word-register-dialog-cmd (list mozc-tool-word-register-dialog-cmd mozc-tool-word-register-dialog-cmd-option))) | |
2161 | + ((mozc-tool-character-palette) | |
2162 | + (mozc-run-process mozc-tool-character-palette-cmd (list mozc-tool-character-palette-cmd mozc-tool-character-palette-cmd-option))) | |
2163 | + ((mozc-tool-hand-writing) | |
2164 | + (mozc-run-process mozc-tool-hand-writing-cmd (list mozc-tool-hand-writing-cmd mozc-tool-hand-writing-cmd-option))) | |
2165 | + (else | |
2166 | + #f)))) | |
1986 | 2167 | + |
1987 | 2168 | +(register-action 'action_mozc_hiragana |
1988 | 2169 | + (lambda (mc) ;; indication handler |
1992 | 2173 | + "ひらがな入力モード")) |
1993 | 2174 | + (lambda (mc) ;; activity predicate |
1994 | 2175 | + (and |
2176 | + (mozc-context-mc-id mc) | |
1995 | 2177 | + (mozc-context-on mc) |
1996 | 2178 | + (= (mozc-lib-input-mode (mozc-context-mc-id mc)) mozc-type-hiragana))) |
1997 | 2179 | + (lambda (mc) ;; action handler |
2005 | 2187 | + "カタカナ入力モード")) |
2006 | 2188 | + (lambda (mc) |
2007 | 2189 | + (and |
2190 | + (mozc-context-mc-id mc) | |
2008 | 2191 | + (mozc-context-on mc) |
2009 | 2192 | + (= (mozc-lib-input-mode (mozc-context-mc-id mc)) mozc-type-katakana))) |
2010 | 2193 | + (lambda (mc) |
2018 | 2201 | + "半角カタカナ入力モード")) |
2019 | 2202 | + (lambda (mc) |
2020 | 2203 | + (and |
2204 | + (mozc-context-mc-id mc) | |
2021 | 2205 | + (mozc-context-on mc) |
2022 | 2206 | + (= (mozc-lib-input-mode (mozc-context-mc-id mc)) mozc-type-halfkana))) |
2023 | 2207 | + (lambda (mc) |
2031 | 2215 | + "半角英数入力モード")) |
2032 | 2216 | + (lambda (mc) |
2033 | 2217 | + (and |
2218 | + (mozc-context-mc-id mc) | |
2034 | 2219 | + (mozc-context-on mc) |
2035 | 2220 | + (= (mozc-lib-input-mode (mozc-context-mc-id mc)) mozc-type-halfwidth-alnum))) |
2036 | 2221 | + (lambda (mc) |
2055 | 2240 | + "全角英数入力モード")) |
2056 | 2241 | + (lambda (mc) |
2057 | 2242 | + (and |
2243 | + (mozc-context-mc-id mc) | |
2058 | 2244 | + (mozc-context-on mc) |
2059 | 2245 | + (= (mozc-lib-input-mode (mozc-context-mc-id mc)) mozc-type-fullwidth-alnum))) |
2060 | 2246 | + (lambda (mc) |
2069 | 2255 | + "ローマ字" |
2070 | 2256 | + "ローマ字入力モード")) |
2071 | 2257 | + (lambda (mc) |
2072 | + (= (mozc-lib-input-rule (mozc-context-mc-id mc)) | |
2073 | + mozc-input-rule-roma)) | |
2258 | + (and (mozc-context-mc-id mc) | |
2259 | + (= (mozc-lib-input-rule (mozc-context-mc-id mc)) | |
2260 | + mozc-input-rule-roma))) | |
2074 | 2261 | + (lambda (mc) |
2075 | 2262 | + (mozc-prepare-input-rule-activation mc mozc-input-rule-roma) |
2076 | 2263 | +)) |
2084 | 2271 | + "かな" |
2085 | 2272 | + "かな入力モード")) |
2086 | 2273 | + (lambda (mc) |
2087 | + (= (mozc-lib-input-rule (mozc-context-mc-id mc)) | |
2088 | + mozc-input-rule-kana)) | |
2274 | + (and (mozc-context-mc-id mc) | |
2275 | + (= (mozc-lib-input-rule (mozc-context-mc-id mc)) | |
2276 | + mozc-input-rule-kana))) | |
2089 | 2277 | + (lambda (mc) |
2090 | 2278 | + (mozc-prepare-input-rule-activation mc mozc-input-rule-kana) |
2091 | 2279 | + )) |
2280 | + | |
2281 | +(register-action 'action_mozc_tool_selector | |
2282 | +;; (indication-alist-indicator 'action_mozc_tool_selector | |
2283 | +;; mozc-tool-indication-alist) | |
2284 | + (lambda (mc) | |
2285 | + '(mozc_tool_selector | |
2286 | + "T" | |
2287 | + "MozcTool selector" | |
2288 | + "MozcTool selector")) | |
2289 | + (lambda (mc) | |
2290 | + #t) | |
2291 | + (lambda (mc) | |
2292 | + #f)) | |
2293 | + | |
2294 | +(register-action 'action_mozc_tool_about_dialog | |
2295 | +;; (indication-alist-indicator 'action_mozc_tool_about_dialog | |
2296 | +;; mozc-tool-indication-alist) | |
2297 | + (lambda (mc) | |
2298 | + '(mozc_tool_about_dialog | |
2299 | + "A" | |
2300 | + "About" | |
2301 | + "About Mozc")) | |
2302 | + (lambda (mc) | |
2303 | + #f) | |
2304 | + (lambda (mc) | |
2305 | + (mozc-tool-activate mc 'mozc-tool-about-dialog))) | |
2306 | + | |
2307 | +(register-action 'action_mozc_tool_config_dialog | |
2308 | +;; (indication-alist-indicator 'action_mozc_tool_config_dialog | |
2309 | +;; mozc-tool-indication-alist) | |
2310 | + (lambda (mc) | |
2311 | + '(mozc_tool_config_dialog | |
2312 | + "C" | |
2313 | + "Config dialog" | |
2314 | + "Config dialog")) | |
2315 | + (lambda (mc) | |
2316 | + #f) | |
2317 | + (lambda (mc) | |
2318 | + (mozc-tool-activate mc 'mozc-tool-config-dialog))) | |
2319 | + | |
2320 | +(register-action 'action_mozc_tool_dictionary_tool | |
2321 | +;; (indication-alist-indicator 'action_mozc_tool_dictionary_tool | |
2322 | +;; mozc-tool-indication-alist) | |
2323 | + (lambda (mc) | |
2324 | + '(mozc_tool_dictionary_tool | |
2325 | + "D" | |
2326 | + "Dictionary tool" | |
2327 | + "Dictionary tool")) | |
2328 | + (lambda (mc) | |
2329 | + #f) | |
2330 | + (lambda (mc) | |
2331 | + (mozc-tool-activate mc 'mozc-tool-dictionary-tool))) | |
2332 | + | |
2333 | +(register-action 'action_mozc_tool_word_register_dialog | |
2334 | +;; (indication-alist-indicator 'action_mozc_tool_word_register_dialog | |
2335 | +;; mozc-tool-indication-alist) | |
2336 | + (lambda (mc) | |
2337 | + '(mozc_tool_word_register_dialog | |
2338 | + "W" | |
2339 | + "Word register dialog" | |
2340 | + "Word register dialog")) | |
2341 | + (lambda (mc) | |
2342 | + #f) | |
2343 | + (lambda (mc) | |
2344 | + (mozc-tool-activate mc 'mozc-tool-word-register-dialog))) | |
2345 | + | |
2346 | +(register-action 'action_mozc_tool_character_palette | |
2347 | +;; (indication-alist-indicator 'action_mozc_tool_character_palette | |
2348 | +;; mozc-tool-indication-alist) | |
2349 | + (lambda (mc) | |
2350 | + '(mozc_tool_character_palette | |
2351 | + "W" | |
2352 | + "Character palette" | |
2353 | + "Character palette")) | |
2354 | + (lambda (mc) | |
2355 | + #f) | |
2356 | + (lambda (mc) | |
2357 | + (mozc-tool-activate mc 'mozc-tool-character-palette))) | |
2358 | + | |
2359 | +(register-action 'action_mozc_tool_hand_writing | |
2360 | +;; (indication-alist-indicator 'action_mozc_tool_hand_writing | |
2361 | +;; mozc-tool-indication-alist) | |
2362 | + (lambda (mc) | |
2363 | + '(mozc_tool_hand_writing | |
2364 | + "W" | |
2365 | + "Hand writing" | |
2366 | + "Hand writing")) | |
2367 | + (lambda (mc) | |
2368 | + #f) | |
2369 | + (lambda (mc) | |
2370 | + (mozc-tool-activate mc 'mozc-tool-hand-writing))) | |
2371 | + | |
2092 | 2372 | + |
2093 | 2373 | +;; Update widget definitions based on action configurations. The |
2094 | 2374 | +;; procedure is needed for on-the-fly reconfiguration involving the |
2101 | 2381 | + (register-widget 'widget_mozc_kana_input_method |
2102 | 2382 | + (activity-indicator-new mozc-kana-input-method-actions) |
2103 | 2383 | + (actions-new mozc-kana-input-method-actions)) |
2384 | + (register-widget 'widget_mozc_tool | |
2385 | + (activity-indicator-new mozc-tool-actions) | |
2386 | + (actions-new mozc-tool-actions)) | |
2104 | 2387 | + (context-list-replace-widgets! 'mozc mozc-widgets))) |
2105 | 2388 | + |
2106 | 2389 | +(define mozc-context-rec-spec |
2116 | 2399 | +(define mozc-context-new |
2117 | 2400 | + (lambda (id im name) |
2118 | 2401 | + (let* ((mc (mozc-context-new-internal id im)) |
2119 | + (mc-id (mozc-lib-alloc-context mc))) | |
2402 | + (mc-id (if (symbol-bound? 'mozc-lib-alloc-context) | |
2403 | + (mozc-lib-alloc-context mc) | |
2404 | + #f))) | |
2120 | 2405 | + (mozc-context-set-widgets! mc mozc-widgets) |
2121 | 2406 | + (mozc-context-set-mc-id! mc mc-id) |
2122 | 2407 | + mc))) |
2132 | 2417 | +(define mozc-proc-direct-state |
2133 | 2418 | + (lambda (mc key key-state) |
2134 | 2419 | + (if (mozc-on-key? key key-state) |
2135 | + (begin | |
2136 | + (mozc-lib-set-on (mozc-context-mc-id mc)) | |
2420 | + (let ((mid (mozc-context-mc-id mc))) | |
2421 | + (if mid | |
2422 | + (mozc-lib-set-on (mozc-context-mc-id mc))) | |
2137 | 2423 | + (mozc-context-set-on! mc #t)) |
2138 | 2424 | + (im-commit-raw mc)))) |
2139 | 2425 | + |
2166 | 2452 | + |
2167 | 2453 | +(define mozc-kana-toggle |
2168 | 2454 | + (lambda (mc mid) |
2169 | + (let ((mode (mozc-lib-input-mode mid))) | |
2170 | + (cond | |
2171 | + ((= mode mozc-type-hiragana) | |
2172 | + (mozc-lib-set-input-mode mc mid mozc-type-katakana)) | |
2173 | + ((= mode mozc-type-katakana) | |
2174 | + (mozc-lib-set-input-mode mc mid mozc-type-hiragana)) | |
2175 | + (else | |
2176 | + #f))))) | |
2455 | + (if mid | |
2456 | + (let ((mode (mozc-lib-input-mode mid))) | |
2457 | + (cond | |
2458 | + ((= mode mozc-type-hiragana) | |
2459 | + (mozc-lib-set-input-mode mc mid mozc-type-katakana)) | |
2460 | + ((= mode mozc-type-katakana) | |
2461 | + (mozc-lib-set-input-mode mc mid mozc-type-hiragana)) | |
2462 | + (else | |
2463 | + #f))) | |
2464 | + #f))) | |
2177 | 2465 | + |
2178 | 2466 | +(define mozc-proc-input-state |
2179 | 2467 | + (lambda (mc key key-state) |
2182 | 2470 | + (let ((mid (mozc-context-mc-id mc))) |
2183 | 2471 | + (cond |
2184 | 2472 | + ((and |
2473 | + mid | |
2185 | 2474 | + (mozc-off-key? key key-state) |
2186 | 2475 | + (not (mozc-lib-has-preedit? mid))) |
2187 | 2476 | + (mozc-lib-set-input-mode mc mid mozc-type-direct)) |
2190 | 2479 | + (meta-key-mask key-state) |
2191 | 2480 | + (super-key-mask key-state) |
2192 | 2481 | + (hyper-key-mask key-state)) |
2193 | + (if (mozc-lib-has-preedit? mid) | |
2482 | + (if (and mid | |
2483 | + (mozc-lib-has-preedit? mid)) | |
2194 | 2484 | + #f ;; ignore |
2195 | 2485 | + (im-commit-raw mc))) ;; pass through |
2196 | 2486 | + (else |
2201 | 2491 | + (let* ((new (mozc-transpose-keys mid key key-state)) |
2202 | 2492 | + (nkey (car new)) |
2203 | 2493 | + (nkey-state (cdr new))) |
2204 | + (if (mozc-lib-press-key mc mid (if (symbol? nkey) | |
2205 | + (keysym-to-int nkey) nkey) | |
2206 | + nkey-state) | |
2494 | + (if (and mid | |
2495 | + (mozc-lib-press-key mc mid (if (symbol? nkey) | |
2496 | + (keysym-to-int nkey) nkey) | |
2497 | + nkey-state)) | |
2207 | 2498 | + #f ; Key event is consumed |
2208 | 2499 | + (begin |
2209 | + (and mozc-use-with-vi? | |
2500 | + (and mid | |
2501 | + mozc-use-with-vi? | |
2210 | 2502 | + (mozc-vi-escape-key? key key-state) |
2211 | 2503 | + (mozc-lib-set-input-mode mc mid mozc-type-direct)) |
2212 | 2504 | + (im-commit-raw mc))))))))))) |
2226 | 2518 | +(define mozc-reset-handler |
2227 | 2519 | + (lambda (mc) |
2228 | 2520 | + (let ((mid (mozc-context-mc-id mc))) |
2229 | + (mozc-lib-reset mid)))) | |
2521 | + (and mid | |
2522 | + (mozc-lib-reset mid))))) | |
2230 | 2523 | + |
2231 | 2524 | +(define mozc-focus-in-handler |
2232 | 2525 | + (lambda (mc) |
2282 | 2575 | +) |
2283 | 2576 | diff --git a/unix/uim/uim.gyp b/unix/uim/uim.gyp |
2284 | 2577 | new file mode 100644 |
2285 | index 0000000..7147a12 | |
2578 | index 0000000..44fda8c | |
2286 | 2579 | --- /dev/null |
2287 | 2580 | +++ b/unix/uim/uim.gyp |
2288 | 2581 | @@ -0,0 +1,82 @@ |
2289 | 2582 | +# |
2290 | +# Copyright (c) 2010 uim Project http://code.google.com/p/uim/ | |
2583 | +# Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/ | |
2291 | 2584 | +# |
2292 | 2585 | +# All rights reserved. |
2293 | 2586 | +# |
2369 | 2662 | + ], |
2370 | 2663 | +} |
2371 | 2664 | -- |
2372 | 1.7.4.1 | |
2665 | 1.7.5.1 | |
2373 | 2666 |