]> git.lyx.org Git - lyx.git/commitdiff
Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
authorAndré Pönitz <poenitz@gmx.net>
Thu, 29 Nov 2007 07:04:28 +0000 (07:04 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 29 Nov 2007 07:04:28 +0000 (07:04 +0000)
Now support/* should have no dependencies on src/* anymore.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8

271 files changed:
src/ASpell.cpp
src/BiblioInfo.cpp
src/Buffer.cpp
src/BufferList.cpp
src/BufferParams.cpp
src/BufferView.cpp
src/Bullet.cpp
src/Changes.cpp
src/Chktex.cpp
src/CmdDef.cpp
src/Color.cpp
src/Converter.cpp
src/ConverterCache.cpp
src/CoordCache.cpp
src/Counters.cpp
src/Cursor.cpp
src/CursorSlice.cpp
src/CutAndPaste.cpp
src/DepTable.cpp
src/DocIterator.cpp
src/EmbeddedFiles.cpp
src/Encoding.cpp
src/Exporter.cpp
src/Font.cpp
src/FontInfo.cpp
src/FontIterator.cpp
src/Format.cpp
src/ISpell.cpp
src/InsetList.cpp
src/Intl.cpp
src/KeyMap.cpp
src/KeySequence.cpp
src/LaTeX.cpp
src/LaTeXFeatures.cpp
src/Language.cpp
src/Layout.cpp
src/Lexer.cpp
src/LyX.cpp
src/LyXAction.cpp
src/LyXFunc.cpp
src/LyXRC.cpp
src/LyXVC.cpp
src/Makefile.am
src/MenuBackend.cpp
src/Messages.cpp [deleted file]
src/Messages.h [deleted file]
src/ModuleList.cpp
src/PDFOptions.cpp
src/PSpell.cpp
src/Paragraph.cpp
src/ParagraphMetrics.cpp
src/ParagraphParameters.cpp
src/Row.cpp
src/Server.cpp
src/ServerSocket.cpp
src/Session.cpp
src/SpellBase.cpp
src/TexRow.cpp
src/Text.cpp
src/Text2.cpp
src/Text3.cpp
src/TextClass.cpp
src/TextClassList.cpp
src/TextMetrics.cpp
src/Thesaurus.cpp
src/TocBackend.cpp
src/ToolbarBackend.cpp
src/Trans.cpp
src/Undo.cpp
src/VCBackend.cpp
src/VSpace.cpp
src/boost.cpp
src/buffer_funcs.cpp
src/client/Messages.cpp
src/client/boost.cpp
src/client/client.cpp
src/client/debug.cpp
src/client/gettext.cpp
src/debug.cpp [deleted file]
src/debug.h [deleted file]
src/factory.cpp
src/frontends/qt4/Action.cpp
src/frontends/qt4/ButtonController.cpp
src/frontends/qt4/ButtonController.h
src/frontends/qt4/ButtonPolicy.cpp
src/frontends/qt4/DialogView.h
src/frontends/qt4/DockView.h
src/frontends/qt4/FileDialog.cpp
src/frontends/qt4/GuiAbout.cpp
src/frontends/qt4/GuiAlert.cpp
src/frontends/qt4/GuiApplication.cpp
src/frontends/qt4/GuiBibtex.cpp
src/frontends/qt4/GuiBox.cpp
src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/GuiClipboard.cpp
src/frontends/qt4/GuiDelimiter.cpp
src/frontends/qt4/GuiDialog.cpp
src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/GuiERT.cpp
src/frontends/qt4/GuiErrorList.cpp
src/frontends/qt4/GuiExternal.cpp
src/frontends/qt4/GuiFontLoader.cpp
src/frontends/qt4/GuiGraphics.cpp
src/frontends/qt4/GuiImage.cpp
src/frontends/qt4/GuiInclude.cpp
src/frontends/qt4/GuiIndex.cpp
src/frontends/qt4/GuiKeySymbol.cpp
src/frontends/qt4/GuiListings.cpp
src/frontends/qt4/GuiLog.cpp
src/frontends/qt4/GuiMath.cpp
src/frontends/qt4/GuiMathMatrix.cpp
src/frontends/qt4/GuiMenubar.cpp
src/frontends/qt4/GuiNomencl.cpp
src/frontends/qt4/GuiNote.cpp
src/frontends/qt4/GuiPainter.cpp
src/frontends/qt4/GuiParagraph.cpp
src/frontends/qt4/GuiParagraph.h
src/frontends/qt4/GuiPopupMenu.cpp
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/GuiPrint.cpp
src/frontends/qt4/GuiSelection.cpp
src/frontends/qt4/GuiSpellchecker.cpp
src/frontends/qt4/GuiTexinfo.cpp
src/frontends/qt4/GuiThesaurus.cpp
src/frontends/qt4/GuiToc.cpp
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiToolbars.cpp
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiViewSource.cpp
src/frontends/qt4/GuiViewSource.h
src/frontends/qt4/GuiWorkArea.cpp
src/frontends/qt4/PanelStack.cpp
src/frontends/qt4/TocModel.cpp
src/frontends/qt4/TocWidget.cpp
src/frontends/qt4/Validator.cpp
src/frontends/qt4/qt_helpers.cpp
src/gettext.cpp [deleted file]
src/gettext.h [deleted file]
src/graphics/GraphicsCache.cpp
src/graphics/GraphicsCacheItem.cpp
src/graphics/GraphicsConverter.cpp
src/graphics/GraphicsImage.cpp
src/graphics/GraphicsLoader.cpp
src/graphics/PreviewLoader.cpp
src/insets/ExternalSupport.cpp
src/insets/ExternalTemplate.cpp
src/insets/ExternalTransforms.cpp
src/insets/Inset.cpp
src/insets/InsetBibtex.cpp
src/insets/InsetBox.cpp
src/insets/InsetBranch.cpp
src/insets/InsetCaption.cpp
src/insets/InsetCitation.cpp
src/insets/InsetCollapsable.cpp
src/insets/InsetCommand.cpp
src/insets/InsetCommandParams.cpp
src/insets/InsetERT.cpp
src/insets/InsetEnvironment.cpp
src/insets/InsetExternal.cpp
src/insets/InsetFlex.cpp
src/insets/InsetFloat.cpp
src/insets/InsetFloatList.cpp
src/insets/InsetFoot.cpp
src/insets/InsetGraphics.cpp
src/insets/InsetGraphicsParams.cpp
src/insets/InsetHFill.cpp
src/insets/InsetHyperlink.cpp
src/insets/InsetInclude.cpp
src/insets/InsetIndex.cpp
src/insets/InsetInfo.cpp
src/insets/InsetInfo.h
src/insets/InsetLine.cpp
src/insets/InsetListings.cpp
src/insets/InsetListingsParams.cpp
src/insets/InsetMarginal.cpp
src/insets/InsetNewline.cpp
src/insets/InsetNewline.h
src/insets/InsetNewpage.cpp
src/insets/InsetNewpage.h
src/insets/InsetNomencl.cpp
src/insets/InsetNote.cpp
src/insets/InsetOptArg.cpp
src/insets/InsetQuotes.cpp
src/insets/InsetRef.cpp
src/insets/InsetSpace.cpp
src/insets/InsetSpecialChar.cpp
src/insets/InsetTOC.cpp
src/insets/InsetTabular.cpp
src/insets/InsetText.cpp
src/insets/InsetTheorem.cpp
src/insets/InsetVSpace.cpp
src/insets/InsetWrap.cpp
src/insets/MailInset.cpp
src/insets/RenderGraphic.cpp
src/insets/RenderPreview.cpp
src/lengthcommon.cpp
src/lyxfind.cpp
src/main.cpp
src/mathed/InsetFormulaMacro.cpp
src/mathed/InsetMath.cpp
src/mathed/InsetMathAMSArray.cpp
src/mathed/InsetMathCases.cpp
src/mathed/InsetMathChar.cpp
src/mathed/InsetMathDecoration.cpp
src/mathed/InsetMathDiff.cpp
src/mathed/InsetMathExInt.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathLim.cpp
src/mathed/InsetMathMBox.cpp
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathRef.cpp
src/mathed/InsetMathScript.cpp
src/mathed/InsetMathSplit.cpp
src/mathed/InsetMathSubstack.cpp
src/mathed/InsetMathSymbol.cpp
src/mathed/InsetMathXYArrow.cpp
src/mathed/MacroTable.cpp
src/mathed/MathAutoCorrect.cpp
src/mathed/MathData.cpp
src/mathed/MathExtern.cpp
src/mathed/MathFactory.cpp
src/mathed/MathMacro.cpp
src/mathed/MathMacroArgument.cpp
src/mathed/MathMacroTemplate.cpp
src/mathed/MathParser.cpp
src/mathed/MathSupport.cpp
src/output.cpp
src/output_docbook.cpp
src/output_latex.cpp
src/output_plaintext.cpp
src/paragraph_funcs.cpp
src/rowpainter.cpp
src/support/FileFilterList.cpp
src/support/FileMonitor.cpp
src/support/FileName.cpp
src/support/FileName.h
src/support/ForkedCallQueue.cpp
src/support/Forkedcall.cpp
src/support/ForkedcallsController.cpp
src/support/Makefile.am
src/support/Messages.cpp [new file with mode: 0644]
src/support/Messages.h [new file with mode: 0644]
src/support/Package.cpp
src/support/SignalSlot.cpp
src/support/Timeout.cpp
src/support/convert.cpp
src/support/cow_ptr.h [deleted file]
src/support/debug.cpp [new file with mode: 0644]
src/support/debug.h [new file with mode: 0644]
src/support/docstream.cpp
src/support/docstring.cpp
src/support/filetools.cpp
src/support/gettext.cpp [new file with mode: 0644]
src/support/gettext.h [new file with mode: 0644]
src/support/gzstream.cpp
src/support/kill.cpp
src/support/lstrings.cpp
src/support/lyxsum.cpp
src/support/os.cpp
src/support/os_cygwin.cpp
src/support/os_win32.cpp
src/support/rename.cpp
src/support/socktools.cpp
src/support/tempname.cpp
src/support/unicode.cpp
src/support/userinfo.cpp
src/tex2lyx/boost.cpp
src/tex2lyx/gettext.cpp
src/tex2lyx/tex2lyx.cpp
src/version.cpp

index 51d1ed4bf9315a740280eda2974744c37959af24..ef7b806b708dd47d4869f15b8385f0e274260c4e 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <config.h>
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <aspell.h>
 
index 4718d37ed27c1575edfded80a31d0727fa3f4213..ca4d2850de747b20022a59c9459f2a2bb44d41c9 100644 (file)
@@ -16,7 +16,6 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "buffer_funcs.h"
-#include "gettext.h"
 #include "InsetIterator.h"
 #include "Paragraph.h"
 
@@ -25,8 +24,9 @@
 #include "insets/InsetBibtex.h"
 #include "insets/InsetInclude.h"
 
-#include "support/lstrings.h"
 #include "support/docstream.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
 
 #include "boost/regex.hpp"
 
index c2e3444148c39eb91b235976aa55fceb7529da41..94a279bffc031e69e68056c59a95efc72f10acf3 100644 (file)
@@ -23,7 +23,6 @@
 #include "Chktex.h"
 #include "Converter.h"
 #include "Counters.h"
-#include "debug.h"
 #include "DocIterator.h"
 #include "EmbeddedFiles.h"
 #include "Encoding.h"
@@ -31,7 +30,6 @@
 #include "Exporter.h"
 #include "Format.h"
 #include "FuncRequest.h"
-#include "gettext.h"
 #include "InsetIterator.h"
 #include "InsetList.h"
 #include "Language.h"
 
 #include "graphics/Previews.h"
 
-#include "support/types.h"
-#include "support/lyxalgo.h"
+#include "support/convert.h"
+#include "support/debug.h"
 #include "support/FileFilterList.h"
 #include "support/filetools.h"
 #include "support/Forkedcall.h"
+#include "support/gettext.h"
 #include "support/gzstream.h"
 #include "support/lstrings.h"
+#include "support/lyxalgo.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/Path.h"
 #include "support/textutils.h"
-#include "support/convert.h"
+#include "support/types.h"
 
 #if !defined (HAVE_FORK)
 # define fork() -1
index 60f87a020199fa7bb475106f16b0ff61d882a76e..5fc0a36ad4156293fd04424b71a3c62ea526f432 100644 (file)
@@ -15,8 +15,6 @@
 #include "Author.h"
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
-#include "gettext.h"
 #include "Session.h"
 #include "LyX.h"
 #include "output_latex.h"
@@ -24,7 +22,9 @@
 
 #include "frontends/alert.h"
 
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/Package.h"
 
index 946a781a0726a79ce5160d0d0a89f347887ab7ff..44573db167afc572f96e556b24328c21411063e3 100644 (file)
 #include "buffer_funcs.h"
 #include "Bullet.h"
 #include "Color.h"
-#include "debug.h"
 #include "Encoding.h"
-#include "gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
-#include "Messages.h"
 #include "ModuleList.h"
 #include "Font.h"
 #include "Lexer.h"
 #include "PDFOptions.h"
 
 #include "frontends/alert.h"
+
 #include "insets/InsetListingsParams.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/docstream.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
+#include "support/Messages.h"
 #include "support/Translator.h"
 #include "support/lstrings.h"
 
index 84c877f55a9f0c99d9d44a9cb1ca8ddf41d0fcea..438de83b42cfb85db03c8f0619444566a96e6d06 100644 (file)
@@ -23,7 +23,6 @@
 #include "CoordCache.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
 #include "DispatchResult.h"
 #include "EmbeddedFiles.h"
 #include "ErrorList.h"
@@ -31,7 +30,6 @@
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
 #include "Intl.h"
 #include "InsetIterator.h"
 #include "Language.h"
 #include "graphics/Previews.h"
 
 #include "support/convert.h"
-#include "support/lstrings.h"
+#include "support/debug.h"
 #include "support/FileFilterList.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
 #include "support/Package.h"
 #include "support/types.h"
 
index 4ae4df2ca391b174ca300b794147dccf3d02cf7c..2db54cec17d8de12ec8bd889826e1d777184836f 100644 (file)
@@ -41,15 +41,12 @@ Bullet const ITEMIZE_DEFAULTS[4] = { Bullet(0, 8),//"\\(\\bullet\\)"
 Bullet::Bullet(int f, int c, int s)
        : font(f), character(c), size(s), user_text(0)
 {
-       if (f < MIN || f >= FONTMAX) {
+       if (f < MIN || f >= FONTMAX)
                font = MIN;
-       }
-       if (c < MIN || c >= CHARMAX) {
+       if (c < MIN || c >= CHARMAX)
                character = MIN;
-       }
-       if (s < MIN || s >= SIZEMAX) {
+       if (s < MIN || s >= SIZEMAX)
                size = MIN;
-       }
        generateText();
        testInvariant();
 }
@@ -65,11 +62,10 @@ Bullet::Bullet(docstring const & t)
 
 void Bullet::setCharacter(int c)
 {
-       if (c < MIN || c >= CHARMAX) {
+       if (c < MIN || c >= CHARMAX)
                character = MIN;
-       } else {
+       else
                character = c;
-       }
        user_text = 0;
        testInvariant();
 }
@@ -77,11 +73,10 @@ void Bullet::setCharacter(int c)
 
 void Bullet::setFont(int f)
 {
-       if (f < MIN || f >= FONTMAX) {
+       if (f < MIN || f >= FONTMAX)
                font = MIN;
-       } else {
+       else
                font = f;
-       }
        user_text = 0;
        testInvariant();
 }
@@ -89,11 +84,10 @@ void Bullet::setFont(int f)
 
 void Bullet::setSize(int s)
 {
-       if (s < MIN || s >= SIZEMAX) {
+       if (s < MIN || s >= SIZEMAX)
                size = MIN;
-       } else {
+       else
                size = s;
-       }
        user_text = 0;
        testInvariant();
 }
@@ -141,9 +135,8 @@ Bullet & Bullet::operator=(Bullet const & b)
 
 docstring const & Bullet::getText() const
 {
-       if (user_text == 0) {
+       if (user_text == 0)
                generateText();
-       }
        return text;
 }
 
@@ -154,12 +147,10 @@ bool operator==(const Bullet & b1, const Bullet & b2)
 
        if (b1.user_text && b2.user_text) {
                /* both have valid text */
-               if (b1.text == b2.text) {
+               if (b1.text == b2.text)
                        result = true;
-               }
-       } else if (((b1.character == b2.character) &&
-                         (b1.font == b2.font)) &&
-                        (b1.size == b2.size)) {
+       } else if (b1.character == b2.character && b1.font == b2.font &&
+                        b1.size == b2.size) {
                result = true;
        }
        return result;
