Protobuf file location refactoring part 1.
This is a series of CLs to move *.proto files into protocol/ directory.
Following files will be moved in this CL.
- commands.proto
- candidates.proto
This is just a refactoring. No user-visible behavior change should occur.
BUG=none
TEST=unittest
Hiroyuki Komatsu authored 8 years ago
Yohei Yukawa committed 8 years ago
212 | 212 | 'type': 'none', |
213 | 213 | 'variables': { |
214 | 214 | 'proto_files': [ |
215 | '../session/candidates.proto', | |
216 | '../session/commands.proto', | |
215 | '../protocol/candidates.proto', | |
216 | '../protocol/commands.proto', | |
217 | 217 | ], |
218 | 218 | }, |
219 | 219 | 'actions': [ |
38 | 38 | #include "base/system_util.h" |
39 | 39 | #include "base/version.h" |
40 | 40 | #include "engine/engine_factory.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "session/session_handler.h" |
43 | 43 | #include "session/session_usage_observer.h" |
44 | 44 | #include "usage_stats/usage_stats_uploader.h" |
175 | 175 | '../../dictionary/dictionary_base.gyp:user_pos', |
176 | 176 | '../../net/net.gyp:http_client', |
177 | 177 | '../../net/net.gyp:json_util', |
178 | '../../session/session_base.gyp:key_parser', | |
179 | '../../session/session_base.gyp:session_protocol', | |
178 | '../../protocol/protocol.gyp:commands_proto', | |
180 | 179 | '../../session/session.gyp:session', |
181 | 180 | '../../session/session.gyp:session_handler', |
182 | 181 | '../../session/session.gyp:session_usage_observer', |
182 | '../../session/session_base.gyp:key_parser', | |
183 | '../../usage_stats/usage_stats.gyp:usage_stats_uploader', | |
183 | 184 | '../../usage_stats/usage_stats_base.gyp:usage_stats', |
184 | '../../usage_stats/usage_stats.gyp:usage_stats_uploader', | |
185 | 185 | ], |
186 | 186 | }, |
187 | 187 | { |
54 | 54 | #include "net/http_client_pepper.h" |
55 | 55 | #include "net/jsoncpp.h" |
56 | 56 | #include "net/json_util.h" |
57 | #include "session/commands.pb.h" | |
57 | #include "protocol/commands.pb.h" | |
58 | 58 | #include "session/session_handler.h" |
59 | 59 | #include "session/session_usage_observer.h" |
60 | 60 | #include "usage_stats/usage_stats.h" |
51 | 51 | #include "base/version.h" |
52 | 52 | #include "config/config.pb.h" |
53 | 53 | #include "ipc/ipc.h" |
54 | #include "session/commands.pb.h" | |
54 | #include "protocol/commands.pb.h" | |
55 | 55 | |
56 | 56 | #ifdef OS_MACOSX |
57 | 57 | #include "base/mac_process.h" |
43 | 43 | '../base/base.gyp:base', |
44 | 44 | '../config/config.gyp:config_protocol', |
45 | 45 | '../ipc/ipc.gyp:ipc', |
46 | '../session/session_base.gyp:session_protocol', | |
46 | '../protocol/protocol.gyp:commands_proto', | |
47 | 47 | ], |
48 | 48 | }, |
49 | 49 | { |
55 | 55 | 'dependencies': [ |
56 | 56 | '../base/base.gyp:base', |
57 | 57 | '../config/config.gyp:config_protocol', |
58 | '../session/session_base.gyp:session_protocol', | |
58 | '../protocol/protocol.gyp:commands_proto', | |
59 | 59 | ], |
60 | 60 | }, |
61 | 61 | ], |
36 | 36 | #include "base/port.h" |
37 | 37 | #include "base/scoped_ptr.h" |
38 | 38 | #include "client/client_interface.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "testing/base/public/gunit_prod.h" |
41 | 41 | // for FRIEND_TEST() |
42 | 42 |
33 | 33 | |
34 | 34 | #include <string> |
35 | 35 | #include "base/port.h" |
36 | #include "session/commands.pb.h" | |
36 | #include "protocol/commands.pb.h" | |
37 | 37 | |
38 | 38 | namespace mozc { |
39 | 39 |
32 | 32 | #include <map> |
33 | 33 | #include <string> |
34 | 34 | #include "client/client_interface.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | |
37 | 37 | namespace mozc { |
38 | 38 | namespace client { |
42 | 42 | #include "base/util.h" |
43 | 43 | #include "client/client.h" |
44 | 44 | #include "config/config_handler.h" |
45 | #include "session/commands.pb.h" | |
45 | #include "protocol/commands.pb.h" | |
46 | 46 | #include "session/random_keyevents_generator.h" |
47 | 47 | |
48 | 48 | DEFINE_string(server_path, "", "specify server path"); |
40 | 40 | #include "base/util.h" |
41 | 41 | #include "client/client.h" |
42 | 42 | #include "evaluation/scorer.h" |
43 | #include "session/commands.pb.h" | |
43 | #include "protocol/commands.pb.h" | |
44 | 44 | |
45 | 45 | // Test data automatically generated by gen_client_quality_test_data.py |
46 | 46 | // TestCase test_cases[] is defined. |
42 | 42 | #include "base/system_util.h" |
43 | 43 | #include "base/util.h" |
44 | 44 | #include "client/client.h" |
45 | #include "protocol/commands.pb.h" | |
46 | #include "renderer/renderer_client.h" | |
45 | 47 | #include "renderer/renderer_command.pb.h" |
46 | #include "renderer/renderer_client.h" | |
47 | #include "session/commands.pb.h" | |
48 | 48 | #include "session/key_parser.h" |
49 | 49 | |
50 | 50 | DEFINE_bool(display_preedit, false, "display predit to tty"); |
37 | 37 | #include "base/util.h" |
38 | 38 | #include "base/version.h" |
39 | 39 | #include "ipc/ipc_mock.h" |
40 | #include "session/commands.pb.h" | |
40 | #include "protocol/commands.pb.h" | |
41 | 41 | #include "testing/base/public/gunit.h" |
42 | 42 | |
43 | 43 | namespace mozc { |
40 | 40 | ], |
41 | 41 | 'dependencies': [ |
42 | 42 | '../base/base.gyp:base', |
43 | '../session/session_base.gyp:session_protocol', | |
43 | '../protocol/protocol.gyp:commands_proto', | |
44 | 44 | 'client.gyp:client', |
45 | 45 | ], |
46 | 46 | 'actions': [ |
43 | 43 | #include "config/character_form_manager.h" |
44 | 44 | #include "config/config.pb.h" |
45 | 45 | #include "config/config_handler.h" |
46 | #include "session/commands.pb.h" | |
46 | #include "protocol/commands.pb.h" | |
47 | 47 | #include "session/key_event_util.h" |
48 | 48 | |
49 | 49 | // Use flags instead of constant for performance evaluation. |
56 | 56 | '../config/config.gyp:config_handler', |
57 | 57 | '../config/config.gyp:config_protocol', |
58 | 58 | '../protobuf/protobuf.gyp:protobuf', |
59 | '../protocol/protocol.gyp:commands_proto', | |
59 | 60 | '../session/session_base.gyp:key_event_util', |
60 | 61 | '../session/session_base.gyp:key_parser', |
61 | # This is needed. GYP is not smart enough about indirect dependencies. | |
62 | '../session/session_base.gyp:session_protocol', | |
63 | 62 | '../transliteration/transliteration.gyp:transliteration', |
64 | 63 | ], |
65 | 64 | }, |
80 | 79 | 'dependencies': [ |
81 | 80 | '../config/config.gyp:config_handler', |
82 | 81 | '../config/config.gyp:config_protocol', |
82 | '../protocol/protocol.gyp:commands_proto', | |
83 | 83 | '../session/session_base.gyp:request_test_util', |
84 | '../session/session_base.gyp:session_protocol', | |
85 | 84 | '../testing/testing.gyp:gtest_main', |
86 | 85 | 'composer', |
87 | 86 | ], |
41 | 41 | #include "composer/internal/typing_corrector.h" |
42 | 42 | #include "composer/internal/transliterators.h" |
43 | 43 | #include "composer/type_corrected_query.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/commands.pb.h" | |
45 | 45 | #include "transliteration/transliteration.h" |
46 | 46 | // for FRIEND_TEST() |
47 | 47 | #include "testing/base/public/gunit_prod.h" |
35 | 35 | #include "base/scoped_ptr.h" |
36 | 36 | #include "composer/composition_interface.h" |
37 | 37 | #include "composer/table.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | #include "transliteration/transliteration.h" |
40 | 40 | |
41 | 41 | DEFINE_string(table, "system://romanji-hiragana.tsv", |
41 | 41 | #include "config/character_form_manager.h" |
42 | 42 | #include "config/config.pb.h" |
43 | 43 | #include "config/config_handler.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/commands.pb.h" | |
45 | 45 | #include "session/key_parser.h" |
46 | 46 | #include "testing/base/public/gunit.h" |
47 | 47 |
35 | 35 | #include "composer/table.h" |
36 | 36 | #include "composer/type_corrected_query.h" |
37 | 37 | #include "composer/internal/typing_model.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | #include "testing/base/public/gunit.h" |
40 | 40 | |
41 | 41 | namespace mozc { |
32 | 32 | #include "base/port.h" |
33 | 33 | #include "base/scoped_ptr.h" |
34 | 34 | #include "base/string_piece.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | // for FRIEND_TEST() |
37 | 37 | #include "testing/base/public/gunit_prod.h" |
38 | 38 |
45 | 45 | #include "composer/internal/typing_model.h" |
46 | 46 | #include "config/config.pb.h" |
47 | 47 | #include "config/config_handler.h" |
48 | #include "session/commands.pb.h" | |
48 | #include "protocol/commands.pb.h" | |
49 | 49 | |
50 | 50 | namespace mozc { |
51 | 51 | namespace composer { |
34 | 34 | #include "composer/internal/composition_input.h" |
35 | 35 | #include "config/config.pb.h" |
36 | 36 | #include "config/config_handler.h" |
37 | #include "protocol/commands.pb.h" | |
37 | 38 | #include "testing/base/public/gunit.h" |
38 | #include "session/commands.pb.h" | |
39 | 39 | |
40 | 40 | DECLARE_string(test_tmpdir); |
41 | 41 |
29 | 29 | #include "config/config_handler.h" |
30 | 30 | #include "converter/conversion_request.h" |
31 | 31 | #include "base/logging.h" |
32 | #include "session/commands.pb.h" | |
32 | #include "protocol/commands.pb.h" | |
33 | 33 | |
34 | 34 | namespace mozc { |
35 | 35 |
45 | 45 | '../dictionary/dictionary_base.gyp:pos_matcher', |
46 | 46 | '../prediction/prediction.gyp:prediction', |
47 | 47 | '../prediction/prediction.gyp:prediction_protocol', |
48 | '../protocol/protocol.gyp:commands_proto', | |
48 | 49 | '../rewriter/rewriter.gyp:rewriter', |
49 | '../session/session_base.gyp:session_protocol', | |
50 | 50 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
51 | 51 | 'converter_base.gyp:conversion_request', |
52 | 52 | 'converter_base.gyp:immutable_converter', |
123 | 123 | '../dictionary/dictionary.gyp:suffix_dictionary', |
124 | 124 | '../dictionary/dictionary_base.gyp:pos_matcher', |
125 | 125 | '../dictionary/dictionary_base.gyp:suppression_dictionary', |
126 | '../protocol/protocol.gyp:commands_proto', | |
126 | 127 | '../rewriter/rewriter_base.gyp:gen_rewriter_files#host', |
127 | '../session/session_base.gyp:session_protocol', | |
128 | 128 | 'connector', |
129 | 129 | 'immutable_converter_interface', |
130 | 130 | 'segmenter', |
139 | 139 | ], |
140 | 140 | 'dependencies': [ |
141 | 141 | '../base/base.gyp:base', |
142 | '../session/session_base.gyp:session_protocol', | |
142 | '../protocol/protocol.gyp:commands_proto', | |
143 | 143 | 'segments', |
144 | 144 | 'conversion_request', |
145 | 145 | ], |
163 | 163 | ], |
164 | 164 | 'dependencies': [ |
165 | 165 | '../base/base.gyp:base', |
166 | '../session/session_base.gyp:session_protocol', | |
166 | '../protocol/protocol.gyp:commands_proto', | |
167 | 167 | ], |
168 | 168 | }, |
169 | 169 | { |
49 | 49 | #include "engine/engine_factory.h" |
50 | 50 | #include "engine/engine_interface.h" |
51 | 51 | #include "engine/mock_data_engine_factory.h" |
52 | #include "session/commands.pb.h" | |
52 | #include "protocol/commands.pb.h" | |
53 | 53 | |
54 | 54 | DEFINE_int32(max_conversion_candidates_size, 200, "maximum candidates size"); |
55 | 55 | DEFINE_string(user_profile_dir, "", "path to user profile directory"); |
45 | 45 | '../engine/engine.gyp:engine', |
46 | 46 | '../engine/engine.gyp:engine_factory', |
47 | 47 | '../engine/engine.gyp:mock_data_engine_factory', |
48 | '../session/session_base.gyp:session_protocol', | |
48 | '../protocol/protocol.gyp:commands_proto', | |
49 | 49 | 'converter.gyp:converter', |
50 | 50 | 'converter_base.gyp:pos_id_printer', |
51 | 51 | 'converter_base.gyp:segments', |
40 | 40 | #include "converter/segments.h" |
41 | 41 | #include "engine/engine_factory.h" |
42 | 42 | #include "engine/engine_interface.h" |
43 | #include "session/commands.pb.h" | |
43 | #include "protocol/commands.pb.h" | |
44 | 44 | #include "testing/base/public/gunit.h" |
45 | 45 | |
46 | 46 | #ifdef OS_ANDROID |
69 | 69 | #include "prediction/predictor_interface.h" |
70 | 70 | #include "prediction/suggestion_filter.h" |
71 | 71 | #include "prediction/user_history_predictor.h" |
72 | #include "protocol/commands.pb.h" | |
72 | 73 | #include "rewriter/rewriter.h" |
73 | 74 | #include "rewriter/rewriter_interface.h" |
74 | #include "session/commands.pb.h" | |
75 | 75 | #include "testing/base/public/gunit.h" |
76 | 76 | #include "transliteration/transliteration.h" |
77 | 77 | #include "usage_stats/usage_stats.h" |
57 | 57 | '../engine/engine.gyp:engine_factory', |
58 | 58 | '../engine/engine.gyp:mock_data_engine_factory', |
59 | 59 | '../prediction/prediction_base.gyp:suggestion_filter', |
60 | '../protocol/protocol.gyp:commands_proto', | |
60 | 61 | '../rewriter/rewriter.gyp:rewriter', |
61 | 62 | '../session/session_base.gyp:request_test_util', |
62 | '../session/session_base.gyp:session_protocol', | |
63 | 63 | '../testing/testing.gyp:gtest_main', |
64 | 64 | '../transliteration/transliteration.gyp:transliteration', |
65 | 65 | '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util', |
85 | 85 | '../config/config.gyp:config_handler', |
86 | 86 | '../engine/engine.gyp:engine', |
87 | 87 | '../engine/engine.gyp:engine_factory', |
88 | '../protocol/protocol.gyp:commands_proto', | |
88 | 89 | '../session/session_base.gyp:request_test_util', |
89 | '../session/session_base.gyp:session_protocol', | |
90 | 90 | '../testing/testing.gyp:gtest_main', |
91 | 91 | ], |
92 | 92 | }, |
58 | 58 | #include "dictionary/pos_matcher.h" |
59 | 59 | #include "dictionary/suppression_dictionary.h" |
60 | 60 | #include "prediction/suggestion_filter.h" |
61 | #include "session/commands.pb.h" | |
61 | #include "protocol/commands.pb.h" | |
62 | 62 | |
63 | 63 | using mozc::dictionary::DictionaryInterface; |
64 | 64 | using mozc::dictionary::POSMatcher; |
57 | 57 | #include "dictionary/system/value_dictionary.h" |
58 | 58 | #include "dictionary/user_dictionary_stub.h" |
59 | 59 | #include "prediction/suggestion_filter.h" |
60 | #include "session/commands.pb.h" | |
60 | #include "protocol/commands.pb.h" | |
61 | 61 | #include "testing/base/public/gunit.h" |
62 | 62 | |
63 | 63 | DECLARE_string(test_tmpdir); |
42 | 42 | #include "engine/chromeos_engine_factory.h" |
43 | 43 | #include "engine/engine_factory.h" |
44 | 44 | #include "engine/engine_interface.h" |
45 | #include "session/commands.pb.h" | |
45 | #include "protocol/commands.pb.h" | |
46 | 46 | #include "session/request_test_util.h" |
47 | 47 | #include "testing/base/public/gunit.h" |
48 | 48 |
43 | 43 | #include "converter/conversion_request.h" |
44 | 44 | #include "converter/converter_interface.h" |
45 | 45 | #include "converter/segments.h" |
46 | #include "session/commands.pb.h" | |
46 | #include "protocol/commands.pb.h" | |
47 | 47 | |
48 | 48 | namespace mozc { |
49 | 49 | namespace quality_regression { |
287 | 287 | Performed_Conversion_ReportBug |
288 | 288 | Performed_Conversion_DeleteSelectedCandidate |
289 | 289 | |
290 | # The count of some SessionCommands defined in session/commands.proto | |
290 | # The count of some SessionCommands defined in protocol/commands.proto | |
291 | 291 | SendCommand_Revert |
292 | 292 | SendCommand_Submit |
293 | 293 | SendCommand_SelectCandidate |
55 | 55 | '../dictionary/system/system_dictionary.gyp:value_dictionary', |
56 | 56 | '../prediction/prediction.gyp:prediction', |
57 | 57 | '../prediction/prediction_base.gyp:suggestion_filter', |
58 | '../protocol/protocol.gyp:commands_proto', | |
58 | 59 | '../rewriter/rewriter.gyp:rewriter', |
59 | '../session/session_base.gyp:session_protocol', | |
60 | 60 | ], |
61 | 61 | }, |
62 | 62 | { |
120 | 120 | '../base/base.gyp:base', |
121 | 121 | '../data_manager/testing/mock_data_manager.gyp:mock_data_manager', |
122 | 122 | '../prediction/prediction.gyp:prediction', |
123 | '../session/session_base.gyp:session_protocol', | |
123 | '../protocol/protocol.gyp:commands_proto', | |
124 | 124 | 'engine', |
125 | 125 | ], |
126 | 126 | }, |
43 | 43 | #include "gui/character_pad/data/local_character_map.h" |
44 | 44 | #include "gui/character_pad/data/unicode_blocks.h" |
45 | 45 | #include "gui/character_pad/selection_handler.h" |
46 | #include "session/commands.pb.h" | |
46 | #include "protocol/commands.pb.h" | |
47 | 47 | |
48 | 48 | namespace mozc { |
49 | 49 | namespace gui { |
51 | 51 | #include "gui/base/win_util.h" |
52 | 52 | #include "handwriting/handwriting_manager.h" |
53 | 53 | #include "handwriting/zinnia_handwriting.h" |
54 | #include "session/commands.pb.h" | |
54 | #include "protocol/commands.pb.h" | |
55 | 55 | |
56 | 56 | namespace mozc { |
57 | 57 |
52 | 52 | #include "gui/config_dialog/keymap_editor.h" |
53 | 53 | #include "gui/config_dialog/roman_table_editor.h" |
54 | 54 | #include "ipc/ipc.h" |
55 | #include "session/commands.pb.h" | |
55 | #include "protocol/commands.pb.h" | |
56 | 56 | #include "session/internal/keymap.h" |
57 | 57 | |
58 | 58 | namespace { |
39 | 39 | #include <vector> |
40 | 40 | #include "base/file_stream.h" |
41 | 41 | #include "base/util.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | |
44 | 44 | namespace mozc { |
45 | 45 | namespace gui { |
44 | 44 | #include "gui/base/table_util.h" |
45 | 45 | #include "gui/config_dialog/combobox_delegate.h" |
46 | 46 | #include "gui/config_dialog/keybinding_editor_delegate.h" |
47 | #include "session/commands.pb.h" | |
47 | #include "protocol/commands.pb.h" | |
48 | 48 | #include "session/internal/keymap.h" |
49 | 49 | #include "session/key_parser.h" |
50 | 50 | // TODO(komatsu): internal files should not be used from external modules. |
37 | 37 | #include "base/logging.h" |
38 | 38 | #include "base/util.h" |
39 | 39 | #include "gui/base/table_util.h" |
40 | #include "session/commands.pb.h" | |
40 | #include "protocol/commands.pb.h" | |
41 | 41 | |
42 | 42 | namespace mozc { |
43 | 43 | namespace gui { |
59 | 59 | '../dictionary/dictionary_base.gyp:user_dictionary', |
60 | 60 | '../ipc/ipc.gyp:ipc', |
61 | 61 | '../ipc/ipc.gyp:window_info_protocol', |
62 | '../session/session_base.gyp:session_protocol', | |
62 | '../protocol/protocol.gyp:commands_proto', | |
63 | 63 | 'gen_base_files', |
64 | 64 | ], |
65 | 65 | 'includes': [ |
370 | 370 | '../config/config.gyp:stats_config_util', |
371 | 371 | '../handwriting/handwriting.gyp:handwriting_manager', |
372 | 372 | '../handwriting/handwriting.gyp:zinnia_handwriting', |
373 | '../session/session_base.gyp:session_protocol', | |
373 | '../protocol/protocol.gyp:commands_proto', | |
374 | 374 | 'gen_character_pad_files', |
375 | 375 | 'gen_character_pad_cp932_data', |
376 | 376 | 'gen_character_pad_data', |
383 | 383 | ['enable_cloud_handwriting==1', { |
384 | 384 | 'dependencies': [ |
385 | 385 | '../handwriting/handwriting.gyp:cloud_handwriting', |
386 | '../session/session_base.gyp:session_protocol', | |
386 | '../protocol/protocol.gyp:commands_proto', | |
387 | 387 | ], |
388 | 388 | }], |
389 | 389 | ['use_libzinnia==1 and OS=="linux"', { |
478 | 478 | '../config/config.gyp:config_handler', |
479 | 479 | '../config/config.gyp:config_protocol', |
480 | 480 | '../config/config.gyp:stats_config_util', |
481 | '../protocol/protocol.gyp:commands_proto', | |
481 | 482 | '../session/session_base.gyp:key_parser', |
482 | 483 | '../session/session_base.gyp:keymap', |
483 | '../session/session_base.gyp:session_protocol', | |
484 | 484 | 'gen_config_dialog_files', |
485 | 485 | ], |
486 | 486 | 'includes': [ |
596 | 596 | '../data_manager/data_manager.gyp:user_pos_manager', |
597 | 597 | '../dictionary/dictionary_base.gyp:dictionary_protocol', |
598 | 598 | '../dictionary/dictionary_base.gyp:user_dictionary', |
599 | '../session/session_base.gyp:session_protocol', | |
599 | '../protocol/protocol.gyp:commands_proto', | |
600 | 600 | 'gen_config_dialog_files', |
601 | 601 | 'gen_dictionary_tool_files', |
602 | 602 | ], |
652 | 652 | '../dictionary/dictionary_base.gyp:dictionary_protocol', |
653 | 653 | '../dictionary/dictionary_base.gyp:pos_matcher', |
654 | 654 | '../dictionary/dictionary_base.gyp:user_dictionary', |
655 | '../session/session_base.gyp:session_protocol', | |
655 | '../protocol/protocol.gyp:commands_proto', | |
656 | 656 | 'gen_word_register_dialog_files', |
657 | 657 | ], |
658 | 658 | 'includes': [ |
750 | 750 | 'dependencies': [ |
751 | 751 | '../base/base.gyp:base', |
752 | 752 | '../ipc/ipc.gyp:ipc', |
753 | '../session/session_base.gyp:session_protocol', | |
753 | '../protocol/protocol.gyp:commands_proto', | |
754 | 754 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
755 | 755 | 'gen_post_install_dialog_files', |
756 | 756 | ], |
810 | 810 | '../client/client.gyp:client', |
811 | 811 | '../config/config.gyp:config_protocol', |
812 | 812 | '../ipc/ipc.gyp:ipc', |
813 | '../session/session_base.gyp:session_protocol', | |
813 | '../protocol/protocol.gyp:commands_proto', | |
814 | 814 | 'gen_set_default_dialog_files', |
815 | 815 | ], |
816 | 816 | 'conditions': [ |
861 | 861 | 'dependencies': [ |
862 | 862 | '../base/base.gyp:base', |
863 | 863 | '../client/client.gyp:client', |
864 | '../protocol/protocol.gyp:commands_proto', | |
864 | 865 | '../renderer/renderer.gyp:renderer_client', |
865 | '../session/session_base.gyp:session_protocol', | |
866 | 866 | ], |
867 | 867 | }, |
868 | 868 | { |
52 | 52 | #include "client/client.h" |
53 | 53 | #include "config/config.pb.h" |
54 | 54 | #include "ipc/ipc.h" |
55 | #include "protocol/commands.pb.h" | |
55 | 56 | #include "renderer/renderer_client.h" |
56 | #include "session/commands.pb.h" | |
57 | 57 | #include "session/ime_switch_util.h" |
58 | 58 | |
59 | 59 | using mozc::commands::Candidates; |
607 | 607 | if (selectedRange.location != NSNotFound || |
608 | 608 | selectedRange.length != NSNotFound || |
609 | 609 | selectedRange.location + deletion_range.offset() > 0) { |
610 | // The offset is a negative value. See session/commands.proto for | |
610 | // The offset is a negative value. See protocol/commands.proto for | |
611 | 611 | // the details. |
612 | 612 | selectedRange.location += deletion_range.offset(); |
613 | 613 | selectedRange.length += deletion_range.length(); |
28 | 28 | |
29 | 29 | @class NSURL; |
30 | 30 | |
31 | #include "session/commands.pb.h" | |
31 | #include "protocol/commands.pb.h" | |
32 | 32 | |
33 | 33 | @interface GoogleJapaneseInputController () |
34 | 34 | // Updates |composedString_| from the result of a key event and put |
35 | 35 | #include "base/const.h" |
36 | 36 | #include "base/logging.h" |
37 | 37 | #include "base/mutex.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | |
40 | 40 | GoogleJapaneseInputServer *g_imkServer = nil; |
41 | 41 |
28 | 28 | |
29 | 29 | #import "mac/GoogleJapaneseInputServer.h" |
30 | 30 | |
31 | #include "session/commands.pb.h" | |
31 | #include "protocol/commands.pb.h" | |
32 | 32 | #include "testing/base/public/googletest.h" |
33 | 33 | #include "testing/base/public/gunit.h" |
34 | 34 |
34 | 34 | |
35 | 35 | #include "base/logging.h" |
36 | 36 | #include "base/mutex.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | |
39 | 39 | using mozc::commands::KeyEvent; |
40 | 40 | using mozc::once_t; |
31 | 31 | #import <Carbon/Carbon.h> |
32 | 32 | #import <Cocoa/Cocoa.h> |
33 | 33 | |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | #include "testing/base/public/googletest.h" |
36 | 36 | #include "testing/base/public/gunit.h" |
37 | 37 |
42 | 42 | '../client/client.gyp:client', |
43 | 43 | '../client/client.gyp:client_mock', |
44 | 44 | '../config/config.gyp:config_protocol', |
45 | '../protocol/protocol.gyp:commands_proto', | |
45 | 46 | '../renderer/renderer.gyp:renderer_client', |
46 | 47 | '../renderer/renderer.gyp:renderer_protocol', |
47 | 48 | '../session/session_base.gyp:ime_switch_util', |
48 | '../session/session_base.gyp:session_protocol', | |
49 | 49 | '../testing/testing.gyp:gtest_main', |
50 | 50 | 'gen_key_mappings', |
51 | 51 | ], |
0 | 0 | MAJOR=2 |
1 | 1 | MINOR=17 |
2 | BUILD=2098 | |
2 | BUILD=2099 | |
3 | 3 | REVISION=102 |
4 | 4 | # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be |
5 | 5 | # downloaded by NaCl Mozc. |
59 | 59 | #include "prediction/suggestion_filter.h" |
60 | 60 | #include "prediction/zero_query_data.h" |
61 | 61 | #include "prediction/zero_query_number_data.h" |
62 | #include "session/commands.pb.h" | |
62 | #include "protocol/commands.pb.h" | |
63 | 63 | |
64 | 64 | // This flag is set by predictor.cc |
65 | 65 | // We can remove this after the ambiguity expansion feature get stable. |
65 | 65 | #include "dictionary/suppression_dictionary.h" |
66 | 66 | #include "dictionary/system/system_dictionary.h" |
67 | 67 | #include "prediction/suggestion_filter.h" |
68 | #include "session/commands.pb.h" | |
68 | #include "protocol/commands.pb.h" | |
69 | 69 | #include "session/request_test_util.h" |
70 | 70 | #include "testing/base/public/gmock.h" |
71 | 71 | #include "testing/base/public/googletest.h" |
44 | 44 | 'dependencies': [ |
45 | 45 | '../base/base.gyp:base', |
46 | 46 | '../base/base.gyp:config_file_stream', |
47 | '../composer/composer.gyp:composer', | |
47 | 48 | '../config/config.gyp:config_handler', |
48 | '../composer/composer.gyp:composer', | |
49 | 49 | '../converter/converter_base.gyp:conversion_request', |
50 | 50 | '../converter/converter_base.gyp:immutable_converter', |
51 | 51 | '../converter/converter_base.gyp:segmenter', |
53 | 53 | '../dictionary/dictionary.gyp:dictionary', |
54 | 54 | '../dictionary/dictionary.gyp:suffix_dictionary', |
55 | 55 | '../dictionary/dictionary_base.gyp:suppression_dictionary', |
56 | '../protocol/protocol.gyp:commands_proto', | |
56 | 57 | '../rewriter/rewriter.gyp:rewriter', |
57 | 58 | '../session/session_base.gyp:request_test_util', |
58 | '../session/session_base.gyp:session_protocol', | |
59 | 59 | '../storage/storage.gyp:storage', |
60 | 60 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
61 | 61 | 'gen_zero_query_data#host', |
42 | 42 | ], |
43 | 43 | 'dependencies': [ |
44 | 44 | '../composer/composer.gyp:composer', |
45 | '../config/config.gyp:config_handler', | |
45 | 46 | '../config/config.gyp:config_protocol', |
46 | 47 | '../converter/converter_base.gyp:connector', |
47 | 48 | '../converter/converter_base.gyp:converter_mock', |
56 | 57 | '../dictionary/dictionary_base.gyp:pos_matcher', |
57 | 58 | '../dictionary/system/system_dictionary.gyp:system_dictionary', |
58 | 59 | '../dictionary/system/system_dictionary.gyp:value_dictionary', |
59 | '../config/config.gyp:config_handler', | |
60 | '../protocol/protocol.gyp:commands_proto', | |
60 | 61 | '../session/session_base.gyp:request_test_util', |
61 | '../session/session_base.gyp:session_protocol', | |
62 | 62 | '../testing/testing.gyp:gtest_main', |
63 | 63 | 'prediction.gyp:prediction', |
64 | 64 | ], |
36 | 36 | #include "config/config.pb.h" |
37 | 37 | #include "config/config_handler.h" |
38 | 38 | #include "converter/segments.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | |
41 | 41 | DECLARE_bool(enable_expansion_for_dictionary_predictor); |
42 | 42 | DECLARE_bool(enable_expansion_for_user_history_predictor); |
44 | 44 | #include "dictionary/suppression_dictionary.h" |
45 | 45 | #include "prediction/predictor_interface.h" |
46 | 46 | #include "prediction/user_history_predictor.h" |
47 | #include "session/commands.pb.h" | |
47 | #include "protocol/commands.pb.h" | |
48 | 48 | #include "session/request_test_util.h" |
49 | 49 | #include "testing/base/public/gmock.h" |
50 | 50 | #include "testing/base/public/googletest.h" |
50 | 50 | #include "dictionary/suppression_dictionary.h" |
51 | 51 | #include "prediction/predictor_interface.h" |
52 | 52 | #include "prediction/user_history_predictor.pb.h" |
53 | #include "protocol/commands.pb.h" | |
53 | 54 | #include "rewriter/variants_rewriter.h" |
54 | #include "session/commands.pb.h" | |
55 | 55 | #include "storage/encrypted_string_storage.h" |
56 | 56 | #include "storage/lru_cache.h" |
57 | 57 | #include "usage_stats/usage_stats.h" |
47 | 47 | #include "data_manager/testing/mock_data_manager.h" |
48 | 48 | #include "dictionary/dictionary_mock.h" |
49 | 49 | #include "dictionary/suppression_dictionary.h" |
50 | #include "session/commands.pb.h" | |
50 | #include "protocol/commands.pb.h" | |
51 | 51 | #include "session/request_test_util.h" |
52 | 52 | #include "testing/base/public/googletest.h" |
53 | 53 | #include "testing/base/public/gunit.h" |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | // Protocol messages of candidates to be used for mozc client/server | |
30 | // communication and client/renderer communication. | |
31 | ||
32 | syntax = "proto2"; | |
33 | ||
34 | package mozc.commands; | |
35 | ||
36 | option java_outer_classname = "ProtoCandidates"; | |
37 | option java_package = "org.mozc.android.inputmethod.japanese.protobuf"; | |
38 | ||
39 | // Annotation against a candidate. | |
40 | message Annotation { | |
41 | // Annotation prepended to the value. | |
42 | optional string prefix = 1; | |
43 | // Annotation appended to the value. | |
44 | optional string suffix = 2; | |
45 | // Type of the candidate such as [HALF][KATAKANA], [GREEK], | |
46 | // [Black square], etc... | |
47 | optional string description = 3; | |
48 | // Shortcut key to select this candidate. | |
49 | optional string shortcut = 4; | |
50 | // Set to true if this candidate can be deleted from history. | |
51 | optional bool deletable = 5 [default = false]; | |
52 | }; | |
53 | ||
54 | // Additional information to a candidate word. This message is | |
55 | // used for describing a word usage for instance. | |
56 | message Information { | |
57 | // Unique number specifying the information. | |
58 | optional int32 id = 1; | |
59 | ||
60 | // Title string of the information. For usage, this value is | |
61 | // probably equal to Candidate::value or its canonicalized value. | |
62 | optional string title = 2; | |
63 | ||
64 | // The content of the information. For usage, this value actually | |
65 | // describes how to use the word. | |
66 | optional string description = 3; | |
67 | ||
68 | // The IDs of candidates which connect with the information. | |
69 | repeated int32 candidate_id = 4; | |
70 | }; | |
71 | ||
72 | // Category describes the attribute of the words. | |
73 | enum Category { | |
74 | CONVERSION = 0; | |
75 | PREDICTION = 1; | |
76 | SUGGESTION = 2; | |
77 | TRANSLITERATION = 3; | |
78 | USAGE = 4; | |
79 | }; | |
80 | ||
81 | // DisplayType is a hint to UI renderers describing how the words are | |
82 | // displayed. | |
83 | enum DisplayType { | |
84 | MAIN = 0; | |
85 | CASCADE = 1; | |
86 | }; | |
87 | ||
88 | // TODO(nona): merge to RendererCommand::Rectangle | |
89 | message Rectangle { | |
90 | required int32 x = 1; | |
91 | required int32 y = 2; | |
92 | required int32 width = 3; | |
93 | required int32 height = 4; | |
94 | } | |
95 | ||
96 | message InformationList { | |
97 | optional uint32 focused_index = 1; | |
98 | repeated Information information = 2; | |
99 | // Category of the infolist. | |
100 | optional Category category = 3 [default = CONVERSION]; | |
101 | ||
102 | // Information to be used for rendering. | |
103 | optional DisplayType display_type = 4 [default = CASCADE]; | |
104 | ||
105 | // How long rendere needs to wait before the infolist is displayed. | |
106 | // the default setting is 500 msec. | |
107 | optional uint32 delay = 5 [ default = 500 ]; | |
108 | }; | |
109 | ||
110 | // Message representing the footer part of the candidate window. | |
111 | message Footer { | |
112 | // Message shown like a status bar. | |
113 | optional string label = 1; | |
114 | // Whether index (e.g. 10/120) is visible or not. | |
115 | optional bool index_visible = 2 [default = false]; | |
116 | // Whether the logo image is visible or not. | |
117 | optional bool logo_visible = 3 [default = false]; | |
118 | // Message modestly shown. It is used for displaying the version on | |
119 | // dev-channel now. | |
120 | optional string sub_label = 4; | |
121 | }; | |
122 | ||
123 | message CandidateWord { | |
124 | // Unique number specifing the candidate. This may be a negative value. | |
125 | optional int32 id = 1; | |
126 | // The first index should be zero and index numbers should increase by one. | |
127 | optional uint32 index = 2; | |
128 | // Reading of the value. The value is only used when the key is | |
129 | // different from the input composition (e.g. suggestion/prediction). | |
130 | optional string key = 3; | |
131 | // Converted value. (e.g. Kanji value). | |
132 | optional string value = 4; | |
133 | optional Annotation annotation = 5; | |
134 | }; | |
135 | ||
136 | message CandidateList { | |
137 | // This value represents the focused position of the next | |
138 | // |candidates|. If the |candidates| is a part of the whole | |
139 | // candidate words (as a result of paging), this value indicates the | |
140 | // position from the beginning of that part. (ex. where | |
141 | // |candidates| contatins 10th to 18th candidates, focused_index=0 | |
142 | // means the 10th candidate, but not 1st candidate. | |
143 | // | |
144 | // The existense of |focused_index| does not represents whether this | |
145 | // candidate list is a 'suggestion' or not. |category| represents | |
146 | // it. | |
147 | optional uint32 focused_index = 1; | |
148 | repeated CandidateWord candidates = 2; | |
149 | // Category of the candidates. | |
150 | optional Category category = 3 [default = CONVERSION]; | |
151 | }; | |
152 | ||
153 | // TODO(komatsu) rename it to CandidateWindow. | |
154 | message Candidates { | |
155 | // TODO(komatsu): Use CandidateList. | |
156 | // When has_focused_index() is true, this message contains predicted and | |
157 | // normally converted candidates. Otherwise, when the field is not set, | |
158 | // this message contains a 'suggestion'. | |
159 | optional uint32 focused_index = 1; | |
160 | ||
161 | // The size of the total candidates in this candidate list. The | |
162 | // value does not include the size of subcandidate lists. Note, the | |
163 | // next repeated-Candidate=3 may not contain all candidates. | |
164 | // all_candidates contains the values of subcandidate lists. | |
165 | required uint32 size = 2; | |
166 | ||
167 | // TODO(komatsu): Use CandidateList. | |
168 | repeated group Candidate = 3 { | |
169 | // The first index should be zero and index numbers should increase by one. | |
170 | required uint32 index = 4; | |
171 | required string value = 5; | |
172 | optional int32 id = 9; // Unique number specifing the candidate. | |
173 | optional Annotation annotation = 7; | |
174 | optional int32 information_id = 10; | |
175 | }; | |
176 | // The position on the composition in character counted by Util::CharsLen. | |
177 | // The number represents the left edge of the candidate window. For example, | |
178 | // if the composition is "あいう" and the cursor is the position is between | |
179 | // "あ" and "い" (e.g. "あ|いう"), the number should be 1. | |
180 | // Note, Util::CharsLen does not take care of IVS or combining character | |
181 | // so much. Thus CharsLen's behavoir on those characters might be changed. | |
182 | required uint32 position = 6; | |
183 | ||
184 | // Nested candidates aka cascading window. | |
185 | optional Candidates subcandidates = 8; | |
186 | ||
187 | // Usages of candidates. | |
188 | optional InformationList usages = 10; | |
189 | ||
190 | // TODO(komatsu): Use CandidateList. | |
191 | // Category of the candidates | |
192 | optional Category category = 11 [default = CONVERSION]; | |
193 | ||
194 | // Information to be used for rendering. | |
195 | optional DisplayType display_type = 12 [default = MAIN]; | |
196 | ||
197 | // Footer of the GUI window. | |
198 | optional Footer footer = 13; | |
199 | ||
200 | // The direction of candidates in the window. This is just a | |
201 | // suggestion from the server and client does not have to follow. | |
202 | enum Direction { | |
203 | VERTICAL = 0; | |
204 | HORIZONTAL = 1; | |
205 | }; | |
206 | optional Direction direction = 14 [ default = VERTICAL ]; | |
207 | ||
208 | // This position is used for suggest window position. | |
209 | optional Rectangle composition_rectangle = 15; | |
210 | optional Rectangle caret_rectangle = 16; | |
211 | ||
212 | enum CandidateWindowLocation{ | |
213 | // Shows candidate window under the caret. This is used for prediction and | |
214 | // conversion | |
215 | CARET = 0; | |
216 | // Shows candidate window aligned with composition area. This is used for | |
217 | // suggestion. | |
218 | COMPOSITION = 1; | |
219 | } | |
220 | optional CandidateWindowLocation window_location = 17; | |
221 | ||
222 | // The number of candidates per page. | |
223 | optional uint32 page_size = 18 [ default = 9 ]; | |
224 | }; |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | // Protocol messages to be used for mozc client/server communication. | |
30 | // | |
31 | // The Command message contains all the input/output values for | |
32 | // client/server commnication. The messages structure of Command and | |
33 | // its child messages are here: | |
34 | ||
35 | syntax = "proto2"; | |
36 | ||
37 | import "config/config.proto"; | |
38 | import "dictionary/user_dictionary_storage.proto"; | |
39 | import "protocol/candidates.proto"; | |
40 | ||
41 | package mozc.commands; | |
42 | ||
43 | option java_outer_classname = "ProtoCommands"; | |
44 | option java_package = "org.mozc.android.inputmethod.japanese.protobuf"; | |
45 | ||
46 | // This enum is used by SessionCommand::input_mode with | |
47 | // CHANGE_INPUT_MODE and Output::mode. | |
48 | enum CompositionMode { | |
49 | DIRECT = 0; | |
50 | HIRAGANA = 1; | |
51 | FULL_KATAKANA = 2; | |
52 | HALF_ASCII = 3; | |
53 | FULL_ASCII = 4; | |
54 | HALF_KATAKANA = 5; | |
55 | NUM_OF_COMPOSITIONS = 6; | |
56 | } | |
57 | ||
58 | message KeyEvent { | |
59 | enum SpecialKey { | |
60 | NO_SPECIALKEY = 0; | |
61 | DIGIT = 1; | |
62 | // On Windows, SpecialKey::On and SpecialKey::OFF are obsolete. Use | |
63 | // TURN_ON_IME session command should be used instead. See b/10216365. | |
64 | // On other platforms, especially on Mac, please note that | |
65 | // client/client.cc still relies on SpecialKey::On for session playback. | |
66 | // We need to fix b/10250883 first. | |
67 | // TODO(team): Unsupport SpecialKey::On and SpecialKey::OFF. | |
68 | ON = 2; | |
69 | OFF = 3; | |
70 | SPACE = 4; | |
71 | ENTER = 5; | |
72 | LEFT = 6; | |
73 | RIGHT = 7; | |
74 | UP = 8; | |
75 | DOWN = 9; | |
76 | ESCAPE = 10; | |
77 | DEL = 11; // not DELETE because DELETE is reserved in MSVC | |
78 | BACKSPACE = 12; | |
79 | HENKAN = 13; | |
80 | MUHENKAN = 14; | |
81 | KANA = 15; // VK_DBE_HIRAGANA(Win), kVK_JIS_Kana(Mac) | |
82 | // TODO(toshiyuki): It is better to rename this to HIRAGANA | |
83 | // In Windows, we have Katakana and it may confusing. | |
84 | HOME = 16; | |
85 | END = 17; | |
86 | TAB = 18; | |
87 | F1 = 19; | |
88 | F2 = 20; | |
89 | F3 = 21; | |
90 | F4 = 22; | |
91 | F5 = 23; | |
92 | F6 = 24; | |
93 | F7 = 25; | |
94 | F8 = 26; | |
95 | F9 = 27; | |
96 | F10 = 28; | |
97 | F11 = 29; | |
98 | F12 = 30; | |
99 | PAGE_UP = 31; | |
100 | PAGE_DOWN = 32; | |
101 | INSERT = 33; | |
102 | F13 = 34; | |
103 | F14 = 35; | |
104 | F15 = 36; | |
105 | F16 = 37; | |
106 | F17 = 38; | |
107 | F18 = 39; | |
108 | F19 = 40; | |
109 | F20 = 41; | |
110 | F21 = 42; | |
111 | F22 = 43; | |
112 | F23 = 44; | |
113 | F24 = 45; | |
114 | EISU = 46; // alphanumeric VK_DBE_ALPHANUMERIC(Win), kVK_JIS_Eisu(Mac) | |
115 | NUMPAD0 = 47; | |
116 | NUMPAD1 = 48; | |
117 | NUMPAD2 = 49; | |
118 | NUMPAD3 = 50; | |
119 | NUMPAD4 = 51; | |
120 | NUMPAD5 = 52; | |
121 | NUMPAD6 = 53; | |
122 | NUMPAD7 = 54; | |
123 | NUMPAD8 = 55; | |
124 | NUMPAD9 = 56; | |
125 | MULTIPLY = 57; // Numpad [*] | |
126 | ADD = 58; // Numpad [+] | |
127 | SEPARATOR = 59; // Numpad [enter] | |
128 | SUBTRACT = 60; // Numpad [-] | |
129 | DECIMAL = 61; // Numpad [.] | |
130 | DIVIDE = 62; // Numpad [/] | |
131 | EQUALS = 63; // Numpad [=] | |
132 | TEXT_INPUT = 64; // Meta key event representing any text input. | |
133 | HANKAKU = 65; | |
134 | KANJI = 66; | |
135 | KATAKANA = 67; // VK_DBE_KATAKANA(Win) | |
136 | CAPS_LOCK = 68; | |
137 | // Unsupported keys (e.g. PrtSc, Pause) fall back to UNDEFINED_KEY. | |
138 | UNDEFINED_KEY = 69; | |
139 | COMMA = 70; // Numpad [,] | |
140 | CLEAR = 71; // Numpad [5] without NUMLOCK | |
141 | VIRTUAL_LEFT = 72; // Left key on virtual (software) keyboard | |
142 | VIRTUAL_RIGHT = 73; // Right key on virtual (software) keyboard | |
143 | VIRTUAL_ENTER = 74; // Enter key on virtual (software) keyboard | |
144 | ||
145 | NUM_SPECIALKEYS = 75; | |
146 | }; | |
147 | ||
148 | // CTRL, ALT and SHIFT cover both LEFT and RIGHT keys. If the | |
149 | // difference between LEFT and RIGHT is no matter, using CTRL (or ALT, SHIFT) | |
150 | // is preferred. | |
151 | // If LEFT (or RIGHT) CTRL(or ALT, SHIFT) is pressed, LEFT_CTRL is set on | |
152 | // Windows or Mac client, or LEFT_CTRL and CTRL are set on Unix client. | |
153 | // Mozc key translation logic is as follows | |
154 | // | |
155 | // ---- Modifier Keys ----- | |
156 | // | | | |
157 | // | B | | |
158 | // ---------+------ -- -----+------- | |
159 | // | | D | | E | | | |
160 | // | A +---- +--------+-------- C | | |
161 | // | | F | | | |
162 | // --Special Keys-- ---Other Keys--- | |
163 | // | |
164 | // A:Press only a special key | |
165 | // => Send special key event with no modifier. | |
166 | // B:Press only modifier keys | |
167 | // => Send modifier key event with no key_code. | |
168 | // C:Press an other key | |
169 | // => Send KeyEvent with no modifier. | |
170 | // D:Press a special key with one or more modifier keys | |
171 | // => Send special key event with modifiers. | |
172 | // E:Press an other key with one or more modifier keys | |
173 | // => If combined key is printable, replace keycodes. Otherwise, just send | |
174 | // with modifier keys. Note that, unless the whole combined key is | |
175 | // printable, keycodes are not replaced even if a subset of combined key is | |
176 | // printable. | |
177 | // F:Otherwise | |
178 | // => Send nothing. | |
179 | // | |
180 | // Following example shows expected behaviours. | |
181 | // E.g. ) | |
182 | // case | Pressed Key | translated key event | |
183 | // ---------------------------------------------------- | |
184 | // A | SP | special_key = 4 | |
185 | // A | F1 | special_key = 19 | |
186 | // B | CTRL | modifier_key = {CTRL} | |
187 | // B | SHIFT | modifier_key = {SHIFT} | |
188 | // B | CTRL+SHIFT | modifier_key = {CTRL,SHIFT} | |
189 | // C | 'a' | key_code = \x61 = 'a' | |
190 | // D | CTRL+BS | special_key = 12, modifier_key = {CTRL} | |
191 | // D | CTRL+SHIFT+BS | special_key = 12, modifier_key = {CTRL,SHIFT} | |
192 | // E | SHIFT+'a' | key_code = \x41 = 'A' | |
193 | // E | CTRL+'a' | key_code = \x61, modifier_key = {CTRL} | |
194 | // E | CTRL+ALT+'a' | key_code = \x61, modifier_key = {CTRL,ALT} | |
195 | // E | CTRL+SHIFT+'a'| key_code = \x61, modifier_key = {CTRL,SHIFT} | |
196 | // F | CTRL+BS+SP | send nothing | |
197 | // | |
198 | // In addition, we treat CAPS lock independently besides alphabet keys, | |
199 | // though it is a member of modifier keys. Following example shows currently | |
200 | // expected behaviours with Caps lock set. | |
201 | // | |
202 | // E.g. ) While CAPS is set on. | |
203 | // Pressed Key | translated key event | |
204 | // ---------------------------------------------------- | |
205 | // 'a' | key_code = \x41 = 'A', modifier_key = {CAPS} | |
206 | // SHIFT+'a' | key_code = \x61 = 'a', modifier_key = {CAPS} | |
207 | // CTRL+'a' | key_code = \x41, modifier_key = {CTRL,CAPS} | |
208 | // CTRL+ALT+'a' | key_code = \x41, modifier_key = {CTRL,ALT,CAPS} | |
209 | // CTRL+SHIFT+'a'| key_code = \x41, modifier_key = {CTRL,SHIFT,CAPS} | |
210 | // | |
211 | // However, only in short-cut judgement, we should convert capital characters | |
212 | // into lower cases. | |
213 | // TODO(peria): Specify exceptions with CAPS, and unify with the above table. | |
214 | ||
215 | enum ModifierKey { | |
216 | CTRL = 1; | |
217 | ALT = 2; | |
218 | SHIFT = 4; | |
219 | KEY_DOWN = 8; | |
220 | KEY_UP = 16; | |
221 | LEFT_CTRL = 32; | |
222 | LEFT_ALT = 64; | |
223 | LEFT_SHIFT = 128; | |
224 | RIGHT_CTRL = 256; | |
225 | RIGHT_ALT = 512; | |
226 | RIGHT_SHIFT = 1024; | |
227 | CAPS = 2048; | |
228 | }; | |
229 | ||
230 | // Probable key event, mainly for touch screen. | |
231 | // User's input has ambiguity (e.g. the touch position is merginal) | |
232 | // so this message expresses the probable event. | |
233 | message ProbableKeyEvent { | |
234 | // message ID is the same as Input message. | |
235 | optional uint32 key_code = 1; | |
236 | optional SpecialKey special_key = 3; // Unprintable key listed above. | |
237 | repeated ModifierKey modifier_keys = 4; // ModifierKeys | |
238 | // Sum of probabilities must be lesser or equal than 1. | |
239 | // 0<= probability <= 1 | |
240 | optional double probability = 10; | |
241 | }; | |
242 | ||
243 | // Printable key in UCS4. If key_code is empty, key_string is used | |
244 | // as a raw input. | |
245 | optional uint32 key_code = 1; | |
246 | optional uint32 modifiers = 2; // Going to be obsolete. | |
247 | optional SpecialKey special_key = 3; // Unprintable key listed above. | |
248 | repeated ModifierKey modifier_keys = 4; // ModifierKeys | |
249 | ||
250 | // String used for preedit. Kana characters and strings typed from | |
251 | // a software keyboard are supposed to be stored here. If key_code | |
252 | // is also set, key_code is treated as the raw input and key_string is | |
253 | // treated as the composition input. For example, to set Kana value, | |
254 | // when key_string is "ち", key_code should be 'a' (97). If key_code | |
255 | // is empty, key_string is also treated as the raw input. | |
256 | optional string key_string = 5; | |
257 | ||
258 | enum InputStyle { | |
259 | // Follow the current input mode (default). | |
260 | FOLLOW_MODE = 0; | |
261 | // Do not transliterate key_string and use it as-is. | |
262 | AS_IS = 1; | |
263 | // Immediately output key_string on the precomposition mode. | |
264 | // Same with AS_IS on the preedit mode. | |
265 | DIRECT_INPUT = 2; | |
266 | }; | |
267 | optional InputStyle input_style = 6 [default = FOLLOW_MODE]; | |
268 | ||
269 | // Input mode | |
270 | // For histrical reasons, this field expects a temporary conversion | |
271 | // mode rather than comeback input mode. | |
272 | optional CompositionMode mode = 7; | |
273 | ||
274 | // Probable key events | |
275 | // Even if you can fill this field, | |
276 | // don't omit Input.key_code and so on | |
277 | // because preedit string is composed based on them. | |
278 | repeated ProbableKeyEvent probable_key_event = 8; | |
279 | ||
280 | // IME on/off mode | |
281 | // You can use this field to change the IME on/off mode indirectly without | |
282 | // sending SpecialKey:ON or SpecialKey:OFF events. | |
283 | // If the internal ImeContext::State is DIRECT and this field is true, the | |
284 | // converter will change the state to PRECONPOSITION and then handles this key | |
285 | // event. | |
286 | // If the internal ImeContext::State is not DIRECT and this field is false, | |
287 | // the converter will change the state to DIRECT and then handles this key | |
288 | // event. | |
289 | // Implementation note: We need both |mode| and |activated| to support | |
290 | // indirect IME off, where |mode| should contain the next mode. If this field | |
291 | // is not set, the server will act as if indirect on/off was not supported. | |
292 | optional bool activated = 9; | |
293 | }; | |
294 | ||
295 | message GenericStorageEntry { | |
296 | enum StorageType { | |
297 | SYMBOL_HISTORY = 0; | |
298 | EMOTICON_HISTORY = 1; | |
299 | EMOJI_HISTORY=2; | |
300 | } | |
301 | optional StorageType type = 1; | |
302 | optional string key = 2; | |
303 | // The type must be bytes instead of string | |
304 | // because value might have U+0000 character as a terminator. | |
305 | // In this case, characters after the terminator are undefined. | |
306 | // Such byte stream cannot be treaed by Java's String class, which | |
307 | // is used for PB's string type. | |
308 | // Instead, PB's bytes type is converted into ByteString in Java, | |
309 | // which can treat C laguage style string described above. | |
310 | repeated bytes value = 3; | |
311 | } | |
312 | ||
313 | message SessionCommand { | |
314 | enum CommandType { | |
315 | // Revert the session, this is usually similar to type ESC several times. | |
316 | REVERT = 1; | |
317 | // Commit the session, this is usually similar to type Enter. | |
318 | // SUBMIT session command is accepted in any status. | |
319 | // Pre-condition: | |
320 | // - Any states of IME are acceptable. | |
321 | // Post-condition: | |
322 | // - Preedit text becomes empty. | |
323 | SUBMIT = 2; | |
324 | // Select the specified candidate word by id. This command is | |
325 | // usually used with mouse clicking. | |
326 | SELECT_CANDIDATE = 3; | |
327 | ||
328 | // Set the focus to the candidate by id. This is usually used | |
329 | // with mouse dragging. The difference from SELECT_CANDIDATE is | |
330 | // that HIGHLIGHT_CANDIDATE does not close the candidate window | |
331 | // while SELECT_CANDIDATE closes the candidate window. | |
332 | HIGHLIGHT_CANDIDATE = 4; | |
333 | ||
334 | // Specify the input mode. This command should be used with | |
335 | // composition_mode. | |
336 | SWITCH_INPUT_MODE = 5; | |
337 | ||
338 | // Return the current status such as composition mode, preedit method, etc. | |
339 | GET_STATUS = 6; | |
340 | ||
341 | // This command is typically used for mobile IME's partial conversion, | |
342 | // but currently it is on the way. This description is for current spec. | |
343 | // | |
344 | // This command requires that candidates exist. | |
345 | // | |
346 | // If there is a focused candidate (Conversion or Prediction state), | |
347 | // the candidate matched with the given id in the first segment is | |
348 | // submitted, even though the selected segment is not the first segment | |
349 | // (Important thing is whether focused candidate exists | |
350 | // or not. Focused index itself is ignored). | |
351 | // This behavior should be updated because current cursor position and | |
352 | // position of focused segment affects nothing. | |
353 | // We should fix this non-intuitive behavior. Intuitive behavior might be | |
354 | // submitting segments from first one to focused one (inclusive). | |
355 | // | |
356 | // If no focused candidate (Suggestion, including ZeroQuery suggestion), | |
357 | // first (and only) segment's candiadte of which id is equal to id field of | |
358 | // Input message is submitted. | |
359 | // This behavior should be fixed because current cursor position affects | |
360 | // nothing. In future, the characters after the cursor should be kept | |
361 | // as preedit. | |
362 | // | |
363 | // This command's pre- and post- conditions are differenct from | |
364 | // SUBMIT command's. Following conditions will be kept after updating | |
365 | // the behavior. | |
366 | // Pre-condition: | |
367 | // - There should be candidate. | |
368 | // Post-condition: | |
369 | // - No guarantee on preedit text. | |
370 | // TODO(yamaguchi): Update corresponding implementation please. | |
371 | SUBMIT_CANDIDATE = 7; | |
372 | ||
373 | // Perform reverse conversion. | |
374 | CONVERT_REVERSE = 8; | |
375 | ||
376 | // Perform Undo. | |
377 | UNDO = 9; | |
378 | ||
379 | // Reset convert history and revert current composition. | |
380 | // This is usually used by moving cursor with mouse clicking. | |
381 | RESET_CONTEXT = 10; | |
382 | ||
383 | // Change cursor position in preedit. | |
384 | MOVE_CURSOR = 11; | |
385 | ||
386 | // Specify the input field type. | |
387 | SWITCH_INPUT_FIELD_TYPE = 12; | |
388 | ||
389 | // Client side event information for collecting usage statistics | |
390 | USAGE_STATS_EVENT = 13; | |
391 | ||
392 | // This command is used in only Android. | |
393 | // Works UNDO or rewind HIRAGANA characters based on the state. | |
394 | UNDO_OR_REWIND = 14; | |
395 | ||
396 | // Expand suggestion candidates. | |
397 | // Usual suggestion algorithm is not "rich" but "fast" because suggestion | |
398 | // is executed every key event (On the other hand predicition is "rich" | |
399 | // because prediction is executed only when a user types TAB key). | |
400 | // This command expands suggestion candidate but IME state is | |
401 | // kept as is (Note : PredictAndConvert key command does almost the same | |
402 | // thing but it changes IME state to prediction). | |
403 | EXPAND_SUGGESTION = 15; | |
404 | ||
405 | // The client can send the current caret position whenever the caret | |
406 | // position is changed. The caret position is used for suggest window | |
407 | // position calculation. This is an optional message. If client can show | |
408 | // suggest window on the correct position, this message can be ignored. | |
409 | SEND_CARET_LOCATION = 16; | |
410 | ||
411 | // Obsolete command. Don't simply remove this command for NUM_OF_COMMANDS. | |
412 | // TODO(team): Replace this command by useful one. | |
413 | OBSOLETE_SEND_LANGUAGE_BAR_COMMAND = 17; | |
414 | ||
415 | // When the server is hadling asynchronous request, the server returns the | |
416 | // message with callback request which session_command is GET_ASYNC_RESULT. | |
417 | // After the delay_millisec, the client sends this command to the server. | |
418 | GET_ASYNC_RESULT = 18; | |
419 | ||
420 | // Commit the raw text of the composed string. | |
421 | COMMIT_RAW_TEXT = 19; | |
422 | ||
423 | // Call ConvertPrevPage session command to show the previous page of | |
424 | // candidates. | |
425 | CONVERT_PREV_PAGE = 20; | |
426 | ||
427 | // Call ConvertNextPage session command to show the next page of | |
428 | // candidates. | |
429 | CONVERT_NEXT_PAGE = 21; | |
430 | ||
431 | // Make sure IME is turned on. Optionally you can also provide new input | |
432 | // mode in |composition_mode| (but you must not set DIRECT to it). | |
433 | // |composition_mode| is honored even when IME is already turned on. | |
434 | TURN_ON_IME = 22; | |
435 | ||
436 | // Make sure IME is turned off. Optionally you can also provide new input | |
437 | // mode in |composition_mode| (but you must not set DIRECT to it). If IME | |
438 | // |composition_mode| is honored even when IME is already turned off. | |
439 | TURN_OFF_IME = 23; | |
440 | ||
441 | // Number of commands. | |
442 | // When new command is added, the command should use below number | |
443 | // and NUM_OF_COMMANDS should be incremented. | |
444 | NUM_OF_COMMANDS = 24; | |
445 | }; | |
446 | required CommandType type = 1; | |
447 | ||
448 | // Unique number specifying a candidate word. | |
449 | optional int32 id = 2; | |
450 | ||
451 | // This is used with SWITCH_INPUT_MODE, TURN_ON_IME and TURN_OFF_IME. | |
452 | optional CompositionMode composition_mode = 3; | |
453 | ||
454 | // Text argument. This is used by CONVERT_REVERSE at this moment. | |
455 | optional string text = 4; | |
456 | ||
457 | // New cursor position in preedit. Used with MOVE_CURSOR. | |
458 | optional uint32 cursor_position = 5; | |
459 | ||
460 | // Client side event for collecting usage statistics | |
461 | enum UsageStatsEvent { | |
462 | INFOLIST_WINDOW_SHOW = 1; | |
463 | INFOLIST_WINDOW_HIDE = 2; | |
464 | HANDWRITING_OPEN_EVENT = 3; | |
465 | HANDWRITING_COMMIT_EVENT = 4; | |
466 | CHARACTER_PALETTE_OPEN_EVENT = 5; | |
467 | CHARACTER_PALETTE_COMMIT_EVENT = 6; | |
468 | SOFTWARE_KEYBOARD_LAYOUT_LANDSCAPE = 7; | |
469 | SOFTWARE_KEYBOARD_LAYOUT_PORTRAIT = 8; | |
470 | SUBMITTED_CANDIDATE_ROW_0 = 9; | |
471 | SUBMITTED_CANDIDATE_ROW_1 = 10; | |
472 | SUBMITTED_CANDIDATE_ROW_2 = 11; | |
473 | SUBMITTED_CANDIDATE_ROW_3 = 12; | |
474 | SUBMITTED_CANDIDATE_ROW_4 = 13; | |
475 | SUBMITTED_CANDIDATE_ROW_5 = 14; | |
476 | SUBMITTED_CANDIDATE_ROW_6 = 15; | |
477 | SUBMITTED_CANDIDATE_ROW_7 = 16; | |
478 | SUBMITTED_CANDIDATE_ROW_8 = 17; | |
479 | SUBMITTED_CANDIDATE_ROW_9 = 18; | |
480 | SUBMITTED_CANDIDATE_ROW_GE10 = 19; | |
481 | KEYBOARD_FOLD_EVENT = 20; | |
482 | KEYBOARD_EXPAND_EVENT = 21; | |
483 | MUSHROOM_SELECTION_DIALOG_OPEN_EVENT = 22; | |
484 | } | |
485 | optional UsageStatsEvent usage_stats_event = 7; | |
486 | optional int32 usage_stats_event_int_value = 9; | |
487 | ||
488 | // Specify the current caret location, this is used for suggest window | |
489 | // position calculation. Used with SEND_CARET_LOCATION. | |
490 | optional Rectangle caret_rectangle = 8; | |
491 | ||
492 | // Unique number specifying an asynchronous request. | |
493 | optional int32 asynchronous_request_id = 10; | |
494 | }; | |
495 | ||
496 | message Context { | |
497 | // Former part of surrounding text. | |
498 | optional string preceding_text = 1; | |
499 | ||
500 | // Latter part of surrounding text. | |
501 | optional string following_text = 2; | |
502 | ||
503 | // If this is true, suggestion feature is disabled regardless the | |
504 | // congiguration. If this is false, suggestion feature is followed | |
505 | // by the user's configuration. If you want to omit interim | |
506 | // suggestions during the key typing, you might want to use | |
507 | // request_suggestion. | |
508 | // TODO(komatsu): Delete this field and use experimental_features. | |
509 | optional bool suppress_suggestion = 3 [default = false]; | |
510 | ||
511 | // Input field type. | |
512 | // The types are based on the input types defined in HTML5. | |
513 | // http://dev.w3.org/html5/spec/Overview.html#attr-input-type | |
514 | // Other types are to be added later. | |
515 | enum InputFieldType { | |
516 | // No restrictions nor special functions. The IME operates as usual. | |
517 | NORMAL = 1; | |
518 | ||
519 | // Password field. Text is hidden after input. | |
520 | // For Android, | |
521 | // In order to make the last character visible to the user, | |
522 | // the IME must not hold more than 2 characters in preedit. | |
523 | PASSWORD = 2; | |
524 | ||
525 | // Telephone number | |
526 | TEL = 3; | |
527 | ||
528 | // Number | |
529 | NUMBER = 4; | |
530 | }; | |
531 | // Type of the input field being focused. | |
532 | optional InputFieldType input_field_type = 4; | |
533 | ||
534 | // An unique revision ID to specify one specific typing session. A client can | |
535 | // use arbitrary value for this field. The converter is expected to clear its | |
536 | // internal history segments whenever this value is changed. A client should | |
537 | // use the same revision ID whenever the converter should keep it internal | |
538 | // history segments. In order to avoid unexpected history learnings, a client | |
539 | // should update the revision whenever the input focus is changed. | |
540 | optional int32 revision = 5 [default = 0]; | |
541 | ||
542 | // Repeated fields to be used for experimental features. | |
543 | repeated string experimental_features = 100; | |
544 | }; | |
545 | ||
546 | // Clients' capability. | |
547 | // Users cannot modify this. | |
548 | // The server has to obey this capability. | |
549 | message Capability { | |
550 | // Bit fields to notify what the client can do. | |
551 | enum TextDeletionCapabilityType { | |
552 | NO_TEXT_DELETION_CAPABILITY = 0; | |
553 | ||
554 | // Can delete preceding text which is adjacent to preedit. | |
555 | DELETE_PRECEDING_TEXT = 1; | |
556 | }; | |
557 | optional TextDeletionCapabilityType text_deletion = 1 | |
558 | [default = NO_TEXT_DELETION_CAPABILITY]; | |
559 | }; | |
560 | ||
561 | // Clients' request to the server. | |
562 | // Users cannot modify this. | |
563 | // In the future each request may be able to be overwirtten by Config. | |
564 | // The server does not have to obey this request. | |
565 | message Request { | |
566 | // Enable zero query suggestion. | |
567 | optional bool zero_query_suggestion = 1 | |
568 | [default = false] ; // true for android | |
569 | ||
570 | // Conversion's candidate includes suggestion, prediction and conversion. | |
571 | optional bool mixed_conversion = 2 | |
572 | [default = false] ; // true for android | |
573 | ||
574 | // Combine all segments like mobile IME. | |
575 | optional bool combine_all_segments = 3 | |
576 | [default = false] ; // true for android | |
577 | ||
578 | enum SpecialRomanjiTable { | |
579 | // Do not use special table. | |
580 | // Romanji table is selected based on Config. | |
581 | DEFAULT_TABLE = 0; | |
582 | ||
583 | // Use special table for 12keys (to hiragana). | |
584 | TWELVE_KEYS_TO_HIRAGANA = 10; | |
585 | ||
586 | // Use special table for 12keys (to half-width ascii). | |
587 | TWELVE_KEYS_TO_HALFWIDTHASCII = 11; | |
588 | ||
589 | // Use special table for flick (to hiragana). | |
590 | FLICK_TO_HIRAGANA = 13; | |
591 | ||
592 | // Use special table for flick (to half-width ascii). | |
593 | FLICK_TO_HALFWIDTHASCII = 14; | |
594 | ||
595 | // Use special table for both toggle and flick (to hiragana). | |
596 | TOGGLE_FLICK_TO_HIRAGANA = 16; | |
597 | ||
598 | // Use special table for both toggle and flick (to half-width ascii). | |
599 | TOGGLE_FLICK_TO_HALFWIDTHASCII = 17; | |
600 | ||
601 | // Use special table for Qwerty (for Mobile) (to hiragana). | |
602 | QWERTY_MOBILE_TO_HIRAGANA = 20; | |
603 | ||
604 | // Use special table for Qwerty (for Mobile) (to half-width ascii). | |
605 | QWERTY_MOBILE_TO_HALFWIDTHASCII = 22; | |
606 | ||
607 | // Use special table for Godan (to hiragana). | |
608 | GODAN_TO_HIRAGANA = 30; | |
609 | ||
610 | // Use special table for Godan (to half-width ascii). | |
611 | GODAN_TO_HALFWIDTHASCII = 31; | |
612 | ||
613 | // Use special table for Notouch (to hiragana). | |
614 | NOTOUCH_TO_HIRAGANA = 40; | |
615 | ||
616 | // Use special table for Notouch (to half-width ascii). | |
617 | NOTOUCH_TO_HALFWIDTHASCII = 41; | |
618 | ||
619 | // Obsolete items. | |
620 | OBSOLETE_TWELVE_KEYS_TO_NUMBER = 12; | |
621 | OBSOLETE_FLICK_TO_NUMBER = 15; | |
622 | OBSOLETE_GODAN_TO_NUMBER = 32; | |
623 | OBSOLETE_QWERTY_MOBILE_TO_HIRAGANA_NUMBER = 21; | |
624 | OBSOLETE_TOGGLE_FLICK_TO_NUMBER = 18; | |
625 | }; | |
626 | ||
627 | // Use special Romanji table. | |
628 | optional SpecialRomanjiTable special_romanji_table = 4 | |
629 | [default = DEFAULT_TABLE] ; // TWELVE_KEYS_TO_HIRAGANA for android. | |
630 | ||
631 | ||
632 | enum SpaceOnAlphanumeric { | |
633 | // The first input is treated as a space, double input is treated | |
634 | // as a conversion. If a character is input after the first | |
635 | // input, the composition will remain. For example, "ab<space>dc" | |
636 | // becomes "ab dc" as a single composition. | |
637 | SPACE_OR_CONVERT_KEEPING_COMPOSITION = 0; | |
638 | ||
639 | // The first input is treated as a space, double input is treated | |
640 | // as a conversion. If a character is input after the first | |
641 | // input, the previous composition will be committed. For | |
642 | // example, "ab<space>dc" results "ab " as a committed string and | |
643 | // "dc" as a composition. | |
644 | SPACE_OR_CONVERT_COMMITING_COMPOSITION = 1; | |
645 | ||
646 | // Commit the composition and a space. | |
647 | COMMIT = 2; | |
648 | }; | |
649 | ||
650 | optional SpaceOnAlphanumeric space_on_alphanumeric = 6 | |
651 | [default = SPACE_OR_CONVERT_KEEPING_COMPOSITION]; | |
652 | ||
653 | // Keyboard name for touch devices. | |
654 | // For example, "TWELVE_KEY_TOGGLE_KANA", "QWERTY_KANA_NUMBER". | |
655 | // It is used to analyze touch event usage stats. | |
656 | optional string keyboard_name = 7; | |
657 | ||
658 | // Enables Composer's input mode auto updating by using surrounding text. | |
659 | // For example, when a composition string is "ad", a carret is at the end, | |
660 | // and a user selects HIRAGANA mode, if the user moves the carret to between | |
661 | // "a" and "d" the mode will be automatically switch to ASCII (temporarily). | |
662 | // See details in the Composer::UpdateInputMode. | |
663 | optional bool update_input_mode_from_surrounding_text = 8 | |
664 | [default = true]; | |
665 | ||
666 | // Enables Kana-modifier-insensitive conversion as follows: | |
667 | // 1) Voiced/Semi-voiced kana will be hit by non-modified kana. | |
668 | // e.g.) "ば" and "ぱ" will be hit by key "は". | |
669 | // 2) Geminate consonant "っ" will be hit by non-modified kana "つ". | |
670 | // 3) Palatalized kana will be hit by non-modified kana. | |
671 | // e.g.) "ゃ" will be hit by key "や". | |
672 | // Here is an example of the search: "学校" ("がっこう") will be hit | |
673 | // by "かつこう". | |
674 | optional bool kana_modifier_insensitive_conversion = 9 [default = false]; | |
675 | ||
676 | // Enables Auto partial suggestion. | |
677 | // For Auto partial suggestion, we can see first segment only candidates | |
678 | // adding to normal realtime conversion suggestion results. | |
679 | // If we commit that candidate, we will show suggestions for remaining part | |
680 | // of key. | |
681 | // | |
682 | // Note: This feature can be enabled only for mobile due to UX design. | |
683 | optional bool auto_partial_suggestion = 10 [default = false]; | |
684 | ||
685 | // Nowadays, four kinds of emoji characters are used in Japan. | |
686 | // - Unicode: Unicode based emoji (since Unicode 6.0). | |
687 | // - Docomo: Docomo's carrier emoji. | |
688 | // - Softbank: Softbank's carrier emoji. | |
689 | // - Kddi: Kddi's carrier emoji. | |
690 | // Note that especially latter three kinds are used on Mobile phones. | |
691 | // So, it is necessary to control what kinds of emoji can be used or not | |
692 | // based on client's (or connected application's) information. | |
693 | // For example, on Android; | |
694 | // - Unicode emoji characters are available only on Android 4.1 or later | |
695 | // only. | |
696 | // - JP mobile carriers' emoji characters depend on the devices. Also, | |
697 | // we need to check the text field's attribute for them. | |
698 | // The following bit set tells the emoji availability to EmojiRewriter. | |
699 | enum EmojiCarrierType { | |
700 | UNICODE_EMOJI = 1; | |
701 | DOCOMO_EMOJI = 2; | |
702 | SOFTBANK_EMOJI = 4; | |
703 | KDDI_EMOJI = 8; | |
704 | } | |
705 | ||
706 | // By default, UNICODE emoji is available. | |
707 | optional int32 available_emoji_carrier = 11 [default = 1]; | |
708 | ||
709 | // For emoji rewriter, it is necessary to control when the rewriter runs | |
710 | // based on the clients. The following bit set is sync'ed to | |
711 | // RewriterInterface::CapabilityType (see rewriter_interface.h, too), | |
712 | // so that clients can fill the value. | |
713 | enum RewriterCapability { | |
714 | NOT_AVAILABLE = 0; | |
715 | CONVERSION = 1; | |
716 | PREDICTION = 2; | |
717 | SUGGESTION = 4; | |
718 | ALL = 7; // CONVERSION | PREDICTION | SUGGESTION. | |
719 | } | |
720 | ||
721 | // By default, Emoji rewriter works on conversion mode only. | |
722 | optional int32 emoji_rewriter_capability = 12 [default = 1]; | |
723 | ||
724 | // Controls the behavior when a user types the left/right key at the edge | |
725 | // of the preedit string (in more precise, the left key at the beginning | |
726 | // of the preedit string, or the right key at the end). | |
727 | enum CrossingEdgeBehavior { | |
728 | // This is the default behavior. The cursor movement at the edge | |
729 | // will make nothing, i.e., keeping the current cursor position (at the | |
730 | // edge), consume the key event. | |
731 | DO_NOTHING = 0; | |
732 | ||
733 | // This is the behavior, especially designed for alphabet keyboards on | |
734 | // mobile devices. Assuming the following text: | |
735 | // XXXXabcde|YYYYY | |
736 | // where XXXX is preceding text, abcde is composing text, YYYYY is | |
737 | // following text and '|' is the caret, when a user sends "RIGHT" | |
738 | // cursor key, we'd like to commit the abcde and move the caret to right. | |
739 | // So the user will get: | |
740 | // XXXXabcdeY|YYYY | |
741 | // Here, what we need is commiting the "abcde" with the appropriate | |
742 | // caret position. (Note that we need to handle the left cursor key, too). | |
743 | // Also, we should *NOT* consume the key, so that the key event will be | |
744 | // handled appropriately by the target application. | |
745 | COMMIT_WITHOUT_CONSUMING = 1; | |
746 | } | |
747 | optional CrossingEdgeBehavior crossing_edge_behavior = 13 | |
748 | [default = DO_NOTHING]; | |
749 | ||
750 | // Controls the behavior of language aware input. Language aware input | |
751 | // guesses the actual language regardless the input mode. For example, | |
752 | // if user type "てst" it will be treated as "test". | |
753 | enum LanguageAwareInputBehavior { | |
754 | // Performs the default behavior considering the platform and channel. | |
755 | DEFAULT_LANGUAGE_AWARE_BEHAVIOR = 0; | |
756 | ||
757 | // Does not perform this functionarity. | |
758 | NO_LANGUAGE_AWARE_INPUT = 1; | |
759 | ||
760 | // Adds a language aware candidate to the suggestion. | |
761 | LANGUAGE_AWARE_SUGGESTION = 2; | |
762 | } | |
763 | optional LanguageAwareInputBehavior language_aware_input = 14 | |
764 | [default = DEFAULT_LANGUAGE_AWARE_BEHAVIOR]; | |
765 | ||
766 | // Page size of the candidate list. | |
767 | optional int32 candidate_page_size = 15 [default = 9]; | |
768 | } | |
769 | ||
770 | // Note there is another ApplicationInfo inside RendererCommand. | |
771 | // Since Input is not using nested message, define ApplicationInfo here. | |
772 | message ApplicationInfo { | |
773 | optional uint32 process_id = 1; | |
774 | optional uint32 thread_id = 2; | |
775 | // The time difference between local time and UTC time in seconds. | |
776 | // This field is not supported except for NaCl. | |
777 | // We use this field in NaCl Mozc because we can't know the local timezone in | |
778 | // NaCl environment. | |
779 | optional int32 timezone_offset = 3; | |
780 | }; | |
781 | ||
782 | message Input { | |
783 | enum CommandType { | |
784 | NONE = 0; | |
785 | CREATE_SESSION = 1; | |
786 | DELETE_SESSION = 2; | |
787 | SEND_KEY = 3; | |
788 | ||
789 | // Check only if the key event will be consumed. This command is | |
790 | // for TSF on Windows. You do not need to use this command, if it | |
791 | // is not necessary. | |
792 | TEST_SEND_KEY = 4; | |
793 | ||
794 | // Evaluate the command specified by SessionCommand. The output | |
795 | // format should be the same with an output of a SEND_KEY command. | |
796 | SEND_COMMAND = 5; | |
797 | ||
798 | // Config accessors. | |
799 | // There are three configurations. | |
800 | // Stored config, Imposed config, One-shot config. | |
801 | // Stored config : Set by SET_CONFIG command. | |
802 | // Its lifetime is permanent (stored into a storage). | |
803 | // GET_CONFIG returns stored config. | |
804 | // Imposed config : Set by SET_IMPOSED_CONFIG. Its lifetime is the | |
805 | // same as the process (*not* stored into a storage as opposed to Stored | |
806 | // config). | |
807 | // Imposed config is prioritized over Stored config. | |
808 | // Only the values explicitly set are effective and override ones in Stored | |
809 | // config. In typical usage, most fields are not set. | |
810 | // GET_CONFIG's result is *not* affected by imposed config | |
811 | // (stored config returns). | |
812 | // One-shot config : Set by each key events. | |
813 | // It is effective while the key event is processed. | |
814 | // This is prioritized over Imposed config. | |
815 | // Like as Imposed config, some fields can be omitted. | |
816 | // TODO(matsuzakit): Rename (GET|SET)_CONFIG to (GET|SET)_STORED_CONFIG | |
817 | GET_CONFIG = 6; | |
818 | SET_CONFIG = 7; | |
819 | SET_IMPOSED_CONFIG = 22; | |
820 | ||
821 | // Set client's request | |
822 | SET_REQUEST = 17; | |
823 | ||
824 | // sync dictionary/history data to local file | |
825 | SYNC_DATA = 8; | |
826 | ||
827 | // shutdowon server safely | |
828 | SHUTDOWN = 9; | |
829 | ||
830 | // reload mutable data (like config, user-dic, history) | |
831 | RELOAD = 10; | |
832 | ||
833 | // clear user history data | |
834 | CLEAR_USER_HISTORY = 11; | |
835 | ||
836 | // clear user prediction data | |
837 | CLEAR_USER_PREDICTION = 12; | |
838 | ||
839 | // clear unused prediction | |
840 | CLEAR_UNUSED_USER_PREDICTION = 16; | |
841 | ||
842 | // clean up sessions | |
843 | // shutdwon if session is empty and | |
844 | // mozc_server is launched with timeout mode | |
845 | CLEANUP = 13; | |
846 | ||
847 | // no operation | |
848 | // can be used for pinging the server | |
849 | NO_OPERATION = 14; | |
850 | ||
851 | // Sync feature is deprecated since 1.13 dev. | |
852 | // TODO(mozc-team): Remove following variables. | |
853 | OBSOLETE_START_CLOUD_SYNC = 18; | |
854 | OBSOLETE_GET_CLOUD_SYNC_STATUS = 23; | |
855 | OBSOLETE_ADD_AUTH_CODE = 24; | |
856 | ||
857 | INSERT_TO_STORAGE = 20; | |
858 | READ_ALL_FROM_STORAGE = 21; | |
859 | CLEAR_STORAGE = 25; | |
860 | ||
861 | // Send a command for user dictionary session. | |
862 | SEND_USER_DICTIONARY_COMMAND = 26; | |
863 | ||
864 | // Number of commands. | |
865 | // When new command is added, the command should use below number | |
866 | // and NUM_OF_COMMANDS should be incremented. | |
867 | // | |
868 | // Note: This enum lack the value for 15 and 19 and it may cause a crash. | |
869 | // Please reuse these value if you can. | |
870 | // 15 have never been used before, and 19 was used to clear synced | |
871 | // data on dev channel. | |
872 | NUM_OF_COMMANDS = 27; | |
873 | }; | |
874 | required CommandType type = 1; | |
875 | ||
876 | // Session ID created by CREATE_SESSION. | |
877 | optional uint64 id = 2; | |
878 | ||
879 | // Key combinations used for SEND_KEY or TEST_SEND_KEY. | |
880 | optional KeyEvent key = 3; | |
881 | ||
882 | // Command sent to the session layer used with SEND_COMMAND. | |
883 | optional SessionCommand command = 4; | |
884 | ||
885 | // Input config | |
886 | optional mozc.config.Config config = 5; | |
887 | ||
888 | // Context data | |
889 | optional Context context = 6; | |
890 | ||
891 | // Client capability | |
892 | optional Capability capability = 7; | |
893 | ||
894 | // Application information, like process id. | |
895 | // Server may be able to change the behavior by seeing the | |
896 | // the program name. | |
897 | optional ApplicationInfo application_info = 8; | |
898 | ||
899 | // Client request | |
900 | optional Request request = 9; | |
901 | ||
902 | // If the command is INSERT_TO_STORAGE, all the fields must be filled. | |
903 | // If READ_ALL_FROM_STORAGE, key and value fields are ignored. | |
904 | optional GenericStorageEntry storage_entry = 10; | |
905 | ||
906 | enum TouchAction { | |
907 | TOUCH_DOWN = 1; | |
908 | TOUCH_MOVE = 2; | |
909 | TOUCH_UP = 3; | |
910 | }; | |
911 | message TouchPosition { | |
912 | optional TouchAction action = 1; | |
913 | // x, y potision: keyboad left-top is (0, 0), right-bottom is (1, 1). | |
914 | optional float x = 2; | |
915 | optional float y = 3; | |
916 | // timestamp (in ms) is set to zero when the touch event starts. | |
917 | optional int64 timestamp = 4; | |
918 | } | |
919 | // TouchEvent contains source_id and stroke. | |
920 | // Touch_events contain all key touch event. | |
921 | // Statistical information are collected for each source_id | |
922 | // by SessionUsageObserver. | |
923 | message TouchEvent { | |
924 | // source_id specifies the user action such as "X button pressed". | |
925 | // It must be unique within the same keyboard_name, | |
926 | // which is set in Request message. | |
927 | optional uint32 source_id = 1; | |
928 | repeated TouchPosition stroke = 2; | |
929 | } | |
930 | repeated TouchEvent touch_events = 12; | |
931 | ||
932 | optional mozc.user_dictionary.UserDictionaryCommand user_dictionary_command | |
933 | = 13; | |
934 | ||
935 | // A flag to control if the server should return suggest-results or not. | |
936 | // If this is set to false, regardless of other configurations, | |
937 | // the server won't return suggestion results. | |
938 | // This is set to true by default. | |
939 | // Note that even if this flag is set to false, when a suggestion is shown | |
940 | // in the previous phase, it is possible from the client to submit it. | |
941 | // This works only for suggestions for the key insersion, but not for | |
942 | // others commands, such as predictions or conversions. | |
943 | // This flag is used for the performance improvement in terms of the | |
944 | // latency. If you want to suppress the suggestions for the UX improment, | |
945 | // you may want to use suppress_suggestion in the Context message. | |
946 | optional bool request_suggestion = 14 [default = true]; | |
947 | }; | |
948 | ||
949 | ||
950 | // Result contains data to be submitted to the host application by the | |
951 | // ime client. | |
952 | message Result { | |
953 | enum ResultType { | |
954 | NONE = 0; | |
955 | STRING = 1; | |
956 | }; | |
957 | required ResultType type = 1; | |
958 | // The result of conversion. | |
959 | required string value = 2; | |
960 | ||
961 | // Source of the value. It is almost always the reading of the value. | |
962 | optional string key = 3; | |
963 | ||
964 | // The caret position after the result submission. | |
965 | // "0" means the end of the result, and a positive value means moving forward | |
966 | // and a negative value backward. | |
967 | // e.g.) "-s", where s is the length of value, means the caret position | |
968 | // after the committing should be the beginning of the committed value. | |
969 | optional int32 cursor_offset = 4 [default = 0]; | |
970 | }; | |
971 | ||
972 | ||
973 | // Preedit represents a composition data, which is rendered on the | |
974 | // host application by the ime client. On Japanese IME, the both | |
975 | // Preedit and Conversion statuses are represented by this message. | |
976 | message Preedit { | |
977 | required uint32 cursor = 1; | |
978 | // The string data of Preedit is separated into Segment messages | |
979 | // presenting the ime server's status. On Preedit status of | |
980 | // Japanese IME, there are up to three segments; left side chars of | |
981 | // cursor, forcused char, right side chars of cursor. On Conversion | |
982 | // status of Japanese IME, the messages literally represent the | |
983 | // segments of the conversion. | |
984 | repeated group Segment = 2 { | |
985 | enum Annotation { | |
986 | NONE = 0; | |
987 | UNDERLINE = 1; | |
988 | HIGHLIGHT = 2; | |
989 | }; | |
990 | required Annotation annotation = 3; | |
991 | required string value = 4; | |
992 | ||
993 | // The length of value in characters. This is NOT a number in | |
994 | // bytes or logical character units. So, the length of "abc" and | |
995 | // "あいう" should be 3, "ヴ" should be 1 and "ヴ" and "う゛" | |
996 | // should be 2. | |
997 | required uint32 value_length = 5; | |
998 | ||
999 | // Source of the value. It is almost always the reading of the value. | |
1000 | optional string key = 6; | |
1001 | }; | |
1002 | ||
1003 | // The position of the first segment whose annotation is 'HIGHLIGHT'. Not set | |
1004 | // if there are no such segments. | |
1005 | optional uint32 highlighted_position = 3; | |
1006 | }; | |
1007 | ||
1008 | ||
1009 | message Status { | |
1010 | // Whether IME is ON or OFF | |
1011 | optional bool activated = 1; | |
1012 | ||
1013 | // Visible composition mode when IME is activated. This mode may come from a | |
1014 | // temporary composition mode. See |comeback_mode|. | |
1015 | // TODO(yukawa): Rename this field to "visible_mode". | |
1016 | optional CompositionMode mode = 2; | |
1017 | ||
1018 | // True composition mode that is suitable for system global and permanent | |
1019 | // composition mode. When a temporary composition mode exists, | |
1020 | // |comeback_mode| can be different from |mode|. | |
1021 | // TODO(yukawa): Use more appropriate name. | |
1022 | optional CompositionMode comeback_mode = 3; | |
1023 | }; | |
1024 | ||
1025 | // This messsage contains which characters are to be deleted by client. | |
1026 | // E.g. if current composition and surrounding text are | |
1027 | // "この感じは漢字は" | |
1028 | // ^^^^^^ | |
1029 | // and we send DeletionRange with offset == -3 and length == 3, then they will | |
1030 | // be rendered like: | |
1031 | // "この漢字は" | |
1032 | // ^^^^^^ | |
1033 | message DeletionRange { | |
1034 | // Offset of start of range. | |
1035 | optional int32 offset = 1; | |
1036 | ||
1037 | // Length of the range. | |
1038 | optional int32 length = 2; | |
1039 | }; | |
1040 | ||
1041 | message Output { | |
1042 | optional uint64 id = 1; | |
1043 | ||
1044 | // This variable is going to be obsolete. | |
1045 | optional CompositionMode mode = 2; | |
1046 | ||
1047 | optional bool consumed = 3; | |
1048 | optional Result result = 4; | |
1049 | optional Preedit preedit = 5; | |
1050 | optional Candidates candidates = 6; | |
1051 | optional KeyEvent key = 7; | |
1052 | ||
1053 | // when URL is non empty, UI can open the page with a browser, | |
1054 | // after finishing the all rendering part. | |
1055 | // We are using this feature for bug-report system. | |
1056 | optional string url = 8; | |
1057 | ||
1058 | // Output config | |
1059 | optional mozc.config.Config config = 9; | |
1060 | ||
1061 | // PreeditMethod: this is the default input mode of the session. | |
1062 | // If the user's config is "kana-input", it returns KANA. Only | |
1063 | // CreateSession response will have this field. | |
1064 | enum PreeditMethod { | |
1065 | ASCII = 0; | |
1066 | KANA = 1; | |
1067 | }; | |
1068 | optional PreeditMethod preedit_method = 10 [default = ASCII]; | |
1069 | ||
1070 | // ErrorCode: | |
1071 | // if SessionHandler::EvalCommand() returns false, | |
1072 | // return output with error_code = SESSION_FAILURE; | |
1073 | enum ErrorCode { | |
1074 | SESSION_SUCCESS = 0; | |
1075 | SESSION_FAILURE = 1; | |
1076 | }; | |
1077 | optional ErrorCode error_code = 11 [ default = SESSION_SUCCESS ]; | |
1078 | ||
1079 | // The current IME status. | |
1080 | optional Status status = 13; | |
1081 | ||
1082 | // All flatten candidate words stored in 1D array. This value is | |
1083 | // filled only when the content is changed. | |
1084 | optional CandidateList all_candidate_words = 14; | |
1085 | ||
1086 | // Range of characters to be deleted by client. | |
1087 | optional DeletionRange deletion_range = 16; | |
1088 | ||
1089 | // if launch_tool_mode is set, MozcTool is supposed to be launched | |
1090 | // by client. | |
1091 | enum ToolMode { | |
1092 | NO_TOOL = 0; // no need to launch tool | |
1093 | CONFIG_DIALOG = 1; | |
1094 | DICTIONARY_TOOL = 2; | |
1095 | WORD_REGISTER_DIALOG = 3; | |
1096 | }; | |
1097 | optional ToolMode launch_tool_mode = 17 [ default = NO_TOOL ]; | |
1098 | ||
1099 | // Callback request to the client. | |
1100 | message Callback { | |
1101 | // Callback command to be sent from the client to the server. The | |
1102 | // optional values such as id and composition_mode can be modified | |
1103 | // or added by the client. | |
1104 | optional SessionCommand session_command = 1; | |
1105 | ||
1106 | // Callback command should be sent after this delay. | |
1107 | optional uint32 delay_millisec = 2; | |
1108 | }; | |
1109 | optional Callback callback = 18; | |
1110 | ||
1111 | // Used when the command is READ_ALL_FROM_STORAGE. | |
1112 | optional GenericStorageEntry storage_entry = 19; | |
1113 | ||
1114 | optional mozc.user_dictionary.UserDictionaryCommandStatus | |
1115 | user_dictionary_command_status = 21; | |
1116 | }; | |
1117 | ||
1118 | message Command { | |
1119 | required Input input = 1; | |
1120 | required Output output = 2; | |
1121 | }; | |
1122 | ||
1123 | message CommandList { | |
1124 | // This message is used for unittest. | |
1125 | repeated Command commands = 1; | |
1126 | }; |
0 | # Copyright 2010-2015, Google Inc. | |
1 | # All rights reserved. | |
2 | # | |
3 | # Redistribution and use in source and binary forms, with or without | |
4 | # modification, are permitted provided that the following conditions are | |
5 | # met: | |
6 | # | |
7 | # * Redistributions of source code must retain the above copyright | |
8 | # notice, this list of conditions and the following disclaimer. | |
9 | # * Redistributions in binary form must reproduce the above | |
10 | # copyright notice, this list of conditions and the following disclaimer | |
11 | # in the documentation and/or other materials provided with the | |
12 | # distribution. | |
13 | # * Neither the name of Google Inc. nor the names of its | |
14 | # contributors may be used to endorse or promote products derived from | |
15 | # this software without specific prior written permission. | |
16 | # | |
17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | # session_base.gyp defines targets for lower layers to link to the session | |
30 | # modules, so modules in lower layers do not depend on ones in higher layers, | |
31 | # avoiding circular dependencies. | |
32 | { | |
33 | 'variables': { | |
34 | 'relative_dir': 'protocol', | |
35 | 'gen_out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(relative_dir)', | |
36 | }, | |
37 | 'targets': [ | |
38 | { | |
39 | 'target_name': 'genproto_candidates_proto', | |
40 | 'type': 'none', | |
41 | 'toolsets': ['host'], | |
42 | 'sources': [ | |
43 | 'candidates.proto', | |
44 | ], | |
45 | 'includes': [ | |
46 | '../protobuf/genproto.gypi', | |
47 | ], | |
48 | 'dependencies': [ | |
49 | '../config/config.gyp:genproto_config', | |
50 | ], | |
51 | }, | |
52 | { | |
53 | 'target_name': 'candidates_proto', | |
54 | 'type': 'static_library', | |
55 | 'hard_dependency': 1, | |
56 | 'sources': [ | |
57 | '<(proto_out_dir)/<(relative_dir)/candidates.pb.cc', | |
58 | ], | |
59 | 'dependencies': [ | |
60 | '../protobuf/protobuf.gyp:protobuf', | |
61 | 'genproto_candidates_proto#host', | |
62 | ], | |
63 | 'export_dependent_settings': [ | |
64 | 'genproto_candidates_proto#host', | |
65 | ], | |
66 | }, | |
67 | { | |
68 | 'target_name': 'genproto_commands_proto', | |
69 | 'type': 'none', | |
70 | 'toolsets': ['host'], | |
71 | 'sources': [ | |
72 | 'commands.proto', | |
73 | ], | |
74 | 'includes': [ | |
75 | '../protobuf/genproto.gypi', | |
76 | ], | |
77 | 'dependencies': [ | |
78 | '../config/config.gyp:genproto_config', | |
79 | '../dictionary/dictionary_base.gyp:genproto_dictionary', | |
80 | ], | |
81 | }, | |
82 | { | |
83 | 'target_name': 'commands_proto', | |
84 | 'type': 'static_library', | |
85 | 'hard_dependency': 1, | |
86 | 'sources': [ | |
87 | '<(proto_out_dir)/<(relative_dir)/commands.pb.cc', | |
88 | ], | |
89 | 'dependencies': [ | |
90 | '../config/config.gyp:config_protocol', | |
91 | '../protobuf/protobuf.gyp:protobuf', | |
92 | '../dictionary/dictionary_base.gyp:dictionary_protocol', | |
93 | 'candidates_proto', | |
94 | 'genproto_commands_proto#host', | |
95 | ], | |
96 | 'export_dependent_settings': [ | |
97 | 'genproto_commands_proto#host', | |
98 | ], | |
99 | }, | |
100 | ], | |
101 | } |
29 | 29 | #import "renderer/mac/CandidateView.h" |
30 | 30 | |
31 | 31 | #include "base/coordinates.h" |
32 | #include "protocol/commands.pb.h" | |
32 | 33 | #include "renderer/table_layout.h" |
33 | 34 | #include "renderer/window_util.h" |
34 | #include "session/commands.pb.h" | |
35 | 35 | #include "renderer/mac/CandidateController.h" |
36 | 36 | #include "renderer/mac/CandidateWindow.h" |
37 | 37 | #include "renderer/mac/InfolistWindow.h" |
33 | 33 | #include "base/logging.h" |
34 | 34 | #include "base/mutex.h" |
35 | 35 | #include "client/client_interface.h" |
36 | #include "protocol/commands.pb.h" | |
36 | 37 | #include "renderer/mac/mac_view_util.h" |
37 | 38 | #include "renderer/table_layout.h" |
38 | #include "session/commands.pb.h" | |
39 | 39 | #include "renderer/renderer_style.pb.h" |
40 | 40 | #include "renderer/renderer_style_handler.h" |
41 | 41 |
33 | 33 | |
34 | 34 | #include "base/logging.h" |
35 | 35 | #include "base/coordinates.h" |
36 | #include "protocol/commands.pb.h" | |
36 | 37 | #include "renderer/mac/CandidateWindow.h" |
37 | #include "session/commands.pb.h" | |
38 | 38 | |
39 | 39 | using mozc::commands::Candidates; |
40 | 40 |
33 | 33 | #include "base/logging.h" |
34 | 34 | #include "base/mutex.h" |
35 | 35 | #include "client/client_interface.h" |
36 | #include "protocol/commands.pb.h" | |
36 | 37 | #include "renderer/mac/mac_view_util.h" |
37 | 38 | #include "renderer/table_layout.h" |
38 | #include "session/commands.pb.h" | |
39 | 39 | #include "renderer/renderer_style.pb.h" |
40 | 40 | #include "renderer/renderer_style_handler.h" |
41 | 41 | |
137 | 137 | title_rect.size.height; |
138 | 138 | |
139 | 139 | if (usages.has_focused_index() && (row == usages.focused_index())) { |
140 | NSRect focused_rect = NSMakeRect(infostyle.window_border(), ypos, | |
140 | NSRect focused_rect = NSMakeRect(infostyle.window_border(), ypos, | |
141 | 141 | infostyle.window_width() - infostyle.window_border() * 2, |
142 | 142 | title_rect.size.height + desc_rect.size.height |
143 | 143 | + infostyle.row_rect_padding() * 2); |
154 | 154 | [NSBezierPath strokeRect:focused_rect]; |
155 | 155 | } else { |
156 | 156 | if (title_style.has_background_color()) { |
157 | NSRect rect = NSMakeRect(infostyle.window_border(), ypos, | |
157 | NSRect rect = NSMakeRect(infostyle.window_border(), ypos, | |
158 | 158 | infostyle.window_width() - infostyle.window_border() * 2, |
159 | 159 | title_rect.size.height + infostyle.row_rect_padding()); |
160 | 160 | [MacViewUtil::ToNSColor(title_style.background_color()) set]; |
161 | 161 | [NSBezierPath fillRect:rect]; |
162 | 162 | } |
163 | 163 | if (desc_style.has_background_color()) { |
164 | NSRect rect = NSMakeRect(infostyle.window_border(), | |
164 | NSRect rect = NSMakeRect(infostyle.window_border(), | |
165 | 165 | ypos + title_rect.size.height + infostyle.row_rect_padding(), |
166 | 166 | infostyle.window_width() - infostyle.window_border() * 2, |
167 | 167 | desc_rect.size.height + infostyle.row_rect_padding()); |
187 | 187 | const InformationList &usages = candidates_.usages(); |
188 | 188 | |
189 | 189 | int ypos = infostyle.window_border(); |
190 | ||
190 | ||
191 | 191 | if (draw_flag && infostyle.has_caption_string()) { |
192 | 192 | const RendererStyle::TextStyle &caption_style = |
193 | 193 | infostyle.caption_style(); |
34 | 34 | #include "base/coordinates.h" |
35 | 35 | #include "base/logging.h" |
36 | 36 | #include "client/client_interface.h" |
37 | #include "protocol/commands.pb.h" | |
37 | 38 | #include "renderer/mac/InfolistWindow.h" |
38 | #include "session/commands.pb.h" | |
39 | 39 | |
40 | 40 | using mozc::commands::Candidates; |
41 | 41 | using mozc::commands::Output; |
34 | 34 | #include "base/logging.h" |
35 | 35 | #include "base/mac_util.h" |
36 | 36 | #include "base/port.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "renderer/mac/RendererBaseWindow.h" |
39 | 39 | |
40 | 40 |
36 | 36 | #include "base/logging.h" |
37 | 37 | #include "base/mutex.h" |
38 | 38 | #include "base/util.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "renderer/mac/mac_server_send_command.h" |
41 | 41 | #include "renderer/mac/CandidateController.h" |
42 | 42 |
33 | 33 | #import "mac/common.h" |
34 | 34 | |
35 | 35 | #include "base/const.h" |
36 | #include "session/commands.pb.h" | |
36 | #include "protocol/commands.pb.h" | |
37 | 37 | |
38 | 38 | namespace mozc { |
39 | 39 | namespace renderer { |
69 | 69 | '../base/base.gyp:base', |
70 | 70 | '../config/config.gyp:config_protocol', |
71 | 71 | '../ipc/ipc.gyp:ipc', |
72 | '../session/session_base.gyp:session_protocol', | |
72 | '../protocol/protocol.gyp:commands_proto', | |
73 | 73 | 'renderer_protocol', |
74 | 74 | ], |
75 | 75 | }, |
84 | 84 | '../client/client.gyp:client', |
85 | 85 | '../config/config.gyp:config_handler', |
86 | 86 | '../ipc/ipc.gyp:ipc', |
87 | '../session/session_base.gyp:session_protocol', | |
87 | '../protocol/protocol.gyp:commands_proto', | |
88 | 88 | 'renderer_protocol', |
89 | 89 | ], |
90 | 90 | }, |
197 | 197 | 'dependencies': [ |
198 | 198 | '../config/config.gyp:config_protocol', |
199 | 199 | '../protobuf/protobuf.gyp:protobuf', |
200 | '../session/session_base.gyp:session_protocol', | |
200 | '../protocol/protocol.gyp:commands_proto', | |
201 | 201 | 'genproto_renderer#host' |
202 | 202 | ], |
203 | 203 | 'export_dependent_settings': [ |
260 | 260 | 'dependencies': [ |
261 | 261 | '../base/base.gyp:base', |
262 | 262 | '../config/config.gyp:config_protocol', |
263 | '../session/session_base.gyp:session_protocol', | |
263 | '../protocol/protocol.gyp:commands_proto', | |
264 | 264 | 'renderer_protocol', |
265 | 265 | ], |
266 | 266 | }, |
288 | 288 | 'dependencies': [ |
289 | 289 | '../base/base.gyp:base', |
290 | 290 | '../config/config.gyp:config_protocol', |
291 | '../session/session_base.gyp:session_protocol', | |
291 | '../protocol/protocol.gyp:commands_proto', | |
292 | 292 | 'renderer_protocol', |
293 | 293 | 'win32_font_util', |
294 | 294 | ], |
411 | 411 | '../config/config.gyp:config_protocol', |
412 | 412 | '../config/config.gyp:stats_config_util', |
413 | 413 | '../ipc/ipc.gyp:ipc', |
414 | '../session/session_base.gyp:session_protocol', | |
414 | '../protocol/protocol.gyp:commands_proto', | |
415 | 415 | 'gen_mozc_renderer_resource_header#host', |
416 | 416 | 'renderer_protocol', |
417 | 417 | 'renderer_server', |
472 | 472 | '../config/config.gyp:config_protocol', |
473 | 473 | '../config/config.gyp:stats_config_util', |
474 | 474 | '../ipc/ipc.gyp:ipc', |
475 | '../session/session_base.gyp:session_protocol', | |
475 | '../protocol/protocol.gyp:commands_proto', | |
476 | 476 | 'gen_renderer_files#host', |
477 | 477 | 'renderer_protocol', |
478 | 478 | 'renderer_server', |
578 | 578 | '../config/config.gyp:genproto_config#host', |
579 | 579 | '../config/config.gyp:stats_config_util', |
580 | 580 | '../ipc/ipc.gyp:ipc', |
581 | '../session/session_base.gyp:genproto_session#host', | |
582 | 581 | 'renderer_protocol', |
583 | 582 | 'gtk2_build_environment', |
584 | 583 | 'renderer_server', |
34 | 34 | |
35 | 35 | syntax = "proto2"; |
36 | 36 | |
37 | import "session/commands.proto"; | |
37 | import "protocol/commands.proto"; | |
38 | 38 | |
39 | 39 | package mozc.commands; |
40 | 40 |
39 | 39 | #include "converter/converter_interface.h" |
40 | 40 | #include "converter/segments.h" |
41 | 41 | #include "rewriter/calculator/calculator_interface.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | |
44 | 44 | namespace mozc { |
45 | 45 |
41 | 41 | #include "converter/segments.h" |
42 | 42 | #include "engine/engine_interface.h" |
43 | 43 | #include "engine/mock_data_engine_factory.h" |
44 | #include "protocol/commands.pb.h" | |
44 | 45 | #include "rewriter/calculator/calculator_interface.h" |
45 | 46 | #include "rewriter/calculator/calculator_mock.h" |
46 | #include "session/commands.pb.h" | |
47 | 47 | #include "testing/base/public/gunit.h" |
48 | 48 | |
49 | 49 | DECLARE_string(test_tmpdir); |
51 | 51 | #include "config/config_handler.h" |
52 | 52 | #include "converter/conversion_request.h" |
53 | 53 | #include "converter/segments.h" |
54 | #include "session/commands.pb.h" | |
54 | #include "protocol/commands.pb.h" | |
55 | 55 | |
56 | 56 | namespace mozc { |
57 | 57 |
41 | 41 | #include "config/config.pb.h" |
42 | 42 | #include "converter/conversion_request.h" |
43 | 43 | #include "converter/segments.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/commands.pb.h" | |
45 | 45 | #include "testing/base/public/gunit.h" |
46 | 46 | |
47 | 47 | DECLARE_string(test_tmpdir); |
41 | 41 | #include "config/config_handler.h" |
42 | 42 | #include "converter/conversion_request.h" |
43 | 43 | #include "converter/segments.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/commands.pb.h" | |
45 | 45 | #include "usage_stats/usage_stats.h" |
46 | 46 | |
47 | 47 | // EmojiRewriter: |
41 | 41 | #include "converter/segments.h" |
42 | 42 | #include "data_manager/user_pos_manager.h" |
43 | 43 | #include "dictionary/pos_matcher.h" |
44 | #include "protocol/commands.pb.h" | |
44 | 45 | #include "rewriter/variants_rewriter.h" |
45 | #include "session/commands.pb.h" | |
46 | 46 | #include "testing/base/public/gunit.h" |
47 | 47 | #include "usage_stats/usage_stats.h" |
48 | 48 | #include "usage_stats/usage_stats_testing_util.h" |
40 | 40 | #include "config/config_handler.h" |
41 | 41 | #include "converter/conversion_request.h" |
42 | 42 | #include "converter/segments.h" |
43 | #include "protocol/commands.pb.h" | |
43 | 44 | #include "rewriter/embedded_dictionary.h" |
44 | 45 | #include "rewriter/rewriter_interface.h" |
45 | #include "session/commands.pb.h" | |
46 | 46 | |
47 | 47 | namespace mozc { |
48 | 48 | namespace { |
38 | 38 | #include "config/config_handler.h" |
39 | 39 | #include "converter/conversion_request.h" |
40 | 40 | #include "converter/segments.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "testing/base/public/gunit.h" |
43 | 43 | |
44 | 44 | DECLARE_string(test_tmpdir); |
35 | 35 | #include "base/util.h" |
36 | 36 | #include "converter/conversion_request.h" |
37 | 37 | #include "converter/segments.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | |
40 | 40 | namespace mozc { |
41 | 41 |
35 | 35 | #include "base/system_util.h" |
36 | 36 | #include "converter/conversion_request.h" |
37 | 37 | #include "converter/segments.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | #include "testing/base/public/gunit.h" |
40 | 40 | |
41 | 41 | DECLARE_string(test_tmpdir); |
39 | 39 | #include "converter/segments.h" |
40 | 40 | #include "dictionary/dictionary_interface.h" |
41 | 41 | #include "dictionary/pos_matcher.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "usage_stats/usage_stats.h" |
44 | 44 | |
45 | 45 | using mozc::dictionary::DictionaryInterface; |
47 | 47 | #include "data_manager/user_pos_manager.h" |
48 | 48 | #include "dictionary/dictionary_mock.h" |
49 | 49 | #include "dictionary/pos_matcher.h" |
50 | #include "session/commands.pb.h" | |
50 | #include "protocol/commands.pb.h" | |
51 | 51 | #include "testing/base/public/gunit.h" |
52 | 52 | #include "usage_stats/usage_stats.h" |
53 | 53 | #include "usage_stats/usage_stats_testing_util.h" |
36 | 36 | #include "config/config_handler.h" |
37 | 37 | #include "converter/conversion_request.h" |
38 | 38 | #include "converter/segments.h" |
39 | #include "protocol/commands.pb.h" | |
39 | 40 | #include "rewriter/rewriter_interface.h" |
40 | #include "session/commands.pb.h" | |
41 | 41 | |
42 | 42 | namespace mozc { |
43 | 43 |
43 | 43 | #include "converter/segments.h" |
44 | 44 | #include "data_manager/data_manager_interface.h" |
45 | 45 | #include "dictionary/pos_matcher.h" |
46 | #include "protocol/commands.pb.h" | |
46 | 47 | #include "rewriter/number_compound_util.h" |
47 | #include "session/commands.pb.h" | |
48 | 48 | |
49 | 49 | using mozc::dictionary::POSMatcher; |
50 | 50 |
45 | 45 | #endif // MOZC_USE_PACKED_DICTIONARY |
46 | 46 | #include "data_manager/testing/mock_data_manager.h" |
47 | 47 | #include "dictionary/pos_matcher.h" |
48 | #include "session/commands.pb.h" | |
48 | #include "protocol/commands.pb.h" | |
49 | 49 | #include "testing/base/public/gunit.h" |
50 | 50 | |
51 | 51 | DECLARE_string(test_tmpdir); |
30 | 30 | |
31 | 31 | #include "converter/conversion_request.h" |
32 | 32 | #include "converter/segments.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | |
35 | 35 | namespace mozc { |
36 | 36 |
28 | 28 | |
29 | 29 | #include "converter/conversion_request.h" |
30 | 30 | #include "converter/segments.h" |
31 | #include "protocol/commands.pb.h" | |
31 | 32 | #include "rewriter/remove_redundant_candidate_rewriter.h" |
32 | 33 | #include "testing/base/public/gunit.h" |
33 | #include "session/commands.pb.h" | |
34 | 34 | |
35 | 35 | namespace mozc { |
36 | 36 | TEST(RemoveRedundantCandidateRewriterTest, RemoveTest) { |
88 | 88 | '../data_manager/data_manager.gyp:user_pos_manager', |
89 | 89 | '../dictionary/dictionary.gyp:dictionary', |
90 | 90 | '../dictionary/dictionary_base.gyp:pos_matcher', |
91 | '../session/session_base.gyp:session_protocol', | |
91 | '../protocol/protocol.gyp:commands_proto', | |
92 | 92 | '../storage/storage.gyp:storage', |
93 | 93 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
94 | 94 | 'calculator/calculator.gyp:calculator', |
71 | 71 | '../data_manager/data_manager.gyp:user_pos_manager', |
72 | 72 | '../data_manager/testing/mock_data_manager.gyp:mock_data_manager', |
73 | 73 | '../engine/engine.gyp:mock_data_engine_factory', |
74 | '../protocol/protocol.gyp:commands_proto', | |
74 | 75 | '../session/session_base.gyp:request_test_util', |
75 | '../session/session_base.gyp:session_protocol', | |
76 | 76 | '../testing/testing.gyp:gtest_main', |
77 | 77 | 'calculator/calculator.gyp:calculator_mock', |
78 | 78 | 'rewriter.gyp:rewriter', |
145 | 145 | '../data_manager/testing/mock_data_manager.gyp:mock_data_manager', |
146 | 146 | '../dictionary/dictionary.gyp:dictionary_mock', |
147 | 147 | '../dictionary/dictionary_base.gyp:pos_matcher', |
148 | '../session/session_base.gyp:session_protocol', | |
148 | '../protocol/protocol.gyp:commands_proto', | |
149 | 149 | '../testing/testing.gyp:gtest_main', |
150 | 150 | '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util', |
151 | 151 | 'rewriter.gyp:rewriter', |
175 | 175 | '../base/base.gyp:base', |
176 | 176 | '../composer/composer.gyp:composer', |
177 | 177 | '../data_manager/testing/mock_data_manager.gyp:mock_data_manager', |
178 | '../protocol/protocol.gyp:commands_proto', | |
178 | 179 | '../session/session_base.gyp:request_test_util', |
179 | '../session/session_base.gyp:session_protocol', | |
180 | 180 | '../testing/testing.gyp:gtest_main', |
181 | 181 | '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util', |
182 | 182 | 'rewriter.gyp:rewriter', |
41 | 41 | #include "converter/conversion_request.h" |
42 | 42 | #include "converter/segments.h" |
43 | 43 | #include "dictionary/pos_matcher.h" |
44 | #include "protocol/commands.pb.h" | |
44 | 45 | #include "rewriter/embedded_dictionary.h" |
45 | 46 | #include "rewriter/rewriter_interface.h" |
46 | #include "session/commands.pb.h" | |
47 | 47 | |
48 | 48 | using mozc::dictionary::POSMatcher; |
49 | 49 |
40 | 40 | #include "converter/segments.h" |
41 | 41 | #include "data_manager/testing/mock_data_manager.h" |
42 | 42 | #include "dictionary/pos_matcher.h" |
43 | #include "session/commands.pb.h" | |
43 | #include "protocol/commands.pb.h" | |
44 | 44 | #include "testing/base/public/gunit.h" |
45 | 45 | |
46 | 46 | DECLARE_string(test_tmpdir); |
42 | 42 | #include "converter/converter_interface.h" |
43 | 43 | #include "converter/segments.h" |
44 | 44 | #include "data_manager/data_manager_interface.h" |
45 | #include "protocol/commands.pb.h" | |
45 | 46 | #include "rewriter/embedded_dictionary.h" |
46 | 47 | #include "rewriter/rewriter_interface.h" |
47 | #include "session/commands.pb.h" | |
48 | 48 | |
49 | 49 | // SymbolRewriter: |
50 | 50 | // When updating the rule |
41 | 41 | #include "data_manager/testing/mock_data_manager.h" |
42 | 42 | #include "engine/engine_interface.h" |
43 | 43 | #include "engine/mock_data_engine_factory.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/commands.pb.h" | |
45 | 45 | #include "testing/base/public/gunit.h" |
46 | 46 | |
47 | 47 | DECLARE_string(test_tmpdir); |
39 | 39 | #include "converter/conversion_request.h" |
40 | 40 | #include "converter/segments.h" |
41 | 41 | #include "dictionary/pos_matcher.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | // For T13n normalize |
44 | 44 | #include "transliteration/transliteration.h" |
45 | 45 | #include "usage_stats/usage_stats.h" |
48 | 48 | #endif // MOZC_USE_PACKED_DICTIONARY |
49 | 49 | #include "data_manager/user_pos_manager.h" |
50 | 50 | #include "dictionary/pos_matcher.h" |
51 | #include "session/commands.pb.h" | |
51 | #include "protocol/commands.pb.h" | |
52 | 52 | #include "testing/base/public/gunit.h" |
53 | 53 | #include "transliteration/transliteration.h" |
54 | 54 | #include "usage_stats/usage_stats.h" |
42 | 42 | #include "converter/segments.h" |
43 | 43 | #include "engine/engine_interface.h" |
44 | 44 | #include "engine/mock_data_engine_factory.h" |
45 | #include "session/commands.pb.h" | |
45 | #include "protocol/commands.pb.h" | |
46 | 46 | #include "testing/base/public/gunit.h" |
47 | 47 | |
48 | 48 | DECLARE_string(test_tmpdir); |
38 | 38 | #include "converter/conversion_request.h" |
39 | 39 | #include "converter/segments.h" |
40 | 40 | #include "dictionary/pos_matcher.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | |
43 | 43 | using mozc::config::CharacterFormManager; |
44 | 44 | using mozc::dictionary::POSMatcher; |
39 | 39 | #include "base/version.h" |
40 | 40 | #include "converter/conversion_request.h" |
41 | 41 | #include "converter/segments.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | |
44 | 44 | namespace mozc { |
45 | 45 | namespace { |
37 | 37 | #include "config/config_handler.h" |
38 | 38 | #include "converter/conversion_request.h" |
39 | 39 | #include "converter/segments.h" |
40 | #include "session/commands.pb.h" | |
40 | #include "protocol/commands.pb.h" | |
41 | 41 | #include "testing/base/public/gunit.h" |
42 | 42 | |
43 | 43 | DECLARE_string(test_tmpdir); |
52 | 52 | #include "base/scoped_ptr.h" |
53 | 53 | #include "base/system_util.h" |
54 | 54 | #include "engine/engine_factory.h" |
55 | #include "session/commands.pb.h" | |
55 | #include "protocol/commands.pb.h" | |
56 | 56 | #include "session/random_keyevents_generator.h" |
57 | 57 | #include "session/session_handler.h" |
58 | 58 | #include "session/session_usage_observer.h" |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | // Protocol messages of candidates to be used for mozc client/server | |
30 | // communication and client/renderer communication. | |
31 | ||
32 | syntax = "proto2"; | |
33 | ||
34 | package mozc.commands; | |
35 | ||
36 | option java_outer_classname = "ProtoCandidates"; | |
37 | option java_package = "org.mozc.android.inputmethod.japanese.protobuf"; | |
38 | ||
39 | // Annotation against a candidate. | |
40 | message Annotation { | |
41 | // Annotation prepended to the value. | |
42 | optional string prefix = 1; | |
43 | // Annotation appended to the value. | |
44 | optional string suffix = 2; | |
45 | // Type of the candidate such as [HALF][KATAKANA], [GREEK], | |
46 | // [Black square], etc... | |
47 | optional string description = 3; | |
48 | // Shortcut key to select this candidate. | |
49 | optional string shortcut = 4; | |
50 | // Set to true if this candidate can be deleted from history. | |
51 | optional bool deletable = 5 [default = false]; | |
52 | }; | |
53 | ||
54 | // Additional information to a candidate word. This message is | |
55 | // used for describing a word usage for instance. | |
56 | message Information { | |
57 | // Unique number specifying the information. | |
58 | optional int32 id = 1; | |
59 | ||
60 | // Title string of the information. For usage, this value is | |
61 | // probably equal to Candidate::value or its canonicalized value. | |
62 | optional string title = 2; | |
63 | ||
64 | // The content of the information. For usage, this value actually | |
65 | // describes how to use the word. | |
66 | optional string description = 3; | |
67 | ||
68 | // The IDs of candidates which connect with the information. | |
69 | repeated int32 candidate_id = 4; | |
70 | }; | |
71 | ||
72 | // Category describes the attribute of the words. | |
73 | enum Category { | |
74 | CONVERSION = 0; | |
75 | PREDICTION = 1; | |
76 | SUGGESTION = 2; | |
77 | TRANSLITERATION = 3; | |
78 | USAGE = 4; | |
79 | }; | |
80 | ||
81 | // DisplayType is a hint to UI renderers describing how the words are | |
82 | // displayed. | |
83 | enum DisplayType { | |
84 | MAIN = 0; | |
85 | CASCADE = 1; | |
86 | }; | |
87 | ||
88 | // TODO(nona): merge to RendererCommand::Rectangle | |
89 | message Rectangle { | |
90 | required int32 x = 1; | |
91 | required int32 y = 2; | |
92 | required int32 width = 3; | |
93 | required int32 height = 4; | |
94 | } | |
95 | ||
96 | message InformationList { | |
97 | optional uint32 focused_index = 1; | |
98 | repeated Information information = 2; | |
99 | // Category of the infolist. | |
100 | optional Category category = 3 [default = CONVERSION]; | |
101 | ||
102 | // Information to be used for rendering. | |
103 | optional DisplayType display_type = 4 [default = CASCADE]; | |
104 | ||
105 | // How long rendere needs to wait before the infolist is displayed. | |
106 | // the default setting is 500 msec. | |
107 | optional uint32 delay = 5 [ default = 500 ]; | |
108 | }; | |
109 | ||
110 | // Message representing the footer part of the candidate window. | |
111 | message Footer { | |
112 | // Message shown like a status bar. | |
113 | optional string label = 1; | |
114 | // Whether index (e.g. 10/120) is visible or not. | |
115 | optional bool index_visible = 2 [default = false]; | |
116 | // Whether the logo image is visible or not. | |
117 | optional bool logo_visible = 3 [default = false]; | |
118 | // Message modestly shown. It is used for displaying the version on | |
119 | // dev-channel now. | |
120 | optional string sub_label = 4; | |
121 | }; | |
122 | ||
123 | message CandidateWord { | |
124 | // Unique number specifing the candidate. This may be a negative value. | |
125 | optional int32 id = 1; | |
126 | // The first index should be zero and index numbers should increase by one. | |
127 | optional uint32 index = 2; | |
128 | // Reading of the value. The value is only used when the key is | |
129 | // different from the input composition (e.g. suggestion/prediction). | |
130 | optional string key = 3; | |
131 | // Converted value. (e.g. Kanji value). | |
132 | optional string value = 4; | |
133 | optional Annotation annotation = 5; | |
134 | }; | |
135 | ||
136 | message CandidateList { | |
137 | // This value represents the focused position of the next | |
138 | // |candidates|. If the |candidates| is a part of the whole | |
139 | // candidate words (as a result of paging), this value indicates the | |
140 | // position from the beginning of that part. (ex. where | |
141 | // |candidates| contatins 10th to 18th candidates, focused_index=0 | |
142 | // means the 10th candidate, but not 1st candidate. | |
143 | // | |
144 | // The existense of |focused_index| does not represents whether this | |
145 | // candidate list is a 'suggestion' or not. |category| represents | |
146 | // it. | |
147 | optional uint32 focused_index = 1; | |
148 | repeated CandidateWord candidates = 2; | |
149 | // Category of the candidates. | |
150 | optional Category category = 3 [default = CONVERSION]; | |
151 | }; | |
152 | ||
153 | // TODO(komatsu) rename it to CandidateWindow. | |
154 | message Candidates { | |
155 | // TODO(komatsu): Use CandidateList. | |
156 | // When has_focused_index() is true, this message contains predicted and | |
157 | // normally converted candidates. Otherwise, when the field is not set, | |
158 | // this message contains a 'suggestion'. | |
159 | optional uint32 focused_index = 1; | |
160 | ||
161 | // The size of the total candidates in this candidate list. The | |
162 | // value does not include the size of subcandidate lists. Note, the | |
163 | // next repeated-Candidate=3 may not contain all candidates. | |
164 | // all_candidates contains the values of subcandidate lists. | |
165 | required uint32 size = 2; | |
166 | ||
167 | // TODO(komatsu): Use CandidateList. | |
168 | repeated group Candidate = 3 { | |
169 | // The first index should be zero and index numbers should increase by one. | |
170 | required uint32 index = 4; | |
171 | required string value = 5; | |
172 | optional int32 id = 9; // Unique number specifing the candidate. | |
173 | optional Annotation annotation = 7; | |
174 | optional int32 information_id = 10; | |
175 | }; | |
176 | // The position on the composition in character counted by Util::CharsLen. | |
177 | // The number represents the left edge of the candidate window. For example, | |
178 | // if the composition is "あいう" and the cursor is the position is between | |
179 | // "あ" and "い" (e.g. "あ|いう"), the number should be 1. | |
180 | // Note, Util::CharsLen does not take care of IVS or combining character | |
181 | // so much. Thus CharsLen's behavoir on those characters might be changed. | |
182 | required uint32 position = 6; | |
183 | ||
184 | // Nested candidates aka cascading window. | |
185 | optional Candidates subcandidates = 8; | |
186 | ||
187 | // Usages of candidates. | |
188 | optional InformationList usages = 10; | |
189 | ||
190 | // TODO(komatsu): Use CandidateList. | |
191 | // Category of the candidates | |
192 | optional Category category = 11 [default = CONVERSION]; | |
193 | ||
194 | // Information to be used for rendering. | |
195 | optional DisplayType display_type = 12 [default = MAIN]; | |
196 | ||
197 | // Footer of the GUI window. | |
198 | optional Footer footer = 13; | |
199 | ||
200 | // The direction of candidates in the window. This is just a | |
201 | // suggestion from the server and client does not have to follow. | |
202 | enum Direction { | |
203 | VERTICAL = 0; | |
204 | HORIZONTAL = 1; | |
205 | }; | |
206 | optional Direction direction = 14 [ default = VERTICAL ]; | |
207 | ||
208 | // This position is used for suggest window position. | |
209 | optional Rectangle composition_rectangle = 15; | |
210 | optional Rectangle caret_rectangle = 16; | |
211 | ||
212 | enum CandidateWindowLocation{ | |
213 | // Shows candidate window under the caret. This is used for prediction and | |
214 | // conversion | |
215 | CARET = 0; | |
216 | // Shows candidate window aligned with composition area. This is used for | |
217 | // suggestion. | |
218 | COMPOSITION = 1; | |
219 | } | |
220 | optional CandidateWindowLocation window_location = 17; | |
221 | ||
222 | // The number of candidates per page. | |
223 | optional uint32 page_size = 18 [ default = 9 ]; | |
224 | }; |
0 | // Copyright 2010-2015, Google Inc. | |
1 | // All rights reserved. | |
2 | // | |
3 | // Redistribution and use in source and binary forms, with or without | |
4 | // modification, are permitted provided that the following conditions are | |
5 | // met: | |
6 | // | |
7 | // * Redistributions of source code must retain the above copyright | |
8 | // notice, this list of conditions and the following disclaimer. | |
9 | // * Redistributions in binary form must reproduce the above | |
10 | // copyright notice, this list of conditions and the following disclaimer | |
11 | // in the documentation and/or other materials provided with the | |
12 | // distribution. | |
13 | // * Neither the name of Google Inc. nor the names of its | |
14 | // contributors may be used to endorse or promote products derived from | |
15 | // this software without specific prior written permission. | |
16 | // | |
17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
18 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
19 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
20 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
21 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
22 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
23 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | ||
29 | // Protocol messages to be used for mozc client/server communication. | |
30 | // | |
31 | // The Command message contains all the input/output values for | |
32 | // client/server commnication. The messages structure of Command and | |
33 | // its child messages are here: | |
34 | ||
35 | syntax = "proto2"; | |
36 | ||
37 | import "config/config.proto"; | |
38 | import "session/candidates.proto"; | |
39 | import "dictionary/user_dictionary_storage.proto"; | |
40 | ||
41 | package mozc.commands; | |
42 | ||
43 | option java_outer_classname = "ProtoCommands"; | |
44 | option java_package = "org.mozc.android.inputmethod.japanese.protobuf"; | |
45 | ||
46 | // This enum is used by SessionCommand::input_mode with | |
47 | // CHANGE_INPUT_MODE and Output::mode. | |
48 | enum CompositionMode { | |
49 | DIRECT = 0; | |
50 | HIRAGANA = 1; | |
51 | FULL_KATAKANA = 2; | |
52 | HALF_ASCII = 3; | |
53 | FULL_ASCII = 4; | |
54 | HALF_KATAKANA = 5; | |
55 | NUM_OF_COMPOSITIONS = 6; | |
56 | } | |
57 | ||
58 | message KeyEvent { | |
59 | enum SpecialKey { | |
60 | NO_SPECIALKEY = 0; | |
61 | DIGIT = 1; | |
62 | // On Windows, SpecialKey::On and SpecialKey::OFF are obsolete. Use | |
63 | // TURN_ON_IME session command should be used instead. See b/10216365. | |
64 | // On other platforms, especially on Mac, please note that | |
65 | // client/client.cc still relies on SpecialKey::On for session playback. | |
66 | // We need to fix b/10250883 first. | |
67 | // TODO(team): Unsupport SpecialKey::On and SpecialKey::OFF. | |
68 | ON = 2; | |
69 | OFF = 3; | |
70 | SPACE = 4; | |
71 | ENTER = 5; | |
72 | LEFT = 6; | |
73 | RIGHT = 7; | |
74 | UP = 8; | |
75 | DOWN = 9; | |
76 | ESCAPE = 10; | |
77 | DEL = 11; // not DELETE because DELETE is reserved in MSVC | |
78 | BACKSPACE = 12; | |
79 | HENKAN = 13; | |
80 | MUHENKAN = 14; | |
81 | KANA = 15; // VK_DBE_HIRAGANA(Win), kVK_JIS_Kana(Mac) | |
82 | // TODO(toshiyuki): It is better to rename this to HIRAGANA | |
83 | // In Windows, we have Katakana and it may confusing. | |
84 | HOME = 16; | |
85 | END = 17; | |
86 | TAB = 18; | |
87 | F1 = 19; | |
88 | F2 = 20; | |
89 | F3 = 21; | |
90 | F4 = 22; | |
91 | F5 = 23; | |
92 | F6 = 24; | |
93 | F7 = 25; | |
94 | F8 = 26; | |
95 | F9 = 27; | |
96 | F10 = 28; | |
97 | F11 = 29; | |
98 | F12 = 30; | |
99 | PAGE_UP = 31; | |
100 | PAGE_DOWN = 32; | |
101 | INSERT = 33; | |
102 | F13 = 34; | |
103 | F14 = 35; | |
104 | F15 = 36; | |
105 | F16 = 37; | |
106 | F17 = 38; | |
107 | F18 = 39; | |
108 | F19 = 40; | |
109 | F20 = 41; | |
110 | F21 = 42; | |
111 | F22 = 43; | |
112 | F23 = 44; | |
113 | F24 = 45; | |
114 | EISU = 46; // alphanumeric VK_DBE_ALPHANUMERIC(Win), kVK_JIS_Eisu(Mac) | |
115 | NUMPAD0 = 47; | |
116 | NUMPAD1 = 48; | |
117 | NUMPAD2 = 49; | |
118 | NUMPAD3 = 50; | |
119 | NUMPAD4 = 51; | |
120 | NUMPAD5 = 52; | |
121 | NUMPAD6 = 53; | |
122 | NUMPAD7 = 54; | |
123 | NUMPAD8 = 55; | |
124 | NUMPAD9 = 56; | |
125 | MULTIPLY = 57; // Numpad [*] | |
126 | ADD = 58; // Numpad [+] | |
127 | SEPARATOR = 59; // Numpad [enter] | |
128 | SUBTRACT = 60; // Numpad [-] | |
129 | DECIMAL = 61; // Numpad [.] | |
130 | DIVIDE = 62; // Numpad [/] | |
131 | EQUALS = 63; // Numpad [=] | |
132 | TEXT_INPUT = 64; // Meta key event representing any text input. | |
133 | HANKAKU = 65; | |
134 | KANJI = 66; | |
135 | KATAKANA = 67; // VK_DBE_KATAKANA(Win) | |
136 | CAPS_LOCK = 68; | |
137 | // Unsupported keys (e.g. PrtSc, Pause) fall back to UNDEFINED_KEY. | |
138 | UNDEFINED_KEY = 69; | |
139 | COMMA = 70; // Numpad [,] | |
140 | CLEAR = 71; // Numpad [5] without NUMLOCK | |
141 | VIRTUAL_LEFT = 72; // Left key on virtual (software) keyboard | |
142 | VIRTUAL_RIGHT = 73; // Right key on virtual (software) keyboard | |
143 | VIRTUAL_ENTER = 74; // Enter key on virtual (software) keyboard | |
144 | ||
145 | NUM_SPECIALKEYS = 75; | |
146 | }; | |
147 | ||
148 | // CTRL, ALT and SHIFT cover both LEFT and RIGHT keys. If the | |
149 | // difference between LEFT and RIGHT is no matter, using CTRL (or ALT, SHIFT) | |
150 | // is preferred. | |
151 | // If LEFT (or RIGHT) CTRL(or ALT, SHIFT) is pressed, LEFT_CTRL is set on | |
152 | // Windows or Mac client, or LEFT_CTRL and CTRL are set on Unix client. | |
153 | // Mozc key translation logic is as follows | |
154 | // | |
155 | // ---- Modifier Keys ----- | |
156 | // | | | |
157 | // | B | | |
158 | // ---------+------ -- -----+------- | |
159 | // | | D | | E | | | |
160 | // | A +---- +--------+-------- C | | |
161 | // | | F | | | |
162 | // --Special Keys-- ---Other Keys--- | |
163 | // | |
164 | // A:Press only a special key | |
165 | // => Send special key event with no modifier. | |
166 | // B:Press only modifier keys | |
167 | // => Send modifier key event with no key_code. | |
168 | // C:Press an other key | |
169 | // => Send KeyEvent with no modifier. | |
170 | // D:Press a special key with one or more modifier keys | |
171 | // => Send special key event with modifiers. | |
172 | // E:Press an other key with one or more modifier keys | |
173 | // => If combined key is printable, replace keycodes. Otherwise, just send | |
174 | // with modifier keys. Note that, unless the whole combined key is | |
175 | // printable, keycodes are not replaced even if a subset of combined key is | |
176 | // printable. | |
177 | // F:Otherwise | |
178 | // => Send nothing. | |
179 | // | |
180 | // Following example shows expected behaviours. | |
181 | // E.g. ) | |
182 | // case | Pressed Key | translated key event | |
183 | // ---------------------------------------------------- | |
184 | // A | SP | special_key = 4 | |
185 | // A | F1 | special_key = 19 | |
186 | // B | CTRL | modifier_key = {CTRL} | |
187 | // B | SHIFT | modifier_key = {SHIFT} | |
188 | // B | CTRL+SHIFT | modifier_key = {CTRL,SHIFT} | |
189 | // C | 'a' | key_code = \x61 = 'a' | |
190 | // D | CTRL+BS | special_key = 12, modifier_key = {CTRL} | |
191 | // D | CTRL+SHIFT+BS | special_key = 12, modifier_key = {CTRL,SHIFT} | |
192 | // E | SHIFT+'a' | key_code = \x41 = 'A' | |
193 | // E | CTRL+'a' | key_code = \x61, modifier_key = {CTRL} | |
194 | // E | CTRL+ALT+'a' | key_code = \x61, modifier_key = {CTRL,ALT} | |
195 | // E | CTRL+SHIFT+'a'| key_code = \x61, modifier_key = {CTRL,SHIFT} | |
196 | // F | CTRL+BS+SP | send nothing | |
197 | // | |
198 | // In addition, we treat CAPS lock independently besides alphabet keys, | |
199 | // though it is a member of modifier keys. Following example shows currently | |
200 | // expected behaviours with Caps lock set. | |
201 | // | |
202 | // E.g. ) While CAPS is set on. | |
203 | // Pressed Key | translated key event | |
204 | // ---------------------------------------------------- | |
205 | // 'a' | key_code = \x41 = 'A', modifier_key = {CAPS} | |
206 | // SHIFT+'a' | key_code = \x61 = 'a', modifier_key = {CAPS} | |
207 | // CTRL+'a' | key_code = \x41, modifier_key = {CTRL,CAPS} | |
208 | // CTRL+ALT+'a' | key_code = \x41, modifier_key = {CTRL,ALT,CAPS} | |
209 | // CTRL+SHIFT+'a'| key_code = \x41, modifier_key = {CTRL,SHIFT,CAPS} | |
210 | // | |
211 | // However, only in short-cut judgement, we should convert capital characters | |
212 | // into lower cases. | |
213 | // TODO(peria): Specify exceptions with CAPS, and unify with the above table. | |
214 | ||
215 | enum ModifierKey { | |
216 | CTRL = 1; | |
217 | ALT = 2; | |
218 | SHIFT = 4; | |
219 | KEY_DOWN = 8; | |
220 | KEY_UP = 16; | |
221 | LEFT_CTRL = 32; | |
222 | LEFT_ALT = 64; | |
223 | LEFT_SHIFT = 128; | |
224 | RIGHT_CTRL = 256; | |
225 | RIGHT_ALT = 512; | |
226 | RIGHT_SHIFT = 1024; | |
227 | CAPS = 2048; | |
228 | }; | |
229 | ||
230 | // Probable key event, mainly for touch screen. | |
231 | // User's input has ambiguity (e.g. the touch position is merginal) | |
232 | // so this message expresses the probable event. | |
233 | message ProbableKeyEvent { | |
234 | // message ID is the same as Input message. | |
235 | optional uint32 key_code = 1; | |
236 | optional SpecialKey special_key = 3; // Unprintable key listed above. | |
237 | repeated ModifierKey modifier_keys = 4; // ModifierKeys | |
238 | // Sum of probabilities must be lesser or equal than 1. | |
239 | // 0<= probability <= 1 | |
240 | optional double probability = 10; | |
241 | }; | |
242 | ||
243 | // Printable key in UCS4. If key_code is empty, key_string is used | |
244 | // as a raw input. | |
245 | optional uint32 key_code = 1; | |
246 | optional uint32 modifiers = 2; // Going to be obsolete. | |
247 | optional SpecialKey special_key = 3; // Unprintable key listed above. | |
248 | repeated ModifierKey modifier_keys = 4; // ModifierKeys | |
249 | ||
250 | // String used for preedit. Kana characters and strings typed from | |
251 | // a software keyboard are supposed to be stored here. If key_code | |
252 | // is also set, key_code is treated as the raw input and key_string is | |
253 | // treated as the composition input. For example, to set Kana value, | |
254 | // when key_string is "ち", key_code should be 'a' (97). If key_code | |
255 | // is empty, key_string is also treated as the raw input. | |
256 | optional string key_string = 5; | |
257 | ||
258 | enum InputStyle { | |
259 | // Follow the current input mode (default). | |
260 | FOLLOW_MODE = 0; | |
261 | // Do not transliterate key_string and use it as-is. | |
262 | AS_IS = 1; | |
263 | // Immediately output key_string on the precomposition mode. | |
264 | // Same with AS_IS on the preedit mode. | |
265 | DIRECT_INPUT = 2; | |
266 | }; | |
267 | optional InputStyle input_style = 6 [default = FOLLOW_MODE]; | |
268 | ||
269 | // Input mode | |
270 | // For histrical reasons, this field expects a temporary conversion | |
271 | // mode rather than comeback input mode. | |
272 | optional CompositionMode mode = 7; | |
273 | ||
274 | // Probable key events | |
275 | // Even if you can fill this field, | |
276 | // don't omit Input.key_code and so on | |
277 | // because preedit string is composed based on them. | |
278 | repeated ProbableKeyEvent probable_key_event = 8; | |
279 | ||
280 | // IME on/off mode | |
281 | // You can use this field to change the IME on/off mode indirectly without | |
282 | // sending SpecialKey:ON or SpecialKey:OFF events. | |
283 | // If the internal ImeContext::State is DIRECT and this field is true, the | |
284 | // converter will change the state to PRECONPOSITION and then handles this key | |
285 | // event. | |
286 | // If the internal ImeContext::State is not DIRECT and this field is false, | |
287 | // the converter will change the state to DIRECT and then handles this key | |
288 | // event. | |
289 | // Implementation note: We need both |mode| and |activated| to support | |
290 | // indirect IME off, where |mode| should contain the next mode. If this field | |
291 | // is not set, the server will act as if indirect on/off was not supported. | |
292 | optional bool activated = 9; | |
293 | }; | |
294 | ||
295 | message GenericStorageEntry { | |
296 | enum StorageType { | |
297 | SYMBOL_HISTORY = 0; | |
298 | EMOTICON_HISTORY = 1; | |
299 | EMOJI_HISTORY=2; | |
300 | } | |
301 | optional StorageType type = 1; | |
302 | optional string key = 2; | |
303 | // The type must be bytes instead of string | |
304 | // because value might have U+0000 character as a terminator. | |
305 | // In this case, characters after the terminator are undefined. | |
306 | // Such byte stream cannot be treaed by Java's String class, which | |
307 | // is used for PB's string type. | |
308 | // Instead, PB's bytes type is converted into ByteString in Java, | |
309 | // which can treat C laguage style string described above. | |
310 | repeated bytes value = 3; | |
311 | } | |
312 | ||
313 | message SessionCommand { | |
314 | enum CommandType { | |
315 | // Revert the session, this is usually similar to type ESC several times. | |
316 | REVERT = 1; | |
317 | // Commit the session, this is usually similar to type Enter. | |
318 | // SUBMIT session command is accepted in any status. | |
319 | // Pre-condition: | |
320 | // - Any states of IME are acceptable. | |
321 | // Post-condition: | |
322 | // - Preedit text becomes empty. | |
323 | SUBMIT = 2; | |
324 | // Select the specified candidate word by id. This command is | |
325 | // usually used with mouse clicking. | |
326 | SELECT_CANDIDATE = 3; | |
327 | ||
328 | // Set the focus to the candidate by id. This is usually used | |
329 | // with mouse dragging. The difference from SELECT_CANDIDATE is | |
330 | // that HIGHLIGHT_CANDIDATE does not close the candidate window | |
331 | // while SELECT_CANDIDATE closes the candidate window. | |
332 | HIGHLIGHT_CANDIDATE = 4; | |
333 | ||
334 | // Specify the input mode. This command should be used with | |
335 | // composition_mode. | |
336 | SWITCH_INPUT_MODE = 5; | |
337 | ||
338 | // Return the current status such as composition mode, preedit method, etc. | |
339 | GET_STATUS = 6; | |
340 | ||
341 | // This command is typically used for mobile IME's partial conversion, | |
342 | // but currently it is on the way. This description is for current spec. | |
343 | // | |
344 | // This command requires that candidates exist. | |
345 | // | |
346 | // If there is a focused candidate (Conversion or Prediction state), | |
347 | // the candidate matched with the given id in the first segment is | |
348 | // submitted, even though the selected segment is not the first segment | |
349 | // (Important thing is whether focused candidate exists | |
350 | // or not. Focused index itself is ignored). | |
351 | // This behavior should be updated because current cursor position and | |
352 | // position of focused segment affects nothing. | |
353 | // We should fix this non-intuitive behavior. Intuitive behavior might be | |
354 | // submitting segments from first one to focused one (inclusive). | |
355 | // | |
356 | // If no focused candidate (Suggestion, including ZeroQuery suggestion), | |
357 | // first (and only) segment's candiadte of which id is equal to id field of | |
358 | // Input message is submitted. | |
359 | // This behavior should be fixed because current cursor position affects | |
360 | // nothing. In future, the characters after the cursor should be kept | |
361 | // as preedit. | |
362 | // | |
363 | // This command's pre- and post- conditions are differenct from | |
364 | // SUBMIT command's. Following conditions will be kept after updating | |
365 | // the behavior. | |
366 | // Pre-condition: | |
367 | // - There should be candidate. | |
368 | // Post-condition: | |
369 | // - No guarantee on preedit text. | |
370 | // TODO(yamaguchi): Update corresponding implementation please. | |
371 | SUBMIT_CANDIDATE = 7; | |
372 | ||
373 | // Perform reverse conversion. | |
374 | CONVERT_REVERSE = 8; | |
375 | ||
376 | // Perform Undo. | |
377 | UNDO = 9; | |
378 | ||
379 | // Reset convert history and revert current composition. | |
380 | // This is usually used by moving cursor with mouse clicking. | |
381 | RESET_CONTEXT = 10; | |
382 | ||
383 | // Change cursor position in preedit. | |
384 | MOVE_CURSOR = 11; | |
385 | ||
386 | // Specify the input field type. | |
387 | SWITCH_INPUT_FIELD_TYPE = 12; | |
388 | ||
389 | // Client side event information for collecting usage statistics | |
390 | USAGE_STATS_EVENT = 13; | |
391 | ||
392 | // This command is used in only Android. | |
393 | // Works UNDO or rewind HIRAGANA characters based on the state. | |
394 | UNDO_OR_REWIND = 14; | |
395 | ||
396 | // Expand suggestion candidates. | |
397 | // Usual suggestion algorithm is not "rich" but "fast" because suggestion | |
398 | // is executed every key event (On the other hand predicition is "rich" | |
399 | // because prediction is executed only when a user types TAB key). | |
400 | // This command expands suggestion candidate but IME state is | |
401 | // kept as is (Note : PredictAndConvert key command does almost the same | |
402 | // thing but it changes IME state to prediction). | |
403 | EXPAND_SUGGESTION = 15; | |
404 | ||
405 | // The client can send the current caret position whenever the caret | |
406 | // position is changed. The caret position is used for suggest window | |
407 | // position calculation. This is an optional message. If client can show | |
408 | // suggest window on the correct position, this message can be ignored. | |
409 | SEND_CARET_LOCATION = 16; | |
410 | ||
411 | // Obsolete command. Don't simply remove this command for NUM_OF_COMMANDS. | |
412 | // TODO(team): Replace this command by useful one. | |
413 | OBSOLETE_SEND_LANGUAGE_BAR_COMMAND = 17; | |
414 | ||
415 | // When the server is hadling asynchronous request, the server returns the | |
416 | // message with callback request which session_command is GET_ASYNC_RESULT. | |
417 | // After the delay_millisec, the client sends this command to the server. | |
418 | GET_ASYNC_RESULT = 18; | |
419 | ||
420 | // Commit the raw text of the composed string. | |
421 | COMMIT_RAW_TEXT = 19; | |
422 | ||
423 | // Call ConvertPrevPage session command to show the previous page of | |
424 | // candidates. | |
425 | CONVERT_PREV_PAGE = 20; | |
426 | ||
427 | // Call ConvertNextPage session command to show the next page of | |
428 | // candidates. | |
429 | CONVERT_NEXT_PAGE = 21; | |
430 | ||
431 | // Make sure IME is turned on. Optionally you can also provide new input | |
432 | // mode in |composition_mode| (but you must not set DIRECT to it). | |
433 | // |composition_mode| is honored even when IME is already turned on. | |
434 | TURN_ON_IME = 22; | |
435 | ||
436 | // Make sure IME is turned off. Optionally you can also provide new input | |
437 | // mode in |composition_mode| (but you must not set DIRECT to it). If IME | |
438 | // |composition_mode| is honored even when IME is already turned off. | |
439 | TURN_OFF_IME = 23; | |
440 | ||
441 | // Number of commands. | |
442 | // When new command is added, the command should use below number | |
443 | // and NUM_OF_COMMANDS should be incremented. | |
444 | NUM_OF_COMMANDS = 24; | |
445 | }; | |
446 | required CommandType type = 1; | |
447 | ||
448 | // Unique number specifying a candidate word. | |
449 | optional int32 id = 2; | |
450 | ||
451 | // This is used with SWITCH_INPUT_MODE, TURN_ON_IME and TURN_OFF_IME. | |
452 | optional CompositionMode composition_mode = 3; | |
453 | ||
454 | // Text argument. This is used by CONVERT_REVERSE at this moment. | |
455 | optional string text = 4; | |
456 | ||
457 | // New cursor position in preedit. Used with MOVE_CURSOR. | |
458 | optional uint32 cursor_position = 5; | |
459 | ||
460 | // Client side event for collecting usage statistics | |
461 | enum UsageStatsEvent { | |
462 | INFOLIST_WINDOW_SHOW = 1; | |
463 | INFOLIST_WINDOW_HIDE = 2; | |
464 | HANDWRITING_OPEN_EVENT = 3; | |
465 | HANDWRITING_COMMIT_EVENT = 4; | |
466 | CHARACTER_PALETTE_OPEN_EVENT = 5; | |
467 | CHARACTER_PALETTE_COMMIT_EVENT = 6; | |
468 | SOFTWARE_KEYBOARD_LAYOUT_LANDSCAPE = 7; | |
469 | SOFTWARE_KEYBOARD_LAYOUT_PORTRAIT = 8; | |
470 | SUBMITTED_CANDIDATE_ROW_0 = 9; | |
471 | SUBMITTED_CANDIDATE_ROW_1 = 10; | |
472 | SUBMITTED_CANDIDATE_ROW_2 = 11; | |
473 | SUBMITTED_CANDIDATE_ROW_3 = 12; | |
474 | SUBMITTED_CANDIDATE_ROW_4 = 13; | |
475 | SUBMITTED_CANDIDATE_ROW_5 = 14; | |
476 | SUBMITTED_CANDIDATE_ROW_6 = 15; | |
477 | SUBMITTED_CANDIDATE_ROW_7 = 16; | |
478 | SUBMITTED_CANDIDATE_ROW_8 = 17; | |
479 | SUBMITTED_CANDIDATE_ROW_9 = 18; | |
480 | SUBMITTED_CANDIDATE_ROW_GE10 = 19; | |
481 | KEYBOARD_FOLD_EVENT = 20; | |
482 | KEYBOARD_EXPAND_EVENT = 21; | |
483 | MUSHROOM_SELECTION_DIALOG_OPEN_EVENT = 22; | |
484 | } | |
485 | optional UsageStatsEvent usage_stats_event = 7; | |
486 | optional int32 usage_stats_event_int_value = 9; | |
487 | ||
488 | // Specify the current caret location, this is used for suggest window | |
489 | // position calculation. Used with SEND_CARET_LOCATION. | |
490 | optional Rectangle caret_rectangle = 8; | |
491 | ||
492 | // Unique number specifying an asynchronous request. | |
493 | optional int32 asynchronous_request_id = 10; | |
494 | }; | |
495 | ||
496 | message Context { | |
497 | // Former part of surrounding text. | |
498 | optional string preceding_text = 1; | |
499 | ||
500 | // Latter part of surrounding text. | |
501 | optional string following_text = 2; | |
502 | ||
503 | // If this is true, suggestion feature is disabled regardless the | |
504 | // congiguration. If this is false, suggestion feature is followed | |
505 | // by the user's configuration. If you want to omit interim | |
506 | // suggestions during the key typing, you might want to use | |
507 | // request_suggestion. | |
508 | // TODO(komatsu): Delete this field and use experimental_features. | |
509 | optional bool suppress_suggestion = 3 [default = false]; | |
510 | ||
511 | // Input field type. | |
512 | // The types are based on the input types defined in HTML5. | |
513 | // http://dev.w3.org/html5/spec/Overview.html#attr-input-type | |
514 | // Other types are to be added later. | |
515 | enum InputFieldType { | |
516 | // No restrictions nor special functions. The IME operates as usual. | |
517 | NORMAL = 1; | |
518 | ||
519 | // Password field. Text is hidden after input. | |
520 | // For Android, | |
521 | // In order to make the last character visible to the user, | |
522 | // the IME must not hold more than 2 characters in preedit. | |
523 | PASSWORD = 2; | |
524 | ||
525 | // Telephone number | |
526 | TEL = 3; | |
527 | ||
528 | // Number | |
529 | NUMBER = 4; | |
530 | }; | |
531 | // Type of the input field being focused. | |
532 | optional InputFieldType input_field_type = 4; | |
533 | ||
534 | // An unique revision ID to specify one specific typing session. A client can | |
535 | // use arbitrary value for this field. The converter is expected to clear its | |
536 | // internal history segments whenever this value is changed. A client should | |
537 | // use the same revision ID whenever the converter should keep it internal | |
538 | // history segments. In order to avoid unexpected history learnings, a client | |
539 | // should update the revision whenever the input focus is changed. | |
540 | optional int32 revision = 5 [default = 0]; | |
541 | ||
542 | // Repeated fields to be used for experimental features. | |
543 | repeated string experimental_features = 100; | |
544 | }; | |
545 | ||
546 | // Clients' capability. | |
547 | // Users cannot modify this. | |
548 | // The server has to obey this capability. | |
549 | message Capability { | |
550 | // Bit fields to notify what the client can do. | |
551 | enum TextDeletionCapabilityType { | |
552 | NO_TEXT_DELETION_CAPABILITY = 0; | |
553 | ||
554 | // Can delete preceding text which is adjacent to preedit. | |
555 | DELETE_PRECEDING_TEXT = 1; | |
556 | }; | |
557 | optional TextDeletionCapabilityType text_deletion = 1 | |
558 | [default = NO_TEXT_DELETION_CAPABILITY]; | |
559 | }; | |
560 | ||
561 | // Clients' request to the server. | |
562 | // Users cannot modify this. | |
563 | // In the future each request may be able to be overwirtten by Config. | |
564 | // The server does not have to obey this request. | |
565 | message Request { | |
566 | // Enable zero query suggestion. | |
567 | optional bool zero_query_suggestion = 1 | |
568 | [default = false] ; // true for android | |
569 | ||
570 | // Conversion's candidate includes suggestion, prediction and conversion. | |
571 | optional bool mixed_conversion = 2 | |
572 | [default = false] ; // true for android | |
573 | ||
574 | // Combine all segments like mobile IME. | |
575 | optional bool combine_all_segments = 3 | |
576 | [default = false] ; // true for android | |
577 | ||
578 | enum SpecialRomanjiTable { | |
579 | // Do not use special table. | |
580 | // Romanji table is selected based on Config. | |
581 | DEFAULT_TABLE = 0; | |
582 | ||
583 | // Use special table for 12keys (to hiragana). | |
584 | TWELVE_KEYS_TO_HIRAGANA = 10; | |
585 | ||
586 | // Use special table for 12keys (to half-width ascii). | |
587 | TWELVE_KEYS_TO_HALFWIDTHASCII = 11; | |
588 | ||
589 | // Use special table for flick (to hiragana). | |
590 | FLICK_TO_HIRAGANA = 13; | |
591 | ||
592 | // Use special table for flick (to half-width ascii). | |
593 | FLICK_TO_HALFWIDTHASCII = 14; | |
594 | ||
595 | // Use special table for both toggle and flick (to hiragana). | |
596 | TOGGLE_FLICK_TO_HIRAGANA = 16; | |
597 | ||
598 | // Use special table for both toggle and flick (to half-width ascii). | |
599 | TOGGLE_FLICK_TO_HALFWIDTHASCII = 17; | |
600 | ||
601 | // Use special table for Qwerty (for Mobile) (to hiragana). | |
602 | QWERTY_MOBILE_TO_HIRAGANA = 20; | |
603 | ||
604 | // Use special table for Qwerty (for Mobile) (to half-width ascii). | |
605 | QWERTY_MOBILE_TO_HALFWIDTHASCII = 22; | |
606 | ||
607 | // Use special table for Godan (to hiragana). | |
608 | GODAN_TO_HIRAGANA = 30; | |
609 | ||
610 | // Use special table for Godan (to half-width ascii). | |
611 | GODAN_TO_HALFWIDTHASCII = 31; | |
612 | ||
613 | // Use special table for Notouch (to hiragana). | |
614 | NOTOUCH_TO_HIRAGANA = 40; | |
615 | ||
616 | // Use special table for Notouch (to half-width ascii). | |
617 | NOTOUCH_TO_HALFWIDTHASCII = 41; | |
618 | ||
619 | // Obsolete items. | |
620 | OBSOLETE_TWELVE_KEYS_TO_NUMBER = 12; | |
621 | OBSOLETE_FLICK_TO_NUMBER = 15; | |
622 | OBSOLETE_GODAN_TO_NUMBER = 32; | |
623 | OBSOLETE_QWERTY_MOBILE_TO_HIRAGANA_NUMBER = 21; | |
624 | OBSOLETE_TOGGLE_FLICK_TO_NUMBER = 18; | |
625 | }; | |
626 | ||
627 | // Use special Romanji table. | |
628 | optional SpecialRomanjiTable special_romanji_table = 4 | |
629 | [default = DEFAULT_TABLE] ; // TWELVE_KEYS_TO_HIRAGANA for android. | |
630 | ||
631 | ||
632 | enum SpaceOnAlphanumeric { | |
633 | // The first input is treated as a space, double input is treated | |
634 | // as a conversion. If a character is input after the first | |
635 | // input, the composition will remain. For example, "ab<space>dc" | |
636 | // becomes "ab dc" as a single composition. | |
637 | SPACE_OR_CONVERT_KEEPING_COMPOSITION = 0; | |
638 | ||
639 | // The first input is treated as a space, double input is treated | |
640 | // as a conversion. If a character is input after the first | |
641 | // input, the previous composition will be committed. For | |
642 | // example, "ab<space>dc" results "ab " as a committed string and | |
643 | // "dc" as a composition. | |
644 | SPACE_OR_CONVERT_COMMITING_COMPOSITION = 1; | |
645 | ||
646 | // Commit the composition and a space. | |
647 | COMMIT = 2; | |
648 | }; | |
649 | ||
650 | optional SpaceOnAlphanumeric space_on_alphanumeric = 6 | |
651 | [default = SPACE_OR_CONVERT_KEEPING_COMPOSITION]; | |
652 | ||
653 | // Keyboard name for touch devices. | |
654 | // For example, "TWELVE_KEY_TOGGLE_KANA", "QWERTY_KANA_NUMBER". | |
655 | // It is used to analyze touch event usage stats. | |
656 | optional string keyboard_name = 7; | |
657 | ||
658 | // Enables Composer's input mode auto updating by using surrounding text. | |
659 | // For example, when a composition string is "ad", a carret is at the end, | |
660 | // and a user selects HIRAGANA mode, if the user moves the carret to between | |
661 | // "a" and "d" the mode will be automatically switch to ASCII (temporarily). | |
662 | // See details in the Composer::UpdateInputMode. | |
663 | optional bool update_input_mode_from_surrounding_text = 8 | |
664 | [default = true]; | |
665 | ||
666 | // Enables Kana-modifier-insensitive conversion as follows: | |
667 | // 1) Voiced/Semi-voiced kana will be hit by non-modified kana. | |
668 | // e.g.) "ば" and "ぱ" will be hit by key "は". | |
669 | // 2) Geminate consonant "っ" will be hit by non-modified kana "つ". | |
670 | // 3) Palatalized kana will be hit by non-modified kana. | |
671 | // e.g.) "ゃ" will be hit by key "や". | |
672 | // Here is an example of the search: "学校" ("がっこう") will be hit | |
673 | // by "かつこう". | |
674 | optional bool kana_modifier_insensitive_conversion = 9 [default = false]; | |
675 | ||
676 | // Enables Auto partial suggestion. | |
677 | // For Auto partial suggestion, we can see first segment only candidates | |
678 | // adding to normal realtime conversion suggestion results. | |
679 | // If we commit that candidate, we will show suggestions for remaining part | |
680 | // of key. | |
681 | // | |
682 | // Note: This feature can be enabled only for mobile due to UX design. | |
683 | optional bool auto_partial_suggestion = 10 [default = false]; | |
684 | ||
685 | // Nowadays, four kinds of emoji characters are used in Japan. | |
686 | // - Unicode: Unicode based emoji (since Unicode 6.0). | |
687 | // - Docomo: Docomo's carrier emoji. | |
688 | // - Softbank: Softbank's carrier emoji. | |
689 | // - Kddi: Kddi's carrier emoji. | |
690 | // Note that especially latter three kinds are used on Mobile phones. | |
691 | // So, it is necessary to control what kinds of emoji can be used or not | |
692 | // based on client's (or connected application's) information. | |
693 | // For example, on Android; | |
694 | // - Unicode emoji characters are available only on Android 4.1 or later | |
695 | // only. | |
696 | // - JP mobile carriers' emoji characters depend on the devices. Also, | |
697 | // we need to check the text field's attribute for them. | |
698 | // The following bit set tells the emoji availability to EmojiRewriter. | |
699 | enum EmojiCarrierType { | |
700 | UNICODE_EMOJI = 1; | |
701 | DOCOMO_EMOJI = 2; | |
702 | SOFTBANK_EMOJI = 4; | |
703 | KDDI_EMOJI = 8; | |
704 | } | |
705 | ||
706 | // By default, UNICODE emoji is available. | |
707 | optional int32 available_emoji_carrier = 11 [default = 1]; | |
708 | ||
709 | // For emoji rewriter, it is necessary to control when the rewriter runs | |
710 | // based on the clients. The following bit set is sync'ed to | |
711 | // RewriterInterface::CapabilityType (see rewriter_interface.h, too), | |
712 | // so that clients can fill the value. | |
713 | enum RewriterCapability { | |
714 | NOT_AVAILABLE = 0; | |
715 | CONVERSION = 1; | |
716 | PREDICTION = 2; | |
717 | SUGGESTION = 4; | |
718 | ALL = 7; // CONVERSION | PREDICTION | SUGGESTION. | |
719 | } | |
720 | ||
721 | // By default, Emoji rewriter works on conversion mode only. | |
722 | optional int32 emoji_rewriter_capability = 12 [default = 1]; | |
723 | ||
724 | // Controls the behavior when a user types the left/right key at the edge | |
725 | // of the preedit string (in more precise, the left key at the beginning | |
726 | // of the preedit string, or the right key at the end). | |
727 | enum CrossingEdgeBehavior { | |
728 | // This is the default behavior. The cursor movement at the edge | |
729 | // will make nothing, i.e., keeping the current cursor position (at the | |
730 | // edge), consume the key event. | |
731 | DO_NOTHING = 0; | |
732 | ||
733 | // This is the behavior, especially designed for alphabet keyboards on | |
734 | // mobile devices. Assuming the following text: | |
735 | // XXXXabcde|YYYYY | |
736 | // where XXXX is preceding text, abcde is composing text, YYYYY is | |
737 | // following text and '|' is the caret, when a user sends "RIGHT" | |
738 | // cursor key, we'd like to commit the abcde and move the caret to right. | |
739 | // So the user will get: | |
740 | // XXXXabcdeY|YYYY | |
741 | // Here, what we need is commiting the "abcde" with the appropriate | |
742 | // caret position. (Note that we need to handle the left cursor key, too). | |
743 | // Also, we should *NOT* consume the key, so that the key event will be | |
744 | // handled appropriately by the target application. | |
745 | COMMIT_WITHOUT_CONSUMING = 1; | |
746 | } | |
747 | optional CrossingEdgeBehavior crossing_edge_behavior = 13 | |
748 | [default = DO_NOTHING]; | |
749 | ||
750 | // Controls the behavior of language aware input. Language aware input | |
751 | // guesses the actual language regardless the input mode. For example, | |
752 | // if user type "てst" it will be treated as "test". | |
753 | enum LanguageAwareInputBehavior { | |
754 | // Performs the default behavior considering the platform and channel. | |
755 | DEFAULT_LANGUAGE_AWARE_BEHAVIOR = 0; | |
756 | ||
757 | // Does not perform this functionarity. | |
758 | NO_LANGUAGE_AWARE_INPUT = 1; | |
759 | ||
760 | // Adds a language aware candidate to the suggestion. | |
761 | LANGUAGE_AWARE_SUGGESTION = 2; | |
762 | } | |
763 | optional LanguageAwareInputBehavior language_aware_input = 14 | |
764 | [default = DEFAULT_LANGUAGE_AWARE_BEHAVIOR]; | |
765 | ||
766 | // Page size of the candidate list. | |
767 | optional int32 candidate_page_size = 15 [default = 9]; | |
768 | } | |
769 | ||
770 | // Note there is another ApplicationInfo inside RendererCommand. | |
771 | // Since Input is not using nested message, define ApplicationInfo here. | |
772 | message ApplicationInfo { | |
773 | optional uint32 process_id = 1; | |
774 | optional uint32 thread_id = 2; | |
775 | // The time difference between local time and UTC time in seconds. | |
776 | // This field is not supported except for NaCl. | |
777 | // We use this field in NaCl Mozc because we can't know the local timezone in | |
778 | // NaCl environment. | |
779 | optional int32 timezone_offset = 3; | |
780 | }; | |
781 | ||
782 | message Input { | |
783 | enum CommandType { | |
784 | NONE = 0; | |
785 | CREATE_SESSION = 1; | |
786 | DELETE_SESSION = 2; | |
787 | SEND_KEY = 3; | |
788 | ||
789 | // Check only if the key event will be consumed. This command is | |
790 | // for TSF on Windows. You do not need to use this command, if it | |
791 | // is not necessary. | |
792 | TEST_SEND_KEY = 4; | |
793 | ||
794 | // Evaluate the command specified by SessionCommand. The output | |
795 | // format should be the same with an output of a SEND_KEY command. | |
796 | SEND_COMMAND = 5; | |
797 | ||
798 | // Config accessors. | |
799 | // There are three configurations. | |
800 | // Stored config, Imposed config, One-shot config. | |
801 | // Stored config : Set by SET_CONFIG command. | |
802 | // Its lifetime is permanent (stored into a storage). | |
803 | // GET_CONFIG returns stored config. | |
804 | // Imposed config : Set by SET_IMPOSED_CONFIG. Its lifetime is the | |
805 | // same as the process (*not* stored into a storage as opposed to Stored | |
806 | // config). | |
807 | // Imposed config is prioritized over Stored config. | |
808 | // Only the values explicitly set are effective and override ones in Stored | |
809 | // config. In typical usage, most fields are not set. | |
810 | // GET_CONFIG's result is *not* affected by imposed config | |
811 | // (stored config returns). | |
812 | // One-shot config : Set by each key events. | |
813 | // It is effective while the key event is processed. | |
814 | // This is prioritized over Imposed config. | |
815 | // Like as Imposed config, some fields can be omitted. | |
816 | // TODO(matsuzakit): Rename (GET|SET)_CONFIG to (GET|SET)_STORED_CONFIG | |
817 | GET_CONFIG = 6; | |
818 | SET_CONFIG = 7; | |
819 | SET_IMPOSED_CONFIG = 22; | |
820 | ||
821 | // Set client's request | |
822 | SET_REQUEST = 17; | |
823 | ||
824 | // sync dictionary/history data to local file | |
825 | SYNC_DATA = 8; | |
826 | ||
827 | // shutdowon server safely | |
828 | SHUTDOWN = 9; | |
829 | ||
830 | // reload mutable data (like config, user-dic, history) | |
831 | RELOAD = 10; | |
832 | ||
833 | // clear user history data | |
834 | CLEAR_USER_HISTORY = 11; | |
835 | ||
836 | // clear user prediction data | |
837 | CLEAR_USER_PREDICTION = 12; | |
838 | ||
839 | // clear unused prediction | |
840 | CLEAR_UNUSED_USER_PREDICTION = 16; | |
841 | ||
842 | // clean up sessions | |
843 | // shutdwon if session is empty and | |
844 | // mozc_server is launched with timeout mode | |
845 | CLEANUP = 13; | |
846 | ||
847 | // no operation | |
848 | // can be used for pinging the server | |
849 | NO_OPERATION = 14; | |
850 | ||
851 | // Sync feature is deprecated since 1.13 dev. | |
852 | // TODO(mozc-team): Remove following variables. | |
853 | OBSOLETE_START_CLOUD_SYNC = 18; | |
854 | OBSOLETE_GET_CLOUD_SYNC_STATUS = 23; | |
855 | OBSOLETE_ADD_AUTH_CODE = 24; | |
856 | ||
857 | INSERT_TO_STORAGE = 20; | |
858 | READ_ALL_FROM_STORAGE = 21; | |
859 | CLEAR_STORAGE = 25; | |
860 | ||
861 | // Send a command for user dictionary session. | |
862 | SEND_USER_DICTIONARY_COMMAND = 26; | |
863 | ||
864 | // Number of commands. | |
865 | // When new command is added, the command should use below number | |
866 | // and NUM_OF_COMMANDS should be incremented. | |
867 | // | |
868 | // Note: This enum lack the value for 15 and 19 and it may cause a crash. | |
869 | // Please reuse these value if you can. | |
870 | // 15 have never been used before, and 19 was used to clear synced | |
871 | // data on dev channel. | |
872 | NUM_OF_COMMANDS = 27; | |
873 | }; | |
874 | required CommandType type = 1; | |
875 | ||
876 | // Session ID created by CREATE_SESSION. | |
877 | optional uint64 id = 2; | |
878 | ||
879 | // Key combinations used for SEND_KEY or TEST_SEND_KEY. | |
880 | optional KeyEvent key = 3; | |
881 | ||
882 | // Command sent to the session layer used with SEND_COMMAND. | |
883 | optional SessionCommand command = 4; | |
884 | ||
885 | // Input config | |
886 | optional mozc.config.Config config = 5; | |
887 | ||
888 | // Context data | |
889 | optional Context context = 6; | |
890 | ||
891 | // Client capability | |
892 | optional Capability capability = 7; | |
893 | ||
894 | // Application information, like process id. | |
895 | // Server may be able to change the behavior by seeing the | |
896 | // the program name. | |
897 | optional ApplicationInfo application_info = 8; | |
898 | ||
899 | // Client request | |
900 | optional Request request = 9; | |
901 | ||
902 | // If the command is INSERT_TO_STORAGE, all the fields must be filled. | |
903 | // If READ_ALL_FROM_STORAGE, key and value fields are ignored. | |
904 | optional GenericStorageEntry storage_entry = 10; | |
905 | ||
906 | enum TouchAction { | |
907 | TOUCH_DOWN = 1; | |
908 | TOUCH_MOVE = 2; | |
909 | TOUCH_UP = 3; | |
910 | }; | |
911 | message TouchPosition { | |
912 | optional TouchAction action = 1; | |
913 | // x, y potision: keyboad left-top is (0, 0), right-bottom is (1, 1). | |
914 | optional float x = 2; | |
915 | optional float y = 3; | |
916 | // timestamp (in ms) is set to zero when the touch event starts. | |
917 | optional int64 timestamp = 4; | |
918 | } | |
919 | // TouchEvent contains source_id and stroke. | |
920 | // Touch_events contain all key touch event. | |
921 | // Statistical information are collected for each source_id | |
922 | // by SessionUsageObserver. | |
923 | message TouchEvent { | |
924 | // source_id specifies the user action such as "X button pressed". | |
925 | // It must be unique within the same keyboard_name, | |
926 | // which is set in Request message. | |
927 | optional uint32 source_id = 1; | |
928 | repeated TouchPosition stroke = 2; | |
929 | } | |
930 | repeated TouchEvent touch_events = 12; | |
931 | ||
932 | optional mozc.user_dictionary.UserDictionaryCommand user_dictionary_command | |
933 | = 13; | |
934 | ||
935 | // A flag to control if the server should return suggest-results or not. | |
936 | // If this is set to false, regardless of other configurations, | |
937 | // the server won't return suggestion results. | |
938 | // This is set to true by default. | |
939 | // Note that even if this flag is set to false, when a suggestion is shown | |
940 | // in the previous phase, it is possible from the client to submit it. | |
941 | // This works only for suggestions for the key insersion, but not for | |
942 | // others commands, such as predictions or conversions. | |
943 | // This flag is used for the performance improvement in terms of the | |
944 | // latency. If you want to suppress the suggestions for the UX improment, | |
945 | // you may want to use suppress_suggestion in the Context message. | |
946 | optional bool request_suggestion = 14 [default = true]; | |
947 | }; | |
948 | ||
949 | ||
950 | // Result contains data to be submitted to the host application by the | |
951 | // ime client. | |
952 | message Result { | |
953 | enum ResultType { | |
954 | NONE = 0; | |
955 | STRING = 1; | |
956 | }; | |
957 | required ResultType type = 1; | |
958 | // The result of conversion. | |
959 | required string value = 2; | |
960 | ||
961 | // Source of the value. It is almost always the reading of the value. | |
962 | optional string key = 3; | |
963 | ||
964 | // The caret position after the result submission. | |
965 | // "0" means the end of the result, and a positive value means moving forward | |
966 | // and a negative value backward. | |
967 | // e.g.) "-s", where s is the length of value, means the caret position | |
968 | // after the committing should be the beginning of the committed value. | |
969 | optional int32 cursor_offset = 4 [default = 0]; | |
970 | }; | |
971 | ||
972 | ||
973 | // Preedit represents a composition data, which is rendered on the | |
974 | // host application by the ime client. On Japanese IME, the both | |
975 | // Preedit and Conversion statuses are represented by this message. | |
976 | message Preedit { | |
977 | required uint32 cursor = 1; | |
978 | // The string data of Preedit is separated into Segment messages | |
979 | // presenting the ime server's status. On Preedit status of | |
980 | // Japanese IME, there are up to three segments; left side chars of | |
981 | // cursor, forcused char, right side chars of cursor. On Conversion | |
982 | // status of Japanese IME, the messages literally represent the | |
983 | // segments of the conversion. | |
984 | repeated group Segment = 2 { | |
985 | enum Annotation { | |
986 | NONE = 0; | |
987 | UNDERLINE = 1; | |
988 | HIGHLIGHT = 2; | |
989 | }; | |
990 | required Annotation annotation = 3; | |
991 | required string value = 4; | |
992 | ||
993 | // The length of value in characters. This is NOT a number in | |
994 | // bytes or logical character units. So, the length of "abc" and | |
995 | // "あいう" should be 3, "ヴ" should be 1 and "ヴ" and "う゛" | |
996 | // should be 2. | |
997 | required uint32 value_length = 5; | |
998 | ||
999 | // Source of the value. It is almost always the reading of the value. | |
1000 | optional string key = 6; | |
1001 | }; | |
1002 | ||
1003 | // The position of the first segment whose annotation is 'HIGHLIGHT'. Not set | |
1004 | // if there are no such segments. | |
1005 | optional uint32 highlighted_position = 3; | |
1006 | }; | |
1007 | ||
1008 | ||
1009 | message Status { | |
1010 | // Whether IME is ON or OFF | |
1011 | optional bool activated = 1; | |
1012 | ||
1013 | // Visible composition mode when IME is activated. This mode may come from a | |
1014 | // temporary composition mode. See |comeback_mode|. | |
1015 | // TODO(yukawa): Rename this field to "visible_mode". | |
1016 | optional CompositionMode mode = 2; | |
1017 | ||
1018 | // True composition mode that is suitable for system global and permanent | |
1019 | // composition mode. When a temporary composition mode exists, | |
1020 | // |comeback_mode| can be different from |mode|. | |
1021 | // TODO(yukawa): Use more appropriate name. | |
1022 | optional CompositionMode comeback_mode = 3; | |
1023 | }; | |
1024 | ||
1025 | // This messsage contains which characters are to be deleted by client. | |
1026 | // E.g. if current composition and surrounding text are | |
1027 | // "この感じは漢字は" | |
1028 | // ^^^^^^ | |
1029 | // and we send DeletionRange with offset == -3 and length == 3, then they will | |
1030 | // be rendered like: | |
1031 | // "この漢字は" | |
1032 | // ^^^^^^ | |
1033 | message DeletionRange { | |
1034 | // Offset of start of range. | |
1035 | optional int32 offset = 1; | |
1036 | ||
1037 | // Length of the range. | |
1038 | optional int32 length = 2; | |
1039 | }; | |
1040 | ||
1041 | message Output { | |
1042 | optional uint64 id = 1; | |
1043 | ||
1044 | // This variable is going to be obsolete. | |
1045 | optional CompositionMode mode = 2; | |
1046 | ||
1047 | optional bool consumed = 3; | |
1048 | optional Result result = 4; | |
1049 | optional Preedit preedit = 5; | |
1050 | optional Candidates candidates = 6; | |
1051 | optional KeyEvent key = 7; | |
1052 | ||
1053 | // when URL is non empty, UI can open the page with a browser, | |
1054 | // after finishing the all rendering part. | |
1055 | // We are using this feature for bug-report system. | |
1056 | optional string url = 8; | |
1057 | ||
1058 | // Output config | |
1059 | optional mozc.config.Config config = 9; | |
1060 | ||
1061 | // PreeditMethod: this is the default input mode of the session. | |
1062 | // If the user's config is "kana-input", it returns KANA. Only | |
1063 | // CreateSession response will have this field. | |
1064 | enum PreeditMethod { | |
1065 | ASCII = 0; | |
1066 | KANA = 1; | |
1067 | }; | |
1068 | optional PreeditMethod preedit_method = 10 [default = ASCII]; | |
1069 | ||
1070 | // ErrorCode: | |
1071 | // if SessionHandler::EvalCommand() returns false, | |
1072 | // return output with error_code = SESSION_FAILURE; | |
1073 | enum ErrorCode { | |
1074 | SESSION_SUCCESS = 0; | |
1075 | SESSION_FAILURE = 1; | |
1076 | }; | |
1077 | optional ErrorCode error_code = 11 [ default = SESSION_SUCCESS ]; | |
1078 | ||
1079 | // The current IME status. | |
1080 | optional Status status = 13; | |
1081 | ||
1082 | // All flatten candidate words stored in 1D array. This value is | |
1083 | // filled only when the content is changed. | |
1084 | optional CandidateList all_candidate_words = 14; | |
1085 | ||
1086 | // Range of characters to be deleted by client. | |
1087 | optional DeletionRange deletion_range = 16; | |
1088 | ||
1089 | // if launch_tool_mode is set, MozcTool is supposed to be launched | |
1090 | // by client. | |
1091 | enum ToolMode { | |
1092 | NO_TOOL = 0; // no need to launch tool | |
1093 | CONFIG_DIALOG = 1; | |
1094 | DICTIONARY_TOOL = 2; | |
1095 | WORD_REGISTER_DIALOG = 3; | |
1096 | }; | |
1097 | optional ToolMode launch_tool_mode = 17 [ default = NO_TOOL ]; | |
1098 | ||
1099 | // Callback request to the client. | |
1100 | message Callback { | |
1101 | // Callback command to be sent from the client to the server. The | |
1102 | // optional values such as id and composition_mode can be modified | |
1103 | // or added by the client. | |
1104 | optional SessionCommand session_command = 1; | |
1105 | ||
1106 | // Callback command should be sent after this delay. | |
1107 | optional uint32 delay_millisec = 2; | |
1108 | }; | |
1109 | optional Callback callback = 18; | |
1110 | ||
1111 | // Used when the command is READ_ALL_FROM_STORAGE. | |
1112 | optional GenericStorageEntry storage_entry = 19; | |
1113 | ||
1114 | optional mozc.user_dictionary.UserDictionaryCommandStatus | |
1115 | user_dictionary_command_status = 21; | |
1116 | }; | |
1117 | ||
1118 | message Command { | |
1119 | required Input input = 1; | |
1120 | required Output output = 2; | |
1121 | }; | |
1122 | ||
1123 | message CommandList { | |
1124 | // This message is used for unittest. | |
1125 | repeated Command commands = 1; | |
1126 | }; |
31 | 31 | |
32 | 32 | #include "base/port.h" |
33 | 33 | #include "base/scoped_ptr.h" |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | |
36 | 36 | namespace mozc { |
37 | 37 |
33 | 33 | #include "base/system_util.h" |
34 | 34 | #include "config/config.pb.h" |
35 | 35 | #include "config/config_handler.h" |
36 | #include "session/commands.pb.h" | |
36 | #include "protocol/commands.pb.h" | |
37 | 37 | #include "session/internal/keymap.h" |
38 | 38 | #include "session/key_parser.h" |
39 | 39 | #include "testing/base/public/googletest.h" |
34 | 34 | |
35 | 35 | #include "base/port.h" |
36 | 36 | #include "base/scoped_ptr.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | |
39 | 39 | namespace mozc { |
40 | 40 |
36 | 36 | #include "converter/converter_interface.h" |
37 | 37 | #include "converter/converter_mock.h" |
38 | 38 | #include "engine/mock_converter_engine.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "session/session_converter.h" |
41 | 41 | #include "testing/base/public/googletest.h" |
42 | 42 | #include "testing/base/public/gunit.h" |
36 | 36 | #include "base/util.h" |
37 | 37 | #include "config/config.pb.h" |
38 | 38 | #include "config/config_handler.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "session/key_event_util.h" |
41 | 41 | |
42 | 42 | namespace mozc { |
38 | 38 | #include "base/port.h" |
39 | 39 | #include "base/singleton.h" |
40 | 40 | #include "config/config.pb.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | |
43 | 43 | namespace mozc { |
44 | 44 | namespace session { |
31 | 31 | #include "base/port.h" |
32 | 32 | #include "base/singleton.h" |
33 | 33 | #include "config/config.pb.h" |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | |
36 | 36 | #include "testing/base/public/gunit.h" |
37 | 37 |
43 | 43 | #include "base/util.h" |
44 | 44 | #include "config/config.pb.h" |
45 | 45 | #include "config/config_handler.h" |
46 | #include "session/commands.pb.h" | |
46 | #include "protocol/commands.pb.h" | |
47 | 47 | #include "session/internal/keymap-inl.h" |
48 | 48 | #include "session/key_event_util.h" |
49 | 49 | #include "session/key_parser.h" |
32 | 32 | |
33 | 33 | #include "config/config.pb.h" |
34 | 34 | #include "config/config_handler.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "session/internal/keymap.h" |
37 | 37 | #include "session/key_parser.h" |
38 | 38 | #include "testing/base/public/gunit.h" |
35 | 35 | #include "base/system_util.h" |
36 | 36 | #include "config/config.pb.h" |
37 | 37 | #include "config/config_handler.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | #include "session/internal/keymap.h" |
40 | 40 | #include "session/internal/keymap-inl.h" |
41 | 41 | #include "session/internal/keymap_factory.h" |
34 | 34 | #include <string> |
35 | 35 | |
36 | 36 | #include "base/port.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | |
39 | 39 | namespace mozc { |
40 | 40 |
34 | 34 | #include "base/text_normalizer.h" |
35 | 35 | #include "base/util.h" |
36 | 36 | #include "converter/segments.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "session/internal/candidate_list.h" |
39 | 39 | #include "testing/base/public/gunit.h" |
40 | 40 |
32 | 32 | |
33 | 33 | #include "base/logging.h" |
34 | 34 | #include "base/port.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | |
37 | 37 | namespace mozc { |
38 | 38 | using commands::KeyEvent; |
30 | 30 | |
31 | 31 | #include "base/number_util.h" |
32 | 32 | #include "base/util.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | #include "session/key_parser.h" |
35 | 35 | #include "testing/base/public/gunit.h" |
36 | 36 |
39 | 39 | #include "base/util.h" |
40 | 40 | #include "config/config.pb.h" |
41 | 41 | #include "config/config_handler.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "session/internal/keymap.h" |
44 | 44 | #include "session/key_parser.h" |
45 | 45 |
30 | 30 | |
31 | 31 | #include "config/config.pb.h" |
32 | 32 | #include "config/config_handler.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | #include "session/key_parser.h" |
35 | 35 | #include "testing/base/public/googletest.h" |
36 | 36 | #include "testing/base/public/gunit.h" |
39 | 39 | #include "base/port.h" |
40 | 40 | #include "base/singleton.h" |
41 | 41 | #include "base/util.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | |
44 | 44 | namespace mozc { |
45 | 45 | using commands::KeyEvent; |
32 | 32 | #include <utility> |
33 | 33 | |
34 | 34 | #include "base/port.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "session/key_event_util.h" |
37 | 37 | #include "testing/base/public/gunit.h" |
38 | 38 |
30 | 30 | |
31 | 31 | #include "base/logging.h" |
32 | 32 | #include "base/port.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | |
35 | 35 | namespace mozc { |
36 | 36 |
29 | 29 | #include "session/output_util.h" |
30 | 30 | |
31 | 31 | #include "base/port.h" |
32 | #include "session/commands.pb.h" | |
32 | #include "protocol/commands.pb.h" | |
33 | 33 | #include "testing/base/public/googletest.h" |
34 | 34 | #include "testing/base/public/gunit.h" |
35 | 35 |
35 | 35 | #include "base/mutex.h" |
36 | 36 | #include "base/port.h" |
37 | 37 | #include "base/util.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | |
40 | 40 | namespace mozc { |
41 | 41 | namespace session { |
31 | 31 | |
32 | 32 | #include <vector> |
33 | 33 | #include "base/port.h" |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | |
36 | 36 | namespace mozc { |
37 | 37 | namespace session { |
31 | 31 | #include <string> |
32 | 32 | #include <vector> |
33 | 33 | |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | #include "testing/base/public/gunit.h" |
36 | 36 | |
37 | 37 | namespace mozc { |
30 | 30 | |
31 | 31 | #include "session/request_test_util.h" |
32 | 32 | |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | |
35 | 35 | namespace mozc { |
36 | 36 | namespace commands { |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "session/commands.pb.h" | |
29 | #include "protocol/commands.pb.h" | |
30 | 30 | #include "session/request_test_util.h" |
31 | 31 | #include "testing/base/public/gunit.h" |
32 | 32 |
46 | 46 | #include "config/config_handler.h" |
47 | 47 | #include "engine/engine_interface.h" |
48 | 48 | #include "engine/user_data_manager_interface.h" |
49 | #include "session/commands.pb.h" | |
49 | #include "protocol/commands.pb.h" | |
50 | 50 | #include "session/internal/ime_context.h" |
51 | 51 | #include "session/internal/key_event_transformer.h" |
52 | 52 | #include "session/internal/keymap-inl.h" |
44 | 44 | '../config/config.gyp:config_handler', |
45 | 45 | '../config/config.gyp:config_protocol', |
46 | 46 | '../converter/converter_base.gyp:converter_util', |
47 | '../protocol/protocol.gyp:commands_proto', | |
47 | 48 | '../transliteration/transliteration.gyp:transliteration', |
48 | 49 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
49 | 50 | 'session_base.gyp:key_parser', |
50 | 51 | 'session_base.gyp:keymap', |
51 | 52 | 'session_base.gyp:keymap_factory', |
52 | 'session_base.gyp:session_protocol', | |
53 | 53 | 'session_base.gyp:session_usage_stats_util', |
54 | 54 | 'session_internal', |
55 | 55 | ], |
69 | 69 | '../composer/composer.gyp:composer', |
70 | 70 | '../config/config.gyp:config_handler', |
71 | 71 | '../config/config.gyp:config_protocol', |
72 | 'session_base.gyp:session_protocol', | |
72 | '../protocol/protocol.gyp:commands_proto', | |
73 | 73 | ], |
74 | 74 | }, |
75 | 75 | { |
90 | 90 | '../dictionary/dictionary_base.gyp:user_dictionary', |
91 | 91 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
92 | 92 | 'session_base.gyp:generic_storage_manager', |
93 | 'session_base.gyp:session_protocol', | |
93 | '../protocol/protocol.gyp:commands_proto', | |
94 | 94 | ], |
95 | 95 | 'conditions': [ |
96 | 96 | ['(target_platform=="NaCl" and _toolset=="target") or target_platform=="Android"', { |
115 | 115 | '../config/config.gyp:stats_config_util', |
116 | 116 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
117 | 117 | '../usage_stats/usage_stats_base.gyp:usage_stats_protocol', |
118 | 'session_base.gyp:session_protocol', | |
118 | 'session_base.gyp:state_proto', | |
119 | 119 | ], |
120 | 120 | }, |
121 | 121 | { |
130 | 130 | # dependency list you will have to update Android's. |
131 | 131 | '../base/base.gyp:base', |
132 | 132 | '../usage_stats/usage_stats.gyp:usage_stats_uploader', |
133 | 'session_base.gyp:session_protocol', | |
133 | '../protocol/protocol.gyp:commands_proto', | |
134 | 134 | 'session_handler', |
135 | 135 | 'session_usage_observer', |
136 | 136 | ], |
144 | 144 | ], |
145 | 145 | 'dependencies': [ |
146 | 146 | '../config/config.gyp:config_protocol', |
147 | '../protocol/protocol.gyp:commands_proto', | |
147 | 148 | 'gen_session_stress_test_data#host', |
148 | 149 | 'session', |
149 | 'session_base.gyp:session_protocol', | |
150 | 150 | ], |
151 | 151 | }, |
152 | 152 | { |
43 | 43 | ], |
44 | 44 | 'dependencies': [ |
45 | 45 | '../config/config.gyp:config_protocol', |
46 | 'session_protocol', | |
46 | '../protocol/protocol.gyp:commands_proto', | |
47 | 47 | ], |
48 | 48 | }, |
49 | 49 | { |
55 | 55 | 'dependencies': [ |
56 | 56 | '../base/base.gyp:base', |
57 | 57 | '../config/config.gyp:config_protocol', |
58 | 'session_protocol', | |
58 | '../protocol/protocol.gyp:commands_proto', | |
59 | 59 | ], |
60 | 60 | }, |
61 | 61 | { |
68 | 68 | '../base/base.gyp:base', |
69 | 69 | '../config/config.gyp:config_handler', |
70 | 70 | '../config/config.gyp:config_protocol', |
71 | '../protocol/protocol.gyp:commands_proto', | |
71 | 72 | 'key_event_util', |
72 | 73 | 'key_parser', |
73 | 'session_protocol', | |
74 | 74 | ], |
75 | 75 | }, |
76 | 76 | { |
82 | 82 | 'dependencies': [ |
83 | 83 | '../base/base.gyp:base', |
84 | 84 | '../config/config.gyp:config_protocol', |
85 | '../protocol/protocol.gyp:commands_proto', | |
85 | 86 | 'keymap', |
86 | 'session_protocol', | |
87 | 87 | ], |
88 | 88 | }, |
89 | 89 | { |
96 | 96 | '../base/base.gyp:base', |
97 | 97 | '../config/config.gyp:config_handler', |
98 | 98 | '../config/config.gyp:config_protocol', |
99 | '../protocol/protocol.gyp:commands_proto', | |
99 | 100 | 'key_info_util', |
100 | 'session_protocol', | |
101 | 101 | ], |
102 | 102 | }, |
103 | 103 | { |
108 | 108 | ], |
109 | 109 | 'dependencies': [ |
110 | 110 | '../base/base.gyp:base', |
111 | 'session_protocol', | |
111 | '../protocol/protocol.gyp:commands_proto', | |
112 | 112 | ], |
113 | 113 | }, |
114 | 114 | { |
122 | 122 | '../base/base.gyp:config_file_stream', |
123 | 123 | '../config/config.gyp:config_handler', |
124 | 124 | '../config/config.gyp:config_protocol', |
125 | '../protocol/protocol.gyp:commands_proto', | |
125 | 126 | 'key_event_util', |
126 | 127 | 'key_parser', |
127 | 128 | 'keymap', |
128 | 'session_protocol', | |
129 | 129 | ], |
130 | 130 | }, |
131 | 131 | { |
136 | 136 | ], |
137 | 137 | 'dependencies': [ |
138 | 138 | '../base/base.gyp:base', |
139 | 'session_protocol', | |
139 | '../protocol/protocol.gyp:commands_proto', | |
140 | 140 | ], |
141 | 141 | }, |
142 | 142 | { |
148 | 148 | 'dependencies': [ |
149 | 149 | '../base/base.gyp:base', |
150 | 150 | '../protobuf/protobuf.gyp:protobuf', |
151 | '../protocol/protocol.gyp:commands_proto', | |
151 | 152 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
152 | 'session_protocol', | |
153 | 153 | ], |
154 | 154 | }, |
155 | 155 | { |
161 | 161 | 'dependencies': [ |
162 | 162 | '../base/base.gyp:base', |
163 | 163 | '../base/base.gyp:config_file_stream', |
164 | '../protocol/protocol.gyp:commands_proto', | |
164 | 165 | '../storage/storage.gyp:storage', |
165 | 'session_protocol', | |
166 | 166 | ] |
167 | 167 | }, |
168 | 168 | { |
169 | 'target_name': 'genproto_session', | |
169 | 'target_name': 'genproto_state_proto', | |
170 | 170 | 'type': 'none', |
171 | 171 | 'toolsets': ['host'], |
172 | 172 | 'sources': [ |
173 | 'candidates.proto', | |
174 | 'commands.proto', | |
175 | 173 | 'state.proto', |
176 | 174 | ], |
177 | 175 | 'includes': [ |
178 | 176 | '../protobuf/genproto.gypi', |
179 | 177 | ], |
180 | 178 | 'dependencies': [ |
181 | '../config/config.gyp:genproto_config', | |
182 | '../dictionary/dictionary_base.gyp:genproto_dictionary', | |
183 | ], | |
184 | }, | |
185 | { | |
186 | 'target_name': 'session_protocol', | |
179 | '../protocol/protocol.gyp:genproto_candidates_proto', | |
180 | '../protocol/protocol.gyp:genproto_commands_proto', | |
181 | ], | |
182 | }, | |
183 | { | |
184 | 'target_name': 'state_proto', | |
187 | 185 | 'type': 'static_library', |
188 | 186 | 'hard_dependency': 1, |
189 | 187 | 'sources': [ |
190 | '<(proto_out_dir)/<(relative_dir)/candidates.pb.cc', | |
191 | '<(proto_out_dir)/<(relative_dir)/commands.pb.cc', | |
192 | 188 | '<(proto_out_dir)/<(relative_dir)/state.pb.cc', |
193 | 189 | ], |
194 | 190 | 'dependencies': [ |
195 | '../config/config.gyp:config_protocol', | |
196 | 191 | '../protobuf/protobuf.gyp:protobuf', |
197 | '../dictionary/dictionary_base.gyp:dictionary_protocol', | |
198 | 'genproto_session#host', | |
192 | '../protocol/protocol.gyp:candidates_proto', | |
193 | '../protocol/protocol.gyp:commands_proto', | |
194 | 'genproto_state_proto#host', | |
199 | 195 | ], |
200 | 196 | 'export_dependent_settings': [ |
201 | 'genproto_session#host', | |
197 | 'genproto_state_proto#host', | |
202 | 198 | ], |
203 | 199 | }, |
204 | 200 | ], |
38 | 38 | #include "base/util.h" |
39 | 39 | #include "engine/engine_factory.h" |
40 | 40 | #include "engine/engine_interface.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "session/key_parser.h" |
43 | 43 | #include "session/session.h" |
44 | 44 |
44 | 44 | #include "converter/converter_interface.h" |
45 | 45 | #include "converter/converter_util.h" |
46 | 46 | #include "converter/segments.h" |
47 | #include "session/commands.pb.h" | |
47 | #include "protocol/commands.pb.h" | |
48 | 48 | #include "session/internal/candidate_list.h" |
49 | 49 | #include "session/internal/session_output.h" |
50 | 50 | #include "session/session_usage_stats_util.h" |
39 | 39 | #include "config/config_handler.h" |
40 | 40 | #include "engine/engine_interface.h" |
41 | 41 | #include "engine/mock_data_engine_factory.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "testing/base/public/googletest.h" |
44 | 44 | #include "testing/base/public/gunit.h" |
45 | 45 |
48 | 48 | #include "config/config_handler.h" |
49 | 49 | #include "converter/converter_mock.h" |
50 | 50 | #include "converter/segments.h" |
51 | #include "session/candidates.pb.h" | |
52 | #include "session/commands.pb.h" | |
51 | #include "protocol/candidates.pb.h" | |
52 | #include "protocol/commands.pb.h" | |
53 | 53 | #include "session/internal/candidate_list.h" |
54 | 54 | #include "session/internal/keymap.h" |
55 | 55 | #include "session/request_test_util.h" |
49 | 49 | #include "dictionary/user_dictionary_storage.pb.h" |
50 | 50 | #include "engine/engine_interface.h" |
51 | 51 | #include "engine/user_data_manager_interface.h" |
52 | #include "session/commands.pb.h" | |
52 | #include "protocol/commands.pb.h" | |
53 | 53 | #include "session/generic_storage_manager.h" |
54 | 54 | #include "session/session.h" |
55 | 55 | #include "session/session_observer_handler.h" |
40 | 40 | #include "converter/converter_interface.h" |
41 | 41 | #include "engine/mock_data_engine_factory.h" |
42 | 42 | #include "engine/user_data_manager_interface.h" |
43 | #include "session/commands.pb.h" | |
43 | #include "protocol/commands.pb.h" | |
44 | 44 | #include "session/key_parser.h" |
45 | 45 | #include "session/request_test_util.h" |
46 | 46 | #include "session/session_handler_test_util.h" |
36 | 36 | #include "base/port.h" |
37 | 37 | #include "base/scoped_ptr.h" |
38 | 38 | #include "engine/engine_factory.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "session/random_keyevents_generator.h" |
41 | 41 | #include "session/session_handler_test_util.h" |
42 | 42 | #include "testing/base/public/gunit.h" |
39 | 39 | #include "engine/mock_converter_engine.h" |
40 | 40 | #include "engine/mock_data_engine_factory.h" |
41 | 41 | #include "engine/user_data_manager_mock.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "session/generic_storage_manager.h" |
44 | 44 | #include "session/session_handler.h" |
45 | 45 | #include "session/session_handler_test_util.h" |
36 | 36 | #include "converter/converter_interface.h" |
37 | 37 | #include "engine/engine_interface.h" |
38 | 38 | #include "prediction/user_history_predictor.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "session/session_handler.h" |
41 | 41 | #include "session/session_handler_interface.h" |
42 | 42 | #include "session/session_usage_observer.h" |
35 | 35 | #include "base/port.h" |
36 | 36 | #include "base/scoped_ptr.h" |
37 | 37 | #include "config/config.pb.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | #include "testing/base/public/gunit.h" |
40 | 40 | #include "usage_stats/usage_stats_testing_util.h" |
41 | 41 |
26 | 26 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | #include "session/commands.pb.h" | |
29 | #include "protocol/commands.pb.h" | |
30 | 30 | #include "session/session_observer_handler.h" |
31 | 31 | #include "session/session_observer_interface.h" |
32 | 32 | #include "testing/base/public/gunit.h" |
41 | 41 | #include "converter/segments.h" |
42 | 42 | #include "engine/engine_factory.h" |
43 | 43 | #include "rewriter/rewriter_interface.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/candidates.pb.h" | |
45 | #include "protocol/commands.pb.h" | |
45 | 46 | #include "session/internal/ime_context.h" |
46 | 47 | #include "session/internal/keymap.h" |
47 | 48 | #include "session/key_parser.h" |
48 | #include "session/candidates.pb.h" | |
49 | 49 | #include "session/session.h" |
50 | 50 | #include "session/session_converter_interface.h" |
51 | 51 | #include "session/session_handler.h" |
38 | 38 | #include "engine/engine_factory.h" |
39 | 39 | #include "ipc/ipc.h" |
40 | 40 | #include "ipc/named_event.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "session/session_handler.h" |
43 | 43 | #include "session/session_usage_observer.h" |
44 | 44 | #include "usage_stats/usage_stats_uploader.h" |
29 | 29 | // Mocked Session Server runner used just for testing. |
30 | 30 | #include <stdio.h> |
31 | 31 | |
32 | #include "protocol/commands.pb.h" | |
32 | 33 | #include "session/session_server.h" |
33 | #include "session/commands.pb.h" | |
34 | 34 | |
35 | 35 | static const int kMaxBufSize = 1024; |
36 | 36 |
45 | 45 | #include "engine/engine_interface.h" |
46 | 46 | #include "engine/mock_converter_engine.h" |
47 | 47 | #include "engine/mock_data_engine_factory.h" |
48 | #include "protocol/candidates.pb.h" | |
49 | #include "protocol/commands.pb.h" | |
48 | 50 | #include "rewriter/transliteration_rewriter.h" |
49 | #include "session/candidates.pb.h" | |
50 | #include "session/commands.pb.h" | |
51 | 51 | #include "session/internal/ime_context.h" |
52 | 52 | #include "session/internal/keymap.h" |
53 | 53 | #include "session/key_parser.h" |
44 | 44 | '../config/config.gyp:config_protocol', |
45 | 45 | '../engine/engine.gyp:engine_factory', |
46 | 46 | '../engine/engine.gyp:mock_data_engine_factory', |
47 | '../protocol/protocol.gyp:commands_proto', | |
47 | 48 | '../testing/testing.gyp:testing', |
48 | 49 | '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util', |
49 | 50 | 'session.gyp:session', |
50 | 51 | 'session.gyp:session_handler', |
51 | 52 | 'session.gyp:session_usage_observer', |
52 | 'session_base.gyp:session_protocol', | |
53 | 53 | ], |
54 | 54 | }, |
55 | 55 | { |
160 | 160 | '../client/client.gyp:client_mock', |
161 | 161 | '../config/config.gyp:config_handler', |
162 | 162 | '../config/config.gyp:stats_config_util', |
163 | '../protocol/protocol.gyp:commands_proto', | |
163 | 164 | '../testing/testing.gyp:gtest_main', |
164 | 165 | '../usage_stats/usage_stats_base.gyp:usage_stats', |
165 | 166 | '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util', |
168 | 169 | 'session_base.gyp:keymap', |
169 | 170 | 'session_base.gyp:keymap_factory', |
170 | 171 | 'session_base.gyp:output_util', |
171 | 'session_base.gyp:session_protocol', | |
172 | 172 | 'session_base.gyp:session_usage_stats_util', |
173 | 173 | ], |
174 | 174 | 'conditions': [ |
194 | 194 | 'dependencies': [ |
195 | 195 | '../base/base.gyp:base', |
196 | 196 | '../config/config.gyp:config_handler', |
197 | '../protocol/protocol.gyp:commands_proto', | |
197 | 198 | '../testing/testing.gyp:gtest_main', |
198 | 199 | 'session_base.gyp:ime_switch_util', |
199 | 200 | 'session_base.gyp:key_event_util', |
200 | 201 | 'session_base.gyp:key_parser', |
201 | 'session_base.gyp:session_protocol', | |
202 | 202 | ], |
203 | 203 | 'variables': { |
204 | 204 | 'test_size': 'small', |
223 | 223 | '../testing/testing.gyp:gtest_main', |
224 | 224 | '../testing/testing.gyp:testing_util', |
225 | 225 | 'session.gyp:session', |
226 | 'session_base.gyp:session_protocol', | |
226 | '../protocol/protocol.gyp:commands_proto', | |
227 | 227 | ], |
228 | 228 | 'variables': { |
229 | 229 | 'test_size': 'small', |
254 | 254 | 'random_keyevents_generator_test.cc', |
255 | 255 | ], |
256 | 256 | 'dependencies': [ |
257 | '../protocol/protocol.gyp:commands_proto', | |
257 | 258 | '../testing/testing.gyp:gtest_main', |
258 | 259 | 'session.gyp:random_keyevents_generator', |
259 | 'session_base.gyp:session_protocol', | |
260 | 260 | ], |
261 | 261 | 'variables': { |
262 | 262 | 'test_size': 'large', |
317 | 317 | '../base/base.gyp:base', |
318 | 318 | '../data/test/session/scenario/scenario.gyp:install_session_handler_scenario_test_data', |
319 | 319 | '../data/test/session/scenario/usage_stats/usage_stats.gyp:install_session_handler_usage_stats_scenario_test_data', |
320 | '../protocol/protocol.gyp:commands_proto', | |
320 | 321 | '../testing/testing.gyp:gtest_main', |
321 | 322 | '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util', |
322 | 323 | 'session.gyp:session_handler', |
323 | 324 | 'session_base.gyp:request_test_util', |
324 | 'session_base.gyp:session_protocol', | |
325 | 325 | 'session_handler_test_util', |
326 | 326 | ], |
327 | 327 | 'variables': { |
41 | 41 | #include "base/singleton.h" |
42 | 42 | #include "base/util.h" |
43 | 43 | #include "config/stats_config_util.h" |
44 | #include "session/commands.pb.h" | |
44 | #include "protocol/commands.pb.h" | |
45 | 45 | #include "session/state.pb.h" |
46 | 46 | #include "usage_stats/usage_stats.h" |
47 | 47 | #include "usage_stats/usage_stats.pb.h" |
38 | 38 | #include "base/util.h" |
39 | 39 | #include "config/stats_config_util.h" |
40 | 40 | #include "config/stats_config_util_mock.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "testing/base/public/googletest.h" |
43 | 43 | #include "testing/base/public/gunit.h" |
44 | 44 | #include "usage_stats/usage_stats.h" |
35 | 35 | #include "base/protobuf/descriptor.h" |
36 | 36 | #include "base/protobuf/message.h" |
37 | 37 | #include "base/util.h" |
38 | #include "session/commands.pb.h" | |
38 | #include "protocol/commands.pb.h" | |
39 | 39 | #include "usage_stats/usage_stats.h" |
40 | 40 | |
41 | 41 | using mozc::commands::Command; |
28 | 28 | |
29 | 29 | #include "session/session_usage_stats_util.h" |
30 | 30 | |
31 | #include "session/commands.pb.h" | |
31 | #include "protocol/commands.pb.h" | |
32 | 32 | #include "session/key_parser.h" |
33 | 33 | #include "testing/base/public/gunit.h" |
34 | 34 | #include "usage_stats/usage_stats.h" |
36 | 36 | #include "base/mutex.h" |
37 | 37 | #include "base/util.h" |
38 | 38 | #include "client/client_mock.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "testing/base/public/gunit.h" |
41 | 41 | #include "testing/base/public/googletest.h" |
42 | 42 |
29 | 29 | // Protocol messages for session state |
30 | 30 | syntax = "proto2"; |
31 | 31 | |
32 | import "session/candidates.proto"; | |
33 | import "session/commands.proto"; | |
32 | import "protocol/candidates.proto"; | |
33 | import "protocol/commands.proto"; | |
34 | 34 | |
35 | 35 | package mozc.session; |
36 | 36 |
42 | 42 | '../../config/config.gyp:config_handler', |
43 | 43 | '../../config/config.gyp:config_protocol', |
44 | 44 | '../../ipc/ipc.gyp:ipc', |
45 | '../../session/session_base.gyp:session_protocol', | |
45 | '../../protocol/protocol.gyp:commands_proto', | |
46 | 46 | 'mozc_emacs_helper_lib', |
47 | 47 | ], |
48 | 48 | }, |
57 | 57 | '../../base/base.gyp:base', |
58 | 58 | '../../client/client.gyp:client', |
59 | 59 | '../../config/config.gyp:config_protocol', |
60 | '../../protocol/protocol.gyp:commands_proto', | |
60 | 61 | '../../session/session_base.gyp:key_parser', |
61 | '../../session/session_base.gyp:session_protocol', | |
62 | 62 | '../../storage/storage.gyp:storage', |
63 | 63 | ], |
64 | 64 | }, |
38 | 38 | #include "base/version.h" |
39 | 39 | #include "client/client.h" |
40 | 40 | #include "config/config_handler.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "unix/emacs/client_pool.h" |
43 | 43 | |
44 | 44 | DEFINE_bool(suppress_stderr, false, |
38 | 38 | #include "base/port.h" |
39 | 39 | #include "base/protobuf/descriptor.h" |
40 | 40 | #include "base/util.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "session/key_parser.h" |
43 | 43 | |
44 | 44 | namespace mozc { |
32 | 32 | |
33 | 33 | #include "base/protobuf/message.h" |
34 | 34 | #include "base/util.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "testing/base/public/googletest.h" |
37 | 37 | #include "testing/base/public/gunit.h" |
38 | 38 |
97 | 97 | ], |
98 | 98 | 'dependencies': [ |
99 | 99 | '../../base/base.gyp:base', |
100 | '../../session/session_base.gyp:session_protocol', | |
100 | '../../protocol/protocol.gyp:commands_proto', | |
101 | 101 | 'ibus_build_environment', |
102 | 102 | ], |
103 | 103 | }, |
108 | 108 | 'property_handler.cc', |
109 | 109 | ], |
110 | 110 | 'dependencies': [ |
111 | '../../session/session_base.gyp:session_protocol', | |
111 | '../../protocol/protocol.gyp:commands_proto', | |
112 | 112 | 'ibus_build_environment', |
113 | 113 | 'message_translator', |
114 | 114 | 'path_util', |
148 | 148 | ], |
149 | 149 | 'dependencies': [ |
150 | 150 | '../../client/client.gyp:client', |
151 | '../../protocol/protocol.gyp:commands_proto', | |
151 | 152 | '../../session/session_base.gyp:ime_switch_util', |
152 | '../../session/session_base.gyp:session_protocol', | |
153 | 153 | 'ibus_property_handler', |
154 | 154 | 'message_translator', |
155 | 155 | 'path_util', |
216 | 216 | '../../base/base.gyp:base', |
217 | 217 | '../../client/client.gyp:client', |
218 | 218 | '../../client/client.gyp:client_mock', |
219 | '../../protocol/protocol.gyp:commands_proto', | |
219 | 220 | '../../session/session_base.gyp:key_event_util', |
220 | '../../session/session_base.gyp:session_protocol', | |
221 | 221 | '../../testing/testing.gyp:gtest_main', |
222 | 222 | 'ibus_mozc_lib', |
223 | 223 | 'ibus_mozc_metadata', |
32 | 32 | #include <cstdlib> |
33 | 33 | |
34 | 34 | #include "base/logging.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "unix/ibus/mozc_engine_property.h" |
37 | 37 | |
38 | 38 | namespace mozc { |
34 | 34 | |
35 | 35 | #include "base/port.h" |
36 | 36 | #include "config/config.pb.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "unix/ibus/key_translator.h" |
39 | 39 | |
40 | 40 | namespace mozc { |
34 | 34 | #include "base/port.h" |
35 | 35 | #include "base/util.h" |
36 | 36 | #include "config/config.pb.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "session/key_event_util.h" |
39 | 39 | #include "testing/base/public/gunit.h" |
40 | 40 |
32 | 32 | #include <map> |
33 | 33 | |
34 | 34 | #include "base/port.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "unix/ibus/ibus_header.h" |
37 | 37 | |
38 | 38 | namespace mozc { |
31 | 31 | #include <memory> |
32 | 32 | #include <set> |
33 | 33 | |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | #include "testing/base/public/gunit.h" |
36 | 36 | |
37 | 37 | namespace mozc { |
46 | 46 | #include "base/util.h" |
47 | 47 | #include "client/client.h" |
48 | 48 | #include "config/config.pb.h" |
49 | #include "session/commands.pb.h" | |
49 | #include "protocol/commands.pb.h" | |
50 | 50 | #include "session/ime_switch_util.h" |
51 | 51 | #include "unix/ibus/engine_registrar.h" |
52 | 52 | #include "unix/ibus/ibus_candidate_window_handler.h" |
34 | 34 | #include <vector> |
35 | 35 | |
36 | 36 | #include "base/port.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "testing/base/public/gunit_prod.h" |
39 | 39 | #include "unix/ibus/engine_interface.h" |
40 | 40 |
29 | 29 | #include "unix/ibus/mozc_engine_property.h" |
30 | 30 | |
31 | 31 | #include "base/port.h" |
32 | #include "session/commands.pb.h" | |
32 | #include "protocol/commands.pb.h" | |
33 | 33 | |
34 | 34 | namespace mozc { |
35 | 35 | namespace ibus { |
29 | 29 | #ifndef MOZC_UNIX_IBUS_MOZC_ENGINE_PROPERTY_H_ |
30 | 30 | #define MOZC_UNIX_IBUS_MOZC_ENGINE_PROPERTY_H_ |
31 | 31 | |
32 | #include "session/commands.pb.h" | |
32 | #include "protocol/commands.pb.h" | |
33 | 33 | |
34 | 34 | namespace mozc { |
35 | 35 | namespace ibus { |
32 | 32 | |
33 | 33 | #include "base/port.h" |
34 | 34 | #include "client/client_mock.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "testing/base/public/gunit.h" |
37 | 37 | |
38 | 38 | using std::unique_ptr; |
31 | 31 | #include <string> |
32 | 32 | |
33 | 33 | #include "base/logging.h" |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | |
36 | 36 | namespace mozc { |
37 | 37 | namespace ibus { |
31 | 31 | |
32 | 32 | #include "base/port.h" |
33 | 33 | // TODO(nona): remove this header. |
34 | #include "session/commands.pb.h" // For CompositionMode | |
34 | #include "protocol/commands.pb.h" // For CompositionMode | |
35 | 35 | |
36 | 36 | namespace mozc { |
37 | 37 | namespace ibus { |
36 | 36 | #include "base/util.h" |
37 | 37 | #include "config/config.pb.h" |
38 | 38 | #include "config/config_handler.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "testing/base/public/gunit.h" |
41 | 41 | #include "usage_stats/usage_stats.h" |
42 | 42 | #include "usage_stats/usage_stats_testing_util.h" |
34 | 34 | #include <Windows.h> // for DWORD |
35 | 35 | |
36 | 36 | #include "base/port.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | |
39 | 39 | namespace mozc { |
40 | 40 | namespace win32 { |
31 | 31 | #include <imm.h> |
32 | 32 | #endif // OS_WIN |
33 | 33 | |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | #include "testing/base/public/googletest.h" |
36 | 36 | #include "testing/base/public/gunit.h" |
37 | 37 | #include "win32/base/conversion_mode_util.h" |
32 | 32 | #include <vector> |
33 | 33 | |
34 | 34 | #include "base/logging.h" |
35 | #include "session/commands.pb.h" | |
35 | #include "protocol/commands.pb.h" | |
36 | 36 | #include "win32/base/input_state.h" |
37 | 37 | #include "win32/base/keyboard.h" |
38 | 38 |
29 | 29 | #include "testing/base/public/googletest.h" |
30 | 30 | #include "testing/base/public/gunit.h" |
31 | 31 | |
32 | #include "session/commands.pb.h" | |
32 | #include "protocol/commands.pb.h" | |
33 | 33 | #include "win32/base/deleter.h" |
34 | 34 | #include "win32/base/input_state.h" |
35 | 35 | #include "win32/base/keyboard.h" |
38 | 38 | #include "base/util.h" |
39 | 39 | #include "client/client_interface.h" |
40 | 40 | #include "config/config_handler.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "session/key_info_util.h" |
43 | 43 | #include "win32/base/conversion_mode_util.h" |
44 | 44 | #include "win32/base/input_state.h" |
39 | 39 | #include "client/client_interface.h" |
40 | 40 | #include "config/config_handler.h" |
41 | 41 | #include "ipc/ipc_mock.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "testing/base/public/googletest.h" |
44 | 44 | #include "testing/base/public/gunit.h" |
45 | 45 | #include "win32/base/input_state.h" |
31 | 31 | #include <memory> |
32 | 32 | |
33 | 33 | #include "base/util.h" |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | |
36 | 36 | namespace mozc { |
37 | 37 | namespace win32 { |
27 | 27 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | 28 | |
29 | 29 | #include <string> |
30 | #include "session/commands.pb.h" | |
30 | #include "protocol/commands.pb.h" | |
31 | 31 | #include "testing/base/public/googletest.h" |
32 | 32 | #include "testing/base/public/gunit.h" |
33 | 33 | #include "win32/base/string_util.h" |
90 | 90 | ], |
91 | 91 | 'dependencies': [ |
92 | 92 | '../../base/base.gyp:base', |
93 | '../../session/session_base.gyp:session_protocol', | |
93 | '../../protocol/protocol.gyp:commands_proto', | |
94 | 94 | '../../testing/testing.gyp:gtest_main', |
95 | 95 | 'imframework_util', |
96 | 96 | ], |
121 | 121 | '../../base/base.gyp:base', |
122 | 122 | '../../config/config.gyp:config_handler', |
123 | 123 | '../../config/config.gyp:config_protocol', |
124 | '../../protocol/protocol.gyp:commands_proto', | |
124 | 125 | '../../session/session_base.gyp:key_info_util', |
125 | '../../session/session_base.gyp:session_protocol', | |
126 | 126 | '../../session/session_base.gyp:output_util', |
127 | 127 | ], |
128 | 128 | 'link_settings': { |
180 | 180 | ], |
181 | 181 | 'dependencies': [ |
182 | 182 | '../../base/base.gyp:base', |
183 | '../../session/session_base.gyp:session_protocol', | |
183 | '../../protocol/protocol.gyp:commands_proto', | |
184 | 184 | '../../testing/testing.gyp:gtest_main', |
185 | 185 | 'ime_base', |
186 | 186 | ], |
47 | 47 | '../../client/client.gyp:client', |
48 | 48 | '../../config/config.gyp:config_protocol', |
49 | 49 | '../../config/config.gyp:stats_config_util', |
50 | '../../ipc/ipc.gyp:ipc', | |
51 | 50 | '../../renderer/renderer.gyp:renderer_client', |
52 | '../../session/session_base.gyp:session_protocol', | |
53 | 51 | '../base/win32_base.gyp:ime_base', |
54 | 52 | '../base/win32_base.gyp:win32_file_verifier', |
55 | 53 | 'gen_mozc_broker_resource_header', |
44 | 44 | #include "base/system_util.h" |
45 | 45 | #include "base/url.h" |
46 | 46 | #include "base/util.h" |
47 | #include "base/version.h" | |
47 | 48 | #include "base/win_util.h" |
48 | #include "base/version.h" | |
49 | 49 | #include "client/client_interface.h" |
50 | 50 | #include "config/stats_config_util.h" |
51 | #include "protocol/commands.pb.h" | |
51 | 52 | #include "renderer/renderer_client.h" |
52 | 53 | #include "server/cache_service_manager.h" |
53 | #include "session/commands.pb.h" | |
54 | 54 | #include "win32/base/imm_registrar.h" |
55 | 55 | #include "win32/base/imm_util.h" |
56 | 56 | #include "win32/base/keyboard_layout_id.h" |
58 | 58 | #include "win32/base/tsf_registrar.h" |
59 | 59 | #include "win32/base/uninstall_helper.h" |
60 | 60 | #include "win32/custom_action/resource.h" |
61 | ||
62 | 61 | |
63 | 62 | #ifdef _DEBUG |
64 | 63 | #define DEBUG_BREAK_FOR_DEBUGGER() \ |
118 | 118 | '../../config/config.gyp:config_handler', |
119 | 119 | '../../config/config.gyp:config_protocol', |
120 | 120 | '../../ipc/ipc.gyp:ipc', |
121 | '../../protocol/protocol.gyp:commands_proto', | |
121 | 122 | '../../renderer/renderer.gyp:renderer_protocol', |
122 | 123 | '../../renderer/renderer.gyp:win32_font_util', |
123 | 124 | '../../renderer/renderer.gyp:win32_renderer_client', |
124 | '../../session/session_base.gyp:session_protocol', | |
125 | 125 | '../base/win32_base.gyp:ime_base', |
126 | 126 | '../base/win32_base.gyp:ime_impl_base', |
127 | 127 | ], |
145 | 145 | '../../client/client.gyp:client', |
146 | 146 | '../../config/config.gyp:stats_config_util', |
147 | 147 | '../../ipc/ipc.gyp:ipc', |
148 | '../../session/session_base.gyp:session_protocol', | |
148 | '../../protocol/protocol.gyp:commands_proto', | |
149 | 149 | '../base/win32_base.gyp:ime_base', |
150 | 150 | '../base/win32_base.gyp:text_icon', |
151 | 151 | 'gen_mozc_ime_resource_header', |
37 | 37 | #include "google/protobuf/stubs/common.h" |
38 | 38 | #include "base/logging.h" |
39 | 39 | #include "base/util.h" |
40 | #include "session/commands.pb.h" | |
40 | #include "protocol/commands.pb.h" | |
41 | 41 | #include "win32/ime/ime_ui_window.h" |
42 | 42 | |
43 | 43 | namespace mozc { |
30 | 30 | #include "testing/base/public/gunit.h" |
31 | 31 | |
32 | 32 | #include "base/util.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | #include "win32/ime/ime_candidate_info.h" |
35 | 35 | |
36 | 36 | namespace mozc { |
34 | 34 | #include "google/protobuf/stubs/common.h" |
35 | 35 | #include "base/logging.h" |
36 | 36 | #include "base/util.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "win32/base/immdev.h" |
39 | 39 | #include "win32/base/string_util.h" |
40 | 40 | #include "win32/ime/ime_message_queue.h" |
30 | 30 | #include "testing/base/public/gunit.h" |
31 | 31 | |
32 | 32 | #include "base/util.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | #include "win32/ime/ime_composition_string.h" |
35 | 35 | |
36 | 36 | namespace mozc { |
37 | 37 | #include "base/util.h" |
38 | 38 | #include "client/client_interface.h" |
39 | 39 | #include "config/config_handler.h" |
40 | #include "session/commands.pb.h" | |
40 | #include "protocol/commands.pb.h" | |
41 | 41 | #include "session/output_util.h" |
42 | 42 | #include "win32/base/conversion_mode_util.h" |
43 | 43 | #include "win32/base/deleter.h" |
38 | 38 | #include "client/client.h" |
39 | 39 | #include "config/config_handler.h" |
40 | 40 | #include "ipc/ipc_mock.h" |
41 | #include "session/commands.pb.h" | |
41 | #include "protocol/commands.pb.h" | |
42 | 42 | #include "testing/base/public/googletest.h" |
43 | 43 | #include "testing/base/public/gunit.h" |
44 | 44 | #include "win32/base/input_state.h" |
36 | 36 | #include <atlbase.h> |
37 | 37 | |
38 | 38 | #include "base/port.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | |
41 | 41 | class ImeSystemLangBarMenu; |
42 | 42 | class ImeCandidateList; |
30 | 30 | |
31 | 31 | #include "base/run_level.h" |
32 | 32 | #include "client/client_interface.h" |
33 | #include "session/commands.pb.h" | |
33 | #include "protocol/commands.pb.h" | |
34 | 34 | #include "win32/base/config_snapshot.h" |
35 | 35 | #include "win32/base/deleter.h" |
36 | 36 | #include "win32/base/focus_hierarchy_observer.h" |
101 | 101 | '../../config/config.gyp:config_handler', |
102 | 102 | '../../config/config.gyp:stats_config_util', |
103 | 103 | '../../protobuf/protobuf.gyp:protobuf', |
104 | '../../protocol/protocol.gyp:commands_proto', | |
104 | 105 | '../../renderer/renderer.gyp:renderer_protocol', |
105 | 106 | '../../renderer/renderer.gyp:renderer_style_handler', |
106 | 107 | '../../renderer/renderer.gyp:table_layout', |
109 | 110 | '../../renderer/renderer.gyp:win32_text_renderer', |
110 | 111 | '../../renderer/renderer.gyp:window_util', |
111 | 112 | '../../session/session_base.gyp:output_util', |
112 | '../../session/session_base.gyp:session_protocol', | |
113 | 113 | '../base/win32_base.gyp:ime_base', |
114 | 114 | '../base/win32_base.gyp:ime_impl_base', |
115 | 115 | '../base/win32_base.gyp:imframework_util', |
39 | 39 | |
40 | 40 | #include "base/util.h" |
41 | 41 | #include "client/client_interface.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "win32/base/conversion_mode_util.h" |
44 | 44 | #include "win32/base/deleter.h" |
45 | 45 | #include "win32/base/input_state.h" |
39 | 39 | |
40 | 40 | #include "base/util.h" |
41 | 41 | #include "client/client_interface.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "win32/base/conversion_mode_util.h" |
44 | 44 | #include "win32/base/input_state.h" |
45 | 45 | #include "win32/base/string_util.h" |
40 | 40 | |
41 | 41 | #include "base/util.h" |
42 | 42 | #include "client/client_interface.h" |
43 | #include "session/commands.pb.h" | |
43 | #include "protocol/commands.pb.h" | |
44 | 44 | #include "win32/base/browser_info.h" |
45 | 45 | #include "win32/base/conversion_mode_util.h" |
46 | 46 | #include "win32/base/deleter.h" |
31 | 31 | #include "base/logging.h" |
32 | 32 | #include "base/system_util.h" |
33 | 33 | #include "base/win_util.h" |
34 | #include "session/commands.pb.h" | |
34 | #include "protocol/commands.pb.h" | |
35 | 35 | #include "win32/tip/tip_dll_module.h" |
36 | 36 | #include "win32/tip/tip_lang_bar_menu.h" |
37 | 37 | #include "win32/tip/tip_resource.h" |
34 | 34 | |
35 | 35 | #include "base/win_util.h" |
36 | 36 | #include "client/client_interface.h" |
37 | #include "session/commands.pb.h" | |
37 | #include "protocol/commands.pb.h" | |
38 | 38 | #include "session/key_info_util.h" |
39 | 39 | #include "win32/base/config_snapshot.h" |
40 | 40 | #include "win32/base/deleter.h" |
33 | 33 | |
34 | 34 | #include "base/util.h" |
35 | 35 | #include "client/client_interface.h" |
36 | #include "session/commands.pb.h" | |
36 | #include "protocol/commands.pb.h" | |
37 | 37 | #include "win32/tip/tip_ref_count.h" |
38 | 38 | |
39 | 39 | using ::mozc::client::ClientFactory; |
36 | 36 | #include <string> |
37 | 37 | |
38 | 38 | #include "base/logging.h" |
39 | #include "session/commands.pb.h" | |
39 | #include "protocol/commands.pb.h" | |
40 | 40 | #include "win32/base/conversion_mode_util.h" |
41 | 41 | #include "win32/tip/tip_compartment_util.h" |
42 | 42 |
46 | 46 | #include "base/update_util.h" |
47 | 47 | #include "base/util.h" |
48 | 48 | #include "base/win_util.h" |
49 | #include "session/commands.pb.h" | |
49 | #include "protocol/commands.pb.h" | |
50 | 50 | #include "win32/base/conversion_mode_util.h" |
51 | 51 | #include "win32/base/indicator_visibility_tracker.h" |
52 | 52 | #include "win32/base/input_state.h" |
39 | 39 | #include <string> |
40 | 40 | |
41 | 41 | #include "base/util.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "win32/tip/tip_dll_module.h" |
44 | 44 | #include "win32/tip/tip_private_context.h" |
45 | 45 | #include "win32/tip/tip_ref_count.h" |
39 | 39 | |
40 | 40 | #include "base/util.h" |
41 | 41 | #include "renderer/renderer_command.pb.h" |
42 | #include "session/commands.pb.h" | |
42 | #include "protocol/commands.pb.h" | |
43 | 43 | #include "win32/base/conversion_mode_util.h" |
44 | 44 | #include "win32/base/input_state.h" |
45 | 45 | #include "win32/tip/tip_dll_module.h" |
42 | 42 | #include <unordered_map> |
43 | 43 | |
44 | 44 | #include "base/util.h" |
45 | #include "protocol/commands.pb.h" | |
45 | 46 | #include "renderer/table_layout.h" |
46 | 47 | #include "renderer/win32/text_renderer.h" |
47 | 48 | #include "renderer/win32/win32_renderer_util.h" |
48 | 49 | #include "renderer/window_util.h" |
49 | #include "session/commands.pb.h" | |
50 | 50 | #include "win32/tip/tip_composition_util.h" |
51 | 51 | #include "win32/tip/tip_dll_module.h" |
52 | 52 | #include "win32/tip/tip_edit_session.h" |
37 | 37 | |
38 | 38 | #include <unordered_map> |
39 | 39 | |
40 | #include "protocol/commands.pb.h" | |
40 | 41 | #include "renderer/renderer_command.pb.h" |
41 | #include "session/commands.pb.h" | |
42 | 42 | #include "win32/base/input_state.h" |
43 | 43 | #include "win32/tip/tip_input_mode_manager.h" |
44 | 44 | #include "win32/tip/tip_private_context.h" |