add bindings for latin charsets, use self-insert as intended from the beginning

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2000 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-05-16 07:53:23 +00:00
parent e926eeb39d
commit 4820fdd44f
17 changed files with 505 additions and 75 deletions

View File

@ -1,3 +1,12 @@
2001-05-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
* bind/latinkeys.bind: new file. bindings for latin1, latin2,
latin3, latin4, latin8, latin9
* bind/emacs.bind: include latinkeys.bind
* bind/cua.bind: include latinkeys.bind
2001-05-04 Lars Gullik Bjřnnes <larsbj@birdstep.com>
* ui/default.ui: add FloatInsert and FloatListInsert

View File

@ -148,3 +148,4 @@
\bind_file menus.bind
\bind_file math.bind
\bind_file latinkeys.bind

View File

@ -203,3 +203,4 @@
\bind_file menus.bind
\bind_file math.bind
\bind_file latinkeys.bind

360
lib/bind/latinkeys.bind Normal file
View File

@ -0,0 +1,360 @@
# Latin 1
\bind "space" "self-insert"
\bind "exclam" "self-insert"
\bind "quotedbl" "self-insert"
\bind "numbersign" "self-insert"
\bind "dollar" "self-insert"
\bind "percent" "self-insert"
\bind "ampersand" "self-insert"
\bind "apostrophe" "self-insert"
\bind "quoteright" "self-insert"
\bind "parenleft" "self-insert"
\bind "parenright" "self-insert"
\bind "asterisk" "self-insert"
\bind "plus" "self-insert"
\bind "comma" "self-insert"
\bind "minus" "self-insert"
\bind "period" "self-insert"
\bind "slash" "self-insert"
\bind "0" "self-insert"
\bind "1" "self-insert"
\bind "2" "self-insert"
\bind "3" "self-insert"
\bind "4" "self-insert"
\bind "5" "self-insert"
\bind "6" "self-insert"
\bind "7" "self-insert"
\bind "8" "self-insert"
\bind "9" "self-insert"
\bind "colon" "self-insert"
\bind "semicolon" "self-insert"
\bind "less" "self-insert"
\bind "equal" "self-insert"
\bind "greater" "self-insert"
\bind "question" "self-insert"
\bind "at" "self-insert"
\bind "~S-A" "self-insert"
\bind "~S-B" "self-insert"
\bind "~S-C" "self-insert"
\bind "~S-D" "self-insert"
\bind "~S-E" "self-insert"
\bind "~S-F" "self-insert"
\bind "~S-G" "self-insert"
\bind "~S-H" "self-insert"
\bind "~S-I" "self-insert"
\bind "~S-J" "self-insert"
\bind "~S-K" "self-insert"
\bind "~S-L" "self-insert"
\bind "~S-M" "self-insert"
\bind "~S-N" "self-insert"
\bind "~S-O" "self-insert"
\bind "~S-P" "self-insert"
\bind "~S-Q" "self-insert"
\bind "~S-R" "self-insert"
\bind "~S-S" "self-insert"
\bind "~S-T" "self-insert"
\bind "~S-U" "self-insert"
\bind "~S-V" "self-insert"
\bind "~S-W" "self-insert"
\bind "~S-X" "self-insert"
\bind "~S-Y" "self-insert"
\bind "~S-Z" "self-insert"
\bind "bracketleft" "self-insert"
\bind "backslash" "self-insert"
\bind "bracketright" "self-insert"
\bind "asciicircum" "self-insert"
\bind "underscore" "self-insert"
\bind "grave" "self-insert"
\bind "quoteleft" "self-insert"
\bind "a" "self-insert"
\bind "b" "self-insert"
\bind "c" "self-insert"
\bind "d" "self-insert"
\bind "e" "self-insert"
\bind "f" "self-insert"
\bind "g" "self-insert"
\bind "h" "self-insert"
\bind "i" "self-insert"
\bind "j" "self-insert"
\bind "k" "self-insert"
\bind "l" "self-insert"
\bind "m" "self-insert"
\bind "n" "self-insert"
\bind "o" "self-insert"
\bind "p" "self-insert"
\bind "q" "self-insert"
\bind "r" "self-insert"
\bind "s" "self-insert"
\bind "t" "self-insert"
\bind "u" "self-insert"
\bind "v" "self-insert"
\bind "w" "self-insert"
\bind "x" "self-insert"
\bind "y" "self-insert"
\bind "z" "self-insert"
\bind "braceleft" "self-insert"
\bind "bar" "self-insert"
\bind "braceright" "self-insert"
\bind "asciitilde" "self-insert"
\bind "nobreakspace" "self-insert"
\bind "exclamdown" "self-insert"
\bind "cent" "self-insert"
\bind "sterling" "self-insert"
\bind "currency" "self-insert"
\bind "yen" "self-insert"
\bind "brokenbar" "self-insert"
\bind "section" "self-insert"
\bind "diaeresis" "self-insert"
\bind "copyright" "self-insert"
\bind "ordfeminine" "self-insert"
\bind "guillemotleft" "self-insert"
\bind "notsign" "self-insert"
\bind "hyphen" "self-insert"
\bind "registered" "self-insert"
\bind "macron" "self-insert"
\bind "degree" "self-insert"
\bind "plusminus" "self-insert"
\bind "twosuperior" "self-insert"
\bind "threesuperior" "self-insert"
\bind "acute" "self-insert"
\bind "mu" "self-insert"
\bind "paragraph" "self-insert"
\bind "periodcentered" "self-insert"
\bind "cedilla" "self-insert"
\bind "onesuperior" "self-insert"
\bind "masculine" "self-insert"
\bind "guillemotright" "self-insert"
\bind "onequarter" "self-insert"
\bind "onehalf" "self-insert"
\bind "threequarters" "self-insert"
\bind "questiondown" "self-insert"
\bind "~S-Agrave" "accent-grave A"
\bind "~S-Aacute" "accent-acute A"
\bind "~S-Acircumflex" "accent-circumflex A"
\bind "~S-Atilde" "accent-tilde A"
\bind "~S-Adiaeresis" "accent-umlaut A"
\bind "~S-Aring" "accent-circle A"
\bind "~S-AE" "self-insert"
\bind "~S-Ccedilla" "accent-cedilla C"
\bind "~S-Egrave" "accent-grave E"
\bind "~S-Eacute" "accent-acute E"
\bind "~S-Ecircumflex" "accent-circumflex E"
\bind "~S-Ediaeresis" "accent-umlaut E"
\bind "~S-Igrave" "accent-grave I"
\bind "~S-Iacute" "accent-acute I"
\bind "~S-Icircumflex" "accent-circumflex I"
\bind "~S-Idiaeresis" "accent-umlaut I"
\bind "ETH" "self-insert"
\bind "Eth" "self-insert"
\bind "~S-Ntilde" "accent-tilde N"
\bind "~S-Ograve" "accent-grave O"
\bind "~S-Oacute" "accent-acute O"
\bind "~S-Ocircumflex" "accent-circumflex O"
\bind "~S-Otilde" "accent-tilde O"
\bind "~S-Odiaeresis" "accent-umlaut O"
\bind "multiply" "self-insert"
\bind "Ooblique" "self-insert"
\bind "Oslash" "self-insert"
\bind "~S-Ugrave" "accent-grave U"
\bind "~S-Uacute" "accent-acute U"
\bind "~S-Ucircumflex" "accent-circumflex U"
\bind "~S-Udiaeresis" "accent-umlaut U"
\bind "~S-Yacute" "accent-acute Y"
\bind "THORN" "self-insert"
\bind "Thorn" "self-insert"
\bind "ssharp" "self-insert"
\bind "agrave" "accent-grave a"
\bind "aacute" "accent-acute a"
\bind "acircumflex" "accent-circumflex a"
\bind "atilde" "accent-tilde a"
\bind "adiaeresis" "accent-umlaut a"
\bind "aring" "accent-circle a"
\bind "ae" "self-insert"
\bind "ccedilla" "accent-cedilla c"
\bind "egrave" "accent-grave e"
\bind "eacute" "accent-acute e"
\bind "ecircumflex" "accent-circumflex e"
\bind "ediaeresis" "accent-umlaut e"
\bind "igrave" "accent-grave i"
\bind "iacute" "accent-acute i"
\bind "icircumflex" "accent-circumflex i"
\bind "idiaeresis" "accent-umlaut i"
\bind "eth" "self-insert"
\bind "ntilde" "accent-tilde n"
\bind "ograve" "accent-grave o"
\bind "oacute" "accent-acute o"
\bind "ocircumflex" "accent-circumflex o"
\bind "otilde" "accent-tilde o"
\bind "odiaeresis" "accent-umlaut o"
\bind "division" "self-insert"
\bind "oslash" "self-insert"
\bind "ooblique" "self-insert"
\bind "ugrave" "accent-grave u"
\bind "uacute" "accent-acute u"
\bind "ucircumflex" "accent-circumflex u"
\bind "udiaeresis" "accent-umlaut u"
\bind "yacute" "accent-acute y"
\bind "thorn" "self-insert"
\bind "ydiaeresis" "accent-umlaut y"
# Latin 2
\bind "Aogonek" "accent-ogonek A"
\bind "breve" "accent-breve b"
\bind "Lstroke" "self-insert"
\bind "Lcaron" "accent-caron L"
\bind "Sacute" "accent-acute S"
\bind "Scaron" "accent-caron S"
\bind "Scedilla" "accent-cedilla S"
\bind "Tcaron" "accent-caron T"
\bind "Zacute" "accent-acute Z"
\bind "Zcaron" "accent-caron Z"
\bind "Zabovedot" "accent-dot Z"
\bind "aogonek" "accent-ogonek a"
\bind "ogonek" "accent-ogonek o"
\bind "lstroke" "self-insert"
\bind "lcaron" "accent-caron l"
\bind "sacute" "accent-acute s"
\bind "caron" "self-insert"
\bind "scaron" "accent-caron s"
\bind "scedilla" "accent-cedilla s"
\bind "tcaron" "accent-caron t"
\bind "zacute" "accent-acute z"
\bind "doubleacute" "self-insert"
\bind "zcaron" "accent-caron z"
\bind "zabovedot" "accent-dot z"
\bind "Racute" "accent-acute R"
\bind "Abreve" "accent-breve A"
\bind "Lacute" "accent-acute L"
\bind "Cacute" "accent-acute C"
\bind "Ccaron" "accent-caron C"
\bind "Eogonek" "accent-ogonek E"
\bind "Ecaron" "accent-caron E"
\bind "Dcaron" "accent-caron D"
\bind "Dstroke" "self-insert"
\bind "Nacute" "accent-actue N"
\bind "Ncaron" "accent-caron N"
\bind "Odoubleacute" "accent-hungarian-umlaut O"
\bind "Rcaron" "accent-caron R"
\bind "Uring" "accent-circle U"
\bind "Udoubleacute" "accent-hungarian-umlaut U"
\bind "Tcedilla" "accent-cedilla T"
\bind "racute" "accent-acute r"
\bind "abreve" "accent-breve a"
\bind "lacute" "accent-acute l"
\bind "cacute" "accent-acute c"
\bind "ccaron" "accent-caron c"
\bind "eogonek" "accent-ogonek e"
\bind "ecaron" "accent-caron e"
\bind "dcaron" "accent-caron d"
\bind "dstroke" "self-insert"
\bind "nacute" "accent-acute n"
\bind "ncaron" "accent-caron n"
\bind "odoubleacute" "accent-hungarian-umlaut o"
\bind "udoubleacute" "accent-hungarian-umlaut u"
\bind "rcaron" "accent-caron r"
\bind "uring" "accent-circle u"
\bind "tcedilla" "accent-cedilla t"
\bind "abovedot" "accent-dot a"
# Latin 3
\bind "Hstroke" "self-insert"
\bind "Hcircumflex" "accent-circumflex H"
\bind "Iabovedot" "accent-dot I"
\bind "Gbreve" "accent-breve G"
\bind "Jcircumflex" "accent-circumflex J"
\bind "hstroke" "self-insert"
\bind "hcircumflex" "accent-circumflex h"
\bind "idotless" "self-insert"
\bind "gbreve" "accent-breve g"
\bind "jcircumflex" "accent-circumflex j"
\bind "Cabovedot" "accent-dot C"
\bind "Ccircumflex" "accent-circumflex C"
\bind "Gabovedot" "accent-dot G"
\bind "Gcircumflex" "accent-circumflex G"
\bind "Ubreve" "accent-breve U"
\bind "Scircumflex" "accent-circumflex S"
\bind "cabovedot" "accent-dot c"
\bind "ccircumflex" "accent-circumflex c"
\bind "gabovedot" "accent-dot g"
\bind "gcircumflex" "accent-circumflex g"
\bind "ubreve" "accent-breve u"
\bind "scircumflex" "accent-circumflex s"
# Latin 4
\bind "kra" "self-insert"
\bind "kappa" "self-insert"
\bind "Rcedilla" "accent-cedilla R"
\bind "Itilde" "accent-tilde I"
\bind "Lcedilla" "accent-cedilla L"
\bind "Emacron" "accent-macron E"
\bind "Gcedilla" "accent-cedilla G"
\bind "Tslash" "self-insert"
\bind "rcedilla" "accent-cedilla r"
\bind "itilde" "accent-tilde i"
\bind "lcedilla" "accent-cedilla l"
\bind "emacron" "accent-macron e"
\bind "gcedilla" "accent-cedilla g"
\bind "tslash" "self-insert"
\bind "ENG" "self-insert"
\bind "eng" "self-insert"
\bind "Amacron" "accent-macron A"
\bind "Iogonek" "accent-ogonek I"
\bind "Eabovedot" "accent-dot E"
\bind "Imacron" "accent-macron I"
\bind "Ncedilla" "accent-cedilla N"
\bind "Omacron" "accent-macron O"
\bind "Kcedilla" "accent-cedilla K"
\bind "Uogonek" "accent-ogonek U"
\bind "Utilde" "accent-tilde U"
\bind "Umacron" "accent-macron U"
\bind "amacron" "accent-macron a"
\bind "iogonek" "accent-ogonek i"
\bind "eabovedot" "accent-dot e"
\bind "imacron" "accent-macron i"
\bind "ncedilla" "accent-cedilla n"
\bind "omacron" "accent-macron o"
\bind "kcedilla" "accent-cedilla k"
\bind "uogonek" "accent-ogonek u"
\bind "utilde" "accent-tilde u"
\bind "umacron" "accent-macron u"
# Latin 8
\bind "Babovedot" "accent-dot B"
\bind "babovedot" "accent-dot b"
\bind "Dabovedot" "accent-dot D"
\bind "Wgrave" "accent-grave W"
\bind "Wacute" "accent-acute W"
\bind "dabovedot" "accent-dot d"
\bind "Ygrave" "accent-grave Y"
\bind "Fabovedot" "accent-dot F"
\bind "fabovedot" "accent-dot f"
\bind "Mabovedot" "accent-dot M"
\bind "mabovedot" "accent-dot m"
\bind "Pabovedot" "accent-dot P"
\bind "wgrave" "accent-grave w"
\bind "pabovedot" "accent-dot p"
\bind "wacute" "accent-acute w"
\bind "Sabovedot" "accent-dot S"
\bind "ygrave" "accent-grave y"
\bind "Wdiaeresis" "accent-umlaut W"
\bind "wdiaeresis" "accent-umlaut w"
\bind "sabovedot" "accent-dot s"
\bind "Wcircumflex" "accent-circumflex W"
\bind "Tabovedot" "accent-dot T"
\bind "Ycircumflex" "accent-circumflex Y"
\bind "wcircumflex" "accent-circumflex w"
\bind "tabovedot" "accent-dot t"
\bind "ycircumflex" "accent-circumflex y"
# Latin 9 (aka latin 9)
\bind "OE" "self-insert"
\bind "oe" "self-insert"
\bind "~S-Ydiaeresis" "accent-umlaut Y"