@@ -185,9 +176,8 @@ void Bullet::generateText() const
 
        if ((font >= 0) && (character >= 0)) {
                text = bulletEntry(font, character);
-               if (size >= 0) {
+               if (size >= 0)
                        text = bulletSize(size) + text;
-               }
                user_text = -1;
                // text is now defined and doesn't need to be recalculated
                // unless font/character or text is modified
index 8c431a0cc86e2e41c55e976105040bd7c22f4eef..e8caabe587d744a8792d94c7a35bccd39ed309c8 100644 (file)
 #include <config.h>
 
 #include "Changes.h"
-#include "debug.h"
 #include "Author.h"
 #include "BufferParams.h"
 #include "LaTeXFeatures.h"
 
+#include "support/debug.h"
+
 #include <boost/assert.hpp>
 
 #include <ostream>
index 2af1ed0487a20bdf118fd9b112a1e07bed8c52bf..c88aefb2ba9a2da00fd534b5d21751700ceef08f 100644 (file)
 #include <config.h>
 
 #include "Chktex.h"
-#include "gettext.h"
 
 #include "LaTeX.h" // TeXErrors
 
 #include "support/convert.h"
 #include "support/docstream.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/Systemcall.h"
 
index 1e4b98e61a192aba69749e9bcebbd5377943abfd..ed7cdbb08767f71e11ae9ef0844af4a583924887 100644 (file)
@@ -13,9 +13,9 @@
 #include "CmdDef.h"
 
 #include "LyXAction.h"
-#include "debug.h"
 #include "Lexer.h"
 
+#include "support/debug.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 
index c4d9351e6bea8202f27b840030534604c5b9328f..3aa3921561ae96c97ca5a6b88709426bc1f15d2f 100644 (file)
@@ -18,9 +18,8 @@
 
 #include "Color.h"
 
-#include "debug.h"
-#include "gettext.h"
-
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 
 #include <boost/assert.hpp>
index 3b958c3117db3ccd578e22cc2fb4771f574a0d79..6715e028c0e1d3158dfe024bda36bf001f199901 100644 (file)
 #include "Buffer.h"
 #include "buffer_funcs.h"
 #include "BufferParams.h"
-#include "debug.h"
 #include "ErrorList.h"
 #include "Format.h"
-#include "gettext.h"
 #include "Language.h"
 #include "LaTeX.h"
 #include "Mover.h"
 
 #include "frontends/alert.h"
 
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
index c61c8554e4a2b066e8576d53461719ed09faf06c..f9a02325628500ec7390d5e0a6e26c0f50ec8b4f 100644 (file)
@@ -18,9 +18,9 @@
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "Mover.h"
-#include "debug.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "support/lyxtime.h"
index 6d197b8fc0d9513a62be1932a96d112ba0cf517c..773d8c7bc422d374bf7f36063f0c667d9b64d591 100644 (file)
@@ -11,9 +11,9 @@
 
 #include "CoordCache.h"
 
-#include "debug.h"
 #include "Text.h"
 
+#include "support/debug.h"
 #include "support/docstring.h"
 
 #include "insets/Inset.h"
index f1b249dcc47bfcaf99a5d2aa9cc9f8e18804d4e8..b4bf026e42d5bd72c9f702a3c9fae76914219fcf 100644 (file)
 #include <config.h>
 
 #include "Counters.h"
-#include "debug.h"
 
-#include "support/lstrings.h"
 #include "support/convert.h"
+#include "support/debug.h"
+#include "support/lstrings.h"
 
 #include <boost/assert.hpp>
 
index b5d01e7ab22a8cf51466473e9b1352b88b60fe8b..aa051340d8e805ecd31709171d8d7913aa56646a 100644 (file)
@@ -19,7 +19,6 @@
 #include "Cursor.h"
 #include "CoordCache.h"
 #include "CutAndPaste.h"
-#include "debug.h"
 #include "DispatchResult.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
@@ -35,6 +34,7 @@
 #include "ParIterator.h"
 #include "TextMetrics.h"
 
+#include "support/debug.h"
 #include "support/docstream.h"
 
 #include "insets/InsetTabular.h"
index 6355a443cf77b51f4c5cf138c67b255bb3380ab5..3f52df8b3faabf2c3a21490fd03874d5900401b2 100644 (file)
 
 #include "CursorSlice.h"
 
-#include "debug.h"
 #include "Text.h"
 #include "Paragraph.h"
 
+#include "support/debug.h"
+
 #include "insets/Inset.h"
 
 #include "mathed/InsetMath.h"
index 998bd9d9d72ec5393a3785bac032b388dc8cddd5..e6afc24c1a7a5c4ecf26eecbd5312b0929a4c012 100644 (file)
 #include "BufferView.h"
 #include "Changes.h"
 #include "Cursor.h"
-#include "debug.h"
 #include "ErrorList.h"
 #include "FuncRequest.h"
-#include "gettext.h"
 #include "InsetIterator.h"
 #include "InsetList.h"
 #include "Language.h"
 #include "mathed/InsetMath.h"
 #include "mathed/MathSupport.h"
 
+#include "support/debug.h"
+#include "support/docstream.h"
+#include "support/gettext.h"
 #include "support/limited_stack.h"
 #include "support/lstrings.h"
-#include "support/docstream.h"
 
 #include "frontends/Clipboard.h"
 #include "frontends/Selection.h"
index 1279e8cf205d2440dc13bbb21bedf0e4a006ca4a..1635f05cccae8d1b7134ffbfeae024a08a751969 100644 (file)
@@ -14,8 +14,7 @@
 
 #include "DepTable.h"
 
-#include "debug.h"
-
+#include "support/debug.h"
 #include "support/lyxlib.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
index ddd261187f98db217fb32348c6b2b097a9eba499..174dec29bfd97e1e3543ee9880a3563fea43187d 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "DocIterator.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "InsetList.h"
 #include "Paragraph.h"
 #include "Text.h"
index 2d2aef8c37b842a1c93d4f2340528fc9191529d2..d1d15cb1c9060117bee909945ff0da6ea91ab186 100644 (file)
 #include <config.h>
 
 #include "EmbeddedFiles.h"
+
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "Paragraph.h"
-#include "InsetIterator.h"
-#include "debug.h"
-#include "gettext.h"
+#include "ErrorList.h"
 #include "Format.h"
+#include "InsetIterator.h"
 #include "Lexer.h"
-#include "ErrorList.h"
+#include "LyX.h"
+#include "Paragraph.h"
+#include "Session.h"
 
 #include "frontends/alert.h"
 
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/convert.h"
 #include "support/lyxlib.h"
 #include "support/lstrings.h"
 
-#include "LyX.h"
-#include "Session.h"
-
 #include <sstream>
 #include <fstream>
 #include <utility>
index 657072a6c5d24f03b8fe2dc7712f057012db0c48..d828b9d7e62fbfbe7c84af15e1f17191b330db80 100644 (file)
 
 #include "Encoding.h"
 
-#include "debug.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "LyXRC.h"
 
+#include "support/debug.h"
 #include "support/FileName.h"
 #include "support/lstrings.h"
 #include "support/unicode.h"
index 6857c87ee15a6203e99ab8406e9c6f49e9a4adab..7cb141bcf562ab76137e3c3f72e3613411c95368 100644 (file)
 
 #include "Exporter.h"
 
-#include "gettext.h"
 #include "Mover.h"
+
 #include "frontends/alert.h"
 
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/Package.h"
 
index dcf7034a1cecc311dab1cc61efe8879c0bb4a031..ce59fd231b54af77fd375cd7defcae6cad2978c9 100644 (file)
@@ -18,9 +18,7 @@
 
 #include "BufferParams.h" // stateText
 #include "Color.h"
-#include "debug.h"
 #include "Encoding.h"
-#include "gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
@@ -29,6 +27,8 @@
 #include "OutputParams.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 
 using std::endl;
index b6918efebfaae8e5e68aaed2f56caa0aea0b9b07..743f6b6325014788145cecedd4257c617e0880ff 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "FontInfo.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <ostream>
 
@@ -202,8 +202,8 @@ static FontState setMisc(FontState newfont,
                else if (org == FONT_OFF)
                        return FONT_ON;
                else {
-                       lyxerr <<"Font::setMisc: Need state"
-                               " FONT_ON or FONT_OFF to toggle. Setting to FONT_ON" << endl;
+                       LYXERR0("Font::setMisc: Need state"
+                               " FONT_ON or FONT_OFF to toggle. Setting to FONT_ON");
                        return FONT_ON;
                }
        } else if (newfont == FONT_IGNORE)
index c4f553162c7aa9f1e91f209bb708a1229dc7973b..e4c2406fa61680856f42e9f67ddbd2f6bb7fb661 100644 (file)
@@ -9,7 +9,6 @@
  *
  */
 
-
 #include <config.h>
 
 #include "FontIterator.h"
index 9b3b8f8bfdab6de8d907a6957dc2bc840b43657a..6dd5bd6557249065eb546ef1c58886b168dd39ec 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "LyXRC.h"
-#include "debug.h"
-#include "gettext.h"
 #include "ServerSocket.h"
 
 #include "frontends/alert.h" //to be removed?
 
+#include "support/debug.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Systemcall.h"
index 0475dd4cd1914bb0149116e288b34f6e027ca518..947a6f4d6116c9a0bb2db1b13f3eb39b1d5979d4 100644 (file)
@@ -15,9 +15,9 @@
 #include "ISpell.h"
 
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Encoding.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "LyXRC.h"
 #include "WordLangTuple.h"
index 6908f3a373bbb79993accf23e099d0d5d0da8dcb..a18c8b636712559eb0f491226cf9066af7037c90 100644 (file)
@@ -16,7 +16,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BranchList.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "insets/InsetBranch.h"
 
index ed0519fae906d936977cce1022f0782b877dcdb6..031c5348784333fa567c2e3e242b3f77a3cfe201 100644 (file)
@@ -14,7 +14,7 @@
 #include <config.h>
 
 #include "Intl.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "LyXRC.h"
 
 
index 01cc435ba41cd287824e7b553c60cdb918242c5e..6d105ee6e87ea8e3ce34254d784dc431e44de259 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "KeyMap.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "KeySequence.h"
 #include "LyXAction.h"
 #include "Lexer.h"
index a2aac20519a5f1efccf62dbb5c946ec03e9bfd54..1af1b88f72b742145b1d163d7853174f4a14e510 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "KeySequence.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "KeyMap.h"
 #include "lfuns.h"
 
index 351f6071d30fe7472fea1f7fc7846042d02a2301..1934894058999d5f626bc595bd2cfc1f8a7cfe1d 100644 (file)
@@ -17,9 +17,9 @@
 
 #include "BufferList.h"
 #include "LaTeX.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyXRC.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DepTable.h"
 
 #include "support/filetools.h"
index b5b71ff77cec66c338060f8c66d3401411d07530..e63507db45999724f340b112a4b88ad6448ec39f 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "Color.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Encoding.h"
 #include "Floating.h"
 #include "FloatList.h"
index 7d0fe850d3895076a24816b689a880a3bdb52b7a..39c6efda93d6209ef978c0dac5800ad8cbef9ef2 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "Language.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Encoding.h"
 #include "Lexer.h"
 #include "LyXRC.h"
index 6cf8a91428e7afb8d895a9098407486c9e3be1bf..c5bc4e5d1031b627a456833ea0be088a3aaa466e 100644 (file)
@@ -15,7 +15,7 @@
 #include "Layout.h"
 #include "TextClass.h"
 #include "Lexer.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/lstrings.h"
 
index caf76b580223ec190fb950fc534405bcbebfb03a..d8dbe629e6d44dfceafb896cdc29624409a5d211 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "Lexer.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/convert.h"
 #include "support/filetools.h"
index c14cbd644e17813502d0dfcc39a9cd894468f5cc..22b4116ba671d72623fe6f25c5ae49c3115f0070 100644 (file)
 
 #include "LyX.h"
 
-#include "Color.h"
-#include "ConverterCache.h"
-#include "Buffer.h"
 #include "buffer_funcs.h"
+#include "Buffer.h"
 #include "BufferList.h"
+#include "CmdDef.h"
+#include "Color.h"
+#include "ConverterCache.h"
 #include "Converter.h"
 #include "CutAndPaste.h"
-#include "debug.h"
 #include "Encoding.h"
 #include "ErrorList.h"
 #include "Format.h"
-#include "gettext.h"
 #include "KeyMap.h"
-#include "CmdDef.h"
 #include "Language.h"
-#include "Session.h"
+#include "Lexer.h"
 #include "LyXAction.h"
 #include "LyXFunc.h"
-#include "Lexer.h"
 #include "LyXRC.h"
+#include "MenuBackend.h"
 #include "ModuleList.h"
+#include "Mover.h"
 #include "Server.h"
 #include "ServerSocket.h"
+#include "Session.h"
 #include "TextClassList.h"
-#include "MenuBackend.h"
-#include "Messages.h"
-#include "Mover.h"
 #include "ToolbarBackend.h"
 
 #include "frontends/alert.h"
 #include "frontends/Application.h"
 
+#include "support/debug.h"
 #include "support/environment.h"
+#include "support/ExceptionMessage.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/ExceptionMessage.h"
+#include "support/Messages.h"
 #include "support/os.h"
 #include "support/Package.h"
 #include "support/Path.h"
index 411c9f13eb7f0fbe7bb7ebdff7fd88007510bfef..095e0d3073d4c7379034871e591540693867ce8e 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "LyXAction.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 
 #include "support/lstrings.h"
index c27275c1b6a3b63ab80ae0c80927226b7c6b9f5f..d3f8882434f8873e119c60f18b86b7cc3ef15148 100644 (file)
 #include "Converter.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Encoding.h"
 #include "ErrorList.h"
 #include "Format.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetIterator.h"
 #include "Intl.h"
 #include "KeyMap.h"
index d1c60a4a0fd00f79c0879a8efe882db89cf926ff..01bf0dca0737827e0445d9d81e7199740e292a1e 100644 (file)
 
 #include "LyXRC.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Color.h"
 #include "Converter.h"
 #include "Format.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Session.h"
 #include "Lexer.h"
 #include "FontEnums.h"
index 62c7ffc60ac1e5fa7e7ead93ccdeb75b806450f1..2e316d6af7fa28a08c6225af65cf986d1d4f024a 100644 (file)
@@ -17,9 +17,9 @@
 
 #include "LyXVC.h"
 #include "VCBackend.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Buffer.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "frontends/alert.h"
 
index 31f813738c8a7aa24a536e7fd8ffa7d152d29bf2..8ec83b70f0a7775796e30ffd447988f854c2df8a 100644 (file)
@@ -97,7 +97,6 @@ SOURCEFILESCORE = \
        Cursor.cpp \
        CursorSlice.cpp \
        CutAndPaste.cpp \
-       debug.cpp \
        DepTable.cpp \
        DocIterator.cpp \
        EmbeddedFiles.cpp \
@@ -114,7 +113,6 @@ SOURCEFILESCORE = \
        Format.cpp \
        FuncRequest.cpp \
        FuncStatus.cpp \
-       gettext.cpp \
        Graph.cpp \
        InsetIterator.cpp \
        InsetList.cpp \
@@ -133,7 +131,6 @@ SOURCEFILESCORE = \
        LyXRC.cpp \
        LyXVC.cpp \
        MenuBackend.cpp \
-       Messages.cpp \
        MetricsInfo.cpp \
        ModuleList.cpp \
        Mover.cpp \
@@ -195,7 +192,6 @@ HEADERFILESCORE = \
        Cursor.h \
        CursorSlice.h \
        CutAndPaste.h \
-       debug.h \
        DepTable.h \
        DispatchResult.h \
        DocIterator.h \
@@ -214,7 +210,6 @@ HEADERFILESCORE = \
        Format.h \
        FuncRequest.h \
        FuncStatus.h \
-       gettext.h \
        Graph.h \
        InsetIterator.h \
        InsetList.h \
@@ -237,7 +232,6 @@ HEADERFILESCORE = \
        LyXRC.h \
        LyXVC.h \
        MenuBackend.h \
-       Messages.h \
        MetricsInfo.h \
        ModuleList.h \
        Mover.h \
index 15365d52b98185e44b8797785388296e8b742c08..ca4dd00d489c1aa1921e2f8b9460309e4247c22a 100644 (file)
 #include "BufferParams.h"
 #include "Converter.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "Format.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "KeyMap.h"
 #include "Session.h"
 #include "LyXAction.h"
diff --git a/src/Messages.cpp b/src/Messages.cpp
deleted file mode 100644 (file)
index 0ea934b..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/* \file Messages.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "Messages.h"
-
-#include "debug.h"
-
-#include "support/docstring.h"
-#include "support/environment.h"
-#include "support/Package.h"
-#include "support/unicode.h"
-
-#include <boost/current_function.hpp>
-
-#include <cerrno>
-
-using std::map;
-using std::string;
-
-namespace {
-
-using lyx::docstring;
-using lyx::from_ascii;
-
-void cleanTranslation(docstring & trans) 
-{
-       /*
-         Some english words have different translations, depending on
-         context. In these cases the original string is augmented by
-         context information (e.g. "To:[[as in 'From page x to page
-         y']]" and "To:[[as in 'From format x to format y']]". This
-         means that we need to filter out everything in double square
-         brackets at the end of the string, otherwise the user sees
-         bogus messages. If we are unable to honour the request we
-         just return what we got in.
-       */
-       docstring::size_type const pos1 = trans.find(from_ascii("[["));
-       if (pos1 != docstring::npos) {
-               docstring::size_type const pos2 
-                       = trans.find(from_ascii("]]"), pos1);
-               if (pos2 != docstring::npos) 
-                       trans.erase(pos1, pos2 - pos1 + 2);
-       }
-}
-
-}
-
-
-#ifdef ENABLE_NLS
-
-#  ifdef HAVE_LOCALE_H
-#    include <locale.h>
-#  endif
-
-#  if HAVE_GETTEXT
-#    include <libintl.h>      // use the header already in the system *EK*
-#  else
-#    include "../intl/libintl.h"
-#  endif
-
-namespace lyx {
-
-using support::package;
-using support::getEnv;
-using support::setEnv;
-
-
-// This version use the traditional gettext.
-Messages::Messages(string const & l)
-       : lang_(l), warned_(false)
-{
-       // strip off any encoding suffix, i.e., assume 8-bit po files
-       string::size_type i = lang_.find(".");
-       lang_ = lang_.substr(0, i);
-       LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
-               << ": language(" << lang_ << ")");
-}
-
-
-void Messages::init()
-{
-       errno = 0;
-       string const locale_dir = package().locale_dir().toFilesystemEncoding();
-       char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
-       int e = errno;
-       if (e) {
-               LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
-                       << "Error code: " << errno << '\n'
-                       << "Directory : " << package().locale_dir().absFilename() << '\n'
-                       << "Rtn value : " << c);
-       }
-
-       if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
-               LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
-                       << "Error code: " << errno << '\n'
-                       << "Codeset   : " << ucs4_codeset << '\n');
-       }
-
-       textdomain(PACKAGE);
-}
-
-
-docstring const Messages::get(string const & m) const
-{
-       if (m.empty())
-               return docstring();
-
-       // Look for the translated string in the cache.
-       TranslationCache::iterator it = cache_.find(m);
-       if (it != cache_.end())
-               return it->second;
-
-       // The string was not found, use gettext to generate it
-
-       string const oldLANGUAGE = getEnv("LANGUAGE");
-       string const oldLC_ALL = getEnv("LC_ALL");
-       if (!lang_.empty()) {
-               // This GNU extension overrides any language locale
-               // wrt gettext.
-               setEnv("LANGUAGE", lang_);
-               // However, setting LANGUAGE does nothing when the
-               // locale is "C". Therefore we set the locale to
-               // something that is believed to exist on most
-               // systems. The idea is that one should be able to
-               // load German documents even without having de_DE
-               // installed.
-               setEnv("LC_ALL", "en_US");
-#ifdef HAVE_LC_MESSAGES
-               setlocale(LC_MESSAGES, "");
-#endif
-       }
-
-       char const * m_c = m.c_str();
-       char const * trans_c = gettext(m_c);
-       docstring trans;
-       if (!trans_c)
-               LYXERR0("Undefined result from gettext");
-       else if (trans_c == m_c) {
-               LYXERR(Debug::DEBUG, "Same as entered returned");
-               trans = from_ascii(m);
-       } else {
-               LYXERR(Debug::DEBUG, "We got a translation");
-               // m is actually not a char const * but ucs4 data
-               trans = reinterpret_cast<char_type const *>(trans_c);
-       }
-
-       cleanTranslation(trans);
-
-       // Reset environment variables as they were.
-       if (!lang_.empty()) {
-               // Reset everything as it was.
-               setEnv("LANGUAGE", oldLANGUAGE);
-               setEnv("LC_ALL", oldLC_ALL);
-#ifdef HAVE_LC_MESSAGES
-               setlocale(LC_MESSAGES, "");
-#endif
-       }
-
-       std::pair<TranslationCache::iterator, bool> result =
-               cache_.insert(std::make_pair(m, trans));
-
-       BOOST_ASSERT(result.second);
-
-       return result.first->second;
-}
-
-} // namespace lyx
-
-#else // ENABLE_NLS
-// This is the dummy variant.
-
-namespace lyx {
-
-Messages::Messages(string const & l) {}
-
-void Messages::init()
-{
-}
-
-
-docstring const Messages::get(string const & m) const
-{
-       docstring trans = from_ascii(m);
-       cleanTranslation(trans);
-       return trans;
-}
-
-} // namespace lyx
-
-#endif
-
-#if 0
-
--#include <locale>
-
-namespace lyx {
-
-// This version of the Pimpl utilizes the message capability of
-// libstdc++ that is distributed with GNU G++.
-class Messages::Pimpl {
-public:
-       typedef std::messages<char>::catalog catalog;
-
-       Pimpl(string const & l)
-               : lang_(l),
-                 loc_gl(lang_.c_str()),
-                 mssg_gl(std::use_facet<std::messages<char> >(loc_gl))
-       {
-               //LYXERR("Messages: language(" << l << ") in dir(" << dir << ")");
-
-               string const locale_dir = package().locale_dir().toFilesystemEncoding();
-               cat_gl = mssg_gl.open(PACKAGE, loc_gl, locale_dir.c_str());
-
-       }
-
-       ~Pimpl()
-       {
-               mssg_gl.close(cat_gl);
-       }
-
-       docstring const get(string const & msg) const
-       {
-               return mssg_gl.get(cat_gl, 0, 0, msg);
-       }
-private:
-       ///
-       string lang_;
-       ///
-       std::locale loc_gl;
-       ///
-       std::messages<char> const & mssg_gl;
-       ///
-       catalog cat_gl;
-};
-
-} // namespace lyx
-
-#endif
diff --git a/src/Messages.h b/src/Messages.h
deleted file mode 100644 (file)
index cb6af76..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- C++ -*-
-/* \file Messages.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef MESSAGES_H
-#define MESSAGES_H
-
-#include "support/docstring.h"
-
-#include <map>
-#include <string>
-
-namespace lyx {
-
-///
-class Messages {
-public:
-       /// messages in the language \p l.
-       /// If \p l is empty, the language will be defined by the environment.
-       Messages(std::string const & l = std::string());
-       ///
-       docstring const get(std::string const & msg) const;
-       ///
-       static void init();
-private:
-       ///
-       std::string lang_;
-       /// Did we warn about unavailable locale already?
-       mutable bool warned_;
-       ///
-       typedef std::map<std::string, docstring> TranslationCache;
-       /// Internal cache for gettext translated strings.
-       /// This is needed for performance reason within \c updateLabels()
-       /// under Windows.
-       mutable TranslationCache cache_;
-};
-
-/// Access to the unique Messages object for the passed \p language.
-/// Implementation is in LyX.cpp.
-extern Messages & getMessages(std::string const & language);
-/// Access to the unique Messages object used for GUI element.
-/// Implementation is in LyX.cpp.
-extern Messages & getGuiMessages();
-
-} // namespace lyx
-
-#endif
index cc697a544f37be565c48f6d0ca673ef291b4cd97..258b71c585f9cff1159019ca8d5e17881363ca90 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "ModuleList.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Lexer.h"
 
 #include "support/filetools.h"
index 149d85b3dbbdd185f330dfe06df433e5979fabaf..94896f562b3692dcbb55ece886a441579070b75f 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "support/convert.h"
 #include "support/lstrings.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Lexer.h"
 
 #include <sstream>
index 547d4ba5ea956c71481b717d10616ab5db6825a2..0a60cd84ebc11b336356fe291df26d06f7b7e649 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <config.h>
 
-#include "debug.h"
+#include "support/debug.h"
 
 #define USE_ORIGINAL_MANAGER_FUNCS 1
 // new aspell pspell missing extern "C"
index e0afc387287a49338842a7c00cdeec33d0a553ae..b28082f83e4de5e6071756de9e9f389ec78d8f18 100644 (file)
@@ -24,8 +24,6 @@
 #include "Changes.h"
 #include "Counters.h"
 #include "Encoding.h"
-#include "debug.h"
-#include "gettext.h"
 #include "InsetList.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
@@ -34,7 +32,6 @@
 #include "Font.h"
 #include "FontList.h"
 #include "LyXRC.h"
-#include "Messages.h"
 #include "OutputParams.h"
 #include "output_latex.h"
 #include "paragraph_funcs.h"
 #include "insets/InsetBibitem.h"
 #include "insets/InsetLabel.h"
 
+#include "support/convert.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
+#include "support/Messages.h"
 #include "support/textutils.h"
-#include "support/convert.h"
 #include "support/unicode.h"
 
 #include <sstream>
index 8820a602294e286fd1c84c693ccf68d304c13b52..ff1eb3ffc17c08e61a51cfd9952d7f77e6d4ff9f 100644 (file)
@@ -24,8 +24,8 @@
 #include "BufferView.h"
 #include "Counters.h"
 #include "Encoding.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Layout.h"
index 905f9f6cdbccd7bb02037ad81757823c2640df26..bbbdca4b394020317cd6a2ce9d1f2042d468cef0 100644 (file)
@@ -17,7 +17,7 @@
 #include "ParagraphParameters.h"
 
 #include "Buffer.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Layout.h"
 #include "Lexer.h"
 #include "Text.h"
index 317244a792fdad5b615da9361a10bf6e0307cc21..f4e62014358740360967da486a3db4f32109848f 100644 (file)
@@ -17,7 +17,7 @@
 #include <config.h>
 
 #include "Row.h"
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index 2ff2fc9434527877e84488a970e43b65ac0b6613..b36fdd1627487b5878eacb5122f3fa649773d425 100644 (file)
@@ -40,7 +40,7 @@
 #include <config.h>
 
 #include "Server.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "LyXAction.h"
 #include "LyXFunc.h"
index 8f10e37ce4919c89946c71f256a8072b544eabd3..ae80d9b750706972da1dc4f6f1098acaa9fdf0b4 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "ServerSocket.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "LyXAction.h"
 #include "LyXFunc.h"
index faaabf17f8d30674f380adc6711e6d5823203ad4..839ec38ada5a94e7892cfa5c5db1de66753d21c8 100644 (file)
@@ -12,7 +12,7 @@
 #include <config.h>
 
 #include "Session.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "support/Package.h"
 #include "support/filetools.h"
 
index 89734b613df36fbfc66b293f8ca55f5b9bc5c086..54b6b20549ca4c310b46030b48f41f8d27a344d0 100644 (file)
@@ -12,7 +12,7 @@
 #include <config.h>
 
 #include "SpellBase.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "support/docstring.h"
 
 
index b8579c5b928d0104fd29090e7cd2514a3f313221..af0268ade280d7be74d08f95c938bff84eaad625 100644 (file)
@@ -13,7 +13,7 @@
 #include <config.h>
 
 #include "TexRow.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <algorithm>
 
index c2ed96b2b274560d6aae70d2a45709410e0038a4..795fca6bf8765ed646fc9d9abfcd1df862880516 100644 (file)
 #include "Cursor.h"
 #include "ParIterator.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Encoding.h"
 #include "ErrorList.h"
 #include "FuncRequest.h"
 #include "factory.h"
 #include "FontIterator.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "Length.h"
 #include "Lexer.h"
index 4aab7d585fa80c536ba4f00750c04744feaa1eb5..ab52d5421f4fc70394e16d28b63d97e22012844c 100644 (file)
 #include "Changes.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "ErrorList.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "Layout.h"
 #include "Lexer.h"
index 0a0f92d6bd6cb0674dbf3b09991f753310b6810d..e51a2db5c526cc5c31dbc79cdf5a67ca1f6d5d5f 100644 (file)
 #include "BufferView.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "ErrorList.h"
 #include "factory.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetList.h"
 #include "Intl.h"
 #include "Language.h"
index 1294cc8f9e3fc2989247c3f23529f8f9954b2f6c..00cbf0941439fc5bbc89cea97c055c12ab2c8f36 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "Color.h"
 #include "Counters.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "Layout.h"
index 3fcc278e218e0425b39c5af071076184568a1bb7..02d065df6608fdc914f6dfc1159fa4c031dc5ba2 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "TextClassList.h"
 #include "TextClass.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Lexer.h"
 
 #include "support/filetools.h"
index 817b5f4a448507bcaadb03bc947916e2cb86519c..14652d2db4e4810ff8900741ead33df8ba541dc9 100644 (file)
@@ -27,7 +27,7 @@
 #include "CoordCache.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FontIterator.h"
 #include "FuncRequest.h"
 #include "InsetList.h"
index 91aa9f649ad1315a5625532c41f757e284824913..466abebc1d5eea6854340bf9d2e560ba20e27923 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "Thesaurus.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/lstrings.h"
 
index 0dfe0ccc8c9fec397645c942d71b5b8db3bce483..27f4623584313f40334acaa0f879ab826d0cbfa2 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "InsetList.h"
index 8dd1df50cf1e061e0a38f5a6c45cc715f44e3b76..b5c7d40574c4b83c4658593181cfd2962d9617d2 100644 (file)
@@ -14,8 +14,8 @@
 #include "ToolbarBackend.h"
 #include "FuncRequest.h"
 #include "Lexer.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "LyXAction.h"
 #include "support/lstrings.h"
 
index 173958a629011a6fdbaaadd99aebae87ab3b4ec6..f2dc6680db3098cbbe238a5dc7c43b3aa8e2359d 100644 (file)
@@ -17,7 +17,7 @@
 #include "BufferView.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Lexer.h"
 #include "LyXRC.h"
 #include "Text.h"
index 3d39308efb4c2b7545ba2897db4ab55d4fd9023f..0c906db882268391f65958b233782050bbd2a95b 100644 (file)
@@ -20,7 +20,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "buffer_funcs.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DocIterator.h"
 #include "Paragraph.h"
 #include "ParagraphList.h"
index dbcb7b502fc8deb56b2c651a7c470e285c61b91c..0fd2094822a42b5a09ba3afa5273ffe968e496b7 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "VCBackend.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Buffer.h"
 
 #include "support/Path.h"
index f377edebaed284f1f69f99c1a7f92ca088a7ccde..979498797056aaab5f5a8c96f8dcf7faa725ba2c 100644 (file)
@@ -15,7 +15,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Length.h"
 #include "Text.h"
 #include "TextMetrics.h" // for defaultRowHeight()
index 93db5cf2ba94f67e2f490cf90a887d17bd01a725..46d43df40ecdce4667951b3efe45fbe061889f04 100644 (file)
@@ -11,7 +11,8 @@
 #include <config.h>
 
 #include "LyX.h"
-#include "debug.h"
+
+#include "support/debug.h"
 #include "support/lyxlib.h"
 
 #include <boost/assert.hpp>
index a01eb78b24f97e14ee379c1eb48daa1be9e7a169..4c858f99152b67b87db695487bd78436e0152e28 100644 (file)
 #include "Buffer.h"
 #include "BufferList.h"
 #include "BufferParams.h"
-#include "debug.h"
 #include "DocIterator.h"
 #include "Counters.h"
 #include "ErrorList.h"
 #include "Floating.h"
 #include "FloatList.h"
-#include "gettext.h"
 #include "InsetList.h"
 #include "InsetIterator.h"
 #include "Language.h"
 #include "insets/InsetBibitem.h"
 #include "insets/InsetInclude.h"
 
+#include "support/debug.h"
 #include "support/filetools.h"
-#include "support/lyxlib.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
+#include "support/lyxlib.h"
 
 
 namespace lyx {
index 34ed666c0fd85b9bde498e7665d6a06874f5e99f..081c6d31eec3161cd4bddf6cd26140fd7a65d404 100644 (file)
@@ -10,7 +10,7 @@
 #include <config.h>
 
 #include "Messages.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "support/filetools.h"
 #include "support/Package.h"
 #include "support/unicode.h"
index 1072bf8c3ea06ca3c12021257b5c79985d5454a7..c3183ea51eeaa07408e8055a5f93cba9f75a0214 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "LyX.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "support/lyxlib.h"
 
 #include <boost/assert.hpp>
index 148bb8404050de3d80922c9a835f0955b7fff2d0..5540f1a2f5cdf6058ab57f1e71ab2e9ed5f73856 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <config.h>
 
-#include "debug.h"
+#include "support/debug.h"
 #include "support/FileName.h"
 #include "support/unicode.h"
 #include "support/lstrings.h"
index f3d569c999c0cc7b325231ffc718803f122d1f6e..320bbf1e8bac1283c30208da702ef038424c8184 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <config.h>
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 
 #include "support/convert.h"
 #include "support/lstrings.h"
index 7eb0be01c1bb86e51527981c699fca1b760de4ad..f5b99cdf7fcbf1a6b5d43bb0498adff1f232a9f7 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <config.h>
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Messages.h"
 
 
diff --git a/src/debug.cpp b/src/debug.cpp
deleted file mode 100644 (file)
index 83a8fe3..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * \file debug.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 <config.h>
-
-#include "debug.h"
-#include "gettext.h"
-
-#include "support/convert.h"
-#include "support/lstrings.h"
-#include "support/FileName.h"
-
-#include <iostream>
-#include <iomanip>
-
-using std::setw;
-using std::string;
-using std::ostream;
-
-
-namespace lyx {
-
-using support::ascii_lowercase;
-using support::bformat;
-using support::isStrInt;
-
-namespace {
-
-struct ErrorItem {
-       Debug::Type level;
-       char const * name;
-       char const * desc;
-};
-
-
-ErrorItem errorTags[] = {
-       { Debug::NONE,      "none",      N_("No debugging message")},
-       { Debug::INFO,      "info",      N_("General information")},
-       { Debug::INIT,      "init",      N_("Program initialisation")},
-       { Debug::KEY,       "key",       N_("Keyboard events handling")},
-       { Debug::GUI,       "gui",       N_("GUI handling")},
-       { Debug::PARSER,    "parser",    N_("Lyxlex grammar parser")},
-       { Debug::LYXRC,     "lyxrc",     N_("Configuration files reading")},
-       { Debug::KBMAP,     "kbmap",     N_("Custom keyboard definition")},
-       { Debug::LATEX,     "latex",     N_("LaTeX generation/execution")},
-       { Debug::MATHED,    "mathed",    N_("Math editor")},
-       { Debug::FONT,      "font",      N_("Font handling")},
-       { Debug::TCLASS,    "tclass",    N_("Textclass files reading")},
-       { Debug::LYXVC,     "lyxvc",     N_("Version control")},
-       { Debug::LYXSERVER, "lyxserver", N_("External control interface")},
-       { Debug::ROFF,      "roff",      N_("Keep *roff temporary files")},
-       { Debug::ACTION,    "action",    N_("User commands")},
-       { Debug::LYXLEX,    "lyxlex",    N_("The LyX Lexxer")},
-       { Debug::DEPEND,    "depend",    N_("Dependency information")},
-       { Debug::INSETS,    "insets",    N_("LyX Insets")},
-       { Debug::FILES,     "files",     N_("Files used by LyX")},
-       { Debug::WORKAREA,  "workarea",  N_("Workarea events")},
-       { Debug::INSETTEXT, "insettext", N_("Insettext/tabular messages")},
-       { Debug::GRAPHICS,  "graphics",  N_("Graphics conversion and loading")},
-       { Debug::CHANGES,   "changes",   N_("Change tracking")},
-       { Debug::EXTERNAL,  "external",  N_("External template/inset messages")},
-       { Debug::PAINTING,  "painting",  N_("RowPainter profiling")},
-       { Debug::DEBUG,     "debug",     N_("Developers' general debug messages")},
-       { Debug::ANY,       "any",       N_("All debugging messages")}
-};
-
-
-int const numErrorTags = sizeof(errorTags)/sizeof(errorTags[0]);
-
-} // namespace anon
-
-
-Debug::Type Debug::value(string const & val)
-{
-       Type l = Debug::NONE;
-       string v = val;
-       while (!v.empty()) {
-               size_t const st = v.find(',');
-               string const tmp = ascii_lowercase(v.substr(0, st));
-               if (tmp.empty())
-                       break;
-               // Is it a number?
-               if (isStrInt(tmp))
-                       l |= static_cast<Type>(convert<int>(tmp));
-               else
-               // Search for an explicit name
-               for (int i = 0 ; i < numErrorTags ; ++i)
-                       if (tmp == errorTags[i].name) {
-                               l |= errorTags[i].level;
-                               break;
-                       }
-               if (st == string::npos)
-               break;
-               v.erase(0, st + 1);
-       }
-       return l;
-}
-
-
-void Debug::showLevel(ostream & os, Debug::Type level)
-{
-       // Show what features are traced
-       for (int i = 0; i != numErrorTags; ++i) {
-               if (errorTags[i].level != Debug::ANY
-                   && errorTags[i].level != Debug::NONE
-                   && errorTags[i].level & level) {
-                       // avoid to_utf8(_(...)) re-entrance problem
-                       docstring const s = _(errorTags[i].desc);
-                       os << to_utf8(bformat(_("Debugging `%1$s' (%2$s)"),
-                                       from_utf8(errorTags[i].name), s))
-                          << '\n';
-               }
-       }
-       os.flush();
-}
-
-
-void Debug::showTags(ostream & os)
-{
-       for (int i = 0; i != numErrorTags ; ++i)
-               os << setw(10) << static_cast<unsigned int>(errorTags[i].level)
-                  << setw(13) << errorTags[i].name
-                  << "  " << to_utf8(_(errorTags[i].desc)) << '\n';
-       os.flush();
-}
-
-
-void LyXErr::disable()
-{
-       enabled_ = false;
-}
-
-
-void LyXErr::enable()
-{
-       enabled_ = true;
-}
-
-
-bool LyXErr::debugging(Debug::Type t) const
-{
-       return (dt & t);
-}
-
-
-void LyXErr::endl()
-{
-       stream() << std::endl;
-}
-
-
-LyXErr & operator<<(LyXErr & l, void const * t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, char const * t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, char t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, int t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, unsigned int t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, long t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, unsigned long t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, double t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::string const & t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, docstring const & t)
-{ l.stream() << to_utf8(t); return l; }
-LyXErr & operator<<(LyXErr & l, support::FileName const & t)
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ostream &(*t)(std::ostream &))
-{ l.stream() << t; return l; }
-LyXErr & operator<<(LyXErr & l, std::ios_base &(*t)(std::ios_base &))
-{ l.stream() << t; return l; }
-
-
-// The global instance
-LyXErr lyxerr;
-
-
-} // namespace lyx
diff --git a/src/debug.h b/src/debug.h
deleted file mode 100644 (file)
index e398c36..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-// -*- C++ -*-
-/**
- * \file debug.h
- *
- * FIXME: It would be nice if, in lyx::use_gui mode, instead of
- * outputting to the console, we would pipe all messages onto a file
- * and visualise the contents dynamically in a Qt window if needed.
- *
- * 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 LYXDEBUG_H
-#define LYXDEBUG_H
-
-#include "support/strfwd.h"
-
-
-namespace std {
-
-class ios_base;
-
-template<typename CharT, typename Traits> class basic_streambuf;
-typedef basic_streambuf<char, char_traits<char> > streambuf;
-
-}
-
-
-namespace lyx {
-
-///  This is all the different debug levels that we have.
-namespace Debug {
-       ///
-       enum Type {
-               ///
-               NONE = 0,
-               ///
-               INFO       = (1 << 0),   // 1
-               ///
-               INIT       = (1 << 1),   // 2
-               ///
-               KEY        = (1 << 2),   // 4
-               ///
-               GUI        = (1 << 3),   // 8
-               ///
-               PARSER     = (1 << 4),   // 16
-               ///
-               LYXRC      = (1 << 5),   // 32
-               ///
-               KBMAP      = (1 << 6),   // 64
-               ///
-               LATEX      = (1 << 7),   // 128
-               ///
-               MATHED     = (1 << 8),   // 256 // Alejandro, please use this.
-               ///
-               FONT       = (1 << 9),   // 512
-               ///
-               TCLASS     = (1 << 10),  // 1024
-               ///
-               LYXVC      = (1 << 11),  // 2048
-               ///
-               LYXSERVER  = (1 << 12),  // 4096
-               ///
-               ROFF       = (1 << 13),  // 8192
-               ///
-               ACTION     = (1 << 14),   // 16384
-               ///
-               LYXLEX     = (1 << 15),
-               ///
-               DEPEND     = (1 << 16),
-               ///
-               INSETS     = (1 << 17),
-               ///
-               FILES      = (1 << 18),
-               ///
-               WORKAREA   = (1 << 19),
-               ///
-               INSETTEXT  = (1 << 20),
-               ///
-               GRAPHICS   = (1 << 21),
-               /// change tracking
-               CHANGES    = (1 << 22),
-               ///
-               EXTERNAL   = (1 << 23),
-               ///
-               PAINTING   = (1 << 24),
-               ///
-               DEBUG      = (1 << 31),
-               ///
-               ANY = 0xffffffff
-       };
-
-       /** A function to convert symbolic string names on debug levels
-           to their numerical value.
-       */
-       Type value(std::string const & val);
-
-       /** Display the tags and descriptions of the current debug level
-           of ds
-       */
-       void showLevel(std::ostream & os, Type level);
-
-       /** show all the possible tags that can be used for debugging */
-       void showTags(std::ostream & os);
-
-} // namespace Debug
-
-
-inline void operator|=(Debug::Type & d1, Debug::Type d2)
-{
-       d1 = static_cast<Debug::Type>(d1 | d2);
-}
-
-
-class LyXErr
-{
-public:
-       /// Disable the stream completely
-       void disable();
-       /// Enable the stream after a possible call of disable()
-       void enable();
-       /// Returns true if t is part of the current debug level.
-       bool debugging(Debug::Type t = Debug::ANY) const;
-       /// Ends output
-       void endl();
-       /// Sets stream
-       void setStream(std::ostream & os) { stream_ = &os; }
-       /// Sets stream
-       std::ostream & stream() { return *stream_; }
-       /// Sets the debug level to t.
-       void level(Debug::Type t) { dt = t; }
-       /// Returns the current debug level.
-       Debug::Type level() const { return dt; }
-       /// Returns stream
-       operator std::ostream &() { return *stream_; }
-private:
-       /// The current debug level
-       Debug::Type dt;
-       /// Is the stream enabled?
-       bool enabled_;
-       /// The real stream
-       std::ostream * stream_;
-};
-
-namespace support { class FileName; }
-
-LyXErr & operator<<(LyXErr &, void const *);
-LyXErr & operator<<(LyXErr &, char const *);
-LyXErr & operator<<(LyXErr &, char);
-LyXErr & operator<<(LyXErr &, int);
-LyXErr & operator<<(LyXErr &, unsigned int);
-LyXErr & operator<<(LyXErr &, long);
-LyXErr & operator<<(LyXErr &, unsigned long);
-LyXErr & operator<<(LyXErr &, double);
-LyXErr & operator<<(LyXErr &, std::string const &);
-LyXErr & operator<<(LyXErr &, docstring const &);
-LyXErr & operator<<(LyXErr &, support::FileName const &);
-LyXErr & operator<<(LyXErr &, std::ostream &(*)(std::ostream &));
-LyXErr & operator<<(LyXErr &, std::ios_base &(*)(std::ios_base &));
-
-extern LyXErr lyxerr;
-
-} // namespace lyx
-
-
-#define LYXERR(type, msg) \
-       do { \
-               if (!lyx::lyxerr.debugging(type)) {} \
-               else { lyx::lyxerr << msg; lyx::lyxerr.endl(); } \
-       } while (0)
-
-#define LYXERR0(msg) LYXERR(lyx::Debug::ANY, msg)
-
-#endif
index 4649f151809bc1d2c62b4b074df7edc600166531..8a8616b02ab6e58faf43ef469ccb7663a2d481c2 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "Lexer.h"
@@ -60,6 +59,7 @@
 
 #include "frontends/alert.h"
 
