Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into fcitx
Browse files Browse the repository at this point in the history
  • Loading branch information
Fcitx Bot committed Oct 8, 2024
2 parents 7dd0681 + db78a43 commit addc398
Show file tree
Hide file tree
Showing 23 changed files with 731 additions and 664 deletions.
13 changes: 4 additions & 9 deletions docs/design_doc/mac_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ convert the NSEvent to Mozc's key event and send to the converter. Also, this
class handles the OS status change such like mode change by mouse clicks.

IMKInputServer handles all of the connection between applications, and invokes
IMKInputController. Normally we don't need to inherit IMKInputServer but use the
standard server class directly, but we do inherit this as
GoogleJapaneseInputServer for some reasons. See *Communication with renderer*
section for the details.
IMKInputController.

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

Expand Down Expand Up @@ -95,10 +92,8 @@ the client. That's tricky because renderer is an IPC server and client does not
run Mozc's IPC server system -- it already has a standard NSRunloop event
handling due to IMKit.framework.

This is why we inherit IMKInputServer, as I described above. The
GoogleJapaneseInputServer registers a new event handling for a new connection
actually. When a click happens, the renderer packs the protobuf data into a
binary string, pack it into NSData, and send this to the client's connection by
When a click happens, the renderer packs the protobuf data into a
binary string, pack it into NSData, and sends this to the client's connection by
a standard Cocoa's IPC using NSConnection.

You may notice "wait, does NSConnection cause memory leaks?" This is absolutely
Expand Down
8 changes: 4 additions & 4 deletions src/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ http_archive(
# Since the URL is shared among multiple versions, we cannot specify the SHA256.
# For offline build (with the --repository_cache flag), SHA256 should be specified.
#
# SHA256 as of 2024-08-14
# SHA256_ZIP_CODE_KEN_ALL = "d2d177ef64b9459a618d8aaa96b6c5f081cb3f37f6e9c00ba912001e66b81f3e"
# SHA256 as of 2024-10-08
# SHA256_ZIP_CODE_KEN_ALL = "e5a32c0199ebc890ea5c48c06fd817a168b26d68ce1c3a86ba0ae1cdf6c2d1c4"
SHA256_ZIP_CODE_KEN_ALL = None

http_archive(
Expand All @@ -278,8 +278,8 @@ http_archive(
url = "https://www.post.japanpost.jp/zipcode/dl/kogaki/zip/ken_all.zip",
)

# SHA256 as of 2024-08-14
# SHA256_ZIP_CODE_JIGYOSYO="ab6fd92df35e63c4566d29f70456da1603d8178ce3fec073f7c27b28d0af2e10"
# SHA256 as of 2024-10-08
# SHA256_ZIP_CODE_JIGYOSYO = "5d52511ce6613fcc0c5b24ac59b463e927cff76ac466c2ae07a511a64bb5913f"
SHA256_ZIP_CODE_JIGYOSYO = None

http_archive(
Expand Down
47 changes: 16 additions & 31 deletions src/mac/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ mozc_objc_library(
],
tags = ["manual"],
deps = [
":imk_controller",
":imk_server",
":mozc_imk_input_controller",
":renderer_receiver",
"//base:const",
"//base:crash_report_handler",
"//base:init_mozc",
Expand All @@ -120,13 +120,9 @@ mozc_objc_library(
)

mozc_objc_library(
name = "imk_controller",
srcs = [
"GoogleJapaneseInputController.mm",
],
hdrs = [
"GoogleJapaneseInputController.h",
],
name = "mozc_imk_input_controller",
srcs = ["mozc_imk_input_controller.mm"],
hdrs = ["mozc_imk_input_controller.h"],
data = [
"English.lproj/Config.xib",
"Japanese.lproj/Config.xib",
Expand All @@ -138,13 +134,10 @@ mozc_objc_library(
"InputMethodKit",
],
tags = ["manual"],
textual_hdrs = [
"GoogleJapaneseInputControllerInterface.h",
],
deps = [
":common",
":imk_server",
":keycode_map",
":renderer_receiver",
"//base:const",
"//base:process",
"//base:util",
Expand All @@ -164,12 +157,12 @@ mozc_objc_library(
)

mozc_objc_test(
name = "imk_controller_test",
name = "mozc_imk_input_controller_test",
size = "small",
srcs = ["GoogleJapaneseInputController_test.mm"],
srcs = ["mozc_imk_input_controller_test.mm"],
deps = [
":imk_controller",
":keycode_map",
":mozc_imk_input_controller",
"//base/mac:mac_util",
"//client:client_mock",
"//protocol:candidates_cc_proto",
Expand All @@ -182,30 +175,22 @@ mozc_objc_test(
)

mozc_objc_library(
name = "imk_server",
srcs = ["GoogleJapaneseInputServer.mm"],
hdrs = ["GoogleJapaneseInputServer.h"],
sdk_frameworks = [
"Foundation",
"InputMethodKit",
],
tags = ["manual"],
name = "renderer_receiver",
srcs = ["renderer_receiver.mm"],
hdrs = ["renderer_receiver.h"],
sdk_frameworks = ["Foundation"],
deps = [
":common",
"//base:const",
"//protocol:commands_cc_proto",
"@com_google_absl//absl/base",
"@com_google_absl//absl/log",
],
)

mozc_objc_test(
name = "imk_server_test",
name = "renderer_receiver_test",
size = "small",
srcs = ["GoogleJapaneseInputServer_test.mm"],
sdk_frameworks = ["InputMethodKit"],
srcs = ["renderer_receiver_test.mm"],
deps = [
":imk_server",
":renderer_receiver",
"//protocol:commands_cc_proto",
"//testing:gunit_main_objc",
],
Expand Down
137 changes: 0 additions & 137 deletions src/mac/GoogleJapaneseInputController.h

This file was deleted.

102 changes: 0 additions & 102 deletions src/mac/GoogleJapaneseInputControllerInterface.h

This file was deleted.

Loading

0 comments on commit addc398

Please sign in to comment.