Commit Graph

22 Commits (master)

Author SHA1 Message Date
nirenjan 84e151389a feat: Enhance x52 character map bin file
Prior to this change, the char_map.bin file was only used for testing.
However, with the upcoming support for profiles, we need to enhance it
and have it installed in the data directory for use by the (future)
compiler.
2026-04-07 23:50:28 -07:00
nirenjan de465fbf6a refactor: Rename daemon sources to remove x52d_ prefix 2026-04-03 23:50:18 -07:00
nirenjan 836206d93f build: Rename source files to remove prefixes
This change makes it simpler to add new sources in the future, they are
already grouped by functionality, so the prefix does nothing.
2026-04-03 23:02:43 -07:00
nirenjan 9c1eaaa4b2 build: Migrate includes to use libx52/ prefix
As part of the refactor, have the sources include the public headers via
the libx52 prefix, instead of relying on the include directories
approach in meson.build
2026-04-03 22:54:48 -07:00
nirenjan 9c47e78fc5 fix: Make pc files not include -Ilibx52/ in CFLAGS
Modern libraries do not handhold the user into just calling the header,
instead they namespace it, e.g. libevdev/libevdev.h. Because we already
install our headers under the libx52/ directory, having the pkg-config
files specify `-Ilibx52/` is a legacy from the old days, and should no
longer be used.

This commit also adds pkg-config files for x52dcomm and vkm, installing
them in their proper locations.
2026-04-03 22:42:37 -07:00
nirenjan 7bdaea442e cleanup: Remove autotools build infrastructure
The autotools build infrastructure was deprecated back in 0.3.3, and any
bugs in the Meson build infrastructure have been fixed now. This
eliminates the legacy build scripts which were hard to maintain.
2026-04-03 22:36:10 -07:00
nirenjan 667e8e2a7b feat: Update symbol visibility 2026-03-30 22:35:52 -07:00
nirenjan 732bc21b65 fix: Address compiler warnings
When enabling --warnlevel=3 during Meson setup, the build threw up
several warnings, mostly related to either unused parameters, or
sometimes an integer type mismatch. This commit addresses all of those
changes and ensures that the build does not contain any unnecessary
warnings.
2026-03-19 00:10:18 -07:00
nirenjan 45d561e0d8 test: Fix SMP test in libx52util
The SMP test was incorrectly calculating the codepoints, resulting in a
test of the codepoints inside the BMP, instead of the individual SMPs.
2026-03-16 22:23:00 -07:00
nirenjan a1098bc134 feat: Add benchmarking for libx52util-bmp-test 2026-03-16 11:16:41 -07:00
nirenjan 569902be76 fix: Add support for Automake tests
In order to continue to support Automake builds, we need to update the
source to comply with C90 standards, as well as ignoring the warnings in
the test binary.
2026-03-16 10:45:02 -07:00
nirenjan 0cb137bbe0 feat: Handle the entire BMP in libx52util
Prior to this change, the libx52util_convert_utf8_string function had a
limited set of characters that it would convert to the MFD character
map, these characters were derived from the x52_char_map.cfg file.
However, this is a tiny subset of the actual supported characters in the
Basic Multilingual Plane (BMP), since many characters in the BMP can be
normalized to a different character (or character sequence) that has a
corresponding glyph on the X52 MFD.

One example of this is the half-width Katakana characters which are
mapped in the display, however the corresponding full-width characters
were not explicitly mapped. With this commit, the generator script now
automatically detects that the half-width characters can be normalized
to the corresponding full width forms, and maps the full width forms
back to the correct characters on the MFD.

A second benefit of this change is that the MFD can now show characters
that would otherwise never be seen, for example, the 3/4 symbol or 5/8
symbol have no corresponding glyph in the MFD, but they can be
translated to the sequence `3` `/` `4`, giving us much more flexibility
on the characters that can actually be displayed.

Finally, with this change, the function also maps missing or unsupported
characters to the box character (0xDB in the display), making it clearer
that there was something there that could not be displayed. Earlier, it
would have simply skipped that character.
2026-03-16 10:18:16 -07:00
nirenjan 74229b391d fix: Update pkgconfig to use correct details 2026-03-12 15:35:11 -07:00
nirenjan b4ec8d4629 build: Migrate to meson build
Meson is a far more robust build framework, compared to autotools. This
greatly simplifies adding new features, since it's far easier to
maintain a set of meson.build files vs the autotools mishmash.

DEPRECATION NOTICE: Autotools based build is deprecated and will be
removed in the future.
2026-03-12 10:20:01 -07:00
nirenjan e9f4e1b3a8 test: Add test cases for libx52util
This change adds a test suite for libx52util, testing all the positive
cases where a character is added to the lookup table. For now, this test
suite only verifies single character mappings, not double character
mappings. A future commit will add test cases for characters not in the
map.
2026-03-09 14:43:33 -07:00
nirenjan 2be7792024 build: Fix libx52util SOLIB version
Because of the fix in 2378ba7dc4, the
library revision should have been updated.
2026-03-08 23:16:40 -07:00
nirenjan 2378ba7dc4 fix: Fix boundary check error in libx52util
Prior to this change, if the input string terminates exactly when `len`
characters have been output, the libx52util_convert_utf8_string function
returns an error of `-E2BIG`, even though the buffer is sufficiently
large. Because the output buffer is not expected to be NUL terminated,
this additional character can be safely placed in the output buffer
without overrun.

This change checks for a non-NUL character when the index matches or
exceeds the output buffer length, and only then will it return -E2BIG.
2026-03-08 20:30:03 -07:00
nirenjan ef4cbee127 fix: Handle malformed UTF-8 input in libx52util
The libx52util_convert_utf8_string function manually converts the UTF-8
string into the character map supported by the X52/X52Pro MFD. However,
there was a bug when handling malformed UTF-8 input. If the state
machine thinks it is at the start of a word and receives malformed UTF-8
input (between 0x80 and 0xC0), it will ignore the characters, but it
will not reset the entry to the map_root location, thereby causing
subsequent characters to be dropped.

This change ensures that the entry is reset to map_root[*input] after
skipping over an invalid UTF-8 sequence.
2026-03-08 20:25:29 -07:00
nirenjan 8d38c4d16b Fix Makefile to build on alternative make implementations
On some systems (notably FreeBSD), the make implementation makes a
distinction between $(builddir)/<path> and <path>, even when builddir is
`.`. This commit removes $(builddir) from all references to generated
files, so that these implementations don't fail. Keeping $(builddir)
causes older versions automake (1.15 and older) to generate a broken
Makefile.
2021-10-12 12:10:36 -07:00
nirenjan e968656672 Fix Cflags and add libx52util.pc 2021-08-03 12:53:26 -07:00
nirenjan ac68ee07e5 Use non-recursive Automake 2021-07-29 23:53:21 -07:00
nirenjan 34adeaec45 Move libx52util to top level 2021-07-29 21:47:07 -07:00