+#include "support/debug.h"
 #include "support/lstrings.h"
 #include "support/ExceptionMessage.h"
 
index d15bdaecdd2980a20c15579c4348d76d4360d242..c048729970d449da4f22c457a580ee980bd485f9 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "Action.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "GuiView.h"
index 68e783691c1c19e331244b65560666e011bd3863..81f07e576a5b82a6e454886054b63f9b503bfc87 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "ButtonController.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "qt_helpers.h"
 
 #include <QPushButton>
index e282787dda202aeaf46198788e02176df07d6738..5710cac3b58b2a687e3c2695b6a81e1566116d5b 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "ButtonPolicy.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include <list>
 
index 98ce944464971e5aaec4fe35b73467d93eb053ed..f29e0aad46dadd91fd8da2dcc3e5664102a87bdb 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "ButtonPolicy.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <iostream>
 
index e4a2ea97fd6d1190baabf70f5a010c8948ad7222..e255b3bc86da69a6d422b95f4ee8b0583cc843fb 100644 (file)
@@ -15,7 +15,7 @@
 #include "Dialog.h"
 #include "GuiView.h"
 #include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QCloseEvent>
 #include <QDialog>
index fe80cdf4bdd7f2812c4c5f957f2c83d2ec97aa5d..9f2563d6874c7281e72a1a985f2e988baedc829c 100644 (file)
@@ -15,7 +15,7 @@
 #include "Dialog.h"
 #include "GuiView.h"
 #include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QDockWidget>
 
