Skip to content

Commit c73ea17

Browse files
eagleoflqjksqsf
authored andcommitted
0.10.9: emscripten 3.1.63
1 parent 00e91ad commit c73ea17

File tree

7 files changed

+68
-66
lines changed

7 files changed

+68
-66
lines changed

checksum

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
05e34aaf2b388a96e6a52fb941e5299f public/rime.data
2-
1985fb80ba5768f171d0108174c98abe public/rime.js
3-
baecfa3a5f7f5fbf2aa7837d3952747a public/rime.wasm
2+
aa1a409d9f050280b4be5f08d2e0becd public/rime.js
3+
b9203c3a3b8f638431a99e0f3e630e93 public/rime.wasm

librime_patch

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index 53f9d537..64dfdba1 100644
2+
index e167e228..9df29c9d 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
55
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.12)
@@ -102,19 +102,6 @@ index bb68bcdb..4ef84beb 100644
102102
bool page_down_cycle() const { return page_down_cycle_; }
103103
const string& select_keys() const { return select_keys_; }
104104
void set_select_keys(const string& keys) { select_keys_ = keys; }
105-
diff --git a/src/rime_api.h b/src/rime_api.h
106-
index 44b2ea3f..d106a197 100644
107-
--- a/src/rime_api.h
108-
+++ b/src/rime_api.h
109-
@@ -422,6 +422,8 @@ RIME_API const char* RimeGetSyncDir(void);
110-
111-
RIME_API const char* RimeGetUserId(void);
112-
113-
+RIME_API Bool RimeChangePage(RimeSessionId session_id, Bool backward);
114-
+
115-
/*! The API structure
116-
* RimeApi is for rime v1.0+
117-
*/
118105
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
119106
index 090a0fc0..a24cd51f 100644
120107
--- a/tools/CMakeLists.txt

