Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(linux): Rename namespace kbp to core 〽️ #9792

Merged
merged 4 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/include/kmx_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef KMX_WORD __attribute__((aligned(1))) KMX_WORD_unaligned;
#ifdef KM_CORE_LIBRARY
// TODO: move this to a common namespace keyman::common::kmx_file or similar in the future
namespace km {
namespace kbp {
namespace core {
namespace kmx {
#endif

Expand Down Expand Up @@ -404,6 +404,6 @@ static_assert(sizeof(COMP_KEYBOARD) == KEYBOARDFILEHEADER_SIZE, "COMP_KEYBOARD m

#ifdef KM_CORE_LIBRARY
} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
#endif
2 changes: 1 addition & 1 deletion core/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ py = import('python')
python = py.find_installation()

# TODO: Shared includes may use namespaces, etc which need future tidyup.
# For now, we use KM_CORE_LIBRARY to inject the km::kbp::kmx namespace
# For now, we use KM_CORE_LIBRARY to inject the km::core::kmx namespace
defns += ['-DKM_CORE_LIBRARY']

# #define DEBUG when we are on a debug build
Expand Down
8 changes: 4 additions & 4 deletions core/src/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
class json;

namespace km {
namespace kbp
namespace core
{

// This will likely be replaced with a class implementing a more space
Expand All @@ -39,13 +39,13 @@ void context::push_marker(uint32_t marker) {
emplace_back(km_core_context_item { KM_CORE_CT_MARKER, {0,}, {marker} });
}

} // namespace kbp
} // namespace core
} // namespace km

json & operator << (json &, km::kbp::context const &);
json & operator << (json &, km::core::context const &);
json & operator << (json &, km_core_context_item const &);


struct km_core_context : public km::kbp::context
struct km_core_context : public km::core::context
{
};
4 changes: 2 additions & 2 deletions core/src/debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <keyman/keyman_core_api_debug.h>

namespace km {
namespace kbp
namespace core
{

class debug_items : public std::vector<km_core_state_debug_item>
Expand Down Expand Up @@ -66,6 +66,6 @@ void debug_items::set_enabled(bool value) noexcept {
_is_enabled = value;
}

} // namespace kbp
} // namespace core
} // namespace km

2 changes: 1 addition & 1 deletion core/src/debuglog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "debuglog.h"

namespace km {
namespace kbp {
namespace core {
namespace kmx {

#define TAB "\t"
Expand Down
6 changes: 3 additions & 3 deletions core/src/debuglog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <keyman/keyman_core_api_bits.h>

namespace km {
namespace kbp {
namespace core {
namespace kmx {

extern KMX_BOOL g_debug_ToConsole, g_debug_KeymanLog, g_silent;
Expand All @@ -17,11 +17,11 @@ extern const struct modifier_names s_modifier_names[];
extern const char *s_key_names[];

#ifdef _MSC_VER
#define DebugLog(msg,...) (km::kbp::kmx::ShouldDebug() ? km::kbp::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg),__VA_ARGS__) : 0)
#define DebugLog(msg,...) (km::core::kmx::ShouldDebug() ? km::core::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg),__VA_ARGS__) : 0)
#define console_error(msg,...) write_console(TRUE, (msg), __VA_ARGS__)
#define console_log(msg,...) write_console(FALSE, (msg), __VA_ARGS__)
#else
#define DebugLog(msg,...) (km::kbp::kmx::ShouldDebug() ? km::kbp::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__) : 0)
#define DebugLog(msg,...) (km::core::kmx::ShouldDebug() ? km::core::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__) : 0)
#define console_error(msg,...) write_console(TRUE, (msg), ##__VA_ARGS__)
#define console_log(msg,...) write_console(FALSE, (msg), ##__VA_ARGS__)
#endif
Expand Down
4 changes: 2 additions & 2 deletions core/src/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "keyboard.hpp"
#include "jsonpp.hpp"

using namespace km::kbp;
using namespace km::core;


inline
Expand Down Expand Up @@ -54,7 +54,7 @@ keyboard_attributes & keyboard_attributes::operator = (keyboard_attributes &&rhs
}


json & km::kbp::operator << (json & j, km::kbp::keyboard_attributes const & kb)
json & km::core::operator << (json & j, km::core::keyboard_attributes const & kb)
{
j << json::object
<< "id" << kb.id
Expand Down
10 changes: 5 additions & 5 deletions core/src/keyboard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
class json;

namespace km {
namespace kbp
namespace core
{
class keyboard_attributes : public km_core_keyboard_attrs
{
std::u16string _keyboard_id;
std::u16string _version_string;
kbp::path _folder_path;
core::path _folder_path;
std::vector<option> _default_opts;

void render();
Expand All @@ -48,15 +48,15 @@ namespace kbp
keyboard_attributes & operator = (keyboard_attributes const &) = delete;
keyboard_attributes & operator = (keyboard_attributes &&);

friend json & operator << (json &, km::kbp::keyboard_attributes const &);
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; }

path_type const & path() const noexcept { return _folder_path; }
};

json & operator << (json &, km::kbp::keyboard_attributes const &);
json & operator << (json &, km::core::keyboard_attributes const &);

} // namespace kbp
} // namespace core
} // namespace km
2 changes: 1 addition & 1 deletion core/src/km_core_context_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ km_core_context_item_list_size(km_core_context_item const *context_items)
return n;
}

json & operator << (json & j, km::kbp::context const & ctxt) {
json & operator << (json & j, km::core::context const & ctxt) {
j << json::array;
for (auto & i: ctxt) j << i;
return j << json::close;
Expand Down
2 changes: 1 addition & 1 deletion core/src/km_core_debug_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "processor.hpp"
#include "state.hpp"

using namespace km::kbp;
using namespace km::core;

km_core_status
km_core_state_debug_set(
Expand Down
2 changes: 1 addition & 1 deletion core/src/km_core_keyboard_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "ldml/ldml_processor.hpp"
#include "mock/mock_processor.hpp"

using namespace km::kbp;
using namespace km::core;

namespace
{
Expand Down
2 changes: 1 addition & 1 deletion core/src/km_core_state_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "processor.hpp"
#include "state.hpp"

using namespace km::kbp;
using namespace km::core;

// Forward declarations
class context;
Expand Down
2 changes: 1 addition & 1 deletion core/src/kmx/kmx_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
#include <kmx/kmx_processevent.h>

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

void KMX_Actions::ResetQueue()
Expand Down
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "kmx_base.h"

namespace km {
namespace kbp {
namespace core {
namespace kmx {

#define MAXACTIONQUEUE 1024
Expand Down Expand Up @@ -59,6 +59,6 @@ class KMX_Actions
};

} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km

4 changes: 2 additions & 2 deletions core/src/kmx/kmx_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#endif

namespace km {
namespace kbp {
namespace core {
namespace kmx {

typedef struct tagSTORE
Expand Down Expand Up @@ -95,5 +95,5 @@ typedef struct tagKMSTATE
enum ProcessStringReturn { psrPostMessages, psrCheckMatches };

} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
2 changes: 1 addition & 1 deletion core/src/kmx/kmx_capslock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <keyman/keyman_core_api_consts.h>
#include <kmx/kmx_processevent.h>

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

/**
Expand Down
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_consts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "kmx_processevent.h"

namespace km {
namespace kbp {
namespace core {
namespace kmx {

const struct char_to_vkey s_char_to_vkey[] = {
Expand Down Expand Up @@ -105,5 +105,5 @@ const struct char_to_vkey s_char_to_vkey[] = {
};

} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
2 changes: 1 addition & 1 deletion core/src/kmx/kmx_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
#include <kmx/kmx_processevent.h>

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

/* KMX_Context */
Expand Down
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define MAXCONTEXT 64

namespace km {
namespace kbp {
namespace core {
namespace kmx {

class KMX_Context
Expand Down Expand Up @@ -118,5 +118,5 @@ class KMX_Context
};

} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "kmx_processevent.h"

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

/* This array is lifted from preservedkeymap.cpp */
Expand Down Expand Up @@ -116,7 +116,7 @@ const struct
};


KMX_BOOL km::kbp::kmx::MapUSCharToVK(KMX_WORD ch, PKMX_WORD puKey, PKMX_DWORD puShiftFlags) {
KMX_BOOL km::core::kmx::MapUSCharToVK(KMX_WORD ch, PKMX_WORD puKey, PKMX_DWORD puShiftFlags) {
assert(puKey != NULL);
assert(puShiftFlags != NULL);
if (ch >= 0x20 && ch < 0x7F) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "kmx_base.h"

namespace km {
namespace kbp {
namespace core {
namespace kmx {

#define VK_SPACE 0x20
Expand Down Expand Up @@ -32,5 +32,5 @@ namespace kmx {
KMX_BOOL MapUSCharToVK(KMX_WORD ch, PKMX_WORD puKey, PKMX_DWORD puShiftFlags);

} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#include <kmx/kmx_processevent.h>

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

void KMX_DebugItems::push_item(
Expand Down Expand Up @@ -93,4 +93,4 @@ void KMX_DebugItems::fill_store_offsets(km_core_state_debug_kmx_info *info, PKMX
}

info->store_offsets[n] = 0xFFFF;
}
}
6 changes: 3 additions & 3 deletions core/src/kmx/kmx_debugger.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <debug.hpp>

namespace km {
namespace kbp {
namespace core {
namespace kmx {

class KMX_DebugItems
Expand Down Expand Up @@ -143,5 +143,5 @@ KMX_DebugItems::push_rule_exit(
}

} // namespace kmx
} // namespace kbp
} // namespace km
} // namespace core
} // namespace km
2 changes: 1 addition & 1 deletion core/src/kmx/kmx_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <state.hpp>
#include <option.hpp>

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

namespace {
Expand Down
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "kmx_base.h"

namespace km {
namespace kbp {
namespace core {
namespace kmx {

class KMX_Environment {
Expand All @@ -30,5 +30,5 @@ class KMX_Environment {
};

} // namespace kmx
} // namespace kbp
} // namespace core
} // namespace km
4 changes: 2 additions & 2 deletions core/src/kmx/kmx_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <assert.h>
#include "kmx_file_validator.hpp"

using namespace km::kbp;
using namespace km::core;
using namespace kmx;

#if defined(_WIN32) || defined(_WIN64)
Expand All @@ -20,7 +20,7 @@ KMX_BOOL KMX_ProcessEvent::Load(km_core_path_name KeyboardName)
return TRUE;
}

const int km::kbp::kmx::CODE__SIZE[] = {
const int km::core::kmx::CODE__SIZE[] = {
-1, // undefined 0x00
1, // CODE_ANY 0x01
2, // CODE_INDEX 0x02
Expand Down
Loading