index ce8651eb01005c7b8330d9243cb666dd6d088c6d..327e6ff243ab381028977ef949e88e55d3a2ae36 100644 (file)
@@ -16,8 +16,8 @@
 #include "LyXFileDialog.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 
 #include "support/FileFilterList.h"
 #include "support/os.h"
index 7d6fa2d15d959a5b155c159d02e4f6f6d533b5c6..b621a98d91706dd42d64021286034a0d1e9af5b4 100644 (file)
@@ -13,7 +13,7 @@
 #include "GuiAbout.h"
 
 #include "qt_helpers.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "version.h"
 
 #include "support/filetools.h"
index f52070fd11ccabee1896df883942555b94533775..2835ec90d3aee9a5cbdefb2352cc46dbdf374b4e 100644 (file)
 #include "frontends/Application.h"
 
 #include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "LyX.h" // for lyx::use_gui
 #include "ui_AskForTextUi.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/docstring.h"
 #include "support/lstrings.h"
index 148166312ac719b205bfc225c73a2a6c8ba06217..7b78c882514ccc2bbbfed740ba7540917d445e38 100644 (file)
 #include "Buffer.h"
 #include "BufferList.h"
 #include "BufferView.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Font.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyX.h"
 #include "LyXFunc.h"
 #include "LyXRC.h"
index da9bb06732307e0238192e9234e47c8f529bace5..71772c7bcc077a4917513e18440d525b340df3b3 100644 (file)
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "ui_BibtexAddUi.h"
 #include "qt_helpers.h"
 #include "Validator.h"
 #include "LyXRC.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "ButtonPolicy.h"
 
index 7da5e6dd12f06d5aab18f3c00504e8be0d808734..1c50d3b7b2ec56885d3b16ae6c5f794a96c980e6 100644 (file)
@@ -15,7 +15,7 @@
 #include "GuiBox.h"
 
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "LengthCombo.h"
 #include "Length.h"
index 4610839a5d07007c81a3b8cecff22ae386b30e66..a1f7067e8434bb9638ae8ed61a45a4fa3a1eb9c4 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "GuiCitation.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "qt_helpers.h"
 #include "Buffer.h"
 #include "BufferParams.h"
index 0bad26412df02e5fff5e96f88242d26c4363f6c1..7522aeb58182e3d7bd22b86676014f0dfaceb5b7 100644 (file)
@@ -15,7 +15,7 @@
 #include "GuiClipboard.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QApplication>
 #include <QClipboard>
index 7182870f2feacd9295fbbd15bffa6ce032de50d8..0d7e55dbe7d61524030902092a733d4d81ce7145 100644 (file)
@@ -16,7 +16,7 @@
 #include "GuiView.h"
 
 #include "qt_helpers.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include <QPixmap>
 #include <QCheckBox>
index 643032c8bfd434bc4a72250826dbd47baa2e5054..9b70bccf08d9229cf9b18cc06515f3fdfb977e00 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "GuiDialog.h"
 #include "GuiView.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "qt_helpers.h"
 
 #include <QCloseEvent>
index f3a6888f8010ae968b5717e75aafd7a19f98d593..27bd73f2efb8e1c15d3fe34738acbdf1eda11a7c 100644 (file)
@@ -23,7 +23,7 @@
 #include "Encoding.h"
 #include "FloatPlacement.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "GuiBranches.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
index f3ee865e3ef32d70508d1287b874cb9511cac728..9910b47c9f5fcd21abc6a9efca843afc4de0d102 100644 (file)
@@ -13,7 +13,7 @@
 #include <config.h>
 
 #include "GuiERT.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "FuncRequest.h"
 
 #include <QRadioButton>
index e24357edca75e34fcbadaac6a83739d6f23a9061..0289b584367af9ca96ce59059023fc839dd9dc79 100644 (file)
@@ -14,8 +14,8 @@
 
 #include "Buffer.h"
 #include "BufferView.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Text.h"
 #include "ParIterator.h"
 
index 1e4abef288407cd339726f03f19899abe5ef989c..2bf12fcd20f352fde1c1875aff4cc78cb65f1906 100644 (file)
@@ -15,7 +15,7 @@
 #include "GuiExternal.h"
 
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Length.h"
 #include "LyXRC.h"
 
index d0c8eb4cc91a4899b7a44664e8ea9210243deacf..deaf5acd75e55f4e5d790a46ecc4bbe03fbc26bc 100644 (file)
@@ -14,7 +14,7 @@
 #include "GuiFontLoader.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "LyXRC.h"
 
 #include "support/convert.h"
index 026e2c5fde503e8ad757ad8336bc51c263eac2f0..74c86496e4383b830a9a9cd9af1f374c1d4d9083 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "GuiGraphics.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "LengthCombo.h"
 #include "Length.h"
 #include "LyXRC.h"
@@ -24,7 +24,7 @@
 #include "Validator.h"
 
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "graphics/GraphicsCache.h"
 #include "graphics/GraphicsCacheItem.h"
index 446bdcad223cbf8357cb79dfb2a14c01b0e15d85..07fdfd3d13603ad5ade0296eff903d11ea2e2f88 100644 (file)
@@ -14,7 +14,7 @@
 #include "GuiImage.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Format.h"
 
 #include "graphics/GraphicsParams.h"
index 976755e62d6634fe50c630e4ab80c08fd7837d9e..5aaf12a889c02afc43510c17f5bccdeb17334a69 100644 (file)
@@ -17,7 +17,7 @@
 #include "Buffer.h"
 #include "Format.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyXRC.h"
 
 #include "qt_helpers.h"
index 477ed544cbf2c480612474713e66052f2db4a87c..4f27d2b4d59acbb4bce108b561433c925c7088b5 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "GuiIndex.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "qt_helpers.h"
 
 #include <QLabel>
index c961d38fdf17f9b73446cdbd3ba7993ada60fc53..32ad7d06b48159f3e58c369d6a32291b86d03929 100644 (file)
@@ -15,7 +15,7 @@
 #include "qlkey.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "Encoding.h"
 #include "Language.h"
index 124c0abb0cc09ceff79a358acd30d2f5caac0667..3d56be910b4f66882c973894da1f6486bdd26540 100644 (file)
@@ -17,7 +17,7 @@
 #include "FuncRequest.h"
 #include "insets/InsetListings.h"
 #include "insets/InsetListingsParams.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/lstrings.h"
 
index 12067c0df91a7d41b1e3513bc9e0d352dc86912f..09c11502b90cfb3a338d14c3f7cd82395d1dc7a8 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "GuiApplication.h"
 #include "qt_helpers.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 
 #include <QCloseEvent>
index 5929a5923ecb657a0e7ef2c60893587af32b87e7..a0979d5f8c8bd64204915c8a7447248a9939e4f0 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "GuiMath.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 
 using std::string;
index dc6331c1f59b75779aab1fb3fde814f4478ac9fe..151196196c497bbcff760fd69769ea157016908d 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "EmptyTable.h"
 #include "qt_helpers.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include <sstream>
 
index 4e56213707654c5800770ddf0830add669f635ea..aac076876b1d80ca19bcc5d4545db96709eb5738 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "MenuBackend.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QCursor>
 #include <QMenuBar>
index 77d1118fb9cfc4b8fe988ef07193bd8ef9f68137..40302d87533768460c2afeb08456000559e8fda0 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "GuiNomencl.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "qt_helpers.h"
 
 #include <QLabel>
index 64fc29bd6995fb33ba1c56b2dccf8df247bd59db..457eb136cb0d2f86200dbcc93795003b0032fa59 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "GuiNote.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "insets/InsetNote.h"
 
index f97356474120b95fc1c451565b3119835ca13e0a..a7f48682e1718004309acd81bc59f2a11637e550 100644 (file)
@@ -20,7 +20,7 @@
 #include "GuiApplication.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Language.h"
 #include "LyXRC.h"
 
index 30506902521e4e3a4cf65ad29454c58bdfa6097d..0af2652f5387a260c015acfa683612e61a6442e0 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 //#include "DialogView.h"
 //#include "DockView.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "GuiView.h"
 #include "Lexer.h"
 #include "Paragraph.h"
index a8ff105014e7bbdb46c9a482d59583bf0a58227a..a5e8a4f0c6306fca5125ac451606ecc0e251fb54 100644 (file)
@@ -23,7 +23,7 @@
 #include "ParagraphParameters.h"
 #include "GuiView.h"
 #include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QCloseEvent>
 #include <QDialog>
index 8528f72bdf8ef711d8d25b686521ac0130425d99..a52961679062e123ea0f6ab7dbd9011fe48ed9b6 100644 (file)
@@ -21,7 +21,7 @@
 #include "MenuBackend.h"
 
 #include "support/lstrings.h"
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index f1d6d106c870b172301081d394d74be964ff9944..23f8a5752f2b110580b70ced799070c50b174637 100644 (file)
@@ -20,9 +20,9 @@
 #include "BufferList.h"
 #include "Color.h"
 #include "ConverterCache.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "GuiFontExample.h"
 #include "GuiKeySymbol.h"
 #include "KeyMap.h"
index 5ff6f0ee0510773a15dd143f9e97815f337e29da..466b905d3464607a4cf5152fe704bfd5a7f86956 100644 (file)
@@ -20,7 +20,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/convert.h"
 #include "support/FileFilterList.h"