View File

@ -43,7 +43,7 @@
194 "\^{A}"
195 "\~{A}"
196 "\"{A}"
197 "\AA{}" # A with circle
197 "\r{A}" # A with circle
198 "\AE{}" # AE cat'ed together
199 "\c{C}" # C cedilla
200 "\`{E}"
@ -75,7 +75,7 @@
226 "\^{a}"
227 "\~{a}"
228 "\"{a}"
229 "\aa{}" # a with circle
229 "\r{a}" # a with circle
230 "\ae{}"
231 "\c{c}" # c cedilla
232 "\`{e}"

View File

@ -10,8 +10,8 @@ src/CutAndPaste.C
src/debug.C
src/exporter.C
src/ext_l10n.h
src/figureForm.C
src/figure_form.C
src/figureForm.C
src/FontLoader.C
src/frontends/controllers/ButtonController.h
src/frontends/controllers/character.C
@ -90,67 +90,67 @@ src/frontends/qt2/paragraphdlgimpl.C
src/frontends/qt2/tabularcreatedlgimpl.C
src/frontends/xforms/combox.C
src/frontends/xforms/FileDialog.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibitem.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/FormBibitem.C
src/frontends/xforms/form_bibtex.C
src/frontends/xforms/FormBibtex.C
src/frontends/xforms/form_browser.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_character.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/FormCharacter.C
src/frontends/xforms/form_citation.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/FormCitation.C
src/frontends/xforms/form_copyright.C
src/frontends/xforms/FormCredits.C
src/frontends/xforms/FormCopyright.C
src/frontends/xforms/form_credits.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormCredits.C
src/frontends/xforms/form_document.C
src/frontends/xforms/FormError.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/form_error.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormError.C
src/frontends/xforms/form_external.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/form_filedialog.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/form_graphics.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/form_include.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormInclude.C
src/frontends/xforms/form_index.C
src/frontends/xforms/FormIndex.C
src/frontends/xforms/FormLog.C
src/frontends/xforms/FormMathsBitmap.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_deco.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/FormMathsDeco.C
src/frontends/xforms/form_maths_delim.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/FormMathsDelim.C
src/frontends/xforms/form_maths_matrix.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/FormMathsMatrix.C
src/frontends/xforms/form_maths_panel.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/FormMathsPanel.C
src/frontends/xforms/form_maths_space.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/FormMathsSpace.C
src/frontends/xforms/form_minipage.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormMinipage.C
src/frontends/xforms/form_paragraph.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/form_preamble.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/FormPreamble.C
src/frontends/xforms/form_preferences.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/form_print.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/form_ref.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/FormRef.C
src/frontends/xforms/form_search.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/FormSearch.C
src/frontends/xforms/form_tabular.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/FormTabular.C
src/frontends/xforms/form_tabular_create.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/FormTabularCreate.C
src/frontends/xforms/form_toc.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormToc.C
src/frontends/xforms/form_url.C
src/frontends/xforms/FormUrl.C
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C

