From 40e4ab9bf3fe01ed763e06df40cfc19b69369cfa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 30 Apr 2007 21:01:24 +0000 Subject: [PATCH] distribute content sof tex-strings.cpp to their respective unique places of usage git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18130 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/BufferParams.cpp | 48 ++++++++-- src/Makefile.am | 2 - src/ParagraphParameters.cpp | 12 ++- src/frontends/controllers/ControlDocument.cpp | 1 - src/frontends/qt4/QDocument.cpp | 37 +++++++- src/tex-strings.cpp | 95 ------------------- src/tex-strings.h | 54 ----------- 7 files changed, 82 insertions(+), 167 deletions(-) delete mode 100644 src/tex-strings.cpp delete mode 100644 src/tex-strings.h diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index d2c068d0fb..85d09b5f3e 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -31,7 +31,6 @@ #include "LyXRC.h" #include "TextClassList.h" #include "OutputParams.h" -#include "tex-strings.h" #include "Spacing.h" #include "TexRow.h" #include "VSpace.h" @@ -46,13 +45,6 @@ #include - -namespace lyx { - -using support::bformat; -using support::rtrim; -using support::tokenPos; - using std::endl; using std::string; using std::istringstream; @@ -60,8 +52,44 @@ using std::ostream; using std::ostringstream; using std::pair; -namespace Alert = lyx::frontend::Alert; +using lyx::support::bformat; +using lyx::support::rtrim; +using lyx::support::tokenPos; + + +static char const * const string_paragraph_separation[] = { + "indent", "skip", "" +}; + + +static char const * const string_quotes_language[] = { + "english", "swedish", "german", "polish", "french", "danish", "" +}; + + +static char const * const string_papersize[] = { + "default", "custom", "letterpaper", "executivepaper", "legalpaper", + "a3paper", "a4paper", "a5paper", "b3paper", "b4paper", "b5paper", "" +}; + + +static char const * const string_orientation[] = { + "portrait", "landscape", "" +}; + + +static char const * const string_footnotekinds[] = { + "footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", "" +}; + + +static char const * const tex_graphics[] = { + "default", "dvips", "dvitops", "emtex", + "ln", "oztex", "textures", "none", "" +}; + +namespace lyx { // Local translators namespace { @@ -441,7 +469,7 @@ string const BufferParams::readToken(Lexer & lex, string const & token) "class or style file required by it is not\n" "available. See the Customization documentation\n" "for more information.\n"), from_utf8(classname)); - Alert::warning(_("Document class not available"), + frontend::Alert::warning(_("Document class not available"), msg + _("LyX will not be able to produce output.")); } } else if (token == "\\begin_preamble") { diff --git a/src/Makefile.am b/src/Makefile.am index bb057ddac9..d21fd4a8a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -244,8 +244,6 @@ lyx_SOURCES = \ TextClass.h \ TextClassList.cpp \ TextClassList.h \ - tex-strings.cpp \ - tex-strings.h \ TextMetrics.cpp \ TextMetrics.h \ Thesaurus.cpp \ diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp index 568f183ec0..eb0dd65a15 100644 --- a/src/ParagraphParameters.cpp +++ b/src/ParagraphParameters.cpp @@ -22,15 +22,12 @@ #include "Lexer.h" #include "Text.h" #include "Paragraph.h" -#include "tex-strings.h" #include "support/lstrings.h" #include -namespace lyx { - -using support::rtrim; +using lyx::support::rtrim; using std::istringstream; using std::ostream; @@ -38,6 +35,13 @@ using std::ostringstream; using std::string; +namespace lyx { + +static char const * const string_align[] = { + "block", "left", "right", "center", "" +}; + + static int findToken(char const * const str[], string const & search_token) { return search_token == "default" ? diff --git a/src/frontends/controllers/ControlDocument.cpp b/src/frontends/controllers/ControlDocument.cpp index 82aeb29605..36c3bbd529 100644 --- a/src/frontends/controllers/ControlDocument.cpp +++ b/src/frontends/controllers/ControlDocument.cpp @@ -25,7 +25,6 @@ #include "Color.h" #include "OutputParams.h" #include "TextClassList.h" -#include "tex-strings.h" // FIXME: those two headers are needed because of the // WorkArea::redraw() call below. diff --git a/src/frontends/qt4/QDocument.cpp b/src/frontends/qt4/QDocument.cpp index 0b2f8f7f1b..322fc0e6f0 100644 --- a/src/frontends/qt4/QDocument.cpp +++ b/src/frontends/qt4/QDocument.cpp @@ -34,7 +34,6 @@ #include "Language.h" #include "LyXRC.h" // defaultUnit #include "TextClassList.h" -#include "tex-strings.h" // tex_graphics #include "Spacing.h" #include "controllers/ControlDocument.h" @@ -54,6 +53,42 @@ using std::vector; using std::string; +char const * const tex_graphics[] = {"default", "dvips", "dvitops", "emtex", + "ln", "oztex", "textures", "none", "" +}; + + +char const * const tex_fonts_roman[] = {"default", "cmr", "lmodern", "ae", "times", "palatino", + "charter", "newcent", "bookman", "utopia", "beraserif", "ccfonts", "chancery", "" +}; + + +char const * tex_fonts_roman_gui[] = { N_("Default"), N_("Computer Modern Roman"), N_("Latin Modern Roman"), + N_("AE (Almost European)"), N_("Times Roman"), N_("Palatino"), N_("Bitstream Charter"), + N_("New Century Schoolbook"), N_("Bookman"), N_("Utopia"), N_("Bera Serif"), + N_("Concrete Roman"), N_("Zapf Chancery"), "" +}; + + +char const * const tex_fonts_sans[] = {"default", "cmss", "lmss", "helvet", "avant", "berasans", "cmbr", "" +}; + + +char const * tex_fonts_sans_gui[] = { N_("Default"), N_("Computer Modern Sans"), N_("Latin Modern Sans"), + N_("Helvetica"), N_("Avant Garde"), N_("Bera Sans"), N_("CM Bright"), "" +}; + + +char const * const tex_fonts_monospaced[] = {"default", "cmtt", "lmtt", "courier", "beramono", + "luximono", "cmtl", "" +}; + + +char const * tex_fonts_monospaced_gui[] = { N_("Default"), N_("Computer Modern Typewriter"), + N_("Latin Modern Typewriter"), N_("Courier"), N_("Bera Mono"), N_("LuxiMono"), + N_("CM Typewriter Light"), "" +}; + namespace lyx { namespace frontend { diff --git a/src/tex-strings.cpp b/src/tex-strings.cpp deleted file mode 100644 index d6f9e2f6cf..0000000000 --- a/src/tex-strings.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/** - * \file tex-strings.cpp - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Lars Gullik Bjønnes - * \author Jean-Marc Lasgouttes - * - * Full author contact details are available in file CREDITS. - */ - -#include - -#include "tex-strings.h" -#include "gettext.h" - - -namespace lyx { - - -// this file should perhaps be split into even smaller parts - -char const * const string_paragraph_separation[] = { - "indent", "skip", "" -}; - - -char const * const string_quotes_language[] = { - "english", "swedish", "german", "polish", "french", "danish", "" -}; - - -char const * const string_papersize[] = { - "default", "custom", "letterpaper", "executivepaper", "legalpaper", - "a3paper", "a4paper", "a5paper", "b3paper", "b4paper", "b5paper", "" -}; - - -char const * const string_orientation[] = { - "portrait", "landscape", "" -}; - - -char const * const string_footnotekinds[] = { - "footnote", "margin", "fig", "tab", "alg", "wide-fig", "wide-tab", "" -}; - - -char const * const string_align[] = { - "block", "left", "right", "center", "" -}; - - -// The following was moved from tex-defs.h to here, because tex-defs.h is -// used all over. As it happens, that meant that these strings were included -// 27 times in the object file. (Asger) - -char const * const tex_graphics[] = {"default", "dvips", "dvitops", "emtex", - "ln", "oztex", "textures", "none", "" -}; - - -char const * const tex_fonts_roman[] = {"default", "cmr", "lmodern", "ae", "times", "palatino", - "charter", "newcent", "bookman", "utopia", "beraserif", "ccfonts", "chancery", "" -}; - - -char const * tex_fonts_roman_gui[] = { N_("Default"), N_("Computer Modern Roman"), N_("Latin Modern Roman"), - N_("AE (Almost European)"), N_("Times Roman"), N_("Palatino"), N_("Bitstream Charter"), - N_("New Century Schoolbook"), N_("Bookman"), N_("Utopia"), N_("Bera Serif"), - N_("Concrete Roman"), N_("Zapf Chancery"), "" -}; - - -char const * const tex_fonts_sans[] = {"default", "cmss", "lmss", "helvet", "avant", "berasans", "cmbr", "" -}; - - -char const * tex_fonts_sans_gui[] = { N_("Default"), N_("Computer Modern Sans"), N_("Latin Modern Sans"), - N_("Helvetica"), N_("Avant Garde"), N_("Bera Sans"), N_("CM Bright"), "" -}; - - -char const * const tex_fonts_monospaced[] = {"default", "cmtt", "lmtt", "courier", "beramono", - "luximono", "cmtl", "" -}; - - -char const * tex_fonts_monospaced_gui[] = { N_("Default"), N_("Computer Modern Typewriter"), - N_("Latin Modern Typewriter"), N_("Courier"), N_("Bera Mono"), N_("LuxiMono"), - N_("CM Typewriter Light"), "" -}; - - -} // namespace lyx diff --git a/src/tex-strings.h b/src/tex-strings.h deleted file mode 100644 index 28c59ed4d5..0000000000 --- a/src/tex-strings.h +++ /dev/null @@ -1,54 +0,0 @@ -// -*- C++ -*- -/** - * \file tex-strings.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Lars Gullik Bjønnes - * \author Jean-Marc Lasgouttes - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef TEX_STRINGS -#define TEX_STRINGS - -namespace lyx { - -/// -extern char const * const string_paragraph_separation[]; -/// -extern char const * const string_quotes_language[]; -/// -extern char const * const string_papersize[]; -/// -extern char const * const string_orientation[]; -/// -extern char const * const string_footnotekinds[]; -/// -extern char const * const string_align[]; - -// The following was moved from tex-defs.h to here, because tex-defs.h is -// used all over. As it happens, that meant that these strings were included -// 27 times in the object file. (Asger) - -/// -extern char const * const tex_graphics[]; - -/// -extern char const * const tex_fonts_roman[]; -/// -extern char const * tex_fonts_roman_gui[]; -/// -extern char const * const tex_fonts_sans[]; -/// -extern char const * tex_fonts_sans_gui[]; -/// -extern char const * const tex_fonts_monospaced[]; -/// -extern char const * tex_fonts_monospaced_gui[]; - - -} // namespace lyx - -#endif -- 2.39.5