index e53c8b6cc8406dbb1bacb748a01a7d5acd72cee3..bc3022b6522d010e47aa32f1317b80e41d7078d0 100644 (file)
@@ -15,7 +15,7 @@
 #include "GuiSelection.h"
 
 #include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/lstrings.h"
 
index 0ca45a6fc16547f80e0bbf714730f089738203c0..1663d2a9a7c87e74d80a6cac24b1bcd735799d9c 100644 (file)
@@ -20,8 +20,8 @@
 #include "BufferView.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "LyXRC.h"
 #include "Paragraph.h"
index 252a97f4116a8be7021a5b7374e773a2d573ceeb..f434c6721fc27b6bccd5ac88954229a6b6c1ac0f 100644 (file)
@@ -14,7 +14,7 @@
 #include "GuiTexinfo.h"
 
 #include "FuncRequest.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/filetools.h"
 #include "support/FileName.h"
index 7267b070d1b1923ae882badca453d13e8a1778f0..9f2d08e33844cd9dc9a610bb99098263bb7b4a7e 100644 (file)
@@ -13,7 +13,7 @@
 #include "GuiThesaurus.h"
 
 #include "qt_helpers.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QCloseEvent>
 #include <QHeaderView>
index 526584e6a3daa14db1bb63666f80e9bb9ffd8c8d..73c6b0331bf2059cd889160c53f938dec776cb99 100644 (file)
 #include "Buffer.h"
 #include "BufferView.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "TextClass.h"
 
 #include "support/convert.h"
index a2e0618710656919927ae7611b0b67ebe37820d3..b89e900b160083aa63d5290747336e2c7d5a5497 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "IconPalette.h"
 #include "Layout.h"
 #include "LyXFunc.h"
index 9d8a3acd8bc6e9b0b56bec1337714b8b03dbc49f..d6183e02f365c9cce6bdf7a2328c9204ac5bff96 100644 (file)
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Layout.h"
 #include "LyX.h"
 #include "LyXFunc.h"
index bdd32b86fc4e642d517148b9721549eeb8f36977..2a5741d8b6b12cfe0f45d027dd3c1cef31ae96cc 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "ErrorList.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Intl.h"
 #include "Layout.h"
 #include "Lexer.h"
index 443844c1fde81bec02633d422bfd0f375de117f4..d1e14c819fe975cb9c5acc462722786e792d2bbc 100644 (file)
@@ -20,7 +20,7 @@
 #include "BufferView.h"
 #include "Buffer.h"
 #include "Cursor.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Paragraph.h"
 #include "TexRow.h"
 
index ab976e3876d889595dd60c1f4fdd213959696e97..340d1d63b0d9508c09d3c4cc1890b1fca7f43cc0 100644 (file)
@@ -20,7 +20,7 @@
 #include "GuiView.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QDockWidget>
 #include <QString>
index ac6df65716546b8c789f246d47b1dad147705c8b..cdc639515ac9845b66c4345f4cd0448795732b30 100644 (file)
 #include "BufferView.h"
 #include "CoordCache.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Font.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "GuiApplication.h"
 #include "GuiKeySymbol.h"
 #include "GuiPainter.h"
index a8974fcf73cd6ece22aa885b5916ff7d621725df..37cdcc47f37dbe798cba20da4871bb0a2ff5fba9 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QFontMetrics>
 #include <QStackedWidget>
index 6ee11a31050b75c0ba3f910b4010d3ab1579dc37..c247817b41efbbdcebe852c4c973781330da25ba 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "TocModel.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <boost/assert.hpp>
 
index 10d0efe493dccc1c15816a7488dccd967012099f..6189f0bb3b6ba38dcda2fc57fe6b72c79d7415eb 100644 (file)
@@ -16,7 +16,7 @@
 #include "GuiToc.h"
 #include "qt_helpers.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <QHeaderView>
 
index ccc23d3ba96047e58cb9d237aa29c99e7f7eb19c..a58a27d31227c03a67043ba4d83a9ac58926405e 100644 (file)
@@ -15,7 +15,7 @@
 #include "Validator.h"
 #include "qt_helpers.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyXRC.h"
 
 #include "frontends/alert.h"
index eb840d97d78d58f15d91ad5ca3f182dd10099e32..1bb5d6eda0f411cb0253bf41f9aca839d4f89fa5 100644 (file)
@@ -16,8 +16,8 @@
 
 #include "LengthCombo.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "Length.h"
 
diff --git a/src/gettext.cpp b/src/gettext.cpp
deleted file mode 100644 (file)
index 08bbdee..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * \file src/gettext.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 <config.h>
-
-#include "gettext.h"
-#include "Messages.h"
-
-#include "support/lstrings.h"
-
-#ifdef HAVE_LOCALE_H
-#  include <locale.h>
-#endif
-
-using std::string;
-
-
-namespace lyx {
-
-docstring const _(string const & str)
-{
-       return getGuiMessages().get(str);
-}
-
-
-void locale_init()
-{
-#ifdef ENABLE_NLS
-#  ifdef HAVE_LC_MESSAGES
-       setlocale(LC_MESSAGES, "");
-#  endif
-       setlocale(LC_CTYPE, "");
-       Messages::init();
-#endif
-       setlocale(LC_NUMERIC, "C");
-}
-
-
-docstring const translateIfPossible(docstring const & name)
-{
-       if (support::isAscii(name))
-               // Probably from a standard configuration file, try to
-               // translate
-               return _(to_ascii(name));
-       else
-               // This must be from a user defined configuration file. We
-               // cannot translate this, since gettext accepts only ascii
-               // keys.
-               return name;
-}
-
-
-} // namespace lyx
diff --git a/src/gettext.h b/src/gettext.h
deleted file mode 100644 (file)
index 597a3a1..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- C++ -*-
-/**
- * \file src/gettext.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 GETTEXT_H
-#define GETTEXT_H
-
-#include "support/strfwd.h"
-
-
-namespace lyx {
-
-/*
- * Native Language Support
- *
- * The general idea is that any string that should be translated is handled
- * as follows:
- *     _("string")
- *
- * Static strings are special, obviously and must be flagged as follows:
- *     static str = N_("string");
- *
- * And wherever they are used:
- *     _(str)
- *
- * Every file where there are strings needs:
- *     #include "gettext.h"
- *
- * Remember to mention each of these files in "po/POFILES.in"
- *
- * The main() needs a locale_init() and a gettext_init() in the beginning.
- */
-
-/*
- * General translation notes:
- *   Commands/options are not translated
- *   Debug messages are not translated
- *   Panic/fatal (that should not happen) messages need not be translated
- */
-
-
-//#ifdef ENABLE_NLS
-
-///
-docstring const _(std::string const &);
-
-//#else // ENABLE_NLS
-
-///
-//#  define _(str) (str)
-
-//#endif
-
-#  define N_(str) (str)              // for detecting static strings
-
-/**
- * Translate \p name if it is possible.
- * This should be used to translate strings that come from configuration
- * files like .ui files. These strings could already be in the native
- * language if they come from a file in the personal directory. */
-docstring const translateIfPossible(docstring const & name);
-
-///
-void locale_init();
-
-
-} // namespace lyx
-
-#endif
index 740ca053ce564c3e775f83cc664f2fbc457dc00f..57bb6a9e5f8f5fd4a91d7d5f620988d17129ffd8 100644 (file)
@@ -15,7 +15,7 @@
 #include "GraphicsCacheItem.h"
 #include "GraphicsImage.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/filetools.h"
 
index 882c44b46b8e3a5f5be5db4250c7fd5b85c80d2d..229dd89e9048122bfb47c34844af98af77b9f103 100644 (file)
@@ -17,7 +17,7 @@
 #include "GraphicsImage.h"
 
 #include "ConverterCache.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Format.h"
 
 #include "support/filetools.h"
index 7dd829a82c4dd20c7174f107467d3248f2451da7..1dd8be961eff0945fc22f3257340e414b21b5122 100644 (file)
@@ -13,7 +13,7 @@
 #include "GraphicsConverter.h"
 
 #include "Converter.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Format.h"
 
 #include "support/filetools.h"
index f4ccf9edc4d5141ea1f22767f14375edeaca1e6f..2be848f235c80b7771f5aa2ccc5aa4d1e73aa9bb 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "GraphicsImage.h"
 #include "GraphicsParams.h"
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index c5a6326d82460683c97e3541119e310cd151da3c..36f6eec2dad5c3fa03fd457d430b4ac3c8fd4e28 100644 (file)
@@ -16,7 +16,7 @@
 #include "GraphicsImage.h"
 #include "GraphicsParams.h"
 #include "GraphicsCache.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/Timeout.h"
 
index 5dd8f982392110748e3bdd41baa981955a54eade..1d9c5628f408561e0ed553877db01502687f1e84 100644 (file)
@@ -17,7 +17,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Converter.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Encoding.h"
 #include "Format.h"
 #include "InsetIterator.h"
index 6694537220607a67cd1cc457976fe68057e6d3fc..19819f932800484e747dd54b8bdf89fbd0e697af 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "Buffer.h"
 #include "Converter.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "ErrorList.h"
 #include "Exporter.h"
 #include "Format.h"
index 46365b6e4d2070b839b4db983fab7f77fcd18534..0c93cbe5eabd8a202c685613e668bf75add824b9 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "ExternalTemplate.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Lexer.h"
 
 #include "support/filetools.h"
index de25277845c926d345b8a7d0f8c2bdee88f3f90e..8506d8e8d2c98c4b70e126b971c9d07c031aadc4 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "ExternalTransforms.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/lstrings.h"
 #include "support/lyxlib.h" // float_equal
index 873245089e889f97e32b998d617285829f0f5e4b..6140d2cb20ede4e3b450bfebdce469fc8347ad02 100644 (file)
 #include "BufferView.h"
 #include "CoordCache.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Text.h"
 #include "TextClass.h"
 #include "MetricsInfo.h"
index b8028dc8f38ce2c1da7ba23ee08de203b35857ea..63f870576c3c78fae42dc13b3aec83f64add6c6f 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "DispatchResult.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Encoding.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
index 3783842cccc460d7bfeb6e2fa5941a8a71033d82..3318c75b6d8a5f4ddc3d89d45e81929fa296c122 100644 (file)
 #include "BufferView.h"
 #include "Cursor.h"
 #include "DispatchResult.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncStatus.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
index d13393102ecba916ba01e99cb7e180bab52bf49e..641efa3024ca00747507a9395af045f742032966 100644 (file)
@@ -21,7 +21,7 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 #include "TextClass.h"
index 37a7051c40635c3a446ae0b9e04917f99dc1c430..0927cf0f48fb95f91105c134496e230061c04b19 100644 (file)
@@ -24,7 +24,7 @@
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetList.h"
 #include "MetricsInfo.h"
 #include "output_latex.h"
index be655e74ab123abef5b70f1ca02faa8ff2c69ab7..43920a695c09f6d5330568ab1091786c3c103696 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "LaTeXFeatures.h"
index 9105cb018514103df1bac1a27470d63833233df8..30fe90327d39a57f0688fcda7190d1c11c1beda2 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "DispatchResult.h"
 #include "FloatList.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
index d14d68c530229faaaec38a7e32bbbd20754059d9..d811d9c0e6fb391d4dbfa892af5b5dc8388c9f1a 100644 (file)
@@ -18,7 +18,7 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 
index d9d388ee028faa30cfe3fcaa698cf86ba94b7c5a..39b066bace83c53fdb2ae64e9d10e4526b2266f9 100644 (file)
@@ -27,8 +27,8 @@
 #include "InsetRef.h"
 #include "InsetTOC.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 
 #include "support/ExceptionMessage.h"
index 2f98b603da5d2befe3762339ca229e17089948b4..05da70c14fddac8ed9675e177f610ee898510991 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "Layout.h"
 #include "LyXAction.h"
index 97ab8d026a85d9d0a2cbe4ead18e77849672e0bc..70e214fa623ce069d1916f06c7ff226872246ff4 100644 (file)
@@ -13,7 +13,7 @@
 #include "InsetEnvironment.h"
 
 #include "BufferParams.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Layout.h"
 #include "OutputParams.h"
 #include "output_latex.h"
index 3f7ff2a06f427540691ae2f0d001bd8809b10a41..74339bc656ca9bc5732a78f11279e8e69b58eab2 100644 (file)
 
 #include "Buffer.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Exporter.h"
 #include "FuncStatus.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "LyXRC.h"
index 81bd94867a76d5e4d62e1abeef8abab6b52789e8..654b9b7253193786c58cbabdcc9898498dfe2635 100644 (file)
@@ -21,7 +21,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "Cursor.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "Text.h"
 #include "MetricsInfo.h"
index edd2da65ad05755ae78fa3861e519aa9e1eed2de..c601b647e839103b6b7882be5e2ec27720c16064 100644 (file)
 #include "BufferView.h"
 #include "Counters.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "OutputParams.h"
index 9488d0a6f21d599428c89f6b6527ddad9d98e849..eafb61065650f017744e99bb3502ba2f705c2ad1 100644 (file)
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
index be8634f317065c12214b360deecc62c6fc7f137a..238f6b78bf7ec011eb0619f9a9a5707ba5c01039 100644 (file)
  */
 
 #include <config.h>
-#include "debug.h"
+#include "support/debug.h"
 
 #include "InsetFoot.h"
 
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Counters.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Layout.h"
 // FIXME: the following is needed just to get the layout of the enclosing
 // paragraph. This seems a bit too much to me (JMarc)
index 4ec3ddf352b74e192653f1ebe64976cad99ee0fa..43d698c8d0cc041bb2b790100d3bfd0475bf9b85 100644 (file)
@@ -56,14 +56,14 @@ TODO
 #include "BufferView.h"
 #include "Converter.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "ErrorList.h"
 #include "Exporter.h"
 #include "Format.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Length.h"
 #include "Lexer.h"
index 5e3cfeb537c43d0f50d473bf92668161edcf4012..8fee672724347f4418e7314529a1691afaafe53f 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "InsetGraphicsParams.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "LyX.h" // for use_gui
 #include "Lexer.h"
 #include "LyXRC.h"
index e1b832ca720b548e2e0cc05254c3e85d668a5508..c9f392c2590e4725a9b542a1d5977c6cf197585a 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "InsetHFill.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include <ostream>
 
index 509fedfe7e3b20583040235f95e11f67c93ef4d5..5c5e885a04a2be22f54a754b7f150752811dd41a 100644 (file)
@@ -16,7 +16,7 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "LaTeXFeatures.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "OutputParams.h"
 
 #include "support/lstrings.h"
index f05f9022ad12fa79f6c1515732a328b1af06e8f5..fb5fe5acbd5a27a8e424fb6c82a12566338e2183 100644 (file)
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Exporter.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "LyX.h"
 #include "LyXRC.h"
index 6326786d444bbac6c198b4edf9bba83f6e4dd30d..1c479b6bbdf43dc5eaeeb998580b17068202d835 100644 (file)
@@ -14,7 +14,7 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
 #include "sgml.h"
index ec4fdcde5357539457f4bce0b130e0cdd46dcc8c..16efeeefd62c50daea35c3dbaf4d927956277bb2 100644 (file)
@@ -16,9 +16,9 @@
 
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetSpecialChar.h"
 #include "KeyMap.h"
 #include "LaTeXFeatures.h"
index c61b0e4985cb0df06503a8064f8703d861f44430..e71b5e833396f4bd5fc476fd0605b4d9f1b17aba 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "InsetText.h"
 #include "RenderButton.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Cursor.h"
 #include "support/Translator.h"
 
index f34ae4259c09f52ec0ecf879dcb16766aab4103c..a12da398917aeec994ff7163f560fbed9c4b6f2d 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "InsetLine.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "Font.h"
 #include "MetricsInfo.h"
index d3a3c64f8c3052c8d20f6969990478b81e56df3b..2d9fc167960a8c00cbd5ea3cf63573727ff51447 100644 (file)
@@ -21,7 +21,7 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetList.h"
 #include "Language.h"
 #include "MetricsInfo.h"
index 1e7c9b69917f5a42cdef5b212b682822ffa8ad35..fb0be3e6050bdf3c3f96840ab4665ecca7896896 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "InsetListingsParams.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Length.h"
 #include "Lexer.h"
 
index ce16f7d327333006ab2385f75cc8e7d131d95472..418ddad4f250baf82d636a4ec099e1db9a831cd5 100644 (file)
@@ -14,7 +14,7 @@
 #include "InsetMarginal.h"
 
 #include "Buffer.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "OutputParams.h"
 
 #include <ostream>
