Commit graph

69 commits

Author SHA1 Message Date
SabineSIL
9ca40faac7
Merge branch 'master' into chore/developer/scatteredCode/cleanup_VKeys
Some checks are pending
Keyman Build Summary / Summarize build status checks (push) Waiting to run
2026-07-02 09:37:43 +02:00
Marc Durdin
6a98a39b8a
Merge branch 'master' into chore/web-core-preflight 2026-05-27 22:37:12 +10:00
Marc Durdin
94723ba556 chore(common): move common cpp files and remove unused files
* Move the following files from common/windows/cpp/include/ to
  common/include/:
  * keymanversion.h
  * vkeys.h

* Move the following file from common/windows/cpp/ to common/cpp/:
  * vkeys.cpp

* Move crc32.cpp,crc32.h into kmcmplib, as they are only used there.

* Remove unused ConvertUTF.c and ConvertUTF.h.

* Update references to the above files.

* Remove precompiled header refs from vkeys.cpp and change data type to
  `char*` for types in vkeys.cpp (unless `USE_CHAR16_T` is defined), so
  that it is more cross-platform accessible, update usages accordingly,
  fixup project definitions accordingly.

* Remove unused define `KMN_KBP_EXPORTING` from kmcmplib/meson.build.

Fixes: #15565
Test-bot: skip
2026-05-20 13:44:05 +02:00
Marc Durdin
8da5cdd059 chore: Merge remote-tracking branch 'origin/epic/web-core' into chore/merge-master-into-web-core 2025-08-28 10:42:57 +02:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00
Sabine
50204abc3d chore(common): disable VK_DECIMAL again in keyman_vkeys.h 2025-07-17 14:54:56 +02:00
Sabine
e2ed50293b chore(common): use new namespace km_vk in kmdecomp 2025-07-17 11:27:49 +02:00
Sabine
9a8e0523f9 chore(common): use new namespace km_vk in imsample.cpp 2025-07-16 13:02:14 +02:00
Sabine
ed8e24812e chore(common): remove VK_DECIMAL from keyman_vkey.h 2025-07-16 12:21:02 +02:00
Sabine
a1465c0767 chore(common): missing semicolon in savekeyboard.cpp 2025-07-16 11:34:09 +02:00
Sabine
49d5270e29 chore(common): use new namespace km_vk in kmx_processevent.cpp, Compiler.cpp and savekeyboard.cpp 2025-07-16 10:56:41 +02:00
Sabine
b4d76dcc51 chore(common): use new namespace km_vk in charToKeyConversion and mac/mcompile/keymap.h 2025-07-15 17:18:32 +02:00
Sabine
be0c84faad chore(common): use new namespace km_vk for constants(2.) 2025-07-15 15:09:10 +02:00
Marc Durdin
7c42887ead
Merge branch 'epic/web-core' into chore/merge-master-into-web-core 2025-03-31 12:13:48 +07:00
Marc Durdin
0ea9938036
Merge pull request #9390 from keymanapp/epic/linux-mcompile
epic: linux and mac mcompile 🐘
2025-03-18 14:36:37 +07:00
Steven R. Loomis
1306cf8760 feat(core): move kmx_plus.tests.cpp to GTest
- also update test_assert.h to vector to GTest if present
2025-03-13 15:05:55 -05:00
Eberhard Beilharz
69cb2fda59
fix(core): use a specific flag for adjusting alignments
This change adds a new flag `KMX_REQUIRES_REALIGNMENT` instead of the
previous `KMX_64BIT` for the cases where we have to re-align the KMX data
at pointer boundaries. Renamed because Emscripten also needs the
re-alignment even though it's 32-bit.

Addresses code review comments.
2025-01-06 14:29:57 +01:00
Marc Durdin
01cedf68b7
Merge branch 'epic/linux-mcompile' into chore/merge-master-into-linux-mcompile 2024-12-05 08:49:17 +01:00
Marc Durdin
d71cb56ca7 fix(core): rename assert() to test_assert() in unit tests
Had a real yak shave this morning with disabling assertions in release
builds in our C/C++ code. It turns out that our unit tests use
`assert()` which we intended to use from `test_assert.h`, but in some
cases `cassert` or `assert.h` had been #included after `test_assert.h`,
overriding our special `assert()` macro. The chain of includes is
somewhat hard to puzzle out -- it's often buried several levels deep.
This meant that a release build would drop all test assertions, meaning
most tests passed, unsurprisingly, as there were no assertions left to
fail ... but some tests failed with crashes because we optimized out
important lines such as `assert(some_important_function())`.

I was quite unhappy with this fragility, so I have opted to rename
`assert()` to `test_assert()` in all of our home-grown C/C++ unit tests,
which further highlighted unit tests which were only using the C/C++
`assert()` and not ours, so then had to figure out which unit test
executables needed to have `test_assert` added, and then ... then ...
discovered a bug in `test_color.h`, where we were #including
`io.h`/`unistd.h` inside a `namespace console_color {}` block, which
just happened to be the first ref to those beautiful headers, and thus
(because `#pragma once`) meant that useful little functions like
`access()` were no longer accessible to us in the global namespace.

I have also audited Every Single Call to `assert()` to verify that we do
not do Important Work inside the parentheses, and, apart from those
offending unit tests, now resolved with `test_assert()`, it looks like
all is good.

I would like to present one very well-shaved yak in this commit.

