Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement line editor and chewing behavior #378

Merged
merged 68 commits into from Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
72eccdc
feat: implement line editor and chewing behavior
kanru Feb 3, 2023
d9f6486
feat(editor): implement input and conversion
kanru Jul 15, 2023
f19f364
feat(editor): basic chinese/other mixed mode in preedit buffer
kanru Jul 17, 2023
d952d2f
refactor(editor): adjust naming convention
kanru Jul 22, 2023
6c1e756
feat(editor): basic full width symbol input
kanru Jul 23, 2023
bfdc35b
refactor(keyboard): refine keyboard layout modules
kanru Jul 23, 2023
0fc9edc
refactor(editor): use key event directly
kanru Jul 24, 2023
ff99130
feat(editor): support special symbol input in chinese mode
kanru Jul 25, 2023
e86837e
refactor(editor): minor cleanup
kanru Jul 29, 2023
6c6e7bd
feat(editor): build libchewing from rust only
kanru Jul 29, 2023
c7b3d1e
feat(editor): pass the fullshape test
kanru Jul 30, 2023
cfaa4ad
feat(editor): pass new tests
kanru Nov 20, 2023
be0b9cc
refactor(editor): new state machine design
kanru Nov 26, 2023
1c87ef2
feat(editor): pass some test-bopomofo test
kanru Dec 17, 2023
748892b
feat(editor): pass all test_select_candidate tests
kanru Dec 24, 2023
38236a5
feat(editor): able to run genkeystroke
kanru Dec 24, 2023
a3aaf1c
feat(editor): pass all test_Esc tests
kanru Dec 24, 2023
f955bd6
feat(editor): pass all test_Del tests
kanru Dec 24, 2023
52a7e61
feat(editor): pass all test_Backspace tests
kanru Dec 24, 2023
66f74c2
feat(editor): pass all test_Up tests
kanru Dec 24, 2023
1db7cef
feat(editor): pass all test_Down tests
kanru Dec 24, 2023
157417a
feat(editor): pass all test_Home tests
kanru Dec 24, 2023
1883b13
feat(editor): pass all test_Capslock and test_End tests
kanru Dec 24, 2023
df28c39
feat(editor): pass all test_Numlock tests
kanru Dec 24, 2023
768c916
feat(editor): pass all test_PageUp and test_PageDown tests
kanru Dec 24, 2023
c92ab5a
feat(editor): pass all test_Space tests
kanru Dec 24, 2023
400a3b1
feat(editor): pass all test_ShiftSpace tests
kanru Dec 24, 2023
b64f95b
fix(editor): symbol selector tests
kanru Dec 24, 2023
3e41a3d
feat(editor): pass all test_get_phoneSeq tests
kanru Dec 25, 2023
11bf4d4
feat(editor): pass all test_longest_phrase tests
kanru Dec 25, 2023
44b80c0
feat(editor): pass all test_interval tests
kanru Dec 25, 2023
02eb800
feat(editor): enable test_DblTab tests
kanru Dec 25, 2023
0806fc3
feat(editor): pass all test_jk_selection tests
kanru Dec 25, 2023
0271254
feat(editor): pass all test_auto_commit tests
kanru Dec 25, 2023
6318739
feat(editor): pass all test_chewing_phone_to_bopomofo tests
kanru Dec 26, 2023
7a03217
feat(editor): pass all test_KB tests
kanru Dec 26, 2023
03a5778
feat(editor): pass all test_Tab_at_the_end tests
kanru Dec 26, 2023
97d2cb2
feat(editor): pass all test_Tab_insert_breakpoint_between_word tests
kanru Dec 27, 2023
0cd5f06
feat(editor): pass all test_Tab_connect_word tests
kanru Dec 27, 2023
d78aaaf
feat(editor): pass all test-keyboard tests
kanru Dec 28, 2023
c05059d
feat(editor): pass all test-error-handling tests
kanru Dec 28, 2023
303f3f2
feat(editor): pass all test-symbol tests
kanru Dec 28, 2023
1c61581
feat(editor): pass all test-easy-symbol tests
kanru Dec 28, 2023
ce65682
feat(editor): pass all test-special-symbol tests
kanru Dec 28, 2023
0a39a5d
feat(editor): pass all test-keyboardless tests except test_cand_list
kanru Dec 28, 2023
6d89c1e
refactor(editor): revert cand_iter change
kanru Dec 28, 2023
4a33dcd
feat(editor): pass all test-keyboardless tests
kanru Dec 29, 2023
a3a98cb
feat(editor): pass all test_ShiftLeft_not_entering_chewing tests
kanru Dec 29, 2023
b9c359c
feat(editor): pass all test_ShiftLeft and test_ShiftRight tests
kanru Dec 30, 2023
8284831
feat(editor): pass all test_CtrlNum tests
kanru Dec 30, 2023
cb44e38
feat(editor): pass all test_userphrase_autolearn tests
kanru Dec 30, 2023
337f92d
feat(editor): pass all test_userphrase_enumerate tests
kanru Dec 30, 2023
78aec4a
feat(editor): pass all test-userphrase tests
kanru Dec 30, 2023
04a582b
feat(editor): pass all test-config tests
kanru Dec 30, 2023
f203571
feat(editor): pass all test-regression tests
kanru Dec 30, 2023
c069a07
Merge remote-tracking branch 'origin/master' into rust/line-editor
kanru Dec 30, 2023
05afde6
build: update corrosion version
kanru Dec 30, 2023
a1f2e75
build: bump MSRV to 1.70
kanru Dec 30, 2023
8fdf849
fix(editor): use local defined div_ceil
kanru Dec 30, 2023
33f71f1
refactor(capi): cleanup unused wrapper code
kanru Dec 30, 2023
29cb729
refactor(capi): merge capi/chewing-internal and capi/chewing-public
kanru Dec 31, 2023
b6fa43a
refactor(capi): merge capi/chewing-internal back to main crate
kanru Dec 31, 2023
fb49ae2
build: try disable NO_LINKER_OVERRIDE
kanru Dec 31, 2023
2333179
refactor: fix or hide some warnings
kanru Dec 31, 2023
4a4f084
build: bump crate version to 0.6.0-alpha.1
kanru Dec 31, 2023
a3409e7
build: bump rusqlite version to 0.30.0
kanru Dec 31, 2023
7d23dab
refactor: remove unused ifdef guards
kanru Dec 31, 2023
81bccba
feat(editor): basic user freq estimate
kanru Dec 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
with_rust: ['true', 'false']
rust_version: ['1.64', 'stable']
rust_version: ['1.70', 'stable']
exclude:
- with_rust: 'false'
rust_version: 'stable'
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Expand Up @@ -147,4 +147,7 @@ contrib/test.sqlite3
*.pyc

