mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-19 23:07:42 +00:00
- split keyboard loading into loading KMX file into blob and then loading the keyboard processor from the blob. - deprecate `km_core_keyboard_load` - move file access next to deprecated method. This is now the only place that loads a file in Core; unit tests have some more places that load files. - introduce GTest and add unit tests for loading from blob Cherry-picked from `epic/web-core` branch. Cherry-Pick-Commit:1deaa323adCherry-Pick-Commit:59019cc8b7Cherry-Pick-Commit:bc46458368Cherry-Pick-Commit:d06aa29956Cherry-Pick-Commit:1c88166f6eCherry-Pick-Commit:069cd21ecdCherry-Pick-Commit:052ae2ec35Cherry-Pick-Commit:11a2a3ba3aPart-of: #11293 Part-of: #8093
59 lines
1.6 KiB
C++
59 lines
1.6 KiB
C++
/*
|
|
Copyright: © 2018 SIL International.
|
|
Description: Internal keyboard class and adaptor class for the API.
|
|
Create Date: 2 Oct 2018
|
|
Authors: Tim Eves (TSE)
|
|
History: 2 Oct 2018 - TSE - Refactored out of km_core_keyboard_api.cpp
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "keyman_core.h"
|
|
|
|
#include "option.hpp"
|
|
#include "path.hpp"
|
|
|
|
// Forward declarations
|
|
class json;
|
|
|
|
namespace km {
|
|
namespace core
|
|
{
|
|
class keyboard_attributes : public km_core_keyboard_attrs
|
|
{
|
|
std::u16string _keyboard_id;
|
|
std::u16string _version_string;
|
|
// unused and deprecated
|
|
core::path _folder_path;
|
|
std::vector<option> _default_opts;
|
|
|
|
void render();
|
|
|
|
public:
|
|
using options_store = decltype(_default_opts);
|
|
|
|
keyboard_attributes()
|
|
: km_core_keyboard_attrs {nullptr, nullptr, nullptr, nullptr} {}
|
|
keyboard_attributes(keyboard_attributes const &) = delete;
|
|
keyboard_attributes(keyboard_attributes &&);
|
|
|
|
keyboard_attributes(std::u16string const & id,
|
|
std::u16string const & version,
|
|
options_store const &opts);
|
|
|
|
keyboard_attributes & operator = (keyboard_attributes const &) = delete;
|
|
keyboard_attributes & operator = (keyboard_attributes &&);
|
|
|
|
friend json & operator << (json &, km::core::keyboard_attributes const &);
|
|
|
|
options_store const & default_opts_store() const noexcept { return _default_opts; }
|
|
options_store & default_opts_store() noexcept { return _default_opts; }
|
|
};
|
|
|
|
json & operator << (json &, km::core::keyboard_attributes const &);
|
|
|
|
} // namespace core
|
|
} // namespace km
|