diff --git a/src/core/settable.cpp b/src/core/settable.cpp index 9d2ec132..9cd9c303 100644 --- a/src/core/settable.cpp +++ b/src/core/settable.cpp @@ -4,94 +4,95 @@ #include #include -namespace +namespace vind { - using namespace vind::core ; - - std::vector default_params { - Param("hintkeys", "asdghklqwertyuiopzxcvbnmfj"), + namespace core + { + std::vector SetTable::default_params { + Param("hintkeys", "asdghklqwertyuiopzxcvbnmfj"), - Param("arrangewin_ignore", ""), + Param("arrangewin_ignore", ""), - Param("autotrack_popup", false), + Param("autotrack_popup", false), - Param("blockstylecaret", false), - Param("blockstylecaret_mode", "solid"), - Param("blockstylecaret_width", 15), + Param("blockstylecaret", false), + Param("blockstylecaret_mode", "solid"), + Param("blockstylecaret_width", 15), - Param("charbreak", "grapheme"), - Param("charcache", false), + Param("charbreak", "grapheme"), + Param("charcache", false), - Param("cmd_bgcolor", "323232"), - Param("cmd_fadeout", 5), - Param("cmd_fontcolor", "c8c8c8"), - Param("cmd_fontextra", 1), - Param("cmd_fontname", "Consolas"), - Param("cmd_fontsize", 23), - Param("cmd_fontweight", 400), - Param("cmd_monitor", "primary"), - Param("cmd_roughpos", "LowerLeft"), - Param("cmd_xmargin", 32), - Param("cmd_ymargin", 96), + Param("cmd_bgcolor", "323232"), + Param("cmd_fadeout", 5), + Param("cmd_fontcolor", "c8c8c8"), + Param("cmd_fontextra", 1), + Param("cmd_fontname", "Consolas"), + Param("cmd_fontsize", 23), + Param("cmd_fontweight", 400), + Param("cmd_monitor", "primary"), + Param("cmd_roughpos", "LowerLeft"), + Param("cmd_xmargin", 32), + Param("cmd_ymargin", 96), - Param("cursor_accel", 90), - Param("cursor_resolution", 250), + Param("cursor_accel", 90), + Param("cursor_resolution", 250), - Param("dedicate_to_window", false), + Param("dedicate_to_window", false), - Param("easyclick_bgcolor", "323232"), - Param("easyclick_fontcolor", "c8c8c8"), - Param("easyclick_fontname", "Consolas"), - Param("easyclick_fontsize", 14), - Param("easyclick_fontweight", 500), + Param("easyclick_bgcolor", "323232"), + Param("easyclick_fontcolor", "c8c8c8"), + Param("easyclick_fontname", "Consolas"), + Param("easyclick_fontsize", 14), + Param("easyclick_fontweight", 500), - Param("gridmove_bgcolor", "323232"), - Param("gridmove_fontcolor", "c8c8c8"), - Param("gridmove_fontname", "Consolas"), - Param("gridmove_fontsize", 14), - Param("gridmove_fontweight", 500), - Param("gridmove_size", "12x8"), + Param("gridmove_bgcolor", "323232"), + Param("gridmove_fontcolor", "c8c8c8"), + Param("gridmove_fontname", "Consolas"), + Param("gridmove_fontsize", 14), + Param("gridmove_fontweight", 500), + Param("gridmove_size", "12x8"), - Param("gui_fontname", "Segoe UI"), - Param("gui_fontsize", 10), + Param("gui_fontname", "Segoe UI"), + Param("gui_fontsize", 10), - Param("hscroll_pageratio", 0.125f), - Param("hscroll_speed", 10), + Param("hscroll_pageratio", 0.125f), + Param("hscroll_speed", 10), - Param("icon_style", "icon32_flat.ico"), + Param("icon_style", "icon32_flat.ico"), - Param("initmode", "i"), + Param("initmode", "i"), - Param("jump_margin", 10), + Param("jump_margin", 10), - Param("keybrd_layout", ""), + Param("keybrd_layout", ""), - Param("listen_interval", 1.0f), + Param("listen_interval", 1.0f), - Param("shell", "cmd"), - Param("shell_startupdir", ""), - Param("shellcmdflag", "-c"), + Param("shell", "cmd"), + Param("shell_startupdir", ""), + Param("shellcmdflag", "-c"), - Param("suppress_for_vim", false), + Param("suppress_for_vim", false), - Param("tempdir", "~/Downloads"), + Param("tempdir", "~/Downloads"), - Param("uiacachebuild", false), - Param("uiacachebuild_lifetime", 1500), - Param("uiacachebuild_staybegin", 500), - Param("uiacachebuild_stayend", 2000), + Param("uiacachebuild", false), + Param("uiacachebuild_lifetime", 1500), + Param("uiacachebuild_staybegin", 500), + Param("uiacachebuild_stayend", 2000), - Param("vcmdline", true), - Param("showcmd", true), + Param("vcmdline", true), + Param("showcmd", true), - Param("vscroll_pageratio", 0.125f), - Param("vscroll_speed", 30), + Param("vscroll_pageratio", 0.125f), + Param("vscroll_speed", 30), - Param("window_hdelta", 100), - Param("window_vdelta", 100), - Param("window_velocity", 100), - Param("winresizer_initmode", 0), - } ; + Param("window_hdelta", 100), + Param("window_vdelta", 100), + Param("window_velocity", 100), + Param("winresizer_initmode", 0), + } ; + } } @@ -114,6 +115,7 @@ namespace vind SetTable::SetTable() : pimpl(std::make_unique()) { + std::lock_guard scoped_lock{pimpl->mtx_} ; for(const auto& param : default_params) { pimpl->deftable_[param.name()] = param ; } diff --git a/src/core/settable.hpp b/src/core/settable.hpp index be862fcb..417a98cc 100644 --- a/src/core/settable.hpp +++ b/src/core/settable.hpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace vind @@ -23,6 +24,8 @@ namespace vind explicit SetTable() ; virtual ~SetTable() noexcept ; + static std::vector default_params ; + public: static SetTable& get_instance() ;