opencc_patch

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/CMakeLists.txt b/CMakeLists.txt
2-
index ee08591..24da933 100644
2+
index 1acb75a..b9b49da 100644
33
--- a/CMakeLists.txt
44
+++ b/CMakeLists.txt
5-
@@ -127,12 +127,23 @@ add_definitions(
5+
@@ -152,12 +152,23 @@ add_definitions(
66
-DPACKAGE_NAME="${PACKAGE_NAME}"
77
)
88

@@ -27,7 +27,7 @@ index ee08591..24da933 100644
2727
if (CMAKE_BUILD_TYPE MATCHES Debug)
2828
add_definitions(-O0 -g3)
2929
endif ()
30-
@@ -196,9 +207,6 @@ endif()
30+
@@ -221,9 +232,6 @@ endif()
3131
######## Subdirectories
3232

3333
add_subdirectory(src)
@@ -37,11 +37,24 @@ index ee08591..24da933 100644
3737

3838
######## Testing
3939

40+
diff --git a/deps/rapidjson-1.1.0/rapidjson/document.h b/deps/rapidjson-1.1.0/rapidjson/document.h
41+
index e3e20df..ad362a6 100644
42+
--- a/deps/rapidjson-1.1.0/rapidjson/document.h
43+
+++ b/deps/rapidjson-1.1.0/rapidjson/document.h
44+
@@ -322,7 +322,7 @@ struct GenericStringRef {
45+
operator const Ch *() const { return s; }
46+
47+
const Ch* const s; //!< plain CharType pointer
48+
- const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
49+
+ SizeType length; //!< length of the string (excluding the trailing NULL terminator)
50+
51+
private:
52+
//! Disallow construction from non-const array
4053
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
41-
index c0a0b10..b8cdc73 100644
54+
index 75eda02..c7bb8c5 100644
4255
--- a/src/CMakeLists.txt
4356
+++ b/src/CMakeLists.txt
44-
@@ -184,5 +184,3 @@ if (ENABLE_BENCHMARK)
57+
@@ -204,5 +204,3 @@ if (ENABLE_BENCHMARK)
4558
endif()
4659

4760
# Subdir

package.json

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@libreservice/my-rime",
3-
"version": "0.10.8",
3+
"version": "0.10.9",
44
"files": [
55
"dist"
66
],
@@ -40,52 +40,52 @@
4040
"preview": "vite preview --host"
4141
},
4242
"devDependencies": {
43-
"@codemirror/language": "^6.10.1",
43+
"@codemirror/language": "^6.10.2",
4444
"@codemirror/legacy-modes": "^6.4.0",
4545
"@libreservice/lazy-cache": "^0.1.2",
46-
"@libreservice/micro-plum": "^0.2.2",
46+
"@libreservice/micro-plum": "^0.2.3",
4747
"@libreservice/my-widget": "^0.1.4",
4848
"@libreservice/my-worker": "^0.4.2",
4949
"@libreservice/wasm-code": "^0.1.5",
50-
"@playwright/test": "^1.43.1",
50+
"@playwright/test": "^1.45.2",
5151
"@rollup/plugin-json": "^6.1.0",
5252
"@rollup/plugin-node-resolve": "^15.2.3",
53-
"@rollup/plugin-replace": "^5.0.5",
53+
"@rollup/plugin-replace": "^5.0.7",
5454
"@types/js-yaml": "^4.0.9",
55-
"@typescript-eslint/eslint-plugin": "^7.8.0",
56-
"@typescript-eslint/parser": "^7.8.0",
55+
"@typescript-eslint/eslint-plugin": "^7.16.1",
56+
"@typescript-eslint/parser": "^7.16.1",
5757
"@vicons/fa": "^0.12.0",
5858
"@vicons/fluent": "^0.12.0",
5959
"@vicons/material": "^0.12.0",
60-
"@vitejs/plugin-vue": "^5.0.4",
60+
"@vitejs/plugin-vue": "^5.0.5",
6161
"client-zip": "^2.4.5",
6262
"emoji-regex": "^10.3.0",
63-
"esbuild": "^0.20.2",
64-
"eslint": "^8.56.0",
63+
"esbuild": "^0.23.0",
64+
"eslint": "^8.57.0",
6565
"eslint-config-standard": "^17.1.0",
6666
"eslint-plugin-import": "^2.29.1",
67-
"eslint-plugin-n": "^17.4.0",
68-
"eslint-plugin-promise": "^6.1.1",
69-
"eslint-plugin-vue": "^9.25.0",
70-
"glob": "^10.3.12",
67+
"eslint-plugin-n": "^17.9.0",
68+
"eslint-plugin-promise": "^6.4.0",
69+
"eslint-plugin-vue": "^9.27.0",
70+
"glob": "^11.0.0",
7171
"idb": "^8.0.0",
7272
"js-yaml": "^4.1.0",
7373
"luaparse": "^0.3.1",
74-
"naive-ui": "^2.38.2",
75-
"rimraf": "^5.0.5",
76-
"rollup": "^4.17.2",
74+
"naive-ui": "^2.39.0",
75+
"rimraf": "^6.0.1",
76+
"rollup": "^4.18.1",
7777
"rollup-plugin-esbuild": "^6.1.1",
7878
"rppi": "^0.1.0",
7979
"textarea-caret": "^3.1.0",
8080
"ts-node": "^10.9.2",
81-
"tslib": "^2.6.2",
82-
"typescript": "^5.4.5",
83-
"vite": "^5.2.11",
81+
"tslib": "^2.6.3",
82+
"typescript": "^5.5.3",
83+
"vite": "^5.3.4",
8484
"vite-plugin-pwa": "^0.20.0",
8585
"vite-plugin-run": "0.4.1",
8686
"vooks": "^0.2.12",
87-
"vue": "^3.4.26",
88-
"vue-router": "^4.3.2",
89-
"vue-tsc": "^2.0.16"
87+
"vue": "^3.4.32",
88+
"vue-router": "^4.4.0",
89+
"vue-tsc": "^2.0.26"
9090
}
9191
}

wasm/api.cpp

