Commit graph

90 commits

Author SHA1 Message Date
Tim Eves
79060a36c6 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-26 11:40:44 +07:00
Joshua A. Horton
ba769e67c3 Merge branch 'beta' into p5s2-merge 2019-02-04 21:02:15 +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
Tim Eves
a441321cf5 Newer compilers are complaining about catching std::exception derived class by value, this fixes that. 2019-01-14 09:44:43 +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
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
Tim Eves
dfcedcdb6c
Merge branch 'master' into common-refactor-actions-options 2018-12-18 17:27:31 +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
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
57b01ad640 Implement new state API using existing machinery. 2018-12-18 08:39:37 +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
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
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
Marc Durdin
8d0f85b7dd
Merge pull request #1384 from keymanapp/common-msvc-update-to-1916
[Common] Update VS version checks to 19.16 for latest release of VS2017 (bug in VS workaround)
2018-12-05 15:16:40 +11:00
Marc Durdin
48f6c9d411 [Common] Tweak comment - to trigger agents 2018-12-05 14:22:50 +11:00
Marc Durdin
5a4d50ab8a [Common] Update VS version checks to 19.16 for latest release of VS2017 (bug in VS workaround) 2018-12-05 14:09:44 +11:00
Marc Durdin
de6f7d681f [Common] Add KM_KBP_IT_INVALIDATE_CONTEXT to request that context buffer is flushed 2018-12-04 09:50:33 +11:00
Marc Durdin
8a2b55e58c [Common] Add support for KM_KBP_IT_EMIT_KEYSTROKE to allow the received key event to be passed on to the application 2018-12-04 09:46:04 +11:00
Marc Durdin
356da843e6
Merge pull request #1348 from keymanapp/common-kpapi-linux-warnings
[common] Eliminate warnings on Linux build
2018-12-03 13:02:19 +11:00
Marc Durdin
5d16d508ff [common] Tweak casts and variable types (review comments) 2018-12-03 09:16:14 +11: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
Tim Eves
70ec24a6e1 Refactor context_items_{from,to}_utf{8,16}, fix utftest and sz_lut defns 2018-11-30 14:35:51 +07:00
glasseyes
68aca71111 add km_kbp_context_items_from_utf8
avoids unnecessary conversions and string duplication

utf8codec private vars needed in cpp for
linker to find them?
2018-11-28 11:56:38 +07:00
Marc Durdin
8e24a55ad4 [common] Eliminate warnings on Linux build 2018-11-27 16:10:07 +11:00
Marc Durdin
e19cf983cb Merge branch 'master' into windows-refactor-kmprocess-for-kpapi 2018-11-26 11:56:52 +11:00
Marc Durdin
9c460e680d [common] Resolve g++ warnings 2018-11-24 12:31:54 +11:00
Marc Durdin
50e5a0d3b4 [common] renaming and cleanup 2018-11-24 12:04:09 +11:00
Marc Durdin
aa418517f0 [common] Address review comment -- move kmx processor into km::kbp::kmx namespace 2018-11-24 11:51:35 +11:00
Marc Durdin
827b00c43c [common] Addressing review comments 2018-11-24 11:33:05 +11:00