mirror of
https://github.com/mii443/mozc.git
synced 2025-12-03 11:18:20 +00:00
Rename the class of GoogleJapaneseInputController to MozcImkInputController.
We need to keep GoogleJapaneseInputController as an alias of MozcImkInputController for backward compatibility. This will be removed in the future when all clients are migrated to the new name and performed relogin at least once. #codehealth PiperOrigin-RevId: 683091904
This commit is contained in:
@@ -26,7 +26,7 @@ IMKInputServer handles all of the connection between applications, and invokes
|
|||||||
IMKInputController.
|
IMKInputController.
|
||||||
|
|
||||||
The IMKit.framework configurations are in Info.plist of the client application.
|
The IMKit.framework configurations are in Info.plist of the client application.
|
||||||
You'll see the GoogleJapaneseInputController class name in mac/Info.plist.
|
You'll see the MozcImkInputController class name in mac/Info.plist.
|
||||||
|
|
||||||
## Communication with converter
|
## Communication with converter
|
||||||
|
|
||||||
|
|||||||
@@ -180,11 +180,11 @@
|
|||||||
<key>InputMethodConnectionName</key>
|
<key>InputMethodConnectionName</key>
|
||||||
<string>${PRODUCT_NAME}_1_Connection</string>
|
<string>${PRODUCT_NAME}_1_Connection</string>
|
||||||
<key>InputMethodServerControllerClass</key>
|
<key>InputMethodServerControllerClass</key>
|
||||||
<string>GoogleJapaneseInputController</string>
|
<string>MozcImkInputController</string>
|
||||||
<key>InputMethodServerDelegateClass</key>
|
<key>InputMethodServerDelegateClass</key>
|
||||||
<string>GoogleJapaneseInputController</string>
|
<string>MozcImkInputController</string>
|
||||||
<key>InputMethodServerDataSourceClass</key>
|
<key>InputMethodServerDataSourceClass</key>
|
||||||
<string>GoogleJapaneseInputController</string>
|
<string>MozcImkInputController</string>
|
||||||
<key>LSBackgroundOnly</key>
|
<key>LSBackgroundOnly</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>LSUIElement</key>
|
<key>LSUIElement</key>
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ int main(int argc, char *argv[]) {
|
|||||||
NSString *rendererConnectionName = @kProductPrefix "_Renderer_Connection";
|
NSString *rendererConnectionName = @kProductPrefix "_Renderer_Connection";
|
||||||
RendererReceiver *rendererReceiver =
|
RendererReceiver *rendererReceiver =
|
||||||
[[RendererReceiver alloc] initWithName:rendererConnectionName];
|
[[RendererReceiver alloc] initWithName:rendererConnectionName];
|
||||||
[GoogleJapaneseInputController setGlobalRendererReceiver:rendererReceiver];
|
[MozcImkInputController setGlobalRendererReceiver:rendererReceiver];
|
||||||
|
|
||||||
// Start the converter server at this time explicitly to prevent the
|
// Start the converter server at this time explicitly to prevent the
|
||||||
// slow-down of the response for initial key event.
|
// slow-down of the response for initial key event.
|
||||||
|
|||||||
@@ -45,13 +45,13 @@
|
|||||||
#include "protocol/renderer_command.pb.h"
|
#include "protocol/renderer_command.pb.h"
|
||||||
#include "renderer/renderer_interface.h"
|
#include "renderer/renderer_interface.h"
|
||||||
|
|
||||||
/** GoogleJapaneseInputController is a subclass of |IMKInputController|, which holds a connection
|
/** MozcImkInputController is a subclass of |IMKInputController|, which holds a connection
|
||||||
* from a client application to the mozc server (Japanese IME server) on the machine.
|
* from a client application to the mozc server (Japanese IME server) on the machine.
|
||||||
*
|
*
|
||||||
* For the detail of IMKInputController itself, see the ADC document
|
* For the detail of IMKInputController itself, see the ADC document
|
||||||
* http://developer.apple.com/documentation/Cocoa/Reference/IMKInputController_Class/
|
* http://developer.apple.com/documentation/Cocoa/Reference/IMKInputController_Class/
|
||||||
*/
|
*/
|
||||||
@interface GoogleJapaneseInputController : IMKInputController <ControllerCallback> {
|
@interface MozcImkInputController : IMKInputController <ControllerCallback> {
|
||||||
@private
|
@private
|
||||||
/** Instance variables are all strong references. */
|
/** Instance variables are all strong references. */
|
||||||
|
|
||||||
@@ -268,3 +268,10 @@
|
|||||||
- (BOOL)fillSurroundingContext:(mozc::commands::Context *)context client:(id<IMKTextInput>)client;
|
- (BOOL)fillSurroundingContext:(mozc::commands::Context *)context client:(id<IMKTextInput>)client;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
/** GoogleJapaneseInputController is an alias of MozcImkInputController for backward compatibility.
|
||||||
|
* This will be removed in the future when all clients are migrated to the new name and performed
|
||||||
|
* relogin at least once.
|
||||||
|
*/
|
||||||
|
@interface GoogleJapaneseInputController : MozcImkInputController {}
|
||||||
|
@end
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ bool CanSurroundingText(absl::string_view bundle_id) {
|
|||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
@implementation GoogleJapaneseInputController
|
@implementation MozcImkInputController
|
||||||
#pragma mark accessors for testing
|
#pragma mark accessors for testing
|
||||||
@synthesize keyCodeMap = keyCodeMap_;
|
@synthesize keyCodeMap = keyCodeMap_;
|
||||||
@synthesize yenSignCharacter = yenSignCharacter_;
|
@synthesize yenSignCharacter = yenSignCharacter_;
|
||||||
@@ -621,10 +621,10 @@ bool CanSurroundingText(absl::string_view bundle_id) {
|
|||||||
#pragma mark Mozc Server methods
|
#pragma mark Mozc Server methods
|
||||||
|
|
||||||
#pragma mark IMKServerInput Protocol
|
#pragma mark IMKServerInput Protocol
|
||||||
// Currently GoogleJapaneseInputController uses handleEvent:client:
|
// Currently MozcImkInputController uses handleEvent:client:
|
||||||
// method to handle key events. It does not support inputText:client:
|
// method to handle key events. It does not support inputText:client:
|
||||||
// nor inputText:key:modifiers:client:.
|
// nor inputText:key:modifiers:client:.
|
||||||
// Because GoogleJapaneseInputController does not use IMKCandidates,
|
// Because MozcImkInputController does not use IMKCandidates,
|
||||||
// the following methods are not needed to implement:
|
// the following methods are not needed to implement:
|
||||||
// candidates
|
// candidates
|
||||||
//
|
//
|
||||||
@@ -967,3 +967,7 @@ bool CanSurroundingText(absl::string_view bundle_id) {
|
|||||||
gRendererReceiver = rendererReceiver;
|
gRendererReceiver = rendererReceiver;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
// An alias of MozcImkInputController for backward compatibility.
|
||||||
|
@implementation GoogleJapaneseInputController
|
||||||
|
@end
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ class MockRenderer : public renderer::RendererInterface {
|
|||||||
commands::RendererCommand called_command_;
|
commands::RendererCommand called_command_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class GoogleJapaneseInputControllerTest : public testing::Test {
|
class MozcImkInputControllerTest : public testing::Test {
|
||||||
protected:
|
protected:
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
mock_server_ = [[MockIMKServer alloc] init];
|
mock_server_ = [[MockIMKServer alloc] init];
|
||||||
@@ -261,7 +261,7 @@ class GoogleJapaneseInputControllerTest : public testing::Test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SetUpController() {
|
void SetUpController() {
|
||||||
controller_ = [[GoogleJapaneseInputController alloc] initWithServer:mock_server_
|
controller_ = [[MozcImkInputController alloc] initWithServer:mock_server_
|
||||||
delegate:nil
|
delegate:nil
|
||||||
client:mock_client_];
|
client:mock_client_];
|
||||||
controller_.imkClientForTest = mock_client_;
|
controller_.imkClientForTest = mock_client_;
|
||||||
@@ -284,7 +284,7 @@ class GoogleJapaneseInputControllerTest : public testing::Test {
|
|||||||
MockClient *mock_client_;
|
MockClient *mock_client_;
|
||||||
const MockRenderer *mock_renderer_;
|
const MockRenderer *mock_renderer_;
|
||||||
|
|
||||||
GoogleJapaneseInputController *controller_;
|
MozcImkInputController *controller_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MockIMKServer *mock_server_;
|
MockIMKServer *mock_server_;
|
||||||
@@ -368,7 +368,7 @@ NSTimeInterval GetDoubleTapInterval() {
|
|||||||
return kDoubleTapInterval;
|
return kDoubleTapInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL SendKeyEvent(unsigned short keyCode, GoogleJapaneseInputController *controller,
|
BOOL SendKeyEvent(unsigned short keyCode, MozcImkInputController *controller,
|
||||||
MockClient *client) {
|
MockClient *client) {
|
||||||
// tap Kana-key
|
// tap Kana-key
|
||||||
NSEvent *kanaKeyEvent = [NSEvent keyEventWithType:NSEventTypeKeyDown
|
NSEvent *kanaKeyEvent = [NSEvent keyEventWithType:NSEventTypeKeyDown
|
||||||
@@ -384,7 +384,7 @@ BOOL SendKeyEvent(unsigned short keyCode, GoogleJapaneseInputController *control
|
|||||||
return [controller handleEvent:kanaKeyEvent client:client];
|
return [controller handleEvent:kanaKeyEvent client:client];
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, UpdateComposedString) {
|
TEST_F(MozcImkInputControllerTest, UpdateComposedString) {
|
||||||
// If preedit is nullptr, it still calls setMarkedText, with an empty string.
|
// If preedit is nullptr, it still calls setMarkedText, with an empty string.
|
||||||
NSMutableAttributedString *expected = [[NSMutableAttributedString alloc] initWithString:@""];
|
NSMutableAttributedString *expected = [[NSMutableAttributedString alloc] initWithString:@""];
|
||||||
[controller_ updateComposedString:nullptr];
|
[controller_ updateComposedString:nullptr];
|
||||||
@@ -423,14 +423,14 @@ TEST_F(GoogleJapaneseInputControllerTest, UpdateComposedString) {
|
|||||||
<< [[NSString stringWithFormat:@"expected:%@ actual:%@", expected, actual] UTF8String];
|
<< [[NSString stringWithFormat:@"expected:%@ actual:%@", expected, actual] UTF8String];
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, ClearCandidates) {
|
TEST_F(MozcImkInputControllerTest, ClearCandidates) {
|
||||||
[controller_ clearCandidates];
|
[controller_ clearCandidates];
|
||||||
EXPECT_EQ(mock_renderer_->counter_ExecCommand(), 1);
|
EXPECT_EQ(mock_renderer_->counter_ExecCommand(), 1);
|
||||||
// After clearing candidates, the candidate window has to be invisible.
|
// After clearing candidates, the candidate window has to be invisible.
|
||||||
EXPECT_FALSE(mock_renderer_->CalledCommand().visible());
|
EXPECT_FALSE(mock_renderer_->CalledCommand().visible());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, UpdateCandidates) {
|
TEST_F(MozcImkInputControllerTest, UpdateCandidates) {
|
||||||
// When output is null, same as ClearCandidate
|
// When output is null, same as ClearCandidate
|
||||||
[controller_ updateCandidates:nullptr];
|
[controller_ updateCandidates:nullptr];
|
||||||
// Run the runloop so "delayedUpdateCandidates" can be called
|
// Run the runloop so "delayedUpdateCandidates" can be called
|
||||||
@@ -490,7 +490,7 @@ TEST_F(GoogleJapaneseInputControllerTest, UpdateCandidates) {
|
|||||||
EXPECT_FALSE(rendererCommand.visible());
|
EXPECT_FALSE(rendererCommand.visible());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, OpenLink) {
|
TEST_F(MozcImkInputControllerTest, OpenLink) {
|
||||||
EXPECT_EQ(gOpenURLCount, 0);
|
EXPECT_EQ(gOpenURLCount, 0);
|
||||||
[controller_ openLink:[NSURL URLWithString:@"http://www.example.com/"]];
|
[controller_ openLink:[NSURL URLWithString:@"http://www.example.com/"]];
|
||||||
// openURL is invoked
|
// openURL is invoked
|
||||||
@@ -504,7 +504,7 @@ TEST_F(GoogleJapaneseInputControllerTest, OpenLink) {
|
|||||||
EXPECT_EQ(gOpenURLCount, 1);
|
EXPECT_EQ(gOpenURLCount, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, SwitchModeToDirect) {
|
TEST_F(MozcImkInputControllerTest, SwitchModeToDirect) {
|
||||||
// setup the IME status
|
// setup the IME status
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
commands::Preedit preedit;
|
commands::Preedit preedit;
|
||||||
@@ -528,7 +528,7 @@ TEST_F(GoogleJapaneseInputControllerTest, SwitchModeToDirect) {
|
|||||||
EXPECT_FALSE(controller_.rendererCommand.visible());
|
EXPECT_FALSE(controller_.rendererCommand.visible());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, SwitchMode) {
|
TEST_F(MozcImkInputControllerTest, SwitchMode) {
|
||||||
// When a mode changes from DIRECT, it should invoke "ON" command beforehand.
|
// When a mode changes from DIRECT, it should invoke "ON" command beforehand.
|
||||||
EXPECT_CALL(*mock_mozc_client_,
|
EXPECT_CALL(*mock_mozc_client_,
|
||||||
SendKeyWithContext(HasSpecialKey(commands::KeyEvent::ON), _, NotNull()))
|
SendKeyWithContext(HasSpecialKey(commands::KeyEvent::ON), _, NotNull()))
|
||||||
@@ -557,7 +557,7 @@ TEST_F(GoogleJapaneseInputControllerTest, SwitchMode) {
|
|||||||
EXPECT_EQ(controller_.mode, commands::HALF_KATAKANA);
|
EXPECT_EQ(controller_.mode, commands::HALF_KATAKANA);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, SwitchDisplayMode) {
|
TEST_F(MozcImkInputControllerTest, SwitchDisplayMode) {
|
||||||
EXPECT_TRUE(mock_client_.selectedMode.empty());
|
EXPECT_TRUE(mock_client_.selectedMode.empty());
|
||||||
EXPECT_EQ(controller_.mode, commands::DIRECT);
|
EXPECT_EQ(controller_.mode, commands::DIRECT);
|
||||||
[controller_ switchDisplayMode];
|
[controller_ switchDisplayMode];
|
||||||
@@ -565,7 +565,7 @@ TEST_F(GoogleJapaneseInputControllerTest, SwitchDisplayMode) {
|
|||||||
EXPECT_EQ(mock_client_.selectedMode, "com.apple.inputmethod.Roman");
|
EXPECT_EQ(mock_client_.selectedMode, "com.apple.inputmethod.Roman");
|
||||||
|
|
||||||
// Does not change the display mode for MS Word. See
|
// Does not change the display mode for MS Word. See
|
||||||
// GoogleJapaneseInputController.mm for the detailed information.
|
// MozcImkInputController.mm for the detailed information.
|
||||||
ResetClientBundleIdentifier(@"com.microsoft.Word");
|
ResetClientBundleIdentifier(@"com.microsoft.Word");
|
||||||
[controller_ switchMode:commands::HIRAGANA client:mock_client_];
|
[controller_ switchMode:commands::HIRAGANA client:mock_client_];
|
||||||
EXPECT_EQ(controller_.mode, commands::HIRAGANA);
|
EXPECT_EQ(controller_.mode, commands::HIRAGANA);
|
||||||
@@ -575,7 +575,7 @@ TEST_F(GoogleJapaneseInputControllerTest, SwitchDisplayMode) {
|
|||||||
EXPECT_EQ(mock_client_.selectedMode, "com.apple.inputmethod.Roman");
|
EXPECT_EQ(mock_client_.selectedMode, "com.apple.inputmethod.Roman");
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, commitText) {
|
TEST_F(MozcImkInputControllerTest, commitText) {
|
||||||
controller_.replacementRange = NSMakeRange(0, 1);
|
controller_.replacementRange = NSMakeRange(0, 1);
|
||||||
[controller_ commitText:"foo" client:mock_client_];
|
[controller_ commitText:"foo" client:mock_client_];
|
||||||
|
|
||||||
@@ -585,7 +585,7 @@ TEST_F(GoogleJapaneseInputControllerTest, commitText) {
|
|||||||
EXPECT_EQ([controller_ replacementRange].location, NSNotFound);
|
EXPECT_EQ([controller_ replacementRange].location, NSNotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, handleConfig) {
|
TEST_F(MozcImkInputControllerTest, handleConfig) {
|
||||||
// Does not support multiple-calculation
|
// Does not support multiple-calculation
|
||||||
config::Config config;
|
config::Config config;
|
||||||
config.set_preedit_method(config::Config::KANA);
|
config.set_preedit_method(config::Config::KANA);
|
||||||
@@ -602,7 +602,7 @@ TEST_F(GoogleJapaneseInputControllerTest, handleConfig) {
|
|||||||
<< [mock_client_.overriddenLayout UTF8String];
|
<< [mock_client_.overriddenLayout UTF8String];
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, DoubleTapKanaReconvert) {
|
TEST_F(MozcImkInputControllerTest, DoubleTapKanaReconvert) {
|
||||||
// tap (short) tap -> emit undo command
|
// tap (short) tap -> emit undo command
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
|
|
||||||
@@ -629,7 +629,7 @@ TEST_F(GoogleJapaneseInputControllerTest, DoubleTapKanaReconvert) {
|
|||||||
EXPECT_THAT(actual_command, Text("bcd"));
|
EXPECT_THAT(actual_command, Text("bcd"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, DoubleTapKanaUndo) {
|
TEST_F(MozcImkInputControllerTest, DoubleTapKanaUndo) {
|
||||||
// tap (short) tap -> emit undo command
|
// tap (short) tap -> emit undo command
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
|
|
||||||
@@ -652,7 +652,7 @@ TEST_F(GoogleJapaneseInputControllerTest, DoubleTapKanaUndo) {
|
|||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, DoubleTapKanaUndoTimeOver) {
|
TEST_F(MozcImkInputControllerTest, DoubleTapKanaUndoTimeOver) {
|
||||||
// tap (long) tap -> don't emit undo command
|
// tap (long) tap -> don't emit undo command
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
|
|
||||||
@@ -670,7 +670,7 @@ TEST_F(GoogleJapaneseInputControllerTest, DoubleTapKanaUndoTimeOver) {
|
|||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, SingleAndDoubleTapKanaUndo) {
|
TEST_F(MozcImkInputControllerTest, SingleAndDoubleTapKanaUndo) {
|
||||||
// tap (long) tap (short) tap -> emit once
|
// tap (long) tap (short) tap -> emit once
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
|
|
||||||
@@ -699,7 +699,7 @@ TEST_F(GoogleJapaneseInputControllerTest, SingleAndDoubleTapKanaUndo) {
|
|||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, TripleTapKanaUndo) {
|
TEST_F(MozcImkInputControllerTest, TripleTapKanaUndo) {
|
||||||
// tap (short) tap (short) tap -> emit twice
|
// tap (short) tap (short) tap -> emit twice
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
|
|
||||||
@@ -729,7 +729,7 @@ TEST_F(GoogleJapaneseInputControllerTest, TripleTapKanaUndo) {
|
|||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, QuadrupleTapKanaUndo) {
|
TEST_F(MozcImkInputControllerTest, QuadrupleTapKanaUndo) {
|
||||||
// tap (short) tap (short) tap (short) tap -> emit thrice
|
// tap (short) tap (short) tap (short) tap -> emit thrice
|
||||||
controller_.mode = commands::HIRAGANA;
|
controller_.mode = commands::HIRAGANA;
|
||||||
|
|
||||||
@@ -764,7 +764,7 @@ TEST_F(GoogleJapaneseInputControllerTest, QuadrupleTapKanaUndo) {
|
|||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Kana, controller_, mock_client_), YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, DoubleTapEisuCommitRawText) {
|
TEST_F(MozcImkInputControllerTest, DoubleTapEisuCommitRawText) {
|
||||||
// Send Eisu-key.
|
// Send Eisu-key.
|
||||||
// Because of special hack for Eisu/Kana keys, it returns YES.
|
// Because of special hack for Eisu/Kana keys, it returns YES.
|
||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Eisu, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Eisu, controller_, mock_client_), YES);
|
||||||
@@ -780,7 +780,7 @@ TEST_F(GoogleJapaneseInputControllerTest, DoubleTapEisuCommitRawText) {
|
|||||||
EXPECT_EQ(SendKeyEvent(kVK_JIS_Eisu, controller_, mock_client_), YES);
|
EXPECT_EQ(SendKeyEvent(kVK_JIS_Eisu, controller_, mock_client_), YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(GoogleJapaneseInputControllerTest, fillSurroundingContext) {
|
TEST_F(MozcImkInputControllerTest, fillSurroundingContext) {
|
||||||
[mock_client_ setAttributedString:[[NSAttributedString alloc] initWithString:@"abcde"]];
|
[mock_client_ setAttributedString:[[NSAttributedString alloc] initWithString:@"abcde"]];
|
||||||
mock_client_.expectedRange = NSMakeRange(2, 1);
|
mock_client_.expectedRange = NSMakeRange(2, 1);
|
||||||
commands::Context context;
|
commands::Context context;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ void CandidateController::AlignWindows() {
|
|||||||
command_.preedit_rectangle().right() - command_.preedit_rectangle().left(),
|
command_.preedit_rectangle().right() - command_.preedit_rectangle().left(),
|
||||||
command_.preedit_rectangle().bottom() - command_.preedit_rectangle().top());
|
command_.preedit_rectangle().bottom() - command_.preedit_rectangle().top());
|
||||||
// The origin point of command_.preedit_rectangle() is the left-top of the
|
// The origin point of command_.preedit_rectangle() is the left-top of the
|
||||||
// base screen which is set in GoogleJapaneseInputController. It is
|
// base screen which is set in MozcImkInputController. It is
|
||||||
// unnecessary calculation but to support older version of GoogleJapaneseInput
|
// unnecessary calculation but to support older version of GoogleJapaneseInput
|
||||||
// process we should not change it. So we minus the height of the screen here.
|
// process we should not change it. So we minus the height of the screen here.
|
||||||
mozc::Rect preedit_rect(mozc::Point(command_.preedit_rectangle().left(),
|
mozc::Rect preedit_rect(mozc::Point(command_.preedit_rectangle().left(),
|
||||||
@@ -211,7 +211,7 @@ void CandidateController::AlignWindows() {
|
|||||||
|
|
||||||
// This is a hacky way to check vertical writing.
|
// This is a hacky way to check vertical writing.
|
||||||
// TODO(komatsu): We should use the return value of attributesForCharacterIndex
|
// TODO(komatsu): We should use the return value of attributesForCharacterIndex
|
||||||
// in GoogleJapaneseInputController.mm as a proper way.
|
// in MozcImkInputController as a proper way.
|
||||||
const bool is_vertical = (preedit_size.height < preedit_size.width);
|
const bool is_vertical = (preedit_size.height < preedit_size.width);
|
||||||
|
|
||||||
// Expand the rect size to make a margin to the candidate window.
|
// Expand the rect size to make a margin to the candidate window.
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ enum COLUMN_TYPE {
|
|||||||
// setCandidates: sets the candidates to be rendered.
|
// setCandidates: sets the candidates to be rendered.
|
||||||
- (void)setCandidates:(const mozc::commands::Candidates *)candidates;
|
- (void)setCandidates:(const mozc::commands::Candidates *)candidates;
|
||||||
|
|
||||||
// setController: sets the reference of GoogleJapaneseInputController.
|
// setController: sets the reference of MozcImkInputController.
|
||||||
// It will be used when mouse clicks. It doesn't take ownerships of
|
// It will be used when mouse clicks. It doesn't take ownerships of
|
||||||
// |controller|.
|
// |controller|.
|
||||||
- (void)setSendCommandInterface:(mozc::client::SendCommandInterface *)command_sender;
|
- (void)setSendCommandInterface:(mozc::client::SendCommandInterface *)command_sender;
|
||||||
|
|||||||
Reference in New Issue
Block a user