Commit graph

38 commits

Author SHA1 Message Date
Tim Eves
5429037179 Fix bug #1494 potential for buffer overrun
The get/put routines now require the buffer size remaining to be read/written to permit checking and the iterator will update this value whenever iterator comparisions are made.  Other direct uses of get/put have been updated.
2019-01-17 17:12:42 +07:00
Tim Eves
f8f1407fb8 Rfactor options out of class state into virtual methods on abstract_processor 2018-12-19 11:20:28 +07:00
Tim Eves
6c98983155 Implement keyboard option saving test case 2018-12-18 10:16:59 +07:00
Tim Eves
57b01ad640 Implement new state API using existing machinery. 2018-12-18 08:39:37 +07:00
Tim Eves
568f1ebcd5 Fix state-api test to use action_item == operator and refactor test build script 2018-12-17 23:41:35 +07:00
Tim Eves
8598daa447 Remove vkey and erased members of action_items union 2018-12-17 23:30:07 +07:00
Tim Eves
9b9833e9b9 Merge branch 'common-refactor-path' into common-refactor-processor-init 2018-12-17 23:13:52 +07:00
Tim Eves
35a764ba51 Fix type deduction issue in path::join static function.
Will compile on Windows now and switch to normalised paths.
2018-12-17 15:39:10 +07:00
Tim Eves
18ce72e7c8 Refactor keyboard processor initialisation code.
Turn the keyboard class backing the km_kbp_keyboard and km_kbp_keyboard_attr objects into just keyboard_attributes.
Move the abstract_processor and sublcasses as the objects that back km_kbp_keyboard and make keyboard_attrs a member of the asbtract_processor.
Move kmx_processor and mock_processor declarations into their own headers.
Make all vector<km_kbp_option_item> into vector<option> to handle memory management, moving and copying correctly.
Update test cases accordingly
2018-12-17 06:02:22 +07:00
Tim Eves
08bab354bd Add a path handling class since std::filesystem is not reliably available
It's not there on Xcode yet and different platforms and compiler put it 
into different library files.
2018-12-14 00:50:04 +07:00
Tim Eves
559824a1b7 Replace utf16_to_utf8 with generic utfcodec based string conversion func
Templated convert for going between any combination of UTF codecs with 
an identity function specialisation for when src & target forms match.
Includes implmentations of json and basic_ostream << operators for 
u16string & u32string.
2018-12-14 00:46:54 +07:00
Tim Eves
70b6310a19 Fix misnamed km_kbp_context_items_to_utf8 call & add test case.
And fix the type of the buffer to match the type in the definition.

Co-Authored-By: Daniel Glassey <glasseyes@users.noreply.github.com>
2018-11-30 15:02:07 +07:00
Tim Eves
4667c5bf84 Add all the missing files that should have been in the preceding commit
Co-Authored-By: Daniel Glassey <glasseyes@users.noreply.github.com>
2018-11-30 14:46:54 +07:00
Marc Durdin
e19cf983cb Merge branch 'master' into windows-refactor-kmprocess-for-kpapi 2018-11-26 11:56:52 +11:00
Marc Durdin
b99cd600f6 [common] Full support for environment. Some refactoring of how environment options are set 2018-11-23 10:12:11 +11:00
Marc Durdin
37f424f090 [common] Working options model. Introduces some gunk around state and options which should be reviewed with TSE 2018-11-20 12:19:43 +11:00
Marc Durdin
06341d79f7 [common] Remove VK_ defines and cleanup warnings 2018-11-19 06:26:46 +11:00
Marc Durdin
328552fae6 [common] fix some build warnings, move files, remove pch.h 2018-11-19 06:21:48 +11:00
Marc Durdin
646c322b4c [Common] First kmx test case (currently fails, as it should) and KMX integration started 2018-11-16 11:12:56 +11:00
Marc Durdin
ac4448f350 [Common] Refactor KPAPI to support multiple processors (kmx, mock, ldml?) 2018-11-14 11:58:44 +11:00
glasseyes
899a9ae1e6 dispose things in tests that were memleaks 2018-11-12 15:55:28 +07:00
Marc Durdin
9ca7bab5f9 [Common] Final checks 2018-11-12 19:23:54 +11:00
Marc Durdin
1ab04f681a [Common] Code Review updates, some minor changes to API, mostly comments and tests; one bug fix 2018-11-12 19:12:59 +11:00
Tim Eves
61f90b172e Fix path handling so it's wchar_t const * on windows and char const * on linux 2018-11-07 04:49:56 +07:00
Tim Eves
689e21856b Explicitly declare test json doc strings as utf8 for Windows compiler 2018-11-07 04:30:09 +07:00
Tim Eves
4afe030627 Add number USVs erased to BACK action item
Possible but difficult to get from state object if not provided.  IBus 
will use this.
2018-11-07 04:26:49 +07:00
Tim Eves
d70fe629e8 Fix state API implmentation to use new options, keyboard and context objects. 2018-11-07 04:25:28 +07:00
Tim Eves
b27fc67259 Rework keyboard API and add more robust checking. 2018-11-07 03:04:45 +07:00
Tim Eves
242105216a Rename options_set -> options and option -> option_item 2018-11-07 02:13:40 +07:00
Tim Eves
9cb22221c6 Rework options API per review
Additionally refactored option.hpp into option.hpp & option.cpp.
lookup now returns just the value since scope and key are fully 
specified in the arguments, but updates and SAVE/RESET action items 
still provide scope, key & value.
2018-11-07 01:37:32 +07:00
Tim Eves
93c76c14df Move headers into include/keyman from include/
Necessary to allow keyboardprocessor.h to refer to auxillary headers as 
<keyboard/header.h>
2018-11-06 16:19:14 +07:00
Tim Eves
333ef283c8 Make constext API more consistent and robust with use of km_kbp_status.
In addition:
Add asserts and checks to better validate the inputs.
Add documentation describing design patterns behind differet types of 
call.
2018-11-06 14:53:33 +07:00
Tim Eves
4d4bb125b6 Add the last of the kmnkbd unit tests for state and engine api. 2018-10-31 16:05:17 +07:00
Tim Eves
b9009bbc33 Add options-api to test to the kmnkbd test suite. 2018-10-30 17:07:48 +07:00
Tim Eves
bbd67c7a9b Minor tidyup stop compiler complaining about unsused variables. 2018-10-30 13:12:30 +07:00
Tim Eves
aa7027fa66 Add keyboard-api test to kmnkmd unit tests 2018-10-30 13:09:31 +07:00
Tim Eves
9af3308ef3 Fix a compiler warnings in context_api under clang and statically link.
While dynamic linking works on linux & Mac OS due to rpath support 
Windows can't find the dll when debugging the test case unless it's 
copied into the tests builddir or it has it's working dir set to the 
DLL's builddir.
2018-10-29 16:05:06 +07:00
Tim Eves
ef548606aa Move keyboardprocessor into it's new toplevel under common/engine 2018-10-25 13:43:28 +07:00