Fixes: #12619
2024-11-28 09:46:01 +07:00
SabineSIL
0a3947ed3c
Merge branch 'epic/linux-mcompile' into feat/mac/mcompile_mac 2024-10-08 19:27:58 +02:00
Dr Mark C. Sinclair
510e5aabd5 fix(developer): modify u16ltrim to copy non-trimmed characters to beginning of string 2024-09-10 10:56:53 +01:00
Dr Mark C. Sinclair
52f0897693 fix(developer): add doc comment to u16trim 2024-09-05 14:32:16 +01:00
Dr Mark C. Sinclair
b902c43ff2 fix(developer): add doc comment to u16rtrim 2024-09-05 14:32:05 +01:00
Dr Mark C. Sinclair
aa6db34ae2 fix(developer): add doc comment to u16ltrim 2024-09-05 14:31:56 +01:00
Dr Mark C. Sinclair
f4115a30dc fix(developer): add u16ltrim(), u16rtrim() and u16trim() to km_u16.cpp and km_u16.h 2024-08-29 15:46:41 +01:00
Marc Durdin
684a2dfa2d
Merge branch 'master' into feat/mac/mcompile_mac 2024-08-14 22:21:33 +10:00
Marc Durdin
dde4e2b2c3 refactor: move kmx_u16 to common and rename to km_u16 2024-08-14 10:07:08 +02:00
Marc Durdin
613bdb6c19 refactor(core): move utfcodec to common
Refactor to support codecvt cleanup work in kmcmplib.
2024-08-13 15:04:07 +02:00
Sabine
cb31cebb33 feat(mac): remove dublicate #include 2024-07-19 12:09:16 +02:00
Joshua Horton
4db806a9d8
Merge branch 'master' into feat/mac/mcompile_mac 2024-06-19 14:09:01 +07:00
Marc Durdin
9465c3e0b4 refactor(common): move enabled declaration into test_color.cpp
Moves variable declaration for `bool enabled` from .h to .cpp and fixes
up builds. Fixes `#include` in ldml_test_source.cpp which was inside a
namespace.

Fixes: #10426
2024-05-20 15:42:41 +07:00
Steven R. Loomis
1fe76bcd26
Merge branch 'master' into chore/core/11033-points-not-units 2024-05-07 09:26:07 -05:00
Steven R. Loomis
fbd1c0c841 chore(core): km_core_cp -> km_core_cu
- fix comment
- fix API version

Fixes: #11033

Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2024-05-06 09:54:07 -05:00
Steven R. Loomis
6706ae0957 chore(core): km_core_cp -> km_core_cu
- km_core_cp represents a 16 bit code unit, not a code point.

Fixes: #11033
2024-05-02 17:39:15 -05:00
SabinePlay
b2072483bc feat(mac): new get_keyval_From_Keycode()
feat(mac): include km_types and u16

feat(mac): include filesystem and some kmx

feat(mac): include old functions in keymap

feat(mac): include kmx_file, mc_kmxfile

feat(mac): include deadkey, filesystem, km_types, import_rules,mc_kmxfile

feat(mac): include functions in mcompile.cpp/h

feat(mac): #includes out to be used
2024-05-02 12:38:46 +02:00
Marc Durdin
cd8121ef65 chore(common): builder scripts now use /resources/build/builder.inc.sh
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).

This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
2024-05-02 15:54:31 +07:00
Marc Durdin
0f390d47cc chore(common): maintenance on build scripts - cd
Fixes #11324.

* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts
2024-05-02 15:54:29 +07:00
Steven R. Loomis
5b1c853557 fix(common,core): support other lookup for modifiers
- the 'other' keyword was incorrectly called 'default'

Fixes: #11072
2024-04-01 23:21:33 -05:00
Steven R. Loomis
5615a5eb4c chore(common): add more references to 0x10000
- at least add comments pointing back to keyman_core_ldml.ts

Fixes: #11072
2024-04-01 12:26:00 -05:00
Steven R. Loomis
bca037cbf3 chore(core): support default lookup for modifiers
- remove default flag from kmx_file.h

Fixes: #11072
2024-03-29 12:07:29 -05:00
Steven R. Loomis
313bbd32a7 feat(core): kmx+ scaffolding for modifiers=default
- add a new value, 0x10000 to indicate 'default'

For: #11072
2024-03-28 12:19:41 -05:00
Marc Durdin
40f0839a4a chore(core): remove bogus test_color.h inclusion 2024-01-17 11:03:42 +07:00
Steven R. Loomis
b6ca0e9ab8 fix(common): kmx struct alignment 🙀
- add gcc / clang and msvc alignment options

For: #9138
2023-11-16 14:37:00 -06:00
Steven R. Loomis
dc5ac44369 fix(common): kmx struct alignment 🙀
- move KMX struct alignment to km_types.h

For: #9138
2023-11-16 14:37:00 -06:00
Steven R. Loomis
2913ba45a8 fix(common): dx: don't call exit(0) on failure 🙀
- always use std::exit(EXIT_FAILURE) if there is an error.
- use --print-errorlogs with meson to show errors to the log

Fixes: #10004
2023-11-14 07:16:32 -06:00
Eberhard Beilharz
604fbc1a75
chore(linux): Rename namespace kbp to core 2023-10-19 10:39:55 +02:00
Eberhard Beilharz
2f073f7778
chore(linux): Rename KMN_CORE to KM_CORE_LIBRARY 2023-10-19 08:51:29 +02:00
Eberhard Beilharz
b5c6f31b05
chore(linux): Rename KBP to CORE 2023-10-18 15:48:21 +02:00
Marc Durdin
db76e2541d chore: rename KM_KBP_ to KM_CORE_ 2023-10-09 14:53:22 +07:00
Marc Durdin
ba5f18defd chore: rename km_kbp_ to km_core_ 2023-10-09 14:53:13 +07:00