diff --git a/HISTORY.md b/HISTORY.md index 1c66c6fc8d..858254e387 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,28 @@ # Keyman Version History +## 18.0.33 alpha 2024-05-10 + +* chore(common): Merge beta to master for Sprint A18S1 (part 2) (#11413) + +## 18.0.32 alpha 2024-05-09 + +* chore(common): Add `minimum-versions.inc.sh` (#11380) +* chore(core): km_core_cp -> km_core_cu (#11341) + +## 18.0.31 alpha 2024-05-08 + +* fix(windows): "Keyboard" should be lower case in UI string for font helper tool (#11392) + +## 18.0.30 alpha 2024-05-07 + +* chore(web): Improve dependencies (#11377) +* test(developer) keyboard info compiler unit tests 3 (#11255) + +## 18.0.29 alpha 2024-05-06 + +* chore(web): Improve web/test.sh script (#11355) +* chore(linux): Fix typo (#11356) + ## 18.0.28 alpha 2024-05-04 * chore(common): maintenance on build scripts - cd (#11329) @@ -121,6 +144,32 @@ * chore(common): move to 18.0 alpha (#10713) * chore: move to 18.0 alpha +## 17.0.322 beta 2024-05-10 + +* fix(web): fixes illegal KMW event state - can't focus a null element (#11385) + +## 17.0.321 beta 2024-05-09 + +* fix(android/engine): Skip updating selection range if invalid (#11384) +* refactor(android/engine): Refactor updateSelection (#11389) + +## 17.0.320 beta 2024-05-07 + +* fix(android): prevents mid-keystroke desynchronization when deleting selected text (#11367) +* fix(web): support SVG elements when checking className (#11365) +* fix(developer): define `lastSelLength` variable (#11366) + +## 17.0.319 beta 2024-05-04 + +* fix(android): inverting a selection range would crash Keyman (#11345) +* fix(developer): handle missing Name element for File element in package compiler (#11352) +* fix(developer): handle missing Description element for File element in package compiler (#11354) + +## 17.0.318 beta 2024-05-02 + +* fix(web): longpress shortcut activation should only consider northward part (#11306) +* chore(ios,mac): support build on Apple Silicon using Xcode 15.3 (#11302) + ## 17.0.317 beta 2024-05-01 * (#11322) diff --git a/VERSION.md b/VERSION.md index 14e3ac045e..2d77f14c8b 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -18.0.29 \ No newline at end of file +18.0.34 diff --git a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java index 85c14dfcb9..10b040cc2e 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java +++ b/android/KMAPro/kMAPro/src/main/java/com/keyman/android/SystemKeyboard.java @@ -57,6 +57,7 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven if (DependencyUtil.libraryExists(LibraryType.SENTRY) && !Sentry.isEnabled()) { Log.d(TAG, "Initializing Sentry"); SentryAndroid.init(getApplicationContext(), options -> { + options.setEnableAutoSessionTracking(false); options.setRelease(com.tavultesoft.kmapro.BuildConfig.VERSION_GIT_TAG); options.setEnvironment(com.tavultesoft.kmapro.BuildConfig.VERSION_ENVIRONMENT); }); diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java index eefcc766d4..1de7decfe0 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java @@ -141,6 +141,7 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene checkSendCrashReport(); if (KMManager.getMaySendCrashReport()) { SentryAndroid.init(context, options -> { + options.setEnableAutoSessionTracking(false); options.setRelease(com.tavultesoft.kmapro.BuildConfig.VERSION_GIT_TAG); options.setEnvironment(com.tavultesoft.kmapro.BuildConfig.VERSION_ENVIRONMENT); }); diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java index 5e54e73f4a..7d741feec0 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java @@ -170,51 +170,63 @@ final class KMKeyboard extends WebView { return result; } + /** + * Updates the selection range of the current context. + * Returns boolean - true if the selection range was updated successfully + */ protected boolean updateSelectionRange() { - boolean result = false; + InputConnection ic = KMManager.getInputConnection(this.keyboardType); - if (ic != null) { - ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0); - if (icText == null) { - return false; - } - - String rawText = icText.text.toString(); - updateText(rawText.toString()); - - int selStart = icText.selectionStart; - int selEnd = icText.selectionEnd; - - int selMin = selStart, selMax = selEnd; - if (selStart > selEnd) { - // Selection is reversed so "swap" - selMin = selEnd; - selMax = selStart; - } - - /* - The values of selStart & selEnd provided by the system are in code units, - not code-points. We need to account for surrogate pairs here. - - Fortunately, it uses UCS-2 encoding... just like JS. - - References: - - https://stackoverflow.com/a/23980211 - - https://android.googlesource.com/platform/frameworks/base/+/152944f/core/java/android/view/inputmethod/InputConnection.java#326 - */ - - // Count the number of characters which are surrogate pairs. - int pairsAtStart = CharSequenceUtil.countSurrogatePairs(rawText.substring(0, selStart), rawText.length()); - String selectedText = rawText.substring(selStart, selEnd); - int pairsSelected = CharSequenceUtil.countSurrogatePairs(selectedText, selectedText.length()); - - selStart -= pairsAtStart; - selEnd -= (pairsAtStart + pairsSelected); - this.loadJavascript(KMString.format("updateKMSelectionRange(%d,%d)", selStart, selEnd)); + if (ic == null) { + // Unable to get connection to the text + return false; } - result = true; - return result; + ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0); + if (icText == null) { + // Failed to get text becausee either input connection became invalid or client is taking too long to respond + // https://developer.android.com/reference/android/view/inputmethod/InputConnection#getExtractedText(android.view.inputmethod.ExtractedTextRequest,%20int) + return false; + } + + String rawText = icText.text.toString(); + updateText(rawText.toString()); + + int selMin = icText.selectionStart, selMax = icText.selectionEnd; + + if (selMin < 0 || selMax < 0) { + // There is no selection or cursor + // Reference https://developer.android.com/reference/android/text/Selection#getSelectionEnd(java.lang.CharSequence) + return false; + } + + if (selMin > selMax) { + // Selection is reversed so "swap" + selMin = icText.selectionEnd; + selMax = icText.selectionStart; + } + + /* + The values of selStart & selEnd provided by the system are in code units, + not code-points. We need to account for surrogate pairs here. + + Fortunately, it uses UCS-2 encoding... just like JS. + + References: + - https://stackoverflow.com/a/23980211 + - https://android.googlesource.com/platform/frameworks/base/+/152944f/core/java/android/view/inputmethod/InputConnection.java#326 + */ + + // Count the number of characters which are surrogate pairs. + int pairsAtStart = CharSequenceUtil.countSurrogatePairs(rawText.substring(0, selMin), rawText.length()); + String selectedText = rawText.substring(selMin, selMax); + int pairsSelected = CharSequenceUtil.countSurrogatePairs(selectedText, selectedText.length()); + + selMin -= pairsAtStart; + selMax -= (pairsAtStart + pairsSelected); + this.loadJavascript(KMString.format("updateKMSelectionRange(%d,%d)", selMin, selMax)); + + return true; } diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java index 74be658216..926ef094f7 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java @@ -135,13 +135,13 @@ public class KMKeyboardJSHandler { end = temp; } if (end > start) { + k.setShouldIgnoreSelectionChange(true); if (s.length() == 0) { ic.setSelection(start, start); ic.deleteSurroundingText(0, end - start); ic.endBatchEdit(); return; } else { - k.setShouldIgnoreSelectionChange(true); ic.setSelection(start, start); ic.deleteSurroundingText(0, end - start); } diff --git a/common/include/km_types.h b/common/include/km_types.h index 0ae6252752..68d741afb0 100644 --- a/common/include/km_types.h +++ b/common/include/km_types.h @@ -28,14 +28,14 @@ typedef uint8_t KMX_BYTE; typedef uint16_t KMX_WORD; #if defined(__cplusplus) -typedef char16_t km_core_cp; +typedef char16_t km_core_cu; typedef char32_t km_core_usv; #else -typedef uint16_t km_core_cp; // code point +typedef uint16_t km_core_cu; // code unit typedef uint32_t km_core_usv; // Unicode Scalar Value #endif -typedef km_core_cp KMX_WCHAR; // wc, 16-bit UNICODE character +typedef km_core_cu KMX_WCHAR; // wc, 16-bit UNICODE character typedef KMX_WCHAR* PKMX_WCHAR; typedef char KMX_CHAR; @@ -60,7 +60,7 @@ typedef KMX_DWORD* PKMX_DWORD; #ifdef USE_CHAR16_T #define lpuch(x) u ## x -typedef km_core_cp KMX_UCHAR; +typedef km_core_cu KMX_UCHAR; #else #define lpuch(x) L ## x typedef wchar_t KMX_UCHAR; diff --git a/common/web/types/build.sh b/common/web/types/build.sh index f1b7c2419c..bf23ea8849 100755 --- a/common/web/types/build.sh +++ b/common/web/types/build.sh @@ -8,6 +8,7 @@ THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" builder_describe "Build Keyman common file types module" \ + "@/core/include/ldml" \ "@/common/web/keyman-version" \ "configure" \ "build" \ diff --git a/common/web/types/package.json b/common/web/types/package.json index 529624bc64..38293f2532 100644 --- a/common/web/types/package.json +++ b/common/web/types/package.json @@ -29,6 +29,7 @@ "url": "https://github.com/keymanapp/keyman/issues" }, "dependencies": { + "@keymanapp/ldml-keyboard-constants": "*", "@keymanapp/keyman-version": "*", "restructure": "git+https://github.com/keymanapp/dependency-restructure.git#7a188a1e26f8f36a175d95b67ffece8702363dfc", "semver": "^7.5.2", diff --git a/core/CORE_API_VERSION.md b/core/CORE_API_VERSION.md index 3eefcb9dd5..227cea2156 100644 --- a/core/CORE_API_VERSION.md +++ b/core/CORE_API_VERSION.md @@ -1 +1 @@ -1.0.0 +2.0.0 diff --git a/core/include/keyman/keyman_core_api.h b/core/include/keyman/keyman_core_api.h index 724b30299f..328965e876 100644 --- a/core/include/keyman/keyman_core_api.h +++ b/core/include/keyman/keyman_core_api.h @@ -205,7 +205,7 @@ interface. Fundamental types for representing data passed across the API. -### km_core_cp type +### km_core_cu type `uint16_t/char16_t` @@ -683,7 +683,7 @@ KMN_API km_core_context_status km_core_state_context_set_if_needed( km_core_state *state, - km_core_cp const *application_context + km_core_cu const *application_context ); /* @@ -800,8 +800,8 @@ Platform layer. ## Specification ```c */ struct km_core_option_item { - km_core_cp const * key; - km_core_cp const * value; + km_core_cu const * key; + km_core_cu const * value; uint8_t scope; }; @@ -860,8 +860,8 @@ KMN_API km_core_status km_core_state_option_lookup(km_core_state const *state, uint8_t scope, - km_core_cp const *key, - km_core_cp const **value); + km_core_cu const *key, + km_core_cu const **value); /* ``` @@ -1005,8 +1005,8 @@ Provides read-only information about a keyboard. ```c */ typedef struct { - km_core_cp const * version_string; - km_core_cp const * id; + km_core_cu const * version_string; + km_core_cu const * id; km_core_path_name folder_path; km_core_option_item const * default_options; } km_core_keyboard_attrs; @@ -1070,8 +1070,8 @@ Describes a single Input Method eXtension library and entry point. ```c */ typedef struct { - km_core_cp const * library_name; - km_core_cp const * function_name; + km_core_cu const * library_name; + km_core_cu const * function_name; uint32_t imx_id; } km_core_keyboard_imx; @@ -1332,7 +1332,7 @@ void km_core_state_imx_register_callback(km_core_state *state, km_core_keyboard_ : pointer to a function that implements the IMX callback `callback_object` -: An opaque pointer that can be used to pass context information to the callback function, +: An opaque pointer that can be used to pass context information to the callback function, usually it is a user-defined data structure. ------------------------------------------------------------------------------- @@ -1523,7 +1523,7 @@ Returns a debug formatted string of the context from the state. ```c */ KMN_API -km_core_cp * +km_core_cu * km_core_state_context_debug(km_core_state *state, km_core_debug_context_type context_type); /* @@ -1538,16 +1538,16 @@ km_core_state_context_debug(km_core_state *state, km_core_debug_context_type con ## Returns -A pointer to a [km_core_cp] UTF-16 string. Must be disposed of by a call -to [km_core_cp_dispose]. +A pointer to a [km_core_cu] UTF-16 string. Must be disposed of by a call +to [km_core_cu_dispose]. ------------------------------------------------------------------------------- -# km_core_cp_dispose() +# km_core_cu_dispose() ## Description -Free the allocated memory belonging to a [km_core_cp] array previously +Free the allocated memory belonging to a [km_core_cu] array previously returned by [km_core_state_context_debug]. May be `nullptr`. ## Specification @@ -1555,14 +1555,14 @@ returned by [km_core_state_context_debug]. May be `nullptr`. ```c */ KMN_API void -km_core_cp_dispose(km_core_cp *cp); +km_core_cu_dispose(km_core_cu *cp); /* ``` ## Parameters `cp` -: A pointer to the start of the [km_core_cp] array to be disposed of. +: A pointer to the start of the [km_core_cu] array to be disposed of. ------------------------------------------------------------------------------- diff --git a/core/include/keyman/keyman_core_api_debug.h b/core/include/keyman/keyman_core_api_debug.h index 8f80481d2c..493de708a4 100644 --- a/core/include/keyman/keyman_core_api_debug.h +++ b/core/include/keyman/keyman_core_api_debug.h @@ -24,7 +24,7 @@ extern "C" #endif /** - * The maximum size of context in km_core_cp units for a single debug + * The maximum size of context in km_core_cu units for a single debug * event. This is taken from MAXCONTEXT in keyman32 (Windows) and is purely * a convenience value. We can increase it if there is a demonstrated need. */ @@ -65,7 +65,7 @@ typedef struct { */ typedef struct { void *store; // LPSTORE - km_core_cp value[DEBUG_MAX_CONTEXT]; // value to be saved into the store + km_core_cu value[DEBUG_MAX_CONTEXT]; // value to be saved into the store } km_core_state_debug_kmx_option_info; /** @@ -80,7 +80,7 @@ typedef struct { */ typedef struct { - km_core_cp context[DEBUG_MAX_CONTEXT]; // The context matched by the rule (? may not need this?) // TODO: rename to context_matched + km_core_cu context[DEBUG_MAX_CONTEXT]; // The context matched by the rule (? may not need this?) // TODO: rename to context_matched void *group; // LPGROUP void *rule; // LPKEY uint16_t store_offsets[DEBUG_STORE_OFFSETS_SIZE]; // pairs--store, char position, terminated by 0xFFFF // TODO use a better structure here diff --git a/core/src/context.hpp b/core/src/context.hpp index bcab65f85d..91cc9688cd 100644 --- a/core/src/context.hpp +++ b/core/src/context.hpp @@ -45,8 +45,8 @@ void context::push_marker(uint32_t marker) { // Context helper functions -km_core_cp* get_context_as_string(km_core_context *context); -km_core_status set_context_from_string(km_core_context *context, km_core_cp const *new_context); +km_core_cu* get_context_as_string(km_core_context *context); +km_core_status set_context_from_string(km_core_context *context, km_core_cu const *new_context); } // namespace core } // namespace km @@ -84,7 +84,7 @@ struct km_core_context : public km::core::context * `km_core_context_items_dispose`. */ km_core_status -context_items_from_utf16(km_core_cp const *text, +context_items_from_utf16(km_core_cu const *text, km_core_context_item **out_ptr); /** @@ -113,7 +113,7 @@ context_items_from_utf16(km_core_cp const *text, */ km_core_status context_items_to_utf16(km_core_context_item const *item, - km_core_cp *buf, + km_core_cu *buf, size_t *buf_size); /** diff --git a/core/src/context_helpers.cpp b/core/src/context_helpers.cpp index 6c687f3200..ff59c6a233 100644 --- a/core/src/context_helpers.cpp +++ b/core/src/context_helpers.cpp @@ -13,9 +13,9 @@ using namespace km::core; /** - * Retrieves the context as a km_core_cp string, dropping markers + * Retrieves the context as a km_core_cu string, dropping markers */ -km_core_cp* km::core::get_context_as_string(km_core_context *context) { +km_core_cu* km::core::get_context_as_string(km_core_context *context) { assert(context != nullptr); if(context == nullptr) { return nullptr; @@ -33,7 +33,7 @@ km_core_cp* km::core::get_context_as_string(km_core_context *context) { return nullptr; } - km_core_cp *app_context_string = new km_core_cp[buf_size]; + km_core_cu *app_context_string = new km_core_cu[buf_size]; km_core_status status = context_items_to_utf16(context_items, app_context_string, &buf_size); km_core_context_items_dispose(context_items); @@ -46,9 +46,9 @@ km_core_cp* km::core::get_context_as_string(km_core_context *context) { } /** - * Updates the context from the new_context km_core_cp string + * Updates the context from the new_context km_core_cu string */ -km_core_status km::core::set_context_from_string(km_core_context *context, km_core_cp const *new_context) { +km_core_status km::core::set_context_from_string(km_core_context *context, km_core_cu const *new_context) { assert(context != nullptr); assert(new_context != nullptr); if(context == nullptr || new_context == nullptr) { diff --git a/core/src/km_core_context_api.cpp b/core/src/km_core_context_api.cpp index 980aa6f298..dd27ab7e5c 100644 --- a/core/src/km_core_context_api.cpp +++ b/core/src/km_core_context_api.cpp @@ -108,7 +108,7 @@ namespace { } km_core_status -context_items_from_utf16(km_core_cp const *text, +context_items_from_utf16(km_core_cu const *text, km_core_context_item **out_ptr) { return _context_items_from(reinterpret_cast(text), out_ptr); @@ -125,7 +125,7 @@ km_core_status context_items_to_utf8(km_core_context_item const *ci, km_core_status context_items_to_utf16(km_core_context_item const *ci, - km_core_cp *buf, size_t * sz_ptr) + km_core_cu *buf, size_t * sz_ptr) { return _context_items_to(ci, reinterpret_cast(buf), diff --git a/core/src/km_core_options_api.cpp b/core/src/km_core_options_api.cpp index 4ea5c74062..4811ee9161 100644 --- a/core/src/km_core_options_api.cpp +++ b/core/src/km_core_options_api.cpp @@ -36,8 +36,8 @@ km_core_options_list_size(km_core_option_item const *opts) km_core_status km_core_state_option_lookup(km_core_state const *state, - uint8_t scope, km_core_cp const *key, - km_core_cp const **value_out) + uint8_t scope, km_core_cu const *key, + km_core_cu const **value_out) { assert(state); assert(key); assert(value_out); if (!state || !key || !value_out) return KM_CORE_STATUS_INVALID_ARGUMENT; diff --git a/core/src/km_core_state_api.cpp b/core/src/km_core_state_api.cpp index 0f3fd7f112..16af9511d8 100644 --- a/core/src/km_core_state_api.cpp +++ b/core/src/km_core_state_api.cpp @@ -285,22 +285,22 @@ km_core_status km_core_state_context_clear( return KM_CORE_STATUS_OK; } -void km_core_cp_dispose( - km_core_cp *cp +void km_core_cu_dispose( + km_core_cu *cp ) { if(cp != nullptr) { delete [] cp; } } -km_core_cp * _new_error_string(std::u16string const str) { - km_core_cp* result = new km_core_cp[str.size()+1]; +km_core_cu * _new_error_string(std::u16string const str) { + km_core_cu* result = new km_core_cu[str.size()+1]; str.copy(result, str.size()); result[str.size()] = 0; return result; } -km_core_cp * km_core_state_context_debug( +km_core_cu * km_core_state_context_debug( km_core_state *state, km_core_debug_context_type context_type ) { @@ -359,7 +359,7 @@ km_core_cp * km_core_state_context_debug( std::u16string s = std::wstring_convert, char16_t>{}.from_bytes(buffer.str()); - km_core_cp* result = new km_core_cp[s.size() + 1]; + km_core_cu* result = new km_core_cu[s.size() + 1]; s.copy(result, s.size()); result[s.size()] = 0; @@ -385,11 +385,11 @@ state_should_invalidate_context(km_core_state *state, // if emit_keystroke is present, check if a context reset is needed if (state_has_action_type(state, KM_CORE_IT_EMIT_KEYSTROKE)) { if ( - // when a backspace keystroke is emitted, it is because we are at the start of - // context, and we want to give the application the chance to process it, e.g. - // by moving to previous field. Note that context manipulation does not result - // in an emit_keystroke backspace action, as this is handled through the - // `code_points_to_delete` field. So we always invalidate context when a + // when a backspace keystroke is emitted, it is because we are at the start of + // context, and we want to give the application the chance to process it, e.g. + // by moving to previous field. Note that context manipulation does not result + // in an emit_keystroke backspace action, as this is handled through the + // `code_points_to_delete` field. So we always invalidate context when a // processor emits a backspace. vk == KM_CORE_VKEY_BKSP || // certain modifiers invalidate context diff --git a/core/src/km_core_state_context_set_if_needed.cpp b/core/src/km_core_state_context_set_if_needed.cpp index 7107815249..70dd5fddb7 100644 --- a/core/src/km_core_state_context_set_if_needed.cpp +++ b/core/src/km_core_state_context_set_if_needed.cpp @@ -39,12 +39,12 @@ typedef struct { // Forward declarations -bool replace_context(context_change_result context_change, km_core_context *context, km_core_cp const *new_context); +bool replace_context(context_change_result context_change, km_core_context *context, km_core_cu const *new_context); bool should_normalize(km_core_state *state); -context_change_result get_context_change(km_core_cp const *new_context, km_core_context *context); +context_change_result get_context_change(km_core_cu const *new_context, km_core_context *context); context_change_result get_context_items_change(km_core_context_item *new_context_items, km_core_context_item *context_items); -bool do_normalize_nfd(km_core_cp const * src, std::u16string &dst); +bool do_normalize_nfd(km_core_cu const * src, std::u16string &dst); km_core_context_status do_fail(km_core_context *app_context, km_core_context *cached_context, const char* error); // --------------------------------------------------------------------------- @@ -52,7 +52,7 @@ km_core_context_status do_fail(km_core_context *app_context, km_core_context *ca km_core_context_status km_core_state_context_set_if_needed( km_core_state *state, - km_core_cp const *new_app_context + km_core_cu const *new_app_context ) { assert(state != nullptr); assert(new_app_context != nullptr); @@ -91,7 +91,7 @@ km_core_state_context_set_if_needed( // Finally, we normalize and replace the cached context std::u16string normalized_buffer; - km_core_cp const *new_cached_context = nullptr; + km_core_cu const *new_cached_context = nullptr; if (should_normalize(state)) { if (!do_normalize_nfd(new_app_context, normalized_buffer)) { @@ -128,7 +128,7 @@ bool replace_context( context_change_result context_change, km_core_context *context, - km_core_cp const *new_context + km_core_cu const *new_context ) { if (context_change.type == CONTEXT_DIFFERENT) { if (set_context_from_string(context, new_context) != KM_CORE_STATUS_OK) { @@ -189,7 +189,7 @@ context_previous_char( */ context_change_result get_context_change( - km_core_cp const *new_context_string, + km_core_cu const *new_context_string, km_core_context *context ) { context_change_result change_type({CONTEXT_DIFFERENT, 0}); @@ -286,7 +286,7 @@ get_context_items_change( /** * Normalize the input string using ICU */ -bool do_normalize_nfd(km_core_cp const * src, std::u16string &dst) { +bool do_normalize_nfd(km_core_cu const * src, std::u16string &dst) { UErrorCode icu_status = U_ZERO_ERROR; const icu::Normalizer2 *nfd = icu::Normalizer2::getNFDInstance(icu_status); assert(U_SUCCESS(icu_status)); diff --git a/core/src/kmx/kmx_debugger.cpp b/core/src/kmx/kmx_debugger.cpp index 374175a650..f380e28942 100644 --- a/core/src/kmx/kmx_debugger.cpp +++ b/core/src/kmx/kmx_debugger.cpp @@ -61,7 +61,7 @@ void KMX_DebugItems::fill_store_offsets(km_core_state_debug_kmx_info *info, PKMX int i, n; - km_core_cp *p; + km_core_cu *p; // TODO turn this into a struct rather than interwoven values for(i = n = 0, p = static_cast(info->rule)->dpContext; p && *p; p = incxstr(p), i++) { diff --git a/core/src/kmx/kmx_environment.cpp b/core/src/kmx/kmx_environment.cpp index 1260f0f4be..bd4d57d0e7 100644 --- a/core/src/kmx/kmx_environment.cpp +++ b/core/src/kmx/kmx_environment.cpp @@ -11,7 +11,7 @@ using namespace km::core; using namespace kmx; namespace { - km_core_cp const + km_core_cu const *DEFAULT_PLATFORM = u"windows hardware desktop native", *DEFAULT_BASELAYOUT = u"kbdus.dll", *DEFAULT_BASELAYOUTALT = u"en-US", diff --git a/core/src/kmx/kmx_environment.h b/core/src/kmx/kmx_environment.h index 6202333b73..0cb90bed28 100644 --- a/core/src/kmx/kmx_environment.h +++ b/core/src/kmx/kmx_environment.h @@ -15,8 +15,8 @@ private: std::u16string _platform; void InitOption( std::vector