Commit graph

218 commits

Author SHA1 Message Date
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
Eberhard Beilharz
a08fbd1346
fix(linux): Ignore keys with IBUS_MOD4_MASK set
If we process keys that have the (Super/Meta/Windows) IBUS_MOD4_MASK
modifier set we ignore the key. Core doesn't handle the Meta modifier
state and so would treat it as regular key. This fixes switching keyboards
in Ubuntu 23.10/24.04 on Wayland.

Fixes #10476.
2024-02-07 18:14:05 +01:00
Marc Durdin
70ba1d1c1e
Merge branch 'chore/core/10520-hide-old-action-apis' into fix/core/10582-km_core_state_get_actions-idempotency 2024-02-05 13:44:47 +11:00
Marc Durdin
8156a8b19d
Merge pull request #10576 from keymanapp/fix/linux/9593_version-comparison
fix(linux): Fix version comparison
2024-02-02 09:47:37 +11:00
Eberhard Beilharz
13eb1002ae
refactor(linux): Deal with invalid version numbers 2024-02-01 17:26:38 +01:00
Eberhard Beilharz
df24cfda0a
chore(linux): Use correct format specifier for g_utf8_strlen
The package build on armhf failed because of the wrong format specifier
which expects a `size_t` instead of `glong` that `g_utf8_strlen` returns.
2024-02-01 16:51:10 +01:00
Eberhard Beilharz
f3efb244dc chore(linux): Adjust test expectations for ICU >= 73
ICU 73 comes with CLDR 43 which contains various corrections. This means
that we get different results when we minimize `bmf-Latn`. This change
sets the test expectations based on the ICU version and so allows tests
to pass on Ubuntu 24.04 which comes with ICU 74.
2024-02-01 14:55:36 +07:00
Marc Durdin
1b88ab99be fix(core): make km_core_state_get_actions() idempotent
Fixes #10582.

Returned struct from the `km_core_state_get_actions()` API is now owned
by the state object. This is a change in API contract. The corresponding
`km_core_actions_dispose()` API has been made private, because there is
never any need for API consumers to call it. As this change is happening
in alpha, we won't bump the ABI version.

`state->app_context` is now guaranteed to be in sync with
`state->context` after `km_core_process_event()`, with the actions
struct populated at that point.

The next and final step in this refactor is to remove the actions queue
altogether from the Core and make that a kmn-only concept, but that will
wait until 18.0. The only consumers of the actions queue are the
kmn-specific interactive debugger in Keyman Developer, and kmn-specific
Input Method eXtensions in Keyman Engine for Windows.
2024-02-01 11:28:08 +07:00
Eberhard Beilharz
02008dc585
fix(linux): Fix version comparison
Implement proper comparison of versions so that 1.10 is newer than 1.9.

Fixes #9593.
2024-01-31 14:47:35 +01:00
Eberhard Beilharz
6d5accdaa4
chore(linux): Adjust test expectations for ICU >= 73
ICU 73 comes with CLDR 43 which contains various corrections. This means
that we get different results when we minimize `bmf-Latn`. This change
sets the test expectations based on the ICU version and so allows tests
to pass on Ubuntu 24.04 which comes with ICU 74.
2024-01-31 12:05:14 +01:00
Marc Durdin
f546c44048
Merge pull request #10390 from keymanapp/epic/core/9999-normalization
epic: Keyman Core normalization 🌱
2024-01-31 10:45:51 +11:00
Eberhard Beilharz
60746e02d0
chore(core): Fix compilation error 2024-01-29 18:00:14 +01:00
Eberhard Beilharz
6b5b44eddd
fix(linux): Fix packaging on Ubuntu and Debian servers
When building packages warnings are treated as errors. When building on
Ubuntu and Debian servers we don't have a patched ibus version but still
want to build the packages. So this change outputs a message instead of
a warning when building packages.
2024-01-29 17:50:04 +01:00
Eberhard Beilharz
a79e64b02d
chore(linux): Add more debug output 2024-01-25 20:02:22 +01:00
Eberhard Beilharz
c713cd02cc
refactor(linux): address code review comments 2024-01-24 14:27:43 +01:00
Eberhard Beilharz
372af218ca
refactor(linux): Use km_core_state_action_items struct instead of queue
Implements #10353.
2024-01-23 17:05:49 +01:00
Marc Durdin
307f7da846 refactor(linux): use km_core_state_context_debug
Relates to #10365.
Fixes #10378.
2024-01-15 08:27:01 +07:00
Marc Durdin
9830f9ea24 refactor(core): use km_core_state_context_clear where possible
Relates to #10365.

Use `km_core_state_context_clear()` instead of `km_core_context_clear()`
as part of eliminating use of `km_core_state_context()`.
2024-01-12 12:05:00 +07:00
Eberhard Beilharz
9b768c57d7
refactor(linux): Use km_core_state_context_set_if_needed
Also update comment on `km_core_state_context_set_if_needed` to make it
clearer that it's expecting a UTF-16 string.