View File

@ -134,8 +134,6 @@ BufferView::Pimpl::Pimpl(BufferView * b, LyXView * o,
workarea_.workAreaKeyPress
.connect(slot(this, &BufferView::Pimpl::workAreaKeyPress));
//screen_ = 0;
cursor_timeout.timeout.connect(slot(this,
&BufferView::Pimpl::cursorToggle));
//current_scrollbar_value = 0;
@ -179,8 +177,6 @@ void BufferView::Pimpl::buffer(Buffer * b)
// Nuke old image
// screen is always deleted when the buffer is changed.
screen_.reset(0);
//delete screen_;
//screen_ = 0;
// If we are closing the buffer, use the first buffer as current
if (!buffer_) {
@ -254,7 +250,7 @@ bool BufferView::Pimpl::fitCursor(LyXText * text)
{
lyx::Assert(screen_.get());
bool ret = screen_->FitCursor(text, bv_);
bool const ret = screen_->FitCursor(text, bv_);
if (ret)
updateScrollbar();
return ret;
@ -2648,7 +2644,18 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
case LFUN_HUNG_UMLAUT:
case LFUN_CIRCLE:
case LFUN_OGONEK:
owner_->getLyXFunc()->handleKeyFunc(action);
if (argument.empty()) {
// As always...
owner_->getLyXFunc()->handleKeyFunc(action);
} else {
owner_->getLyXFunc()->handleKeyFunc(action);
owner_->getIntl()->getTrans()
.TranslateAndInsert(argument[0], TEXT(bv_));
update(TEXT(bv_),
BufferView::SELECT
| BufferView::FITCUR
| BufferView::CHANGE);
}
break;
// --- insert characters ----------------------------------------
@ -2926,6 +2933,8 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
case LFUN_UNKNOWN_ACTION:
{
// Ok what does this break.
#if 0
if (!buffer_) {
owner_->getLyXFunc()->setErrorMessage(N_("No document open"));
break;
@ -2975,6 +2984,10 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
// strange going on so we just tell this to someone!
owner_->getLyXFunc()->setErrorMessage(N_("No argument given"));
}
#else
owner_->getLyXFunc()->setErrorMessage(N_("Unknow function!"));
#endif
break;
}
default:

View File

@ -1,3 +1,9 @@
2001-05-11 Lars Gullik Bjønnes <larsbj@birdstep.com>
* BufferView_pimpl.C (Dispatch): comment out the old "default" key
handling.
(Dispatch): enhance the accent inset a bit. (not perfect)
2001-05-10 Lars Gullik Bjønnes <larsbj@birdstep.com>
* buffer.C (makeLaTeXFile): use stringstream on language_optons.

View File

@ -39,12 +39,14 @@ FontLoader::FontLoader()
reset();
}
// Destroy font loader
FontLoader::~FontLoader()
{
unload();
}
// Update fonts after zoom, dpi, font names, or norm change
// For now, we just ditch all fonts we have. Later, we should
// reuse the ones that are already loaded.
@ -53,6 +55,7 @@ void FontLoader::update()
unload();
}
// Reset font loader
void FontLoader::reset()
{
@ -67,6 +70,7 @@ void FontLoader::reset()
}
}
// Unload all fonts
void FontLoader::unload()
{
@ -87,6 +91,7 @@ void FontLoader::unload()
}
}
// Get font info
/* Takes care of finding which font that can match the given request. Tries
different alternatives. */