index 5562fe800577561556cf227791752d93ed9d636f..103fbe866a590ee12d8bdc6dc2618a8891caf7f5 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "InsetNewline.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
index 4e24da3e250c03989d9e2c97744b2a7ffe90d300..b74b161e08e2651503087572690d9f2ab431e490 100644 (file)
@@ -14,7 +14,7 @@
 
 
 #include "Inset.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 
 namespace lyx {
index 6054e688790a4766bdca8c9b2e384ea7e098ec4a..1afdf5c2b6b6c62e6d583a607493adf850a028b7 100644 (file)
@@ -12,8 +12,8 @@
 
 #include "InsetNewpage.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Text.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
index ba8c6c87c7c9a8c9f69fbe9b6f3a63403597a5de..db3f2e1fc0209e49f968449d7e112bbadbf038e7 100644 (file)
@@ -14,7 +14,7 @@
 
 
 #include "Inset.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 
 namespace lyx {
index c2fdade285797ad19269eea8d169c429a036dbe4..dec08854d2877a7e4707ef5e548e51753045ba05 100644 (file)
@@ -16,7 +16,7 @@
 #include "Buffer.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetIterator.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
index 2c8096fd0f39194abc12692ca554fb62eec61660..bb2f0eeb1bd35f71fcacd5a2cadc2113f589cd0e 100644 (file)
 #include "BufferParams.h"
 #include "Counters.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Exporter.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
index d4d3fa3e9225a9b1f78d0642bd3f1c80575d62f3..a51b77ee0fd111fa8dfdc709bd938215d3903bd6 100644 (file)
@@ -12,8 +12,8 @@
 
 #include "InsetOptArg.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 
 #include "support/docstream.h"
 
index 3c6524119dad8b7c63d1688b7d98a416a902ea00..50b9ec18080daa473771ff79eb9a172e594c52e9 100644 (file)
@@ -15,7 +15,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
index 5fb240a95dab94312580d9aa168f5c89a15879fe..498a06b915db4d8a7d3c07e61971fc50e321be60 100644 (file)
@@ -15,7 +15,7 @@
 #include "Cursor.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "LyXFunc.h"
 #include "OutputParams.h"
index 83600c376b703e943ab5ba6a653fd4ca38a029b2..d1f2b399f4703aaf1a62ee315f593df2bfa6b295 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "InsetSpace.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
index b8a75669733f7a29c6c3f37f8dc444e33e98c201..a580a81ec3d8dd484d7344497182681ae33023f4 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "InsetSpecialChar.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
index f23a87d82d9c5463637ad202f9cba5b123839ccb..ea9345bb6da53eea5d3eb96cb6ae8a9d4d7d5f9b 100644 (file)
@@ -15,7 +15,7 @@
 #include "Buffer.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "TocBackend.h"
index b8a5847e8fc95412f773d06db068450c29a9aa27..53fac2ceac3a6f52f7fc1b193df4672353fd2db4 100644 (file)
 #include "Counters.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
index c43a57e3f0afc8cfaa25bf8b25cf669da1639f78..18c8c9543aaf58ddda4f9b576be7a2f8f0939992 100644 (file)
 #include "CoordCache.h"
 #include "CutAndPaste.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "ErrorList.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "InsetList.h"
 #include "Intl.h"
 #include "lyxfind.h"
index 066f3bcd769e7fe099a3d11d5223ab084dd199b8..9a62fbf483a17da2c68fb5fde0dadd9a138b0f32 100644 (file)
@@ -14,8 +14,8 @@
 #include "InsetTheorem.h"
 #include "insets/InsetText.h"
 
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "FontInfo.h"
 #include "Text.h"
 #include "MetricsInfo.h"
index 08ff46c3e1344413a0fd11861f32e0762f21f7fc..2444f675310d91c1e0742f92fcb8bbc17b59839c 100644 (file)
@@ -18,7 +18,7 @@
 #include "Dimension.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "Text.h"
 #include "MetricsInfo.h"
index 4a420a4e0efbe73b9898ab1ae787134d0b27da40..aea6976a526561b70aa3bdb6a127a1862416ff40 100644 (file)
 #include "BufferView.h"
 #include "Counters.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 #include "OutputParams.h"
index f2c5d8e8e4115f31b9a94feb330db8f645d0925c..722cbf362056df159be67f8ad8a84ca9bdd8d3a1 100644 (file)
@@ -13,7 +13,7 @@
 #include "MailInset.h"
 
 #include "BufferView.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "frontends/Application.h"
 
index 60ca378ba5aa40d17333952446220e4592eadd83..bb3cebf0a0908c21d888e43d4c86ece96c9ea694 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "insets/Inset.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyX.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
index cc4fe5ed93ca05c55aac5b3d83c29ca94dfb1644..4ad8ef126951fe7a1052429e35ecf1277104ec5d 100644 (file)
@@ -15,7 +15,7 @@
 
 #include "BufferView.h"
 #include "Dimension.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyX.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
index e783555733f329e0d1cdf535b13c0e8a964a2e52..05baafaaa278a3057cc4495a3ecdcf4d271d0c44 100644 (file)
@@ -12,7 +12,7 @@
 
 #include <config.h>
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Length.h"
 
 #include <string>
index 4186fa8f1eac0be183d29fb20ce72c44ee7072d5..e9a462a8759cf9ce42d26278e92dec4c34db5182 100644 (file)
@@ -22,9 +22,9 @@
 #include "buffer_funcs.h"
 #include "BufferView.h"
 #include "Changes.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Text.h"
 #include "Paragraph.h"
 #include "ParIterator.h"
index 9ffd8c27fd86e37e6a04afc573a87b7cbc00e96d..41ce51a772e85d57823e1bffbf252753f1986b6a 100644 (file)
@@ -11,9 +11,9 @@
 
 #include <config.h>
 
-#include "debug.h"
+#include "support/debug.h"
 #include "LyX.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/os.h"
 
index d3c4183ce654e471f828fbf0f27e224a77d9a182..2941e5597de8edab98f81cc92fc380074933ea8b 100644 (file)
@@ -17,8 +17,8 @@
 
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 
index 00c3fc3df258eb679ba595b1a329f60b283ae82d..126f4f71b79a3d77db4f35b233348dfbe17e7988 100644 (file)
@@ -14,8 +14,8 @@
 #include "InsetMath.h"
 #include "MathData.h"
 #include "MathStream.h"
-#include "gettext.h"
-#include "debug.h"
+#include "support/gettext.h"
+#include "support/debug.h"
 
 #include "support/docstream.h"
 #include "support/lstrings.h"
index 1e7d20c206e1bcaf9feb073d4ed763e2b32f3c55..a8fdf68346e110ff1322dc954d10ae6229fc6855 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/lstrings.h"
 
index ee0b4da33bf5dc32c096ea049c62d2f248028070..8a45e2155534c9e76256926b50301fa91dd7de19 100644 (file)
@@ -15,7 +15,7 @@
 #include "Cursor.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "MathData.h"
 #include "MathStream.h"
index d985d5d69a9dfdc2356014402c57fab7570d331f..02013d901367196c6499b8f4865a2a125084276c 100644 (file)
@@ -17,7 +17,7 @@
 #include "MathStream.h"
 #include "MetricsInfo.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "Dimension.h"
 #include "TextPainter.h"
 
index d2a739c4b5230c4b281d1a504dae252b2edcd574..5ac5c340dd53cd285dca2bb95124c13e015accc3 100644 (file)
@@ -20,7 +20,7 @@
 #include "MetricsInfo.h"
 
 #include "LaTeXFeatures.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include <ostream>
 
index 1db14450aa3e99382d44ff7a964fcbec1b60b0e4..a3688225b59ed1a44ed009b9817630ae16258b88 100644 (file)
@@ -13,7 +13,7 @@
 #include "InsetMathDiff.h"
 #include "MathData.h"
 #include "MathStream.h"
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index f990cde56cad3314c309d38321b7882bda2a9a89..23372ba16d92dfbcc3e6ff6ed132074d6a9f1a7c 100644 (file)
@@ -15,7 +15,7 @@
 #include "MathStream.h"
 #include "MathStream.h"
 #include "InsetMathSymbol.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/docstring.h"
 
index f630fb2cff1026bcbffed564eeec148956857159..a7e0d6e349b74e2af0f23cffeec7c917b9cf7535 100644 (file)
@@ -21,9 +21,9 @@
 #include "CutAndPaste.h"
 #include "FuncStatus.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "frontends/Clipboard.h"
 #include "frontends/Painter.h"
index 4df678a450c78bafe7246785d59ebb28edd42452..894504e7a474ea63021fcfc38105af14acdcf11e 100644 (file)
 #include "FuncStatus.h"
 #include "LaTeXFeatures.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LyXRC.h"
 #include "OutputParams.h"
 #include "sgml.h"
index 89d580954e75b02ae66c925035b74d0fe22c1e89..3bc981056618dda9f57ec865a9d951707fe9a91a 100644 (file)
@@ -13,7 +13,7 @@
 #include "InsetMathLim.h"
 #include "MathData.h"
 #include "MathStream.h"
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index 90b152f9c18d8b8bec4dd1103e3fe4b079fd9b16..680eb4df8fc5bb99ea8fc96da6ef5e21cd8a47f3 100644 (file)
@@ -18,7 +18,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "MetricsInfo.h"
 #include "output_latex.h"
 #include "OutputParams.h"
index 00d38403d9f304d80810b12c0d10529e311cf303..cabf241194d6f21d8d3a54efa79dda1bc5eea115 100644 (file)
 #include "CoordCache.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "LyXFunc.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Text.h"
 #include "OutputParams.h"
 
index de847d1b19484c94d6d50e14d680169c7f171a6e..35322dcda5c35a652c8183dc9c88a8ddb2e4f2bf 100644 (file)
 #include "LaTeXFeatures.h"
 #include "Buffer.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "MathData.h"
 #include "MathFactory.h"
 #include "MathSupport.h"
index 54a8a1b1035a361fe66b24566b3405c0aa95c1e7..8b1c0e1fc56a61edb9508b598e7d32b89e59c1c3 100644 (file)
@@ -18,7 +18,7 @@
 #include "InsetMathFont.h"
 #include "DispatchResult.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 
 #include <boost/assert.hpp>
index 287073bc45e61d1a4e2558b0e82a399324df5bee..d5a7200b2f481f2f7d9b5018b622c27df7221ff1 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 
 #include "support/lstrings.h"
index 8d72d4798ad225e7537079a15ec97b94718618cc..433f7cca59cb65c633c5e97e04bcf20e65a20141 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "support/lstrings.h"
 
index 34c87ce748b4ef6e0f3e3569202e83468668a567..b9bca09fc4197df4bc3c48922684264f27517eec 100644 (file)
@@ -19,7 +19,7 @@
 #include "MathAtom.h"
 #include "LaTeXFeatures.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/textutils.h"
 
index cddc17fa900990dd06fb1baf2a88fe01a25d8dce..62acb0a17420b0fdc12394c5a08ec90fae922b1e 100644 (file)
@@ -14,7 +14,7 @@
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "frontends/Painter.h"
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index fdfceb4124f2dbab2bd1be3499ab288eda1c9ed9..fb46f401702d3e8ea09b56f5c308a9d859e56b5f 100644 (file)
@@ -19,7 +19,7 @@
 #include "InsetMathNest.h"
 #include "Buffer.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "DocIterator.h"
 
 #include <boost/assert.hpp>
index caa81cff9bc945aec9f16c22569d6e0c8b8bba88..c8b6788af5235331b33417a6e1100337787dedf2 100644 (file)
@@ -15,7 +15,7 @@
 #include "InsetMath.h"
 #include "MathSupport.h"
 #include "MathParser.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/filetools.h" //  LibFileSearch
 #include "support/docstream.h"
index 4177779a0d07ab86105efe5c0dc0bf2562bf0235..253a888c745eae46e9b70832dc3b3cfd3753193b 100644 (file)
@@ -27,7 +27,7 @@
 #include "BufferView.h"
 #include "CoordCache.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/docstream.h"
 
index 2d7fd9d39d890ab4055dc114b0465c8dc4a00e57..49b01631d1993dd94887a80f7c9586d00b260974 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "MathExtern.h"
 
-#include "debug.h"
+#include "support/debug.h"
 #include "InsetMathArray.h"
 #include "InsetMathChar.h"
 #include "InsetMathDelim.h"
index 923a5dc1c2d85b2b9922ff0283f0a8187cd94df6..8af81f3a8d573cb2bfa9b31fcf75a50150d38ccb 100644 (file)
@@ -47,7 +47,7 @@
 #include "MathParser.h"
 #include "MathSupport.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "insets/InsetCommand.h"
 
index 94d1a8215ee4c09395730fe4197bdfc89cab7e6a..19ca28cf1b210f456554c50e60b77f92a35192a5 100644 (file)
@@ -20,7 +20,7 @@
 #include "Buffer.h"
 #include "BufferView.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "LaTeXFeatures.h"
 #include "FuncStatus.h"
 #include "FuncRequest.h"
index b7a0273266322c57b2da3e2ade0a697f02aafa57..33e29ed1660e3dbc1b0a7215c2b6b596340e8a93 100644 (file)
@@ -15,7 +15,7 @@
 #include "MathStream.h"
 #include "MathSupport.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 
 namespace lyx {
index 26d10509c47a3f15cf02352d2a3e2a1d8bca1a90..3ff517eb86031d7e8cdd2595e8efa1f05f997037 100644 (file)
 #include "Buffer.h"
 #include "Color.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Lexer.h"
 #include "Undo.h"
 
@@ -41,7 +41,7 @@
 #include "support/docstream.h"
 #include "support/lstrings.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <sstream>
 
index 9193e666a74998c05d87e778ce19824d1dd58889..4c3f60a433a3fa75c386ab671175cb50cd36dca7 100644 (file)
@@ -63,7 +63,7 @@ following hack as starting point to write some macros:
 #include "MathSupport.h"
 
 #include "Lexer.h"
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/convert.h"
 #include "support/docstream.h"
index ef352584fdbc32e6f29df7aa3c7e7215a3f4815d..5a60602c8f991c24015557eda08496c6f6bbd292 100644 (file)
@@ -18,7 +18,7 @@
 #include "MathParser.h"
 #include "MathStream.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include "support/docstream.h"
 
index aa93e283ac985c679ab2213247d80daab516edcf..b3377b3762994061beb1d2c55211dd37e115f360 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "output.h"
 
-#include "gettext.h"
+#include "support/gettext.h"
 
 #include "frontends/alert.h"
 
index 369bcb62d128021061c7eb76cb4af8cbddb4f516..ba4bc9b09e01a1596f0c33621af5d8da9d6c3237 100644 (file)
@@ -17,7 +17,7 @@
 #include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "Counters.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Layout.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
index 7b68bcb25e6b12dcaa45ea70a2c9d7eaa7dcd364..47ae3f8be74a2dd9fcf3925bac50b581cbd7460e 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "Encoding.h"
 #include "InsetList.h"
 #include "Language.h"
index d12c82b85cc3f70c8e52b3d3b0edc1c1750559fc..0ab78d17f9b8d001f0352063472a84f82094aa76 100644 (file)
@@ -14,8 +14,8 @@
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
-#include "gettext.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "Layout.h"
 #include "output.h"
 #include "OutputParams.h"
@@ -132,7 +132,7 @@ void writePlaintextParagraph(Buffer const & buf,
 
        //--
        // we should probably change to the paragraph language in the
-       // gettext here (if possible) so that strings are output in
+       // support/gettext.here (if possible) so that strings are output in
        // the correct language! (20012712 Jug)
        //--
        switch (ltype) {
index 46d4c17a01354d83216ab63cc31cb717b2ca8d9f..9e56bd550bd3105df4049dd08ff3d74e4c42ee7e 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "BufferParams.h"
 #include "Changes.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "InsetList.h"
 #include "Layout.h"
 #include "Paragraph.h"
index 9546e417201571e3550752c9a1d0522c23d5d7ae..9296c49e4693e20e1155e8c3301204f4cbdc2ec7 100644 (file)
 #include "Buffer.h"
 #include "CoordCache.h"
 #include "Cursor.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Changes.h"
 #include "Encoding.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Language.h"
 #include "Layout.h"
 #include "LyXRC.h"
index 06272d13101b29d386f3ef7125842557d9b91213..4b39efdfdad3adf8b03300ce5dbe48c3666c3d85 100644 (file)
 #include <config.h>
 
 #include "support/FileFilterList.h"
-#include "support/lstrings.h"
 
-// FIXME Interface violation
-#include "gettext.h"
+#include "support/lstrings.h"
+#include "support/gettext.h"
 
 #include <boost/regex.hpp>
 #include <boost/tokenizer.hpp>
index 6ec87a738e345295e79c998b28388a94a5413d5c..df887235096710140edbb42497fd4b5077907eb3 100644 (file)
@@ -11,6 +11,7 @@
 #include <config.h>
 
 #include "support/FileMonitor.h"
+
 #include "support/FileName.h"
 #include "support/lyxlib.h"
 #include "support/Timeout.h"
index c6255ce01e978bb2efa464a4bb1fbdfd12d1d5aa..115f97beb7d1a531052e49e12a00f1378483ea8e 100644 (file)
 #include <config.h>
 
 #include "support/FileName.h"
+
+#include "support/debug.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
+#include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/qstring_helpers.h"
 
-#include "debug.h"
-#include "lyxlib.h"
-
 #include <QDateTime>
 #include <QDir>
 #include <QFile>
index b7583a390c5c5cb3b514dc5c846959298e817b07..37180011e05252ce202df2a4b1741f850655334c 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef FILENAME_H
 #define FILENAME_H
 
-#include "strfwd.h"
+#include "support/strfwd.h"
 
 #include <ctime>
 #include <string>
index 148dba9acd8e21e1601ff4545221b56821587dfa..003f0ef304db2352ed02b8bc2d487e8d9fa1bbc7 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "support/ForkedCallQueue.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <boost/bind.hpp>
 
index 2eba69f3294e2e214aaadca395bcedc034c27721..50b89b98eaf51c8b160b95f8badf95c6dbda5050 100644 (file)
 #include <config.h>
 
 #include "support/Forkedcall.h"
+
+#include "support/debug.h"
+#include "support/filetools.h"
 #include "support/ForkedcallsController.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/filetools.h"
 #include "support/os.h"
 #include "support/Timeout.h"
 
-#include "debug.h"
-
 #include <boost/bind.hpp>
 
 #include <vector>
index a6f9a1df582c28f53def92a71c8f3ece0e33fc4b..f825f91736ef8da8592b555e6fcf0a429da88bdc 100644 (file)
@@ -15,9 +15,9 @@
 #include <config.h>
 
 #include "support/ForkedcallsController.h"
-#include "support/Forkedcall.h"
 
-#include "debug.h"
+#include "support/debug.h"
+#include "support/Forkedcall.h"
 
 #ifdef _WIN32
 # include <sstream>
index 883e4faf6b9be341509523ccebc2e0a199439c24..0846d55a7c926601bc235f7b5929bfeea5d41fb1 100644 (file)
@@ -29,7 +29,8 @@ liblyxsupport_la_SOURCES = \
        convert.h \
        copy.cpp \
        copied_ptr.h \
-       cow_ptr.h \
+       debug.cpp \
+       debug.h \
        docstream.cpp \
        docstream.h \
        docstring.cpp \
@@ -49,6 +50,8 @@ liblyxsupport_la_SOURCES = \
        ForkedCallQueue.h \
        ForkedcallsController.cpp \
        ForkedcallsController.h \
+       gettext.cpp \
+       gettext.h \
        getcwd.cpp \
        gzstream.cpp \
        gzstream.h \
@@ -61,6 +64,8 @@ liblyxsupport_la_SOURCES = \
        lyxtime.cpp \
        lyxtime.h \
        lyxsum.cpp \
+       Messages.cpp \
+       Messages.h \
        mkdir.cpp \
        os.cpp \
        os.h \
diff --git a/src/support/Messages.cpp b/src/support/Messages.cpp
new file mode 100644 (file)
index 0000000..b86874c
--- /dev/null
@@ -0,0 +1,244 @@
+/* \file Messages.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "support/Messages.h"
+
+#include "support/debug.h"
+#include "support/docstring.h"
+#include "support/environment.h"
+#include "support/Package.h"
+#include "support/unicode.h"
+
+#include <boost/current_function.hpp>
+
+#include <cerrno>
+
+using std::map;
+using std::string;
+
+namespace {
+
+using lyx::docstring;
+using lyx::from_ascii;
+
+void cleanTranslation(docstring & trans) 
+{
+       /*
+         Some english words have different translations, depending on
+         context. In these cases the original string is augmented by
+         context information (e.g. "To:[[as in 'From page x to page
+         y']]" and "To:[[as in 'From format x to format y']]". This
+         means that we need to filter out everything in double square
+         brackets at the end of the string, otherwise the user sees
+         bogus messages. If we are unable to honour the request we
+         just return what we got in.
+       */
+       size_t const pos1 = trans.find(from_ascii("[["));
+       if (pos1 != docstring::npos) {
+               size_t const pos2 = trans.find(from_ascii("]]"), pos1);
+               if (pos2 != docstring::npos) 
+                       trans.erase(pos1, pos2 - pos1 + 2);
+       }
+}
+
+}
+
+
+#ifdef ENABLE_NLS
+
+#  ifdef HAVE_LOCALE_H
+#    include <locale.h>
+#  endif
+
+#  if HAVE_GETTEXT
+#    include <libintl.h>      // use the header already in the system *EK*
+#  else
+#    include "../../intl/libintl.h"
+#  endif
+
+namespace lyx {
+
+using support::package;
+using support::getEnv;
+using support::setEnv;
+
+
+// This version use the traditional gettext.
+Messages::Messages(string const & l)
+       : lang_(l), warned_(false)
+{
+       // strip off any encoding suffix, i.e., assume 8-bit po files
+       string::size_type i = lang_.find(".");
+       lang_ = lang_.substr(0, i);
+       LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION
+               << ": language(" << lang_ << ")");
+}
+
+
+void Messages::init()
+{
+       errno = 0;
+       string const locale_dir = package().locale_dir().toFilesystemEncoding();
+       char const * c = bindtextdomain(PACKAGE, locale_dir.c_str());
+       int e = errno;
+       if (e) {
+               LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
+                       << "Error code: " << errno << '\n'
+                       << "Directory : " << package().locale_dir().absFilename() << '\n'
+                       << "Rtn value : " << c);
+       }
+
+       if (!bind_textdomain_codeset(PACKAGE, ucs4_codeset)) {
+               LYXERR(Debug::DEBUG, BOOST_CURRENT_FUNCTION << '\n'
+                       << "Error code: " << errno << '\n'
+                       << "Codeset   : " << ucs4_codeset << '\n');
+       }
+
+       textdomain(PACKAGE);
+}
+
+
+docstring const Messages::get(string const & m) const
+{
+       if (m.empty())
+               return docstring();
+
+       // Look for the translated string in the cache.
+       TranslationCache::iterator it = cache_.find(m);
+       if (it != cache_.end())
+               return it->second;
+
+       // The string was not found, use gettext to generate it
+
+       string const oldLANGUAGE = getEnv("LANGUAGE");
+       string const oldLC_ALL = getEnv("LC_ALL");
+       if (!lang_.empty()) {
+               // This GNU extension overrides any language locale
+               // wrt gettext.
+               setEnv("LANGUAGE", lang_);
+               // However, setting LANGUAGE does nothing when the
+               // locale is "C". Therefore we set the locale to
+               // something that is believed to exist on most
+               // systems. The idea is that one should be able to
+               // load German documents even without having de_DE
+               // installed.
+               setEnv("LC_ALL", "en_US");
+#ifdef HAVE_LC_MESSAGES
+               setlocale(LC_MESSAGES, "");
+#endif
+       }
+
+       char const * m_c = m.c_str();
+       char const * trans_c = gettext(m_c);
+       docstring trans;
+       if (!trans_c)
+               LYXERR0("Undefined result from gettext");
+       else if (trans_c == m_c) {
+               LYXERR(Debug::DEBUG, "Same as entered returned");
+               trans = from_ascii(m);
+       } else {
+               LYXERR(Debug::DEBUG, "We got a translation");
+               // m is actually not a char const * but ucs4 data
+               trans = reinterpret_cast<char_type const *>(trans_c);
+       }
+
+       cleanTranslation(trans);
+
+       // Reset environment variables as they were.
+       if (!lang_.empty()) {
+               // Reset everything as it was.
+               setEnv("LANGUAGE", oldLANGUAGE);
+               setEnv("LC_ALL", oldLC_ALL);
+#ifdef HAVE_LC_MESSAGES
+               setlocale(LC_MESSAGES, "");
+#endif
+       }
+
+       std::pair<TranslationCache::iterator, bool> result =
+               cache_.insert(std::make_pair(m, trans));
+
+       BOOST_ASSERT(result.second);
+
+       return result.first->second;
+}
+
+} // namespace lyx
+
+#else // ENABLE_NLS
+// This is the dummy variant.
+
+namespace lyx {
+
+Messages::Messages(string const & l) {}
+
+void Messages::init()
+{
+}
+
+
+docstring const Messages::get(string const & m) const
+{
+       docstring trans = from_ascii(m);
+       cleanTranslation(trans);
+       return trans;
+}
+
+} // namespace lyx
+
+#endif
+
+#if 0
+
+-#include <locale>
+
+namespace lyx {
+
+// This version of the Pimpl utilizes the message capability of
+// libstdc++ that is distributed with GNU G++.
+class Messages::Pimpl {
+public:
+       typedef std::messages<char>::catalog catalog;
+
+       Pimpl(string const & l)
+               : lang_(l),
+                 loc_gl(lang_.c_str()),
+                 mssg_gl(std::use_facet<std::messages<char> >(loc_gl))
+       {
+               //LYXERR("Messages: language(" << l << ") in dir(" << dir << ")");
+
+               string const locale_dir = package().locale_dir().toFilesystemEncoding();
+               cat_gl = mssg_gl.open(PACKAGE, loc_gl, locale_dir.c_str());
+
+       }
+
+       ~Pimpl()
+       {
+               mssg_gl.close(cat_gl);
+       }
+
+       docstring const get(string const & msg) const
+       {
+               return mssg_gl.get(cat_gl, 0, 0, msg);
+       }
+private:
+       ///
+       string lang_;
+       ///
+       std::locale loc_gl;
+       ///
+       std::messages<char> const & mssg_gl;
+       ///
+       catalog cat_gl;
+};
+
+} // namespace lyx
+
+#endif
diff --git a/src/support/Messages.h b/src/support/Messages.h
new file mode 100644 (file)
index 0000000..cb6af76
--- /dev/null
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+/* \file Messages.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef MESSAGES_H
+#define MESSAGES_H
+
+#include "support/docstring.h"
+
+#include <map>
+#include <string>
+
+namespace lyx {
+
+///
+class Messages {
+public:
+       /// messages in the language \p l.
+       /// If \p l is empty, the language will be defined by the environment.
+       Messages(std::string const & l = std::string());
+       ///
+       docstring const get(std::string const & msg) const;
+       ///
+       static void init();
+private:
+       ///
+       std::string lang_;
+       /// Did we warn about unavailable locale already?
+       mutable bool warned_;
+       ///
+       typedef std::map<std::string, docstring> TranslationCache;
+       /// Internal cache for gettext translated strings.
+       /// This is needed for performance reason within \c updateLabels()
+       /// under Windows.
+       mutable TranslationCache cache_;
+};
+
+/// Access to the unique Messages object for the passed \p language.
+/// Implementation is in LyX.cpp.
+extern Messages & getMessages(std::string const & language);
+/// Access to the unique Messages object used for GUI element.
+/// Implementation is in LyX.cpp.
+extern Messages & getGuiMessages();
+
+} // namespace lyx
+
+#endif
index 1d54cd1d561be501516ebd71986ced52bb0dce40..b526df6d4d15399e1fec67233829056dd968ff7d 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 /**
- * \file package.C
+ * \file package.cpp
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
 
 #include "support/Package.h"
 
-#include "debug.h"
-#include "gettext.h"
-
+#include "support/debug.h"
 #include "support/environment.h"
+#include "support/ExceptionMessage.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
-#include "support/ExceptionMessage.h"
 #include "support/os.h"
 
 #if defined (USE_WINDOWS_PACKAGING)
index 54c16aa8aafa66007e18fb16479e48a56e1f590c..c1d27a8cc7b48a0434e0c557082aa74d4b3e175d 100644 (file)
@@ -11,8 +11,8 @@
 
 #include <config.h>
 
-#include "SignalSlot.h"
-#include "SignalSlotPrivate.h"
+#include "support/SignalSlot.h"
+#include "support/SignalSlotPrivate.h"
 
 namespace lyx {
 
index 9c16b595ad85aa8e11c8ccb77faf86297a1a62d9..a736a89278cbfcd8930d1ffc0ef70af889c373c8 100644 (file)
 
 #include <config.h>
 
+#include "support/Timeout.h"
+#include "support/debug.h"
+
 #include <QObject>
 #include <QTimerEvent>
 
-#include "debug.h"
-#include "Timeout.h"
-
-
 namespace lyx {
 
 /**
index 754a53622e88c3e1ac00caad07859db2ef82841c..b7ce3fc90bd33ee2d17ce1a707fbbf105c3cd880 100644 (file)
@@ -11,8 +11,7 @@
 
 #include <config.h>
 
-#include "convert.h"
-
+#include "support/convert.h"
 #include "support/docstring.h"
 
 #include <boost/lexical_cast.hpp>
diff --git a/src/support/cow_ptr.h b/src/support/cow_ptr.h
deleted file mode 100644 (file)
index 685d0e4..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-// -*- C++ -*-
-/**
- * \file cow_ptr.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Angus Leeming
- *
- * A pointer with copy-on-write semantics
- *
- * The original version of this class was written by Yonat Sharon
- * and is freely available at http://ootips.org/yonat/
- *
- * I modified it to use boost::shared_ptr internally, rather than use his
- * home-grown equivalent.
- */
-
-#ifndef COW_PTR_H
-#define COW_PTR_H
-
-#include <boost/shared_ptr.hpp>
-
-
-namespace lyx {
-namespace support {
-
-template <typename T>
-class cow_ptr {
-public:
-       explicit cow_ptr(T * = 0);
-       cow_ptr(cow_ptr const &);
-       cow_ptr & operator=(cow_ptr const &);
-
-       T const & operator*() const;
-       T const * operator->() const;
-       T const * get() const;
-
-       T & operator*();
-       T * operator->();
-       T * get();
-
-private:
-       boost::shared_ptr<T> ptr_;
-       void copy();
-};
-
-
-template <typename T>
-cow_ptr<T>::cow_ptr(T * p)
-       : ptr_(p)
-{}
-
-
-template <typename T>
-cow_ptr<T>::cow_ptr(cow_ptr const & other)
-       : ptr_(other.ptr_)
-{}
-
-
-template <typename T>
-cow_ptr<T> & cow_ptr<T>::operator=(cow_ptr const & other)
-{
-       if (&other != this)
-               ptr_ = other.ptr_;
-       return *this;
-}
-
-
-template <typename T>
-T const & cow_ptr<T>::operator*() const
-{
-       return *ptr_;
-}
-
-
-template <typename T>
-T const * cow_ptr<T>::operator->() const
-{
-       return ptr_.get();
-}
-
-
-template <typename T>
-T const * cow_ptr<T>::get() const
-{
-       return ptr_.get();
-}
-
-
-template <typename T>
-T & cow_ptr<T>::operator*()
-{
-       copy();
-       return *ptr_;
-}
-
-
-template <typename T>
-T * cow_ptr<T>::operator->()
-{
-       copy();
-       return ptr_.get();
-}
-
-
-template <typename T>
-T * cow_ptr<T>::get()
-{
-       copy();
-       return ptr_.get();
-}
-
-
-template <typename T>
-void cow_ptr<T>::copy()
-{
-       if (!ptr_.unique())
-               ptr_ = boost::shared_ptr<T>(new T(*ptr_.get()));
-}
-
-} // namespace support
-} // namespace lyx
-
-#endif // NOT COW_PTR_H
diff --git a/src/support/debug.cpp b/src/support/debug.cpp
new file mode 100644 (file)
index 0000000..b90eaf6
--- /dev/null
@@ -0,0 +1,192 @@
+/**
+ * \file debug.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 <config.h>
+
+#include "support/debug.h"
+
+#include "support/convert.h"
+#include "support/gettext.h"
+#include "support/lstrings.h"
+#include "support/FileName.h"
+
+#include <iostream>
+#include <iomanip>
+
+using std::setw;
+using std::string;
+using std::ostream;
+
+
+namespace lyx {
+
+using support::ascii_lowercase;
+using support::bformat;
+using support::isStrInt;
+
+namespace {
+
+struct ErrorItem {
+       Debug::Type level;
+       char const * name;
+       char const * desc;
+};
+
+
+ErrorItem errorTags[] = {
+       { Debug::NONE,      "none",      N_("No debugging message")},
+       { Debug::INFO,      "info",      N_("General information")},
+       { Debug::INIT,      "init",      N_("Program initialisation")},
+       { Debug::KEY,       "key",       N_("Keyboard events handling")},
+       { Debug::GUI,       "gui",       N_("GUI handling")},
+       { Debug::PARSER,    "parser",    N_("Lyxlex grammar parser")},
+       { Debug::LYXRC,     "lyxrc",     N_("Configuration files reading")},
+       { Debug::KBMAP,     "kbmap",     N_("Custom keyboard definition")},
+       { Debug::LATEX,     "latex",     N_("LaTeX generation/execution")},
+       { Debug::MATHED,    "mathed",    N_("Math editor")},
+       { Debug::FONT,      "font",      N_("Font handling")},
+       { Debug::TCLASS,    "tclass",    N_("Textclass files reading")},
+       { Debug::LYXVC,     "lyxvc",     N_("Version control")},
+       { Debug::LYXSERVER, "lyxserver", N_("External control interface")},
+       { Debug::ROFF,      "roff",      N_("Keep *roff temporary files")},
+       { Debug::ACTION,    "action",    N_("User commands")},
+       { Debug::LYXLEX,    "lyxlex",    N_("The LyX Lexxer")},
+       { Debug::DEPEND,    "depend",    N_("Dependency information")},
+       { Debug::INSETS,    "insets",    N_("LyX Insets")},
+       { Debug::FILES,     "files",     N_("Files used by LyX")},
+       { Debug::WORKAREA,  "workarea",  N_("Workarea events")},
+       { Debug::INSETTEXT, "insettext", N_("Insettext/tabular messages")},
+       { Debug::GRAPHICS,  "graphics",  N_("Graphics conversion and loading")},
+       { Debug::CHANGES,   "changes",   N_("Change tracking")},
+       { Debug::EXTERNAL,  "external",  N_("External template/inset messages")},
+       { Debug::PAINTING,  "painting",  N_("RowPainter profiling")},
+       { Debug::DEBUG,     "debug",     N_("Developers' general debug messages")},
+       { Debug::ANY,       "any",       N_("All debugging messages")}
+};
+
+
+int const numErrorTags = sizeof(errorTags)/sizeof(errorTags[0]);
+
+} // namespace anon
+
+
+Debug::Type Debug::value(string const & val)
+{
+       Type l = Debug::NONE;
+       string v = val;
+       while (!v.empty()) {
+               size_t const st = v.find(',');
+               string const tmp = ascii_lowercase(v.substr(0, st));
+               if (tmp.empty())
+                       break;
+               // Is it a number?
+               if (isStrInt(tmp))
+                       l |= static_cast<Type>(convert<int>(tmp));
+               else
+               // Search for an explicit name
+               for (int i = 0 ; i < numErrorTags ; ++i)
+                       if (tmp == errorTags[i].name) {
+                               l |= errorTags[i].level;
+                               break;
+                       }
+               if (st == string::npos)
+               break;
+               v.erase(0, st + 1);
+       }
+       return l;
+}
+
+
+void Debug::showLevel(ostream & os, Debug::Type level)
+{
+       // Show what features are traced
+       for (int i = 0; i != numErrorTags; ++i) {
+               if (errorTags[i].level != Debug::ANY
+                   && errorTags[i].level != Debug::NONE
+                   && errorTags[i].level & level) {
+                       // avoid to_utf8(_(...)) re-entrance problem
+                       docstring const s = _(errorTags[i].desc);
+                       os << to_utf8(bformat(_("Debugging `%1$s' (%2$s)"),
+                                       from_utf8(errorTags[i].name), s))
+                          << '\n';
+               }
+       }
+       os.flush();
+}
+
+
+void Debug::showTags(ostream & os)
+{
+       for (int i = 0; i != numErrorTags ; ++i)
+               os << setw(10) << static_cast<unsigned int>(errorTags[i].level)
+                  << setw(13) << errorTags[i].name
+                  << "  " << to_utf8(_(errorTags[i].desc)) << '\n';
+       os.flush();
+}
+
+
+void LyXErr::disable()
+{
+       enabled_ = false;
+}
+
+
+void LyXErr::enable()
+{
+       enabled_ = true;
+}
+
+
+bool LyXErr::debugging(Debug::Type t) const
+{
+       return (dt & t);
+}
+
+
+void LyXErr::endl()
+{
+       stream() << std::endl;
+}
+
+
+LyXErr & operator<<(LyXErr & l, void const * t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, char const * t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, char t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, int t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, unsigned int t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, long t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, unsigned long t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, double t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, std::string const & t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, docstring const & t)
+{ l.stream() << to_utf8(t); return l; }
+LyXErr & operator<<(LyXErr & l, support::FileName const & t)
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, std::ostream &(*t)(std::ostream &))
+{ l.stream() << t; return l; }
+LyXErr & operator<<(LyXErr & l, std::ios_base &(*t)(std::ios_base &))
+{ l.stream() << t; return l; }
+
+
+// The global instance
+LyXErr lyxerr;
+
+
+} // namespace lyx
diff --git a/src/support/debug.h b/src/support/debug.h
new file mode 100644 (file)
index 0000000..e398c36
--- /dev/null
@@ -0,0 +1,179 @@
+// -*- C++ -*-
+/**
+ * \file debug.h
+ *
+ * FIXME: It would be nice if, in lyx::use_gui mode, instead of
+ * outputting to the console, we would pipe all messages onto a file
+ * and visualise the contents dynamically in a Qt window if needed.
+ *
+ * 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 LYXDEBUG_H
+#define LYXDEBUG_H
+
+#include "support/strfwd.h"
+
+
+namespace std {
+
+class ios_base;
+
+template<typename CharT, typename Traits> class basic_streambuf;
+typedef basic_streambuf<char, char_traits<char> > streambuf;
+
+}
+
+
+namespace lyx {
+
+///  This is all the different debug levels that we have.
+namespace Debug {
+       ///
+       enum Type {
+               ///
+               NONE = 0,
+               ///
+               INFO       = (1 << 0),   // 1
+               ///
+               INIT       = (1 << 1),   // 2
+               ///
+               KEY        = (1 << 2),   // 4
+               ///
+               GUI        = (1 << 3),   // 8
+               ///
+               PARSER     = (1 << 4),   // 16
+               ///
+               LYXRC      = (1 << 5),   // 32
+               ///
+               KBMAP      = (1 << 6),   // 64
+               ///
+               LATEX      = (1 << 7),   // 128
+               ///
+               MATHED     = (1 << 8),   // 256 // Alejandro, please use this.
+               ///
+               FONT       = (1 << 9),   // 512
+               ///
+               TCLASS     = (1 << 10),  // 1024
+               ///
+               LYXVC      = (1 << 11),  // 2048
+               ///
+               LYXSERVER  = (1 << 12),  // 4096
+               ///
+               ROFF       = (1 << 13),  // 8192
+               ///
+               ACTION     = (1 << 14),   // 16384
+               ///
+               LYXLEX     = (1 << 15),
+               ///
+               DEPEND     = (1 << 16),
+               ///
+               INSETS     = (1 << 17),
+               ///
+               FILES      = (1 << 18),
+               ///
+               WORKAREA   = (1 << 19),
+               ///
+               INSETTEXT  = (1 << 20),
+               ///
+               GRAPHICS   = (1 << 21),
+               /// change tracking
+               CHANGES    = (1 << 22),
+               ///
+               EXTERNAL   = (1 << 23),
+               ///
+               PAINTING   = (1 << 24),
+               ///
+               DEBUG      = (1 << 31),
+               ///
+               ANY = 0xffffffff
+       };
+
+       /** A function to convert symbolic string names on debug levels
+           to their numerical value.
+       */
+       Type value(std::string const & val);
+
+       /** Display the tags and descriptions of the current debug level
+           of ds
+       */
+       void showLevel(std::ostream & os, Type level);
+
+       /** show all the possible tags that can be used for debugging */
+       void showTags(std::ostream & os);
+
+} // namespace Debug
+
+
+inline void operator|=(Debug::Type & d1, Debug::Type d2)
+{
+       d1 = static_cast<Debug::Type>(d1 | d2);
+}
+
+
+class LyXErr
+{
+public:
+       /// Disable the stream completely
+       void disable();
+       /// Enable the stream after a possible call of disable()
+       void enable();
+       /// Returns true if t is part of the current debug level.
+       bool debugging(Debug::Type t = Debug::ANY) const;
+       /// Ends output
+       void endl();
+       /// Sets stream
+       void setStream(std::ostream & os) { stream_ = &os; }
+       /// Sets stream
+       std::ostream & stream() { return *stream_; }
+       /// Sets the debug level to t.
+       void level(Debug::Type t) { dt = t; }
+       /// Returns the current debug level.
+       Debug::Type level() const { return dt; }
+       /// Returns stream
+       operator std::ostream &() { return *stream_; }
+private:
+       /// The current debug level
+       Debug::Type dt;
+       /// Is the stream enabled?
+       bool enabled_;
+       /// The real stream
+       std::ostream * stream_;
+};
+
+namespace support { class FileName; }
+
+LyXErr & operator<<(LyXErr &, void const *);
+LyXErr & operator<<(LyXErr &, char const *);
+LyXErr & operator<<(LyXErr &, char);
+LyXErr & operator<<(LyXErr &, int);
+LyXErr & operator<<(LyXErr &, unsigned int);
+LyXErr & operator<<(LyXErr &, long);
+LyXErr & operator<<(LyXErr &, unsigned long);
+LyXErr & operator<<(LyXErr &, double);
+LyXErr & operator<<(LyXErr &, std::string const &);
+LyXErr & operator<<(LyXErr &, docstring const &);
+LyXErr & operator<<(LyXErr &, support::FileName const &);
+LyXErr & operator<<(LyXErr &, std::ostream &(*)(std::ostream &));
+LyXErr & operator<<(LyXErr &, std::ios_base &(*)(std::ios_base &));
+
+extern LyXErr lyxerr;
+
+} // namespace lyx
+
+
+#define LYXERR(type, msg) \
+       do { \
+               if (!lyx::lyxerr.debugging(type)) {} \
+               else { lyx::lyxerr << msg; lyx::lyxerr.endl(); } \
+       } while (0)
+
+#define LYXERR0(msg) LYXERR(lyx::Debug::ANY, msg)
+
+#endif
index 924743ea4cc3051f12f986d3995b992f7b182bfe..69de4160d0a5cc7ee50b702392fd17b210e0adc2 100644 (file)
@@ -10,8 +10,8 @@
 
 #include <config.h>
 
