X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fintl.C;h=ff1162d2a0f0a338b586486ab53b45114b80b752;hb=35204f8f33d7400a5fefeffea533fb4cb4097211;hp=6eac587bc6ab7620b68bfed37fb66a22f79dd1a5;hpb=8283e978f8d621041c432b9b88a476bfd567385c;p=lyx.git diff --git a/src/intl.C b/src/intl.C index 6eac587bc6..ff1162d2a0 100644 --- a/src/intl.C +++ b/src/intl.C @@ -1,29 +1,25 @@ -/* This file is part of - * ====================================================== +/** + * \file intl.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * - * LyX, The Document Processor + * \author unknown + * \author Lars Gullik Bjønnes + * \author Angus Leeming + * \author John Levon * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2001 The LyX Team. - * - * ====================================================== */ - -/* - * International support for LyX + * Full author contact details are available in file CREDITS. */ #include -#ifdef __GNUG__ -#pragma implementation -#endif - #include "intl.h" #include "debug.h" #include "lyxrc.h" -#include "support/lstrings.h" -#include "language.h" + +namespace lyx { + using std::endl; @@ -35,66 +31,71 @@ Intl::Intl() } -void Intl::KeyMapOn(bool on) +void Intl::keyMapOn(bool on) { keymapon = on; if (on) { if (keymap == PRIMARY) - KeyMapPrim(); + keyMapPrim(); else - KeyMapSec(); + keyMapSec(); } else - trans.DisableKeymap(); + trans.disableKeymap(); } -void Intl::ToggleKeyMap() +void Intl::toggleKeyMap() { if (keymapon && (keymap == PRIMARY)) { - KeyMapSec(); + keyMapSec(); } else if (keymapon) { - KeyMapOn(false); + keyMapOn(false); } else - KeyMapPrim(); + keyMapPrim(); } -void Intl::KeyMapPrim() +void Intl::keyMapPrim() { - if (!trans.SetPrimary(prim_lang)) - trans.EnablePrimary(); + if (!trans.setPrimary(prim_lang)) + trans.enablePrimary(); keymapon = true; keymap = PRIMARY; } -void Intl::KeyMapSec() +void Intl::keyMapSec() { - if (!trans.SetSecondary(sec_lang)) - trans.EnableSecondary(); + if (!trans.setSecondary(sec_lang)) + trans.enableSecondary(); keymapon = true; keymap = SECONDARY; } -void Intl::InitKeyMapper(bool on) +void Intl::initKeyMapper(bool on) { lyxerr[Debug::INIT] << "Initializing key mappings..." << endl; + if (trans.setPrimary(prim_lang) == -1) + prim_lang.erase(); + if (trans.setSecondary(sec_lang) == -1) + sec_lang.erase(); + trans.setCharset(lyxrc.font_norm); + if (prim_lang.empty() && sec_lang.empty()) keymapon = false; else keymapon = on; - KeyMapOn(keymapon); + keyMapOn(keymapon); if (keymapon) - KeyMapPrim(); - - trans.SetPrimary(prim_lang); - trans.SetSecondary(sec_lang); - trans.setCharset(lyxrc.font_norm); + keyMapPrim(); } + + +} // namespace lyx