# rust
/target
/target

# clangd
/.cache/clangd
55 changes: 28 additions & 27 deletions CMakeLists.txt
Expand Up @@ -80,7 +80,8 @@ option(USE_VALGRIND "Use valgrind when testing" true)
option(WITH_RUST "Use rust implemented internals (experimental)" false)
if (WITH_RUST)
add_subdirectory(cmake/corrosion)
corrosion_import_crate(MANIFEST_PATH Cargo.toml NO_LINKER_OVERRIDE)
corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES chewing FEATURES capi)
corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES chewing-tools)
add_compile_definitions(WITH_RUST)
endif()

Expand Down Expand Up @@ -165,9 +166,7 @@ set(ALL_INC
)

if (WITH_RUST)
include_directories(capi/chewing-public/include)
include_directories(capi/chewing-internal/include)
list(APPEND ALL_INC capi/chewing-public/include/chewing_rs.h)
list(APPEND ALL_INC ${INC_DIR}/chewing_rs.h)
endif()

add_subdirectory(doc)
Expand All @@ -185,21 +184,14 @@ target_compile_definitions(common PRIVATE
CHEWING_DATADIR=\"${CMAKE_INSTALL_FULL_DATADIR}/libchewing\"
)

add_library(chewing OBJECT
add_library(chewing_c OBJECT
${ALL_INC}
${INC_DIR}/internal/chewing-private.h
${INC_DIR}/internal/chewingutil.h
${INC_DIR}/internal/choice-private.h
${INC_DIR}/internal/global-private.h

${SRC_DIR}/compat.c
${SRC_DIR}/chewingio.c
${SRC_DIR}/chewingutil.c
${SRC_DIR}/choice.c
${SRC_DIR}/mod_aux.c
${SRC_DIR}/private.h
)
if (NOT WITH_RUST)
if (WITH_RUST)
target_sources(chewing_c PRIVATE
src/rust_wrapper.c
)
else()
target_sources(common PRIVATE
${SRC_DIR}/porting_layer/include/plat_mmap.h
${SRC_DIR}/porting_layer/include/plat_path.h
Expand All @@ -214,21 +206,31 @@ target_sources(common PRIVATE
${SRC_DIR}/common/chewing-utf8-util.c
${SRC_DIR}/common/key2pho.c
)
target_sources(chewing PRIVATE
target_sources(chewing_c PRIVATE
${INC_DIR}/internal/bopomofo-private.h
${INC_DIR}/internal/chewing-private.h
${INC_DIR}/internal/chewingutil.h
${INC_DIR}/internal/choice-private.h
${INC_DIR}/internal/dict-private.h
${INC_DIR}/internal/global-private.h
${INC_DIR}/internal/pinyin-private.h
${INC_DIR}/internal/tree-private.h
${INC_DIR}/internal/userphrase-private.h
${INC_DIR}/internal/bopomofo-private.h

${SRC_DIR}/bopomofo.c
${SRC_DIR}/chewingio.c
${SRC_DIR}/chewingutil.c
${SRC_DIR}/choice.c
${SRC_DIR}/compat.c
${SRC_DIR}/dict.c
${SRC_DIR}/mod_aux.c
${SRC_DIR}/pinyin.c
${SRC_DIR}/private.h
${SRC_DIR}/tree.c
${SRC_DIR}/userphrase.c
${SRC_DIR}/bopomofo.c
)
endif()
target_compile_definitions(chewing PRIVATE
target_compile_definitions(chewing_c PRIVATE
CHEWING_DATADIR=\"${CMAKE_INSTALL_FULL_DATADIR}/libchewing\"
)

Expand Down Expand Up @@ -277,11 +279,11 @@ if (BUILD_DLL OR NOT MSVC)
add_compile_definitions(CHEWINGDLL_EXPORTS)
endif()
add_library(chewing_shared SHARED
$<TARGET_OBJECTS:chewing>
$<TARGET_OBJECTS:chewing_c>
$<TARGET_OBJECTS:common>
)
if (WITH_RUST)
corrosion_set_env_vars(chewing-public CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR})
corrosion_set_env_vars(chewing CMAKE_BINARY_DIR=${CMAKE_BINARY_DIR})
if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
target_link_options(chewing_shared PRIVATE "-Wl,-version-script,${CMAKE_BINARY_DIR}/symbols.map")
target_link_options(chewing_shared PRIVATE "-Wl,--gc-sections")
Expand All @@ -300,7 +302,7 @@ endif()

if (NOT BUILD_DLL)
add_library(chewing_static STATIC
$<TARGET_OBJECTS:chewing>
$<TARGET_OBJECTS:chewing_c>
$<TARGET_OBJECTS:common>
)
list(APPEND LIBS chewing_static)
Expand All @@ -309,10 +311,9 @@ endif()

foreach(lib ${LIBS})
if (WITH_RUST)
target_link_libraries(${lib} PRIVATE chewing-public)
target_link_libraries(${lib} PRIVATE chewing-internal)
target_link_libraries(${lib} PRIVATE chewing)
if (WITH_SQLITE3)
target_link_libraries(chewing-internal INTERFACE ${SQLite3_LIBRARIES})
target_link_libraries(chewing INTERFACE ${SQLite3_LIBRARIES})
endif()
else()
target_link_libraries(${lib} userphrase)
Expand Down