View File

@ -1504,10 +1504,6 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
unsigned int linelen) const
{
ostringstream buffer;
LyXFont font1;
LyXFont font2;
Inset const * inset;
char c;
char depth = 0;
int ltype = 0;
int ltype_depth = 0;
@ -1517,7 +1513,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
int noparbreak = 0;
int islatex = 0;
if (!par->previous()) {
/* begins or ends a deeper area ?*/
// begins or ends a deeper area ?
if (depth != par->params.depth()) {
if (par->params.depth() > depth) {
while (par->params.depth() > depth) {
@ -1530,7 +1526,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
}
}
/* First write the layout */
// First write the layout
string const tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
if (tmp == "Itemize") {
ltype = 1;
@ -1573,7 +1569,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
lyxerr << "Should this ever happen?" << endl;
}
font1 = LyXFont(LyXFont::ALL_INHERIT, params.language);
LyXFont const font1 = LyXFont(LyXFont::ALL_INHERIT, params.language);
for (LyXParagraph::size_type i = 0; i < par->size(); ++i) {
if (!i && !noparbreak) {
if (linelen > 0)
@ -1582,17 +1578,17 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
buffer << " ";
currlinelen = depth * 2;
switch (ltype) {
case 0: /* Standard */
case 4: /* (Sub)Paragraph */
case 5: /* Description */
case 0: // Standard
case 4: // (Sub)Paragraph
case 5: // Description
break;
case 6: /* Abstract */
case 6: // Abstract
if (linelen > 0)
buffer << "Abstract\n\n";
else
buffer << "Abstract: ";
break;
case 7: /* Bibliography */
case 7: // Bibliography
if (!ref_printed) {
if (linelen > 0)
buffer << "References\n\n";
@ -1611,7 +1607,7 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
currlinelen += (ltype_depth-depth)*2;
}
}
font2 = par->GetFontSettings(params, i);
LyXFont const font2 = par->GetFontSettings(params, i);
if (font1.latex() != font2.latex()) {
if (font2.latex() == LyXFont::OFF)
islatex = 0;
@ -1620,23 +1616,29 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
} else {
islatex = 0;
}
c = par->GetUChar(params, i);
char c = par->GetUChar(params, i);
if (islatex)
continue;
switch (c) {
case LyXParagraph::META_INSET:
if ((inset = par->GetInset(i))) {
{
Inset const * inset = par->GetInset(i);
if (inset) {
if (!inset->Ascii(this, buffer)) {
string dummy;
string s = rsplit(buffer.str().c_str(),
dummy, '\n');
string const s =
rsplit(buffer.str().c_str(),
dummy, '\n');
currlinelen += s.length();
} else {
// to be sure it breaks paragraph
currlinelen += linelen;
}
}
break;
}
break;
case LyXParagraph::META_NEWLINE:
if (linelen > 0) {
buffer << "\n";
@ -1651,12 +1653,15 @@ string const Buffer::asciiParagraph(LyXParagraph const * par,
currlinelen += (ltype_depth - depth) * 2;
}
break;
case LyXParagraph::META_HFILL:
buffer << "\t";
break;
case '\\':
buffer << "\\";
break;
default:
if ((linelen > 0) && (currlinelen > (linelen - 10)) &&
(c == ' ') && ((i + 2) < par->size()))

View File

@ -30,7 +30,7 @@ bool CharacterSet::loadFile(string const & fname)
// open definition file
lyxerr[Debug::KBMAP]
<< "Reading character set file " << fname << ".cdef" << endl;
string filename = LibFileSearch("kbd", fname, "cdef");
string const filename = LibFileSearch("kbd", fname, "cdef");
ifstream ifs(filename.c_str());
if (!ifs) {
lyxerr << "Unable to open character set file" << endl;
@ -38,8 +38,6 @@ bool CharacterSet::loadFile(string const & fname)
}
name_ = fname;
string str;
int n;
string line;
// Ok, I'll be the first to admit that this is probably not
// the fastest way to parse the cdef files, but I though it
@ -49,9 +47,10 @@ bool CharacterSet::loadFile(string const & fname)
while(getline(ifs, line)) {
if (reg.exact_match(line)) {
LRegex::SubMatches const & sub = reg.exec(line);
n = lyx::atoi(line.substr(sub[1].first,
int const n = lyx::atoi(line.substr(sub[1].first,
sub[1].second));
str = LSubstring(line, sub[2].first, sub[2].second);
string const str = LSubstring(line, sub[2].first,
sub[2].second);
if (lyxerr.debugging(Debug::KBMAP))
lyxerr << "Chardef: " << n
<< " to [" << str << "]" << endl;

View File

@ -260,11 +260,32 @@ unsigned int kb_sequence::getsym() const
char kb_sequence::getiso() const
{
int const c = getsym();
unsigned int const c = getsym();
lyxerr << "Raw keysym: " << hex << c << dec << endl;
lyxerr << "byte 3: " << hex << (c & 0x0000FF00) << dec << endl;
if (c > 0xff)
switch (c & 0x0000FF00) {
// latin 1 byte 3 = 0
case 0x00000000:
return c;
// latin 2 byte 3 = 1
case 0x00000100:
// latin 3 byte 3 = 2
case 0x00000200:
// latin 4 byte 3 = 3
case 0x00000300:
// latin 8 byte 3 = 18 (0x12)
case 0x00001200:
// latin 9 byte 3 = 19 (0x13)
case 0x00001300:
return c & 0x000000FF;
default:
return '\0';
return c;
}
// not a latin char we know of
return '\0';
}

View File

@ -39,7 +39,7 @@ public:
/// Make length negative to mark the sequence as deleted
void delseq();
///
char getiso() const;

View File

@ -197,10 +197,10 @@ void LyXFunc::moveCursorUpdate(bool flag, bool selecting)
void LyXFunc::handleKeyFunc(kb_action action)
{
char c = 0;
char c = keyseq.getiso();
if (keyseq.length == -1 && keyseq.getiso() != 0)
c = keyseq.getiso();
if (keyseq.length != -1) c = 0;
owner->getIntl()->getTrans()
.deadkey(c, get_accent(action).accent, TEXT(false));
// Need to reset, in case the minibuffer calls these
@ -317,6 +317,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
}
if (action == -1) {
#if 0
if (keyseq.length < -1) { // unknown key sequence...
string buf;
keyseq.print(buf);
@ -336,6 +337,10 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
// so we`ll skip the dispatch.
return 0;
}
#else
owner->message(_("Unknown function."));
return 0;
#endif
} else if (action == LFUN_SELFINSERT) {
// We must set the argument to the char looked up by
// XKeysymToString
@ -357,7 +362,7 @@ int LyXFunc::processKeySym(KeySym keysym, unsigned int state)
xke.same_screen = True;
char ret[10];
KeySym tmpkeysym;
int res = XLookupString(&xke, ret, 10, &tmpkeysym, 0);
int const res = XLookupString(&xke, ret, 10, &tmpkeysym, 0);
//Assert(keysym == tmpkeysym);
lyxerr[Debug::KEY] << "TmpKeysym ["
<< tmpkeysym << "]" << endl;
@ -561,6 +566,7 @@ void LyXFunc::miniDispatch(string const & s)
Dispatch(s);
}
string const LyXFunc::Dispatch(string const & s)
{
// Split command string into command and argument
@ -1483,7 +1489,8 @@ string const LyXFunc::Dispatch(int ac,
default:
// Then if it was none of the above
if (!owner->view()->Dispatch(action, argument))
lyxerr << "A truly unknown func!" << endl;
lyxerr << "A truly unknown func ["
<< action << "]!" << endl;
break;
} // end of switch

View File

@ -60,6 +60,7 @@ public:
/// we need one internall which is called from inside LyXAction and
/// can contain the string argument.
func_status getStatus(int ac) const;
///
func_status getStatus(int ac, string const & not_to_use_arg) const;
/// The last key was meta

View File

@ -85,7 +85,8 @@ tex_accent_struct get_accent(kb_action action)
return temp;
}
string DoAccent(string const & s, tex_accent accent)
string const DoAccent(string const & s, tex_accent accent)
{
string res;
@ -99,7 +100,8 @@ string DoAccent(string const & s, tex_accent accent)
return res;
}
string DoAccent(char c, tex_accent accent)
string const DoAccent(char c, tex_accent accent)
{
return DoAccent(tostr(c), accent);
}

View File

@ -160,8 +160,7 @@ string const TransCombinedState::normalkey(char c, string const & trans)
// Check if the key is allowed on the combination
if (countChar(comb_info_->data, c) > 0) {
string temp;
temp = DoAccent(c, deadkey2_info_.accent);
string const temp = DoAccent(c, deadkey2_info_.accent);
res = DoAccent(temp, deadkey_info_.accent);
currentState = init_state_;
} else {
@ -333,7 +332,8 @@ void TransManager::deadkey(char c, tex_accent accent, LyXText * t)
// or a accent command was typed in the minibuffer
KmodInfo i;
if (active_->isAccentDefined(accent, i) == true) {
string res = trans_fsm_.currentState->deadkey(c, i);
string const res = trans_fsm_
.currentState->deadkey(c, i);
insert(res, t);
return;
}