0 | |
Origin: macuim project: http://macuim.googlecode.com/svn/trunk / r290
|
|
0 |
Origin: macuim project: http://macuim.googlecode.com/svn/trunk / r304
|
1 | 1 |
Bug: none
|
2 | 2 |
Bug-Debian: none
|
3 | 3 |
|
4 | |
From a8dab019e89185c013853ba987992177fd38833d Mon Sep 17 00:00:00 2001
|
|
4 |
From 2bee6c7a0e8b060bfde1a6fcdb1279405a73a82e Mon Sep 17 00:00:00 2001
|
5 | 5 |
From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
|
6 | |
Date: Sat, 17 Dec 2011 00:51:19 +0900
|
7 | |
Subject: [PATCH] Add uim-mozc r288
|
|
6 |
Date: Fri, 27 Jan 2012 17:26:52 +0900
|
|
7 |
Subject: [PATCH] Update uim-mozc to r304
|
8 | 8 |
|
9 | 9 |
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
|
10 | 10 |
---
|
11 | |
unix/uim/key_translator.cc | 436 ++++++++++++++++
|
|
11 |
unix/uim/key_translator.cc | 436 ++++++++++++++
|
12 | 12 |
unix/uim/key_translator.h | 111 ++++
|
13 | |
unix/uim/mozc.cc | 1032 ++++++++++++++++++++++++++++++++++++++
|
14 | |
unix/uim/scm/mozc-custom.scm | 385 ++++++++++++++
|
|
13 |
unix/uim/mozc.cc | 1190 ++++++++++++++++++++++++++++++++++++++
|
|
14 |
unix/uim/scm/mozc-custom.scm | 390 +++++++++++++
|
15 | 15 |
unix/uim/scm/mozc-key-custom.scm | 74 +++
|
16 | |
unix/uim/scm/mozc.scm | 513 +++++++++++++++++++
|
17 | |
unix/uim/uim.gyp | 87 ++++
|
18 | |
7 files changed, 2638 insertions(+), 0 deletions(-)
|
|
16 |
unix/uim/scm/mozc.scm | 555 ++++++++++++++++++
|
|
17 |
unix/uim/uim.gyp | 87 +++
|
|
18 |
7 files changed, 2843 insertions(+), 0 deletions(-)
|
19 | 19 |
create mode 100644 unix/uim/key_translator.cc
|
20 | 20 |
create mode 100644 unix/uim/key_translator.h
|
21 | 21 |
create mode 100644 unix/uim/mozc.cc
|
|
26 | 26 |
|
27 | 27 |
diff --git a/unix/uim/key_translator.cc b/unix/uim/key_translator.cc
|
28 | 28 |
new file mode 100644
|
29 | |
index 0000000..6020923
|
|
29 |
index 0000000..c7c4c4a
|
30 | 30 |
--- /dev/null
|
31 | 31 |
+++ b/unix/uim/key_translator.cc
|
32 | 32 |
@@ -0,0 +1,436 @@
|
33 | 33 |
+// Copyright 2010, Google Inc.
|
34 | |
+// Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
34 |
+// Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
35 | 35 |
+// All rights reserved.
|
36 | 36 |
+//
|
37 | 37 |
+// Redistribution and use in source and binary forms, with or without
|
|
468 | 468 |
+} // namespace mozc
|
469 | 469 |
diff --git a/unix/uim/key_translator.h b/unix/uim/key_translator.h
|
470 | 470 |
new file mode 100644
|
471 | |
index 0000000..fbcc365
|
|
471 |
index 0000000..32f1659
|
472 | 472 |
--- /dev/null
|
473 | 473 |
+++ b/unix/uim/key_translator.h
|
474 | 474 |
@@ -0,0 +1,111 @@
|
475 | 475 |
+// Copyright 2010, Google Inc.
|
476 | |
+// Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
476 |
+// Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
477 | 477 |
+// All rights reserved.
|
478 | 478 |
+//
|
479 | 479 |
+// Redistribution and use in source and binary forms, with or without
|
|
585 | 585 |
+#endif // MOZC_UNIX_UIM_KEY_TRANSLATOR_H_
|
586 | 586 |
diff --git a/unix/uim/mozc.cc b/unix/uim/mozc.cc
|
587 | 587 |
new file mode 100644
|
588 | |
index 0000000..88b9633
|
|
588 |
index 0000000..d7e6498
|
589 | 589 |
--- /dev/null
|
590 | 590 |
+++ b/unix/uim/mozc.cc
|
591 | |
@@ -0,0 +1,1032 @@
|
|
591 |
@@ -0,0 +1,1190 @@
|
592 | 592 |
+/*
|
593 | 593 |
+
|
594 | |
+ Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
594 |
+ Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
595 | 595 |
+
|
596 | 596 |
+ All rights reserved.
|
597 | 597 |
+
|
|
693 | 693 |
+} *context_slot;
|
694 | 694 |
+
|
695 | 695 |
+static KeyTranslator *keyTranslator;
|
|
696 |
+static bool enable_reconversion;
|
|
697 |
+static void update_all(uim_lisp mc_, int id);
|
696 | 698 |
+
|
697 | 699 |
+static int
|
698 | 700 |
+unused_context_id(void)
|
|
723 | 725 |
+ context_slot[id].session->SyncData();
|
724 | 726 |
+ context_slot[id].last_sync_time = current_time;
|
725 | 727 |
+ }
|
|
728 |
+}
|
|
729 |
+
|
|
730 |
+static void
|
|
731 |
+update_deletion_range(uim_lisp mc_, int id)
|
|
732 |
+{
|
|
733 |
+ commands::Output *output = context_slot[id].output;
|
|
734 |
+ int offset, length;
|
|
735 |
+
|
|
736 |
+ if (!enable_reconversion)
|
|
737 |
+ return;
|
|
738 |
+
|
|
739 |
+ if (!output->has_deletion_range())
|
|
740 |
+ return;
|
|
741 |
+
|
|
742 |
+ offset = output->deletion_range().offset();
|
|
743 |
+ length = output->deletion_range().length();
|
|
744 |
+
|
|
745 |
+ if (offset + length < 0)
|
|
746 |
+ return;
|
|
747 |
+
|
|
748 |
+ uim_scm_callf("im-delete-text", "oyyii", mc_, "primary", "cursor", -offset, offset + length);
|
726 | 749 |
+}
|
727 | 750 |
+
|
728 | 751 |
+static void
|
|
913 | 936 |
+}
|
914 | 937 |
+
|
915 | 938 |
+static void
|
|
939 |
+execute_callback(uim_lisp mc_, int id)
|
|
940 |
+{
|
|
941 |
+ commands::Output *output = context_slot[id].output;
|
|
942 |
+
|
|
943 |
+ if (!enable_reconversion)
|
|
944 |
+ return;
|
|
945 |
+
|
|
946 |
+ if (!output->has_callback())
|
|
947 |
+ return;
|
|
948 |
+
|
|
949 |
+ if (!output->callback().has_session_command())
|
|
950 |
+ return;
|
|
951 |
+
|
|
952 |
+ const commands::SessionCommand &command = output->callback().session_command();
|
|
953 |
+ if (!command.has_type())
|
|
954 |
+ return;
|
|
955 |
+
|
|
956 |
+ const commands::SessionCommand::CommandType type = command.type();
|
|
957 |
+ commands::SessionCommand session_command;
|
|
958 |
+ session_command.set_type(type);
|
|
959 |
+ int use_primary_text = 0;
|
|
960 |
+
|
|
961 |
+ switch (type) {
|
|
962 |
+ case commands::SessionCommand::UNDO:
|
|
963 |
+ // do nothing.
|
|
964 |
+ break;
|
|
965 |
+ case commands::SessionCommand::CONVERT_REVERSE:
|
|
966 |
+ {
|
|
967 |
+ // try selected text first
|
|
968 |
+ uim_lisp ustr = uim_scm_callf("im-acquire-text", "oyyiy", mc_, "selection", "beginning", 0, "full");
|
|
969 |
+ uim_lisp latter;
|
|
970 |
+
|
|
971 |
+ if (TRUEP(ustr) &&
|
|
972 |
+ !NULLP(latter = uim_scm_callf("ustr-latter-seq", "o", ustr))) {
|
|
973 |
+ uim_lisp str = CAR(latter);
|
|
974 |
+
|
|
975 |
+ string text = REFER_C_STR(str);
|
|
976 |
+ session_command.set_text(text);
|
|
977 |
+ } else {
|
|
978 |
+#if 0
|
|
979 |
+ // then primary text
|
|
980 |
+ uim_lisp former;
|
|
981 |
+ ustr = uim_scm_callf("im-acquire-text", "oyyyi", mc_, "primary", "cursor", "line", 0);
|
|
982 |
+ if (TRUEP(ustr) && !NULLP(former = uim_scm_callf("ustr-former-seq", "o", ustr))) {
|
|
983 |
+ uim_lisp str = CAR(former);
|
|
984 |
+ string text = REFER_C_STR(str);
|
|
985 |
+ session_command.set_text(text);
|
|
986 |
+ use_primary_text = 1;
|
|
987 |
+ } else
|
|
988 |
+ return;
|
|
989 |
+#else
|
|
990 |
+ // UNDO if no selection
|
|
991 |
+ session_command.set_type(commands::SessionCommand::UNDO);
|
|
992 |
+#endif
|
|
993 |
+ }
|
|
994 |
+ }
|
|
995 |
+ break;
|
|
996 |
+ default:
|
|
997 |
+ return;
|
|
998 |
+ }
|
|
999 |
+
|
|
1000 |
+ if (!context_slot[id].session->SendCommand(session_command, context_slot[id].output)) {
|
|
1001 |
+ // callback command failed
|
|
1002 |
+ return;
|
|
1003 |
+ }
|
|
1004 |
+
|
|
1005 |
+ if (type == commands::SessionCommand::CONVERT_REVERSE) {
|
|
1006 |
+ if (use_primary_text)
|
|
1007 |
+ uim_scm_callf("im-delete-text", "oyyyi", mc_, "primary", "cursor", "line", 0);
|
|
1008 |
+ else
|
|
1009 |
+ uim_scm_callf("im-delete-text", "oyyiy", mc_, "selection", "beginning", 0, "full");
|
|
1010 |
+ }
|
|
1011 |
+ update_all(mc_, id);
|
|
1012 |
+}
|
|
1013 |
+
|
|
1014 |
+static void
|
916 | 1015 |
+update_all(uim_lisp mc_, int id)
|
917 | 1016 |
+{
|
|
1017 |
+ update_deletion_range(mc_, id);
|
918 | 1018 |
+ update_result(mc_, id);
|
919 | 1019 |
+ update_preedit(mc_, id);
|
920 | 1020 |
+ update_candidates(mc_, id);
|
921 | 1021 |
+ update_composition_mode(mc_, id);
|
|
1022 |
+ execute_callback(mc_, id);
|
922 | 1023 |
+}
|
923 | 1024 |
+
|
924 | 1025 |
+static uim_lisp
|
|
949 | 1050 |
+#if !USE_CASCADING_CANDIDATES
|
950 | 1051 |
+ session->EnableCascadingWindow(false);
|
951 | 1052 |
+#endif
|
|
1053 |
+
|
|
1054 |
+ if (!enable_reconversion) {
|
|
1055 |
+ if (!FALSEP(uim_scm_callf("symbol-bound?", "y", "mozc-check-uim-version")))
|
|
1056 |
+ enable_reconversion = (bool)C_BOOL(uim_scm_callf("mozc-check-uim-version", "iii", 1, 7, 2));
|
|
1057 |
+ }
|
|
1058 |
+
|
|
1059 |
+ if (enable_reconversion) {
|
|
1060 |
+ commands::Capability capability;
|
|
1061 |
+ capability.set_text_deletion(commands::Capability::DELETE_PRECEDING_TEXT);
|
|
1062 |
+ session->set_client_capability(capability);
|
|
1063 |
+ }
|
|
1064 |
+
|
952 | 1065 |
+
|
953 | 1066 |
+ return MAKE_INT(id);
|
954 | 1067 |
+}
|
|
1505 | 1618 |
+ const int32 cand_id = context_slot[id].output->candidates().candidate(idx).id();
|
1506 | 1619 |
+#endif
|
1507 | 1620 |
+
|
1508 | |
+ commands::Output output;
|
1509 | 1621 |
+ commands::SessionCommand command;
|
1510 | 1622 |
+ command.set_type(commands::SessionCommand::SELECT_CANDIDATE);
|
1511 | 1623 |
+ command.set_id(cand_id);
|
|
1526 | 1638 |
+ case config::Config::ROMAN:
|
1527 | 1639 |
+ rule = 0;
|
1528 | 1640 |
+ break;
|
1529 | |
+ case config::Config::KANA:
|
|
1641 |
+ case config::Config::KANA:
|
1530 | 1642 |
+ rule = 1;
|
1531 | 1643 |
+ break;
|
1532 | 1644 |
+ default:
|
|
1568 | 1680 |
+
|
1569 | 1681 |
+ return uim_scm_t();
|
1570 | 1682 |
+}
|
1571 | |
+
|
|
1683 |
+
|
|
1684 |
+static uim_lisp
|
|
1685 |
+reconvert(uim_lisp mc_, uim_lisp id_)
|
|
1686 |
+{
|
|
1687 |
+ if (!enable_reconversion)
|
|
1688 |
+ return uim_scm_f();
|
|
1689 |
+
|
|
1690 |
+ int id = C_INT(id_);
|
|
1691 |
+ commands::SessionCommand session_command;
|
|
1692 |
+ session_command.set_type(commands::SessionCommand::CONVERT_REVERSE);
|
|
1693 |
+
|
|
1694 |
+ // try selected text first, then primary text
|
|
1695 |
+ uim_lisp ustr = uim_scm_callf("im-acquire-text", "oyyiy", mc_, "selection" , "beginning", 0, "full");
|
|
1696 |
+ uim_lisp former, latter;
|
|
1697 |
+ int use_primary_text = 0;
|
|
1698 |
+
|
|
1699 |
+ if (TRUEP(ustr) &&
|
|
1700 |
+ !NULLP(latter = uim_scm_callf("ustr-latter-seq", "o", ustr))) {
|
|
1701 |
+ uim_lisp str = CAR(latter);
|
|
1702 |
+
|
|
1703 |
+ string text = REFER_C_STR(str);
|
|
1704 |
+ session_command.set_text(text);
|
|
1705 |
+ } else {
|
|
1706 |
+ ustr = uim_scm_callf("im-acquire-text", "oyyyi", mc_, "primary", "cursor", "line", 0);
|
|
1707 |
+ if (TRUEP(ustr) &&
|
|
1708 |
+ !NULLP(former = uim_scm_callf("ustr-former-seq", "o", ustr))) {
|
|
1709 |
+ uim_lisp str = CAR(former);
|
|
1710 |
+ string text = REFER_C_STR(str);
|
|
1711 |
+ session_command.set_text(text);
|
|
1712 |
+ use_primary_text = 1;
|
|
1713 |
+ } else
|
|
1714 |
+ return uim_scm_f();
|
|
1715 |
+ }
|
|
1716 |
+
|
|
1717 |
+ if (!context_slot[id].session->SendCommand(session_command, context_slot[id].output))
|
|
1718 |
+ return uim_scm_f();
|
|
1719 |
+
|
|
1720 |
+ if (use_primary_text)
|
|
1721 |
+ uim_scm_callf("im-delete-text", "oyyyi", mc_, "primary", "cursor", "line", 0);
|
|
1722 |
+ else
|
|
1723 |
+ uim_scm_callf("im-delete-text", "oyyiy", mc_, "selection", "beginning", 0, "full");
|
|
1724 |
+ update_all(mc_, id);
|
|
1725 |
+
|
|
1726 |
+ return uim_scm_t();
|
|
1727 |
+}
|
|
1728 |
+
|
1572 | 1729 |
+} // namespace
|
1573 | 1730 |
+} // namespace
|
1574 | 1731 |
+
|
|
1594 | 1751 |
+ uim_scm_init_proc3("mozc-lib-set-candidate-index", mozc::uim::select_candidate);
|
1595 | 1752 |
+ uim_scm_init_proc1("mozc-lib-input-rule", mozc::uim::get_input_rule);
|
1596 | 1753 |
+ uim_scm_init_proc3("mozc-lib-set-input-rule", mozc::uim::set_input_rule);
|
|
1754 |
+ uim_scm_init_proc2("mozc-lib-reconvert", mozc::uim::reconvert);
|
1597 | 1755 |
+
|
1598 | 1756 |
+ int argc = 1;
|
1599 | 1757 |
+ static const char name[] = "uim-mozc";
|
|
1623 | 1781 |
+}
|
1624 | 1782 |
diff --git a/unix/uim/scm/mozc-custom.scm b/unix/uim/scm/mozc-custom.scm
|
1625 | 1783 |
new file mode 100644
|
1626 | |
index 0000000..22df0c6
|
|
1784 |
index 0000000..f779728
|
1627 | 1785 |
--- /dev/null
|
1628 | 1786 |
+++ b/unix/uim/scm/mozc-custom.scm
|
1629 | |
@@ -0,0 +1,385 @@
|
|
1787 |
@@ -0,0 +1,390 @@
|
1630 | 1788 |
+;;;
|
1631 | |
+;;; Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
1789 |
+;;; Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
1632 | 1790 |
+;;;
|
1633 | 1791 |
+;;; All rights reserved.
|
1634 | 1792 |
+;;;
|
|
1775 | 1933 |
+ 'mozc_tool_hand_writing
|
1776 | 1934 |
+ "H"
|
1777 | 1935 |
+ (N_ "Hand writing")
|
1778 | |
+ (N_ "Hand writing"))))
|
|
1936 |
+ (N_ "Hand writing"))
|
|
1937 |
+ (list 'action_mozc_reconvert
|
|
1938 |
+ 'mozc_reconvert
|
|
1939 |
+ "R"
|
|
1940 |
+ (N_ "Reconvert")
|
|
1941 |
+ (N_ "Reconvert"))))
|
1779 | 1942 |
+
|
1780 | 1943 |
+
|
1781 | 1944 |
+;;; Buttons
|
|
2014 | 2177 |
+ (N_ "long description will be here."))
|
2015 | 2178 |
diff --git a/unix/uim/scm/mozc-key-custom.scm b/unix/uim/scm/mozc-key-custom.scm
|
2016 | 2179 |
new file mode 100644
|
2017 | |
index 0000000..fbc94ae
|
|
2180 |
index 0000000..bcf8528
|
2018 | 2181 |
--- /dev/null
|
2019 | 2182 |
+++ b/unix/uim/scm/mozc-key-custom.scm
|
2020 | 2183 |
@@ -0,0 +1,74 @@
|
2021 | 2184 |
+;;;
|
2022 | |
+;;; Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
2185 |
+;;; Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
2023 | 2186 |
+;;;
|
2024 | 2187 |
+;;; All rights reserved.
|
2025 | 2188 |
+;;;
|
|
2094 | 2257 |
+ (_ "long description will be here"))
|
2095 | 2258 |
diff --git a/unix/uim/scm/mozc.scm b/unix/uim/scm/mozc.scm
|
2096 | 2259 |
new file mode 100644
|
2097 | |
index 0000000..c66c799
|
|
2260 |
index 0000000..fc12561
|
2098 | 2261 |
--- /dev/null
|
2099 | 2262 |
+++ b/unix/uim/scm/mozc.scm
|
2100 | |
@@ -0,0 +1,513 @@
|
|
2263 |
@@ -0,0 +1,555 @@
|
2101 | 2264 |
+;;;
|
2102 | |
+;;; Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
2265 |
+;;; Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
2103 | 2266 |
+;;;
|
2104 | 2267 |
+;;; All rights reserved.
|
2105 | 2268 |
+;;;
|
|
2131 | 2294 |
+(require "util.scm")
|
2132 | 2295 |
+(require "process.scm")
|
2133 | 2296 |
+(require "japanese.scm")
|
|
2297 |
+(require "ustr.scm")
|
2134 | 2298 |
+(require-custom "generic-key-custom.scm")
|
2135 | 2299 |
+(require-custom "mozc-custom.scm")
|
2136 | 2300 |
+(require-custom "mozc-key-custom.scm")
|
|
2176 | 2340 |
+ #f))
|
2177 | 2341 |
+ ((= 0 pid2)
|
2178 | 2342 |
+ (setenv "MALLOC_CHECK_" "0" 0)
|
|
2343 |
+ (setenv "GTK_IM_MODULE" "gtk-im-context-simple" 0)
|
2179 | 2344 |
+ (if (= (process-execute file argv) -1)
|
2180 | 2345 |
+ (uim-notify-fatal (format (N_ "cannot execute ~a") file)))
|
2181 | 2346 |
+ (_exit 0))
|
|
2203 | 2368 |
+ (else
|
2204 | 2369 |
+ #f))))
|
2205 | 2370 |
+
|
|
2371 |
+(define mozc-reconvert
|
|
2372 |
+ (lambda (mc)
|
|
2373 |
+ (let ((mid (mozc-context-mc-id mc)))
|
|
2374 |
+ (if mid
|
|
2375 |
+ (begin
|
|
2376 |
+ (if (not (mozc-context-on mc))
|
|
2377 |
+ (begin
|
|
2378 |
+ (mozc-lib-set-on mid)
|
|
2379 |
+ (mozc-context-set-on! mc #t)))
|
|
2380 |
+ (mozc-lib-reconvert mc mid))
|
|
2381 |
+ #f))))
|
|
2382 |
+
|
2206 | 2383 |
+(register-action 'action_mozc_hiragana
|
2207 | 2384 |
+ (lambda (mc) ;; indication handler
|
2208 | 2385 |
+ '(ja_hiragana
|
|
2407 | 2584 |
+ (lambda (mc)
|
2408 | 2585 |
+ (mozc-tool-activate mc 'mozc-tool-hand-writing)))
|
2409 | 2586 |
+
|
|
2587 |
+(register-action 'action_mozc_reconvert
|
|
2588 |
+;; (indication-alist-indicator 'action_mozc_reconvert
|
|
2589 |
+;; mozc-tool-indication-alist)
|
|
2590 |
+ (lambda (mc)
|
|
2591 |
+ '(mozc_reconvert
|
|
2592 |
+ "R"
|
|
2593 |
+ "Reconvert"
|
|
2594 |
+ "Reconvert"))
|
|
2595 |
+ (lambda (mc)
|
|
2596 |
+ #f)
|
|
2597 |
+ (lambda (mc)
|
|
2598 |
+ (mozc-reconvert mc)))
|
2410 | 2599 |
+
|
2411 | 2600 |
+;; Update widget definitions based on action configurations. The
|
2412 | 2601 |
+;; procedure is needed for on-the-fly reconfiguration involving the
|
|
2437 | 2626 |
+(define mozc-context-new
|
2438 | 2627 |
+ (lambda (id im name)
|
2439 | 2628 |
+ (let* ((mc (mozc-context-new-internal id im))
|
2440 | |
+ (mc-id (if (symbol-bound? 'mozc-lib-alloc-context)
|
|
2629 |
+ (mid (if (symbol-bound? 'mozc-lib-alloc-context)
|
2441 | 2630 |
+ (mozc-lib-alloc-context mc)
|
2442 | 2631 |
+ #f)))
|
2443 | 2632 |
+ (mozc-context-set-widgets! mc mozc-widgets)
|
2444 | |
+ (mozc-context-set-mc-id! mc mc-id)
|
|
2633 |
+ (mozc-context-set-mc-id! mc mid)
|
2445 | 2634 |
+ mc)))
|
2446 | 2635 |
+
|
2447 | 2636 |
+(define mozc-separator
|
|
2457 | 2646 |
+ (if (mozc-on-key? key key-state)
|
2458 | 2647 |
+ (let ((mid (mozc-context-mc-id mc)))
|
2459 | 2648 |
+ (if mid
|
2460 | |
+ (mozc-lib-set-on (mozc-context-mc-id mc)))
|
|
2649 |
+ (mozc-lib-set-on mid))
|
2461 | 2650 |
+ (mozc-context-set-on! mc #t))
|
2462 | 2651 |
+ (im-commit-raw mc))))
|
2463 | 2652 |
+
|
|
2467 | 2656 |
+
|
2468 | 2657 |
+(define mozc-release-handler
|
2469 | 2658 |
+ (lambda (mc)
|
2470 | |
+ (let ((mc-id (mozc-context-mc-id mc)))
|
2471 | |
+ (if mc-id
|
2472 | |
+ (mozc-lib-free-context mc-id)
|
|
2659 |
+ (let ((mid (mozc-context-mc-id mc)))
|
|
2660 |
+ (if mid
|
|
2661 |
+ (mozc-lib-free-context mid)
|
2473 | 2662 |
+ #f)
|
2474 | 2663 |
+ #f)))
|
2475 | 2664 |
+
|
|
2587 | 2776 |
+ (let ((mid (mozc-context-mc-id mc)))
|
2588 | 2777 |
+ (mozc-lib-set-candidate-index mc mid idx))))
|
2589 | 2778 |
+
|
|
2779 |
+(define mozc-check-uim-version
|
|
2780 |
+ (lambda (request-major request-minor request-patch)
|
|
2781 |
+ (let* ((version (string-split (uim-version) "."))
|
|
2782 |
+ (len (length version))
|
|
2783 |
+ (major (if (>= len 1) (string->number (list-ref version 0)) 0))
|
|
2784 |
+ (minor (if (>= len 2) (string->number (list-ref version 1)) 0))
|
|
2785 |
+ (patch (if (>= len 3) (string->number (list-ref version 2)) 0)))
|
|
2786 |
+ (or (> major request-major)
|
|
2787 |
+ (and
|
|
2788 |
+ (= major request-major)
|
|
2789 |
+ (> minor request-minor))
|
|
2790 |
+ (and
|
|
2791 |
+ (= major request-major)
|
|
2792 |
+ (= minor request-minor)
|
|
2793 |
+ (>= patch request-patch))))))
|
|
2794 |
+
|
2590 | 2795 |
+(mozc-configure-widgets)
|
2591 | 2796 |
+
|
2592 | 2797 |
+(register-im
|
|
2613 | 2818 |
+)
|
2614 | 2819 |
diff --git a/unix/uim/uim.gyp b/unix/uim/uim.gyp
|
2615 | 2820 |
new file mode 100644
|
2616 | |
index 0000000..9fe04ca
|
|
2821 |
index 0000000..3bbc62f
|
2617 | 2822 |
--- /dev/null
|
2618 | 2823 |
+++ b/unix/uim/uim.gyp
|
2619 | 2824 |
@@ -0,0 +1,87 @@
|
2620 | 2825 |
+#
|
2621 | |
+# Copyright (c) 2010-2011 uim Project http://code.google.com/p/uim/
|
|
2826 |
+# Copyright (c) 2010-2012 uim Project http://code.google.com/p/uim/
|
2622 | 2827 |
+#
|
2623 | 2828 |
+# All rights reserved.
|
2624 | 2829 |
+#
|
|
2705 | 2910 |
+ ],
|
2706 | 2911 |
+}
|
2707 | 2912 |
--
|
2708 | |
1.7.7.3
|
|
2913 |
1.7.8.3
|
2709 | 2914 |
|