-#include "docstream.h"
-#include "unicode.h"
+#include "support/docstream.h"
+#include "support/unicode.h"
 
 #include <cerrno>
 #include <cstdio>
index 2baa974a0b6e91e36d84a021a6b6d7cb679d1e25..88b790207e21de6fb74830f21ccecbfd2c139bcc 100644 (file)
 
 #include <config.h>
 
-#include "docstring.h"
-#include "qstring_helpers.h"
-#include "unicode.h"
-#include "lstrings.h"
+#include "support/docstring.h"
+
+#include "support/lstrings.h"
+#include "support/qstring_helpers.h"
+#include "support/unicode.h"
 
 #include <locale>
 #include <iostream>
index 3855794609a1280b5459b34fbd282b15f857355e..1bc4c6105e7357737fd8a592f3d90409ccb44212 100644 (file)
 
 #include <config.h>
 
+#include "support/filetools.h"
+
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/environment.h"
-#include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
 #include "support/Path.h"
 #include "support/Systemcall.h"
 
-// FIXME Interface violation
-#include "gettext.h"
-#include "debug.h"
-
 #include <boost/assert.hpp>
 #include <boost/regex.hpp>
 
@@ -246,7 +245,7 @@ FileName const i18nLibFileSearch(string const & dir, string const & name,
           variable. But we don't use the value if the currently
           selected locale is the C locale. This is a GNU extension.
 
-          Otherwise, w use a trick to guess what gettext has done:
+          Otherwise, w use a trick to guess what support/gettext.has done:
           each po file is able to tell us its name. (JMarc)
        */
 
diff --git a/src/support/gettext.cpp b/src/support/gettext.cpp
new file mode 100644 (file)
index 0000000..ce3a52d
--- /dev/null
@@ -0,0 +1,61 @@
+/**
+ * \file src/gettext.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 <config.h>
+
+#include "support/gettext.h"
+
+#include "support/lstrings.h"
+#include "support/Messages.h"
+
+#ifdef HAVE_LOCALE_H
+#  include <locale.h>
+#endif
+
+using std::string;
+
+
+namespace lyx {
+
+docstring const _(string const & str)
+{
+       return getGuiMessages().get(str);
+}
+
+
+void locale_init()
+{
+#ifdef ENABLE_NLS
+#  ifdef HAVE_LC_MESSAGES
+       setlocale(LC_MESSAGES, "");
+#  endif
+       setlocale(LC_CTYPE, "");
+       Messages::init();
+#endif
+       setlocale(LC_NUMERIC, "C");
+}
+
+
+docstring const translateIfPossible(docstring const & name)
+{
+       if (support::isAscii(name))
+               // Probably from a standard configuration file, try to
+               // translate
+               return _(to_ascii(name));
+       else
+               // This must be from a user defined configuration file. We
+               // cannot translate this, since gettext accepts only ascii
+               // keys.
+               return name;
+}
+
+
+} // namespace lyx
diff --git a/src/support/gettext.h b/src/support/gettext.h
new file mode 100644 (file)
index 0000000..bbec30a
--- /dev/null
@@ -0,0 +1,77 @@
+// -*- C++ -*-
+/**
+ * \file src/support/gettext.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 GETTEXT_H
+#define GETTEXT_H
+
+#include "support/strfwd.h"
+
+
+namespace lyx {
+
+/*
+ * Native Language Support
+ *
+ * The general idea is that any string that should be translated is handled
+ * as follows:
+ *     _("string")
+ *
+ * Static strings are special, obviously and must be flagged as follows:
+ *     static str = N_("string");
+ *
+ * And wherever they are used:
+ *     _(str)
+ *
+ * Every file where there are strings needs:
+ *     #include "support/gettext.h"
+ *
+ * Remember to mention each of these files in "po/POFILES.in"
+ *
+ * The main() needs a locale_init() and a gettext_init() in the beginning.
+ */
+
+/*
+ * General translation notes:
+ *   Commands/options are not translated
+ *   Debug messages are not translated
+ *   Panic/fatal (that should not happen) messages need not be translated
+ */
+
+
+//#ifdef ENABLE_NLS
+
+///
+docstring const _(std::string const &);
+
+//#else // ENABLE_NLS
+
+///
+//#  define _(str) (str)
+
+//#endif
+
+#  define N_(str) (str)              // for detecting static strings
+
+/**
+ * Translate \p name if it is possible.
+ * This should be used to translate strings that come from configuration
+ * files like .ui files. These strings could already be in the native
+ * language if they come from a file in the personal directory. */
+docstring const translateIfPossible(docstring const & name);
+
+///
+void locale_init();
+
+
+} // namespace lyx
+
+#endif
index 13013abdc0d9fc8ec0edab4c10fc9581818ecebc..fe521f3087066708e8d63a647bba143d973ea004 100644 (file)
@@ -28,7 +28,8 @@
 
 #include <config.h>
 