+22-20
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ namespace my_rime {
99

1010
enum { COMMITTED, ACCEPTED, REJECTED, UNHANDLED };
1111

12+
auto api = rime_get_api();
13+
1214
RimeTraits traits = {0};
1315
RimeSessionId session_id;
1416
RimeCommit commit;
@@ -42,14 +44,14 @@ void handler(void *context_object, RimeSessionId session_id,
4244
if (std::string(message_value) == "success") {
4345
deployed = true;
4446
RimeSchemaList schemas;
45-
RimeGetSchemaList(&schemas);
47+
api->get_schema_list(&schemas);
4648
for (size_t i = 0; i < schemas.size; ++i) {
4749
boost::json::object obj;
4850
obj["id"] = schemas.list[i].schema_id;
4951
obj["name"] = schemas.list[i].name;
5052
schema_array.push_back(obj);
5153
}
52-
RimeFreeSchemaList(&schemas);
54+
api->free_schema_list(&schemas);
5355
}
5456
EM_ASM(_deployStatus(UTF8ToString($0), UTF8ToString($1)), message_value,
5557
to_json(schema_array));
@@ -59,14 +61,14 @@ void handler(void *context_object, RimeSessionId session_id,
5961
std::string get_schema_name(std::string schema) { return schema_name[schema]; }
6062

6163
void start_rime() {
62-
RimeInitialize(&traits);
63-
RimeSetNotificationHandler(handler, NULL);
64+
api->initialize(&traits);
65+
api->set_notification_handler(handler, NULL);
6466
rime_started = true;
6567
}
6668

6769
void stop_rime() {
68-
RimeDestroySession(session_id);
69-
RimeFinalize();
70+
api->destroy_session(session_id);
71+
api->finalize();
7072
rime_started = false;
7173
}
7274

@@ -89,13 +91,13 @@ const char *post_process() {
8991
if (updated_schema.size()) {
9092
obj["updatedSchema"] = updated_schema;
9193
}
92-
RimeFreeCommit(&commit);
93-
Bool has_committed = RimeGetCommit(session_id, &commit);
94+
api->free_commit(&commit);
95+
Bool has_committed = api->get_commit(session_id, &commit);
9496
if (has_committed) {
9597
obj["committed"] = commit.text;
9698
}
97-
RimeFreeContext(&context);
98-
RimeGetContext(session_id, &context);
99+
api->free_context(&context);
100+
api->get_context(session_id, &context);
99101
if (context.composition.length > 0) {
100102
auto &composition = context.composition;
101103
std::string pre_edit = composition.preedit;
@@ -141,15 +143,15 @@ const char *post_process() {
141143

142144
extern "C" {
143145
void set_option(const char *option, int value) {
144-
RimeSetOption(session_id, option, value);
146+
api->set_option(session_id, option, value);
145147
}
146148

147149
void init() {
148150
RIME_STRUCT_INIT(RimeTraits, traits);
149151
traits.shared_data_dir = "/usr/share/rime-data";
150152
traits.user_data_dir = "/rime";
151153
traits.app_name = "My RIME";
152-
RimeSetup(&traits);
154+
api->setup(&traits);
153155
RIME_STRUCT_INIT(RimeCommit, commit);
154156
RIME_STRUCT_INIT(RimeContext, context);
155157
}
@@ -162,39 +164,39 @@ void set_page_size(int size) { page_size = size; }
162164

163165
const char *process(const char *input) {
164166
pre_process();
165-
RimeSimulateKeySequence(session_id, input);
167+
api->simulate_key_sequence(session_id, input);
166168
return post_process();
167169
}
168170

169171
const char *select_candidate_on_current_page(int index) {
170172
pre_process();
171-
RimeSelectCandidateOnCurrentPage(session_id, index);
173+
api->select_candidate_on_current_page(session_id, index);
172174
return post_process();
173175
}
174176

175177
const char *change_page(bool backward) {
176178
pre_process();
177-
RimeChangePage(session_id, backward);
179+
api->change_page(session_id, backward);
178180
return post_process();
179181
}
180182

181183
void set_ime(const char *ime) {
182184
if (rime_started) {
183185
// Need to reset session when using F4 to select a schema
184186
// not available yet.
185-
RimeDestroySession(session_id);
187+
api->destroy_session(session_id);
186188
} else {
187189
start_rime();
188190
}
189-
session_id = RimeCreateSession();
190-
RimeSelectSchema(session_id, ime);
191+
session_id = api->create_session();
192+
api->select_schema(session_id, ime);
191193
}
192194

193195
void deploy() {
194196
stop_rime();
195197
start_rime();
196-
RimeStartMaintenance(true);
197-
session_id = RimeCreateSession();
198+
api->start_maintenance(true);
199+
session_id = api->create_session();
198200
}
199201

200202
void reset() {

0 commit comments

Comments
 (0)