Closes #10212.
2024-01-10 18:57:41 +01:00
Eberhard Beilharz
52bb859817
chore(linux): Rename (lib)kmnkbp to (lib)keymancore 2023-10-19 10:35:09 +02:00
Eberhard Beilharz
337018a24b
chore(linux): Add missing tests
This adds (and fixes) two tests that were previously left out by
accident.
2023-10-17 20:29:28 +02:00
Eberhard Beilharz
0eb5065bf4
chore(linux): Unnecessary to check for NULL before calling g_free
`g_free` will return if the parameter is NULL, so we don't have to
check for that.

See glib [documentation](https://docs.gtk.org/glib/func.free.html).
2023-10-16 18:24:56 +02:00
Eberhard Beilharz
b0dd74ca59
feat(linux): Ignore invalid values in custom keyboards list 🏘️ 2023-10-12 18:31:42 +02:00
Eberhard Beilharz
8e1ee9ea7b
feat(linux): Allow loading of keyboards with arbitrary language 🏘️
Part of #8598.
2023-10-12 18:31:42 +02:00
Eberhard Beilharz
2a7d1758ae
feat(linux): Store user-added keyboards in GSettings 🏘️ 2023-10-12 18:31:41 +02:00
Eberhard Beilharz
7bab603b5b
refactor(linux): Simplify adding keyboard
Before we add a keyboard we check if we already added this keyboard
(in a different area). If we did (with the same or newer version) we
skip this keyboard. This change now immediately returns whereas previously
we set a flag and then didn't execute the rest of the method.
2023-10-10 18:00:05 +02:00
Eberhard Beilharz
22126a0eef
refactor(linux): Use auto cleanup 2023-10-10 15:52:51 +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
Marc Durdin
906a0a2ed7 chore: fix typo 2023-10-09 14:41:01 +07:00
Marc Durdin
4ef18f5e29 chore(core): rename keyboardprocessor.h to keyman_core_api.h
Fixes #9721.

Also tweaks some documentation references to keyboardprocessor, but does
not touch those relating to debian/control.
2023-10-09 14:21:01 +07:00
Eberhard Beilharz
4ab6031d0b
chore(linux): Address code review comments 2023-09-29 10:07:11 +02:00
Eberhard Beilharz
3812a1da3b
refactor(linux): Add more tests for keymanutil.c 🏘️ 2023-09-28 17:25:11 +02:00
Eberhard Beilharz
08f0b4dfed
chore(linux): Extract free_info method in kmpdetails.c 🏘️
Also add guard to kmpdetails.h.
2023-09-28 13:18:59 +02:00
Eberhard Beilharz
1b5a86607d
chore(linux): Check that background processes are still running
Before we run a test we now check that ibus and the other processes
we need are still running. If not we run test setup again.

Maybe fix #9570.
2023-09-25 18:55:54 +02:00
Eberhard Beilharz
89eab5e0ee
chore(linux): Don't crash if error is not set 2023-09-21 10:25:48 +02:00
Eberhard Beilharz
a03eca3d81
refactor(linux): Rename defines to clarify purpose 🏘️ 2023-09-18 19:00:29 +02:00
Eberhard Beilharz
7c7d46720c
chore(linux): Split startup process
This change improves the startup method so that it will also work
if ibus hasn't started yet. Also fixes two memory leaks.
2023-09-15 16:58:34 +02:00
Eberhard Beilharz
71c6bfb960
refactor(linux): Reformat file 2023-09-14 11:31:29 +02:00
Eberhard Beilharz
5a03371052
fix(linux): Get name, not version 2023-08-03 17:04:17 +02:00
Eberhard Beilharz
aac11a2c1e
chore(linux): Fix memory leaks 2023-08-03 17:04:16 +02:00
Eberhard Beilharz
81f46e1a6d
feat(linux): Minimize tags before adding keyboards
This ensures that bcp47 language tags are in a form the OS
understands.
2023-07-19 16:20:27 +02:00
Eberhard Beilharz
bc4b1fd19f
chore(linux): Remove do-nothing option --verbose
`ibus-engine-keyman` accepted a `--verbose` and `-v` command line
option which didn't do anything. Instead this change adds a comment
explaining how to get more verbose output.
2023-07-18 20:21:26 +02:00
Eberhard Beilharz
749112660d
chore(linux): Move some files to keyman-config
Some of the configuration files are useful for other distributions
as well. So this change moves them out of `debian/` to
`linux/keyman-config` so that they will be included in the source
tar ball.

Also remove zero-width space from one file.

Closes #8880.
2023-06-05 15:24:41 +02:00
Eberhard Beilharz
1823e1febb
feat(linux): Address code review comments 2023-05-23 11:48:58 +02:00
Eberhard Beilharz
ab25157364
feat(linux): Refactor to benefit from C++ RAII
Also apply changes from code review comments.
2023-05-22 19:51:45 +02:00
Eberhard Beilharz
c2e6fe23bd
feat(linux): Client side 2023-05-15 09:13:58 +02:00
Eberhard Beilharz
a7630a0265
fix(linux): Fix linux tests 2023-05-05 10:55:45 +02:00
Eberhard Beilharz
c20531b08a
chore(linux): Log error 2023-03-06 16:00:43 +01:00
Eberhard Beilharz
a26caa4d18
feat(linux): Add DBus method SendText
This new DBus method allows an OSK to output a junk of text.
2023-03-06 16:00:43 +01:00