-#include "gzstream.h"
+#include "support/gzstream.h"
+
 #include <iostream>
 #ifdef HAVE_STRING_H
 # include <string.h> // for memcpy
index f3ee53dd2c5f25d259af689e669082a8b4089ad6..4e6f173239c02b5dee4ac6ca852fc3c86fbd1a20 100644 (file)
@@ -18,8 +18,8 @@
 #include <csignal>
 
 #ifdef _WIN32
-#include "debug.h"
-#include "os.h"
+#include "support/debug.h"
+#include "support/os.h"
 
 #include <windows.h>
 #include <cerrno>
index 16d7946ef623fbc6aa09fb52ba41671f4e50d44b..7aeefdfb527528680c351cb17515d2282b5e2355 100644 (file)
 
 #include "support/lstrings.h"
 
-#include "support/lyxlib.h"
 #include "support/convert.h"
+#include "support/debug.h"
+#include "support/lyxlib.h"
 #include "support/qstring_helpers.h"
 #include "support/textutils.h"
 
-#include "debug.h"
-
 #include <boost/tokenizer.hpp>
 #include <boost/assert.hpp>
 
index 4a932bb117bed41c36c08f83091e5f5903ef2c38..488395ac32cad24971552a06fbb4fe2d1d1ab248 100644 (file)
@@ -11,7 +11,7 @@
 #include <config.h>
 
 #include "support/lyxlib.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "support/FileName.h"
 
 #include <boost/crc.hpp>
index 99bb35810fbb6e04d28c1dd744b700433a6eb37c..4d2c55ed378e3862c0d4ce7c520f07e13a1bdcd4 100644 (file)
 #include <config.h>
 
 #if defined(__CYGWIN__) || defined(__CYGWIN32__)
-#include "os_cygwin.cpp"
+#include "support/os_cygwin.cpp"
 #elif defined(_WIN32)
-#include "os_win32.cpp"
+#include "support/os_win32.cpp"
 #else
-#include "os_unix.cpp"
+#include "support/os_unix.cpp"
 #endif
 
 namespace lyx {
index c4c02bea87773b3909ed3bdce74758cadea4b97a..952f038f1a3357adc6dcdeae8923a975fd00f75c 100644 (file)
@@ -15,9 +15,9 @@
 #include <config.h>
 
 #include "support/os.h"
-#include "support/lstrings.h"
 
-#include "debug.h"
+#include "support/lstrings.h"
+#include "support/debug.h"
 
 #include <windows.h>
 #include <io.h>
index 1d8c209d9c919621caebfa0793101a7ca327b436..0b9cc7c024adea1ebbd80c9c70d927b7c7fdcf73 100644 (file)
 
 #include "support/os.h"
 #include "support/os_win32.h"
-#include "support/lstrings.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/filetools.h"
+#include "support/lstrings.h"
 #include "support/ExceptionMessage.h"
 
-#include "debug.h"
-#include "gettext.h"
-
 #include <boost/assert.hpp>
 
 #include <cstdlib>
index 4ad0c76b45f980d027dccfe3fd6eea6d1dc4d585..96ea85fc89863990b0f7f8dbbf644a8b54ea375f 100644 (file)
@@ -29,8 +29,8 @@ bool rename(FileName const & from, FileName const & to)
                if (copy(from, to)) {
                        from.removeFile();
                        return true;
-               } else
-                       return false;
+               }
+               return false;
        }
        return true;
 }
index 662739f2720a16d5628fac0472c6cf14b92a723a..9215228df9cee6d21a7032f06b8fbdbfc5767796 100644 (file)
@@ -39,7 +39,7 @@ int accept(int)
 
 #include "support/lyxlib.h"
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <sys/socket.h>
 #include <sys/un.h>
index e3e8023b7c3a498b7c60ef6697dc3c49a09ade3a..7030c2a72c87c60fa76c7f49c55e897724d62fda 100644 (file)
 #include "support/lyxlib.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/filetools.h"
 #include "support/Package.h"
 
-#include "debug.h"
-
 #include <boost/scoped_array.hpp>
 
 #include <cstdlib>
index f929d5665378ba122c15fb1d9a6f9d407ebf361f..d34f7c8e9080f5914d21d6097831517519a1b013 100644 (file)
@@ -12,9 +12,8 @@
 
 #include <config.h>
 
-#include "unicode.h"
-
-#include "debug.h"
+#include "support/unicode.h"
+#include "support/debug.h"
 
 #include <iconv.h>
 
index da86eb3355b96861dadaf0649ac8ef42197f983d..1b9b3c1a43f0e189b8b8e0be253c6dfa17bfcbc3 100644 (file)
@@ -17,7 +17,7 @@
 #include <boost/assert.hpp>
 
 #if defined (_WIN32)
-# include "gettext.h"
+# include "support/gettext.h"
 # include <windows.h>
 # include <lmcons.h>
 #else
index d66af3f2b4a39a55f9e387fd625854f18e7f8505..e073058e87a3a9a4a503667283c6e2282008bcac 100644 (file)
 
 #include <config.h>
 
-#include "debug.h"
+#include "support/debug.h"
 
 #include <boost/assert.hpp>
 
 #include <cstdlib>
 #include <exception>
+#include <ostream>
 
 
 using std::endl;
index 79630fde70c98c9a01edbf3bfa345136289db817..c49bb929b0ad3d2c7115246c6622af8fd145a81f 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <config.h>
 
-#include "gettext.h"
+#include "support/gettext.h"
 #include "../support/docstring.h"
 
 
index fa0dc3ecf077a2e08ebf4a7dcf2bcdb48c3cd893..32a06c6bde868e717e1b00c1ce217fe77ea36a07 100644 (file)
 #include "tex2lyx.h"
 #include "Context.h"
 
-#include "debug.h"
 #include "TextClass.h"
 #include "Layout.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
+#include "support/ExceptionMessage.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/ExceptionMessage.h"
 #include "support/os.h"
 #include "support/Package.h"
 #include "support/unicode.h"
@@ -61,10 +61,9 @@ using support::onlyPath;
 using support::os::internal_path;
 using support::rtrim;
 
-LayoutPtr captionlayout;
 
 // Hacks to allow the thing to link in the lyxlayout stuff
-LyXErr lyxerr(std::cerr.rdbuf());
+LayoutPtr captionlayout;
 
 
 string const trim(string const & a, char const * p)
@@ -99,7 +98,7 @@ void split(string const & s, vector<string> & result, char delim)
 string join(vector<string> const & input, char const * delim)
 {
        ostringstream os;
-       for (size_t i = 0; i < input.size(); ++i) {
+       for (size_t i = 0; i != input.size(); ++i) {
                if (i)
                        os << delim;
                os << input[i];
@@ -170,7 +169,8 @@ namespace {
 /*!
  * Read one command definition from the syntax file
  */
-void read_command(Parser & p, string command, CommandMap & commands) {
+void read_command(Parser & p, string command, CommandMap & commands)
+{
        if (p.next_token().asInput() == "*") {
                p.get_token();
                command += '*';
@@ -497,6 +497,8 @@ int main(int argc, char * argv[])
 {
        using namespace lyx;
 
+       lyxerr.setStream(std::cerr);
+
        easyParse(argc, argv);
 
        if (argc <= 1) {
index 6027f9a06cb1b963b3f2232e4112dfd628140837..ccd44281f96c584a1ab49c4246bedb9b29de3a41 100644 (file)
@@ -7,9 +7,6 @@
  * \author Jean-Marc Lasgouttes
  *
  * Full author contact details are available in file CREDITS.
- *
- * Warning! This file is autogenerated from version.cpp.in.
- * All changes to this file will be lost.
  */
 
 #include <config.h>