Commit graph

154 commits

Author SHA1 Message Date
Tim Eves
674917f2bc Use more generic preprocessor macro 64bit
__x86_64__ is only for Intel __LP64__ and _LP64 are for any arch that has 64bit `long int` and pointers, and 32bit `int` same as Intel.
2019-02-27 07:07:32 +07:00
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
Daniel Glassey
c71677f9a8
Merge pull request #1477 from keymanapp/common-keyboardprocessor-xenial
[common][linux] keyboardprocessor on xenial
2019-01-04 10:59:26 +07:00
glasseyes
30be8a13a1 add comment about meson for kmcomp.found 2019-01-03 16:31:40 +07:00
glasseyes
8558a22144 xenial doesn't like files in args
Error message is:
"Command line arguments must be strings, files or targets"

even though the arguments are files()
2019-01-03 15:57:18 +07:00
Tim Eves
a9512c206a Spevify meson project_version and libtool version number separately.
Set the default project version to 11.0.0
2019-01-03 14:52:06 +07:00
glasseyes
50c325b0ad ignore alphas in d/watch
set tier for launchpad.sh to get SHA256SUMS from right place
2019-01-03 12:57:02 +07:00
Tim Eves
0514304076 Fix double staged option tests 035 & 036 test correct expected values 2018-12-19 12:36:16 +07:00
Tim Eves
2f2254ddca km_kbp_state_options_update should set the persisted cache copy as well. 2018-12-19 12:35:08 +07:00
Tim Eves
da815eb92e Fix use-after0free in abstract_processor::lookup_option() design
Since option was not assigned to non temporary storage the string was deleted and caused the API to return freed memory.
2018-12-19 12:15:24 +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
Marc Durdin
8e73a4d729 [Common] Update tests to validate that option persist actions are correctly handled. 2018-12-19 10:45:56 +11:00
Tim Eves
d2e9ef9d49 Enable test support for PERSIST action. 2018-12-18 18:54:06 +07:00
Tim Eves
dfcedcdb6c
Merge branch 'master' into common-refactor-actions-options 2018-12-18 17:27:31 +07:00
Tim Eves
02e2350a43
Merge pull request #1437 from keymanapp/common-refactor-processor-init
[wip] [Common] refactor processor init
2018-12-18 17:10:57 +07:00
Tim Eves
ed8799dbbb Fix FTBFS bug on Windows 2018-12-18 17:03:36 +07:00
Tim Eves
f3474dbaa5 Tidy up KMX_Option a bit and add persist action queuing to Save() 2018-12-18 16:39:07 +07:00
glasseyes
7e1c076079 put test back and make is use L and R keys 2018-12-18 12:50:41 +07:00
glasseyes
65457bd603 remove test for generic CTRL and ALT
which shouldn't be used for input
2018-12-18 12:06:00 +07:00
Tim Eves
86eafe9391
Merge pull request #1427 from keymanapp/common-refactor-path
[Common] refactor path
2018-12-18 10:39:46 +07:00
Tim Eves
6c98983155 Implement keyboard option saving test case 2018-12-18 10:16:59 +07:00
Tim Eves
9a991f9abc More tidy ups 2018-12-18 10:16:04 +07:00
Tim Eves
a1766f5405 Enable new kmx tests 2018-12-18 09:45:41 +07:00
Tim Eves
cf28753737 Add extra kmx test keyboards to exercise option processing better
Thanks to @mcdurdin for creating those
2018-12-18 09:11:07 +07:00
glasseyes
416aaec057 rename new tests to 038, 039 2018-12-18 08:41:21 +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
29a5fa6d2e Add more convert function use, psuh_persist actions and various tidy-ups 2018-12-17 23:40:44 +07:00
Tim Eves
8598daa447 Remove vkey and erased members of action_items union 2018-12-17 23:30:07 +07:00
Tim Eves
0bf44af891 Whitespace, warnings and header tidy ups 2018-12-17 23:28:59 +07:00
Tim Eves
fbecf51a1a Refactor direct access to actions context lists with objects and smart push methods 2018-12-17 23:21:38 +07:00
Tim Eves
9b9833e9b9 Merge branch 'common-refactor-path' into common-refactor-processor-init 2018-12-17 23:13:52 +07:00
glasseyes
1c2eca06f2 tests for punctuation keys and generic ctrlalt 2018-12-17 20:09:24 +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
glasseyes
db3e12880b context for 020 deadkeys and backspace 2018-12-17 10:25:03 +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
e79c524d90 Fix option value type's copy ctor and move ctor & assignment
Also add an copy assignment operator and allow initialisation from 
char16_t pointers as well as u16string objects.
2018-12-17 05:55:23 +07:00
Tim Eves
2067547640 Add support for char16_t * compatible << operator to json class 2018-12-17 05:42:10 +07:00
Tim Eves
56f85d1a82 Fix wrong overload of std::string:;append 2018-12-17 02:40:35 +07:00
Tim Eves
a3aca838fb Fix ambiguity during type deduction in normalise on Windows. 2018-12-14 09:38:04 +07:00
Tim Eves
5e01266bb7 Revert "Fix ambiguity during type deduction in normalise on Windows."
This reverts commit f3bf0d1c6a.
Checked in to the wrong branch.
2018-12-14 09:36:02 +07:00
Tim Eves
f3bf0d1c6a Fix ambiguity during type deduction in normalise on Windows. 2018-12-14 02:03:18 +07:00
Tim Eves
ca150e099f Add add path::native() to get system native character type
Also normalise path separators from '/' to '\\' on windows and correct 
path separator.
2018-12-14 01:59:51 +07:00
Tim Eves
7c304f678c Turn all kbp::path types into km::kbp::path to keep MSVC happy. 2018-12-14 01:22:04 +07:00
Tim Eves
c7e641b93b Remove last vestiges of std::filesystem use to enable MacOS X build 2018-12-14 01:07:52 +07:00
Tim Eves
4694a7a70b #include <alogrithm> for std::min on Windows
Add json << operator for path objects
2018-12-14 01:02:34 +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
glasseyes
45b89ff5d2 put RALT back into test 000 2018-12-13 12:04:03 +07:00
glasseyes
3f306af8e9 [common] tweak kmx tests for ibus-keyman test
handle python compatible /Uxxxxxxxx format for smp
use e.g. [K_A] instead of a in keys:
RALT K_B is ” on an Alt-Gr keyboard so use LALT instead
2018-12-13 12:04:03 +07:00