]> git.lyx.org Git - lyx.git/commitdiff
Rename ascii to plaintext and LatexRunParams to OutputParams.
authorJosé Matox <jamatos@lyx.org>
Wed, 5 Nov 2003 12:06:20 +0000 (12:06 +0000)
committerJosé Matox <jamatos@lyx.org>
Wed, 5 Nov 2003 12:06:20 +0000 (12:06 +0000)
Create new files for each output format.

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

119 files changed:
src/ChangeLog
src/LaTeX.C
src/LaTeX.h
src/Makefile.am
src/buffer.C
src/buffer.h
src/bufferlist.C
src/bufferlist.h
src/bufferparams.C
src/converter.C
src/converter.h
src/exporter.C
src/graphics/ChangeLog
src/graphics/PreviewLoader.C
src/insets/ChangeLog
src/insets/inset.h
src/insets/insetbibtex.C
src/insets/insetbibtex.h
src/insets/insetbox.C
src/insets/insetbox.h
src/insets/insetbranch.C
src/insets/insetbranch.h
src/insets/insetcaption.C
src/insets/insetcaption.h
src/insets/insetcite.C
src/insets/insetcite.h
src/insets/insetcollapsable.C
src/insets/insetcollapsable.h
src/insets/insetcommand.C
src/insets/insetcommand.h
src/insets/insetenv.C
src/insets/insetenv.h
src/insets/insetert.C
src/insets/insetert.h
src/insets/insetexternal.C
src/insets/insetexternal.h
src/insets/insetfloat.C
src/insets/insetfloat.h
src/insets/insetfloatlist.C
src/insets/insetfloatlist.h
src/insets/insetfoot.C
src/insets/insetfoot.h
src/insets/insetgraphics.C
src/insets/insetgraphics.h
src/insets/insethfill.C
src/insets/insethfill.h
src/insets/insetinclude.C
src/insets/insetinclude.h
src/insets/insetindex.C
src/insets/insetindex.h
src/insets/insetlabel.C
src/insets/insetlabel.h
src/insets/insetlatexaccent.C
src/insets/insetlatexaccent.h
src/insets/insetline.C
src/insets/insetline.h
src/insets/insetlist.C
src/insets/insetlist.h
src/insets/insetmarginal.C
src/insets/insetmarginal.h
src/insets/insetminipage.C
src/insets/insetminipage.h
src/insets/insetnewline.C
src/insets/insetnewline.h
src/insets/insetnote.C
src/insets/insetnote.h
src/insets/insetoptarg.C
src/insets/insetoptarg.h
src/insets/insetpagebreak.C
src/insets/insetpagebreak.h
src/insets/insetquotes.C
src/insets/insetquotes.h
src/insets/insetref.C
src/insets/insetref.h
src/insets/insetspace.C
src/insets/insetspace.h
src/insets/insetspecialchar.C
src/insets/insetspecialchar.h
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/insets/insettheorem.C
src/insets/insettheorem.h
src/insets/insettoc.C
src/insets/insettoc.h
src/insets/inseturl.C
src/insets/inseturl.h
src/insets/insetwrap.C
src/insets/insetwrap.h
src/latexrunparams.h [deleted file]
src/mathed/ChangeLog
src/mathed/formula.C
src/mathed/formula.h
src/mathed/formulamacro.C
src/mathed/formulamacro.h
src/mathed/math_inset.C
src/mathed/math_inset.h
src/mathed/ref_inset.C
src/mathed/ref_inset.h
src/output.C [new file with mode: 0644]
src/output.h [new file with mode: 0644]
src/output_docbook.C [new file with mode: 0644]
src/output_docbook.h [new file with mode: 0644]
src/output_latex.C [new file with mode: 0644]
src/output_latex.h [new file with mode: 0644]
src/output_linuxdoc.C [new file with mode: 0644]
src/output_linuxdoc.h [new file with mode: 0644]
src/output_plaintext.C [new file with mode: 0644]
src/output_plaintext.h [new file with mode: 0644]
src/outputparams.h [new file with mode: 0644]
src/paragraph.C
src/paragraph.h
src/paragraph_funcs.C
src/paragraph_funcs.h
src/paragraph_pimpl.C
src/paragraph_pimpl.h
src/tabular.C
src/tabular.h

index cd98cdcac8d226d02e3f7c0158dfe27da9efffa1..7c7fdfcb845d1f5eb993395c3b9f0fcac6d15bef 100644 (file)
@@ -1,3 +1,27 @@
+2003-11-05  José Matos  <jamatos@lyx.org>
+
+       * output_docbook.[Ch]:
+       * output_latex.[Ch]:
+       * output_linuxdoc.[Ch]:
+       * output_plaintext.[Ch]: New files for output formats.
+       * output.[Ch]: New file for helper functions.
+
+       * buffer.[Ch]:
+       * paragraph_funcs.[Ch]: output functions moved to new files.
+
+       * outputparams.h: rename of latexrunparams.h
+
+       * LaTeX.[Ch]:
+       * buffer.[Ch]:
+       * bufferlist.[Ch]:
+       * converter.[Ch]:
+       * exporter.C:
+       * paragraph.[Ch]:
+       * paragraph_funcs.[Ch]:
+       * paragraph_pimpl.[Ch]:
+       * tabular.[Ch]: rename ascii to plaintext
+       and LatexRunParams to OutputParams.
+       
 2003-11-05  Alfredo Braunstein  <abraunst@libero.it>
 
        * iterators.[Ch] (text): require bv argument
index 4230c72c00274e007ee8f99052daaf6ae4cb8902..9fd1f9dbdf6a6618d3323fd3f86e9aa417d52c1e 100644 (file)
@@ -120,7 +120,7 @@ bool operator!=(Aux_Info const & a, Aux_Info const & o)
  * CLASS LaTeX
  */
 
-LaTeX::LaTeX(string const & latex, LatexRunParams const & rp,
+LaTeX::LaTeX(string const & latex, OutputParams const & rp,
             string const & f, string const & p)
        : cmd(latex), file(f), path(p), runparams(rp)
 {
index 2c358795a7d9db0de106b8ce30a4eb14a49aacf3..7675e039fd4f144668934c1eac5927acb4d47edc 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef LATEX_H
 #define LATEX_H
 
-#include "latexrunparams.h"
+#include "outputparams.h"
 
 #include <boost/utility.hpp>
 #include <boost/signals/signal1.hpp>
@@ -132,7 +132,7 @@ public:
           cmd = the latex command, file = name of the (temporary) latex file,
           path = name of the files original path.
        */
-       LaTeX(std::string const & cmd, LatexRunParams const &,
+       LaTeX(std::string const & cmd, OutputParams const &,
              std::string const & file, std::string const & path);
 
        /// runs LaTeX several times
@@ -192,7 +192,7 @@ private:
        std::string output_file;
 
        ///
-       LatexRunParams runparams;
+       OutputParams runparams;
 };
 
 #endif
index 25ff4213c9286e492ec677220a5cf311849ded69..c54871bcd4f4331789b8aa819b64a9b765cad407 100644 (file)
@@ -87,7 +87,6 @@ lyx_SOURCES = \
        LaTeX.h \
        LaTeXFeatures.C \
        LaTeXFeatures.h \
-       latexrunparams.h \
        LyXAction.C \
        LyXAction.h \
        MenuBackend.C \
@@ -223,6 +222,17 @@ lyx_SOURCES = \
        messages.h \
        metricsinfo.C \
        metricsinfo.h \
+       output.C \
+       output.h \
+       outputparams.h \
+       output_docbook.C \
+       output_docbook.h \
+       output_latex.C \
+       output_latex.h \
+       output_linuxdoc.C \
+       output_linuxdoc.h \
+       output_plaintext.C \
+       output_plaintext.h \
        paper.h \
        paragraph.C \
        paragraph.h \
index 6c55642d374a68a5c2feefb00148d7d4884a2564..2cc84449377e59820af902e1ba9c5f19b8e67cb9 100644 (file)
 #include "lyxrc.h"
 #include "lyxvc.h"
 #include "messages.h"
+#include "output.h"
+#include "output_docbook.h"
+#include "output_latex.h"
+#include "output_linuxdoc.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
@@ -128,19 +132,6 @@ namespace {
 
 const int LYX_FORMAT = 225;
 
-bool openFileWrite(ofstream & ofs, string const & fname)
-{
-       ofs.open(fname.c_str());
-       if (!ofs) {
-               string const file = MakeDisplayPath(fname, 50);
-               string text = bformat(_("Could not open the specified "
-                                       "document\n%1$s."), file);
-               Alert::error(_("Could not open file"), text);
-               return false;
-       }
-       return true;
-}
-
 } // namespace anon
 
 
@@ -884,36 +875,15 @@ bool Buffer::do_writeFile(ostream & ofs) const
 }
 
 
-void Buffer::writeFileAscii(string const & fname, LatexRunParams const & runparams)
-{
-       ofstream ofs;
-       if (!::openFileWrite(ofs, fname))
-               return;
-       writeFileAscii(ofs, runparams);
-}
-
-
-void Buffer::writeFileAscii(ostream & os, LatexRunParams const & runparams)
-{
-       ParagraphList::iterator beg = paragraphs().begin();
-       ParagraphList::iterator end = paragraphs().end();
-       ParagraphList::iterator it = beg;
-       for (; it != end; ++it) {
-               asciiParagraph(*this, *it, os, runparams, it == beg);
-       }
-       os << "\n";
-}
-
-
 void Buffer::makeLaTeXFile(string const & fname,
                           string const & original_path,
-                          LatexRunParams const & runparams,
+                          OutputParams const & runparams,
                           bool output_preamble, bool output_body)
 {
        lyxerr[Debug::LATEX] << "makeLaTeXFile..." << endl;
 
        ofstream ofs;
-       if (!::openFileWrite(ofs, fname))
+       if (!openFileWrite(ofs, fname))
                return;
 
        makeLaTeXFile(ofs, original_path,
@@ -928,10 +898,10 @@ void Buffer::makeLaTeXFile(string const & fname,
 
 void Buffer::makeLaTeXFile(ostream & os,
                           string const & original_path,
-                          LatexRunParams const & runparams_in,
+                          OutputParams const & runparams_in,
                           bool output_preamble, bool output_body)
 {
-       LatexRunParams runparams = runparams_in;
+       OutputParams runparams = runparams_in;
        niceFile() = runparams.nice; // this will be used by Insetincludes.
 
        // validate the buffer.
@@ -1068,11 +1038,11 @@ bool Buffer::isSGML() const
 
 
 void Buffer::makeLinuxDocFile(string const & fname,
-                             LatexRunParams const & runparams,
+                             OutputParams const & runparams,
                              bool body_only )
 {
        ofstream ofs;
-       if (!::openFileWrite(ofs, fname))
+       if (!openFileWrite(ofs, fname))
                return;
 
        niceFile() = runparams.nice; // this will be used by included files.
@@ -1131,11 +1101,11 @@ void Buffer::makeLinuxDocFile(string const & fname,
 
 
 void Buffer::makeDocBookFile(string const & fname,
-                            LatexRunParams const & runparams,
+                            OutputParams const & runparams,
                             bool only_body)
 {
        ofstream ofs;
-       if (!::openFileWrite(ofs, fname))
+       if (!openFileWrite(ofs, fname))
                return;
 
        niceFile() = runparams.nice; // this will be used by Insetincludes.
@@ -1210,8 +1180,8 @@ int Buffer::runChktex()
        message(_("Running chktex..."));
 
        // Generate the LaTeX file if neccessary
-       LatexRunParams runparams;
-       runparams.flavor = LatexRunParams::LATEX;
+       OutputParams runparams;
+       runparams.flavor = OutputParams::LATEX;
        runparams.nice = false;
        makeLaTeXFile(name, org_path, runparams);
 
index 5b3de3e38be7328c5422b862acf85e88047468fe..27c9dd29f8ef5db49692ff36babae8033cb10f0f 100644 (file)
@@ -36,7 +36,7 @@ class LyXLex;
 class LyXRC;
 class LyXVC;
 class LaTeXFeatures;
-class LatexRunParams;
+class OutputParams;
 class Language;
 class Messages;
 class ParIterator;
@@ -135,28 +135,28 @@ public:
        bool writeFile(std::string const &) const;
 
        ///
-       void writeFileAscii(std::string const &, LatexRunParams const &);
+       void writeFileAscii(std::string const &, OutputParams const &);
        ///
-       void writeFileAscii(std::ostream &, LatexRunParams const &);
+       void writeFileAscii(std::ostream &, OutputParams const &);
        /// Just a wrapper for the method below, first creating the ofstream.
        void makeLaTeXFile(std::string const & filename,
                           std::string const & original_path,
-                          LatexRunParams const &,
+                          OutputParams const &,
                           bool output_preamble = true,
                           bool output_body = true);
        ///
        void makeLaTeXFile(std::ostream & os,
                           std::string const & original_path,
-                          LatexRunParams const &,
+                          OutputParams const &,
                           bool output_preamble = true,
                           bool output_body = true);
        ///
        void makeLinuxDocFile(std::string const & filename,
-                             LatexRunParams const & runparams_in,
+                             OutputParams const & runparams_in,
                              bool only_body = false);
        ///
        void makeDocBookFile(std::string const & filename,
-                            LatexRunParams const & runparams_in,
+                            OutputParams const & runparams_in,
                             bool only_body = false);
        /// returns the main language for the buffer (document)
        Language const * getLanguage() const;
index a5b0c820eaa89789ba324826139669a24d679abc..20a0a72e05fb429c9bfefeb33e60285b4f31a8a0 100644 (file)
@@ -20,6 +20,7 @@
 #include "lastfiles.h"
 #include "lyx_cb.h"
 #include "lyx_main.h"
+#include "output_latex.h"
 #include "paragraph.h"
 
 #include "frontends/Alert.h"
@@ -214,7 +215,7 @@ Buffer * BufferList::getBuffer(unsigned int choice)
 
 
 void BufferList::updateIncludedTeXfiles(string const & mastertmpdir,
-                                       LatexRunParams const & runparams)
+                                       OutputParams const & runparams)
 {
        BufferStorage::iterator it = bstore.begin();
        BufferStorage::iterator end = bstore.end();
index ad3ae4da8ccca7b4d995f545cef954cb8c2969e9..5d8ddab2e4828699f08ef89c65430ba60ff68571 100644 (file)
@@ -18,7 +18,7 @@
 #include <vector>
 
 class Buffer;
-class LatexRunParams;
+class OutputParams;
 
 /**
  * The class holds all all open buffers, and handles construction
@@ -44,7 +44,7 @@ public:
        std::vector<std::string> const getFileNames() const;
 
        /// FIXME
-       void updateIncludedTeXfiles(std::string const &, LatexRunParams const &);
+       void updateIncludedTeXfiles(std::string const &, OutputParams const &);
 
        /// emergency save for all buffers
        void emergencyWriteAll();
index 243fd69b42f362a46d04dfc23bd1177b64082280..2f3d5147cbb7ff2e403816122ffaacfc4f2a0fe9 100644 (file)
 #include "gettext.h"
 #include "language.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "lyxtextclasslist.h"
+#include "outputparams.h"
 #include "tex-strings.h"
 #include "Spacing.h"
 #include "texrow.h"
index 370843056bf2a18ce44abe252813bc62dd0746c0..906678fe1ab3778608f31296bf02858c4c64b532 100644 (file)
@@ -283,9 +283,9 @@ bool Converters::convert(Buffer const * buffer,
        if (edgepath.empty()) {
                return false;
        }
-       LatexRunParams runparams;
+       OutputParams runparams;
        runparams.flavor = usePdflatex(edgepath) ?
-               LatexRunParams::PDFLATEX : LatexRunParams::LATEX;
+               OutputParams::PDFLATEX : OutputParams::LATEX;
 
        string path = OnlyPath(from_file);
        Path p(path);
@@ -492,8 +492,8 @@ bool Converters::formatIsUsed(string const & format)
 bool Converters::scanLog(Buffer const & buffer, string const & /*command*/,
                         string const & filename)
 {
-       LatexRunParams runparams;
-       runparams.flavor = LatexRunParams::LATEX;
+       OutputParams runparams;
+       runparams.flavor = OutputParams::LATEX;
        LaTeX latex("", runparams, filename, "");
        TeXErrors terr;
        int result = latex.scanLogFile(terr);
@@ -521,7 +521,7 @@ private:
 
 
 bool Converters::runLaTeX(Buffer const & buffer, string const & command,
-                         LatexRunParams const & runparams)
+                         OutputParams const & runparams)
 {
        buffer.busy(true);
        buffer.message(_("Running LaTeX..."));
index a244198e8bee46b7daff7a1b4e47737b6d342779..b24f017e79d578c0b00d6ebd8aeea227a3cca781 100644 (file)
@@ -21,7 +21,7 @@
 class Buffer;
 class Format;
 class Formats;
-class LatexRunParams;
+class OutputParams;
 
 
 ///
@@ -132,7 +132,7 @@ private:
                     std::string const & filename);
        ///
        bool runLaTeX(Buffer const & buffer, std::string const & command,
-                     LatexRunParams const &);
+                     OutputParams const &);
        ///
        ConverterList converterlist_;
        ///
index 1d386a2a6d6dd2ae9a3d6503319aa14057b079ba..dc267c0349f35326f27c1af5842f0d4b25e3f207 100644 (file)
@@ -24,9 +24,9 @@
 #include "converter.h"
 #include "format.h"
 #include "gettext.h"
-#include "latexrunparams.h"
 #include "lyxrc.h"
-
+#include "output_plaintext.h"
+#include "outputparams.h"
 #include "frontends/Alert.h"
 
 #include "support/filetools.h"
@@ -60,8 +60,8 @@ bool Exporter::Export(Buffer * buffer, string const & format,
                      bool put_in_tempdir, string & result_file)
 {
        string backend_format;
-       LatexRunParams runparams;
-       runparams.flavor = LatexRunParams::LATEX;
+       OutputParams runparams;
+       runparams.flavor = OutputParams::LATEX;
        runparams.linelen = lyxrc.ascii_linelen;
        vector<string> backends = Backends(*buffer);
        if (find(backends.begin(), backends.end(), format) == backends.end()) {
@@ -71,7 +71,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
                                converters.getPath(*it, format);
                        if (!p.empty()) {
                                if (converters.usePdflatex(p))
-                                       runparams.flavor = LatexRunParams::PDFLATEX;
+                                       runparams.flavor = OutputParams::PDFLATEX;
                                backend_format = *it;
                                break;
                        }
@@ -93,7 +93,7 @@ bool Exporter::Export(Buffer * buffer, string const & format,
 
        // Ascii backend
        if (backend_format == "text")
-               buffer->writeFileAscii(filename, runparams);
+               writeFileAscii(*buffer, filename, runparams);
        // Linuxdoc backend
        else if (buffer->isLinuxDoc()) {
                runparams.nice = !put_in_tempdir;
index 4ee0957f453634db9bced804fb07c2ff73cb7366..c9677cb26fac48c2a33fbef5fd82c17a9ce0dbfa 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-05  José Matos  <jamatos@lyx.org>
+
+       * PreviewLoader.C (dumpPreamble): rename ascii to plaintext
+       and LatexRunParams to OutputParams.
+
 2003-10-22  Angus Leeming  <leeming@lyx.org>
 
        * PreviewImage.C (statusChanged): always pass on the signal, not just
index 370b0fd1543d601517d615629b45dc641b69a94c..255c44322faef028aff31a72150b3afc0ba5a302 100644 (file)
@@ -17,9 +17,9 @@
 #include "converter.h"
 #include "debug.h"
 #include "format.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxrc.h"
+#include "outputparams.h"
 
 #include "frontends/lyx_gui.h" // hexname
 
@@ -570,8 +570,8 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
        // Why on earth is Buffer::makeLaTeXFile a non-const method?
        Buffer & tmp = const_cast<Buffer &>(buffer_);
        // Dump the preamble only.
-       LatexRunParams runparams;
-       runparams.flavor = LatexRunParams::LATEX;
+       OutputParams runparams;
+       runparams.flavor = OutputParams::LATEX;
        runparams.nice = true;
        runparams.moving_arg = true;
        runparams.free_spacing = true;
@@ -580,7 +580,7 @@ void PreviewLoader::Impl::dumpPreamble(ostream & os) const
        // FIXME! This is a HACK! The proper fix is to control the 'true'
        // passed to WriteStream below:
        // int InsetFormula::latex(Buffer const &, ostream & os,
-       //                         LatexRunParams const & runparams) const
+       //                         OutputParams const & runparams) const
        // {
        //      WriteStream wi(os, runparams.moving_arg, true);
        //      par_->write(wi);
index 6a5a301589b62064c7b35eb31557d721dcb09696..2778f6cff4911a66a4c77e0010b05a9d244a96a9 100644 (file)
@@ -1,3 +1,45 @@
+2003-11-05  José Matos  <jamatos@lyx.org>
+
+       * inset.h:
+       * insetbibtex.[Ch]:
+       * insetbox.[Ch]:
+       * insetbranch.[Ch]:
+       * insetcaption.[Ch]:
+       * insetcite.[Ch]:
+       * insetcollapsable.[Ch]:
+       * insetcommand.[Ch]:
+       * insetenv.[Ch]:
+       * insetert.[Ch]:
+       * insetexternal.[Ch]:
+       * insetfloat.[Ch]:
+       * insetfloatlist.[Ch]:
+       * insetfoot.[Ch]:
+       * insetgraphics.[Ch]:
+       * insethfill.[Ch]:
+       * insetinclude.[Ch]:
+       * insetindex.[Ch]:
+       * insetlabel.[Ch]:
+       * insetlatexaccent.[Ch]:
+       * insetline.[Ch]:
+       * insetlist.[Ch]:
+       * insetmarginal.[Ch]:
+       * insetminipage.[Ch]:
+       * insetnewline.[Ch]:
+       * insetnote.[Ch]:
+       * insetoptarg.[Ch]:
+       * insetpagebreak.[Ch]:
+       * insetquotes.[Ch]:
+       * insetref.[Ch]:
+       * insetspace.[Ch]:
+       * insetspecialchar.[Ch]:
+       * insettabular.[Ch]:
+       * insettext.[Ch]:
+       * insettheorem.[Ch]:
+       * insettoc.[Ch]:
+       * inseturl.[Ch]:
+       * insetwrap.[Ch]: rename ascii to plaintext
+       and LatexRunParams to OutputParams.
+
 2003-11-05  Alfredo Braunstein  <abraunst@libero.it>
 
        * insetcollapsable.C (edit): add open() all
index 65ea2bd2309881c055402c85bcf777dcdd5b61f1..18631a849361d4a9cae1b40d13f334843ab6b722 100644 (file)
@@ -23,7 +23,7 @@
 class Buffer;
 class LColor_color;
 class FuncRequest;
-class LatexRunParams;
+class OutputParams;
 class LyXCursor;
 class LyXFont;
 class LyXLex;
@@ -181,16 +181,16 @@ public:
        virtual void read(Buffer const &, LyXLex & lex) = 0;
        /// returns the number of rows (\n's) of generated tex code.
        virtual int latex(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const = 0;
+                         OutputParams const &) const = 0;
        ///
-       virtual int ascii(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const = 0;
+       virtual int plaintext(Buffer const &, std::ostream &,
+                         OutputParams const &) const = 0;
        ///
        virtual int linuxdoc(Buffer const &, std::ostream &,
-                            LatexRunParams const &) const = 0;
+                            OutputParams const &) const = 0;
        ///
        virtual int docbook(Buffer const &, std::ostream &,
-                           LatexRunParams const &) const = 0;
+                           OutputParams const &) const = 0;
 
        /// returns LyX code associated with the inset. Used for TOC, ...)
        virtual InsetOld::Code lyxCode() const { return NO_CODE; }
index 69a40df55ee39e785bb51a32d8b68f589714c7b5..0dbbed0c56d9337feba15637d9c45d3933f5a535 100644 (file)
@@ -18,8 +18,8 @@
 #include "debug.h"
 #include "funcrequest.h"
 #include "gettext.h"
-#include "latexrunparams.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
 #include "support/filetools.h"
 #include "support/lstrings.h"
@@ -133,7 +133,7 @@ string const InsetBibtex::getScreenLabel(Buffer const &) const
 
 
 int InsetBibtex::latex(Buffer const & buffer, ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        // changing the sequence of the commands
        // 1. \bibliographystyle{style}
index 2554b48fef3b17c8f025675229e5a8a9f704c3e0..049c895279d7952974213040a40b979976379e9d 100644 (file)
@@ -40,7 +40,7 @@ public:
        bool display() const { return true; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        void fillWithBibKeys(Buffer const & buffer,
                std::vector<std::pair<std::string,std::string> > & keys) const;
index 4a8ef7aa01fc90eaaf87edd8f2b48c73d882a33c..167ce31955c51cc658318a33b6316e394079cea7 100644 (file)
@@ -204,7 +204,7 @@ InsetBox::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetBox::latex(Buffer const & buf, ostream & os,
-                               LatexRunParams const & runparams) const
+                               OutputParams const & runparams) const
 {
        BoxType btype = boxtranslator().find(params_.type);
 
@@ -333,21 +333,21 @@ int InsetBox::latex(Buffer const & buf, ostream & os,
 
 
 int InsetBox::linuxdoc(Buffer const & buf, std::ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        return inset.linuxdoc(buf, os, runparams);
 }
 
 
 int InsetBox::docbook(Buffer const & buf, std::ostream & os,
-                     LatexRunParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        return inset.docbook(buf, os, runparams);
 }
 
 
-int InsetBox::ascii(Buffer const & buf, std::ostream & os,
-                   LatexRunParams const & runparams) const
+int InsetBox::plaintext(Buffer const & buf, std::ostream & os,
+                   OutputParams const & runparams) const
 {
        int i = 0;
        string const pt = params_.type;
@@ -372,7 +372,7 @@ int InsetBox::ascii(Buffer const & buf, std::ostream & os,
                break;
        }
 
-       i = inset.ascii(buf, os, runparams);
+       i = inset.plaintext(buf, os, runparams);
 
        switch (btype) {
                case Frameless:
index 7a1604f2df1937e41ca98be84cea8d21659a4b5a..70baad6188320b3be485c45665f7766689541427 100644 (file)
@@ -79,16 +79,16 @@ public:
        bool showInsetDialog(BufferView * bv) const;
        ///
        int latex(Buffer const &, std::ostream &,
-                       LatexRunParams const &) const;
+                       OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
index 29189e9ce1821e68669b047962e0303f0c2ea1ef..b8cc58517ad20fa954fd2d60178a6b7ac1427ae3 100644 (file)
@@ -155,7 +155,7 @@ InsetBranch::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetBranch::latex(Buffer const & buf, ostream & os,
-       LatexRunParams const & runparams) const
+       OutputParams const & runparams) const
 {
        string const branch_sel = buf.params().branchlist().allSelected();
        if (branch_sel.find(params_.branch, 0) != string::npos)
@@ -165,7 +165,7 @@ int InsetBranch::latex(Buffer const & buf, ostream & os,
 
 
 int InsetBranch::linuxdoc(Buffer const & buf, std::ostream & os,
-                         LatexRunParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        string const branch_sel = buf.params().branchlist().allSelected();
        if (branch_sel.find(params_.branch, 0) != string::npos)
@@ -175,7 +175,7 @@ int InsetBranch::linuxdoc(Buffer const & buf, std::ostream & os,
 
 
 int InsetBranch::docbook(Buffer const & buf, std::ostream & os,
-                        LatexRunParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        string const branch_sel = buf.params().branchlist().allSelected();
        if (branch_sel.find(params_.branch, 0) != string::npos)
@@ -184,12 +184,12 @@ int InsetBranch::docbook(Buffer const & buf, std::ostream & os,
 }
 
 
-int InsetBranch::ascii(Buffer const & buf, std::ostream & os,
-                      LatexRunParams const & runparams) const
+int InsetBranch::plaintext(Buffer const & buf, std::ostream & os,
+                      OutputParams const & runparams) const
 {
        string const branch_sel = buf.params().branchlist().allSelected();
        if (branch_sel.find(params_.branch, 0) != string::npos) {
-               return inset.ascii(buf, os, runparams);
+               return inset.plaintext(buf, os, runparams);
        }
        return 0;
 }
index 2422ef171add3c6dad8962dad61cf263c2b1a306..a1d710b3c8c54c9466dc1accda42af4d1b05ae55 100644 (file)
@@ -55,16 +55,16 @@ public:
        bool showInsetDialog(BufferView *) const;
        ///
        int latex(Buffer const &, std::ostream &,
-                       LatexRunParams const &) const;
+                       OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const & runparams) const;
+                   OutputParams const & runparams) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
index 5b282dbd1626ef7d76ca529cd805360e5f37d30a..132af638fc50e37bb6beb0066f23168d2e71fa6a 100644 (file)
@@ -113,7 +113,7 @@ void InsetCaption::draw(PainterInfo & pi, int x, int y) const
 
 
 int InsetCaption::latex(Buffer const & buf, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        // This is a bit too simplistic to take advantage of
        // caption options we must add more later. (Lgb)
@@ -127,8 +127,8 @@ int InsetCaption::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetCaption::ascii(Buffer const & /*buf*/,ostream & /*os*/,
-                       LatexRunParams const & /*runparams*/) const
+int InsetCaption::plaintext(Buffer const & /*buf*/,ostream & /*os*/,
+                       OutputParams const & /*runparams*/) const
 {
        // FIX: Implement me!
        return 0;
@@ -136,7 +136,7 @@ int InsetCaption::ascii(Buffer const & /*buf*/,ostream & /*os*/,
 
 
 int InsetCaption::docbook(Buffer const & buf, ostream & os,
-                         LatexRunParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        int ret;
        os << "<title>";
index f1d4cea05468cd6c58fd4f35e6ca1487024534ab..40f906cfaf196670e74500807d049a1bd71c6730 100644 (file)
@@ -35,13 +35,13 @@ public:
        virtual void draw(PainterInfo & pi, int x, int y) const;
        ///
        virtual int latex(Buffer const & buf, std::ostream & os,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
        ///
-       int ascii(Buffer const & buf, std::ostream & os,
-                 LatexRunParams const & runparams) const;
+       int plaintext(Buffer const & buf, std::ostream & os,
+                 OutputParams const & runparams) const;
        ///
        int docbook(Buffer const & buf, std::ostream & os,
-                   LatexRunParams const & runparams) const;
+                   OutputParams const & runparams) const;
 };
 
 
index 8d8ba89afd62f8e8f8e46650f9e63e58de0a3077..ba8f9ca2f29df03d7100e9fae2079696d7aa08d6 100644 (file)
@@ -325,7 +325,7 @@ InsetCitation::priv_dispatch(FuncRequest const & cmd,
 }
                
 
-int InsetCitation::ascii(Buffer const & buffer, ostream & os, int) const
+int InsetCitation::plaintext(Buffer const & buffer, ostream & os, int) const
 {
        if (cache.params == params() && cache.style == getStyle(buffer))
                os << cache.generated_label;
@@ -340,7 +340,7 @@ int InsetCitation::ascii(Buffer const & buffer, ostream & os, int) const
 // citations and then changes his mind, turning natbib support off. The output
 // should revert to \cite[]{}
 int InsetCitation::latex(Buffer const & buffer, ostream & os,
-                        LatexRunParams const &) const
+                        OutputParams const &) const
 {
        os << "\\";
        if (buffer.params().use_natbib)
index b26fe970e68136426c30ec7126b885e23efca9f3..6cb9b5e2f10bdd19274d3cc7b0d1301e90955e80 100644 (file)
@@ -35,10 +35,10 @@ public:
        ///
        InsetOld::Code lyxCode() const { return InsetOld::CITE_CODE; }
        ///
-       int ascii(Buffer const &, std::ostream &, int linelen) const;
+       int plaintext(Buffer const &, std::ostream &, int linelen) const;
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
 protected:
index 5d148b4fd06788dd0f3ab9fb04c77ef3405ea7fc..4e105fe9ce282446bb68980a2ddaad8c129a7403 100644 (file)
@@ -241,28 +241,28 @@ void InsetCollapsable::lfunMouseRelease(FuncRequest const & cmd)
 
 
 int InsetCollapsable::latex(Buffer const & buf, ostream & os,
-                           LatexRunParams const & runparams) const
+                           OutputParams const & runparams) const
 {
        return inset.latex(buf, os, runparams);
 }
 
 
-int InsetCollapsable::ascii(Buffer const & buf, ostream & os,
-                           LatexRunParams const & runparams) const
+int InsetCollapsable::plaintext(Buffer const & buf, ostream & os,
+                           OutputParams const & runparams) const
 {
-       return inset.ascii(buf, os, runparams);
+       return inset.plaintext(buf, os, runparams);
 }
 
 
 int InsetCollapsable::linuxdoc(Buffer const & buf, ostream & os,
-                              LatexRunParams const & runparams) const
+                              OutputParams const & runparams) const
 {
        return inset.linuxdoc(buf, os, runparams);
 }
 
 
 int InsetCollapsable::docbook(Buffer const & buf, ostream & os,
-                             LatexRunParams const & runparams) const
+                             OutputParams const & runparams) const
 {
        return inset.docbook(buf, os, runparams);
 }
index ead9ce94255c4fa08a16714ad5c9285097ef9a34..cae30c8954fd07ef73d23aa0b1612821206b6e61 100644 (file)
@@ -69,16 +69,16 @@ public:
        int insetInInsetY() const;
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const & runparams) const;
+                   OutputParams const & runparams) const;
        ///
        void validate(LaTeXFeatures & features) const;
        /// FIXME, document
index 27f44991e646e117f4a3275fa199f825da22161d..544d25a7da1a835d95fd66c63c66ce4c7f3c82cd 100644 (file)
@@ -60,29 +60,29 @@ void InsetCommand::setParams(InsetCommandParams const & p)
 
 
 int InsetCommand::latex(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        os << getCommand();
        return 0;
 }
 
 
-int InsetCommand::ascii(Buffer const &, ostream &,
-                       LatexRunParams const &) const
+int InsetCommand::plaintext(Buffer const &, ostream &,
+                       OutputParams const &) const
 {
        return 0;
 }
 
 
 int InsetCommand::linuxdoc(Buffer const &, ostream &,
-                          LatexRunParams const &) const
+                          OutputParams const &) const
 {
        return 0;
 }
 
 
 int InsetCommand::docbook(Buffer const &, ostream &,
-                         LatexRunParams const &) const
+                         OutputParams const &) const
 {
        return 0;
 }
index 09778451a64a3af97351204dd1aa3716d52e5e58..749d41579f34239a1042e883e020cea2395ca489 100644 (file)
@@ -46,16 +46,16 @@ public:
        void scanCommand(std::string const & c) { p_.scanCommand(c); };
        ///
        virtual int latex(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        virtual int linuxdoc(Buffer const &, std::ostream &,
-                            LatexRunParams const &) const;
+                            OutputParams const &) const;
        ///
        virtual int docbook(Buffer const &, std::ostream &,
-                           LatexRunParams const & runparams) const;
+                           OutputParams const & runparams) const;
        ///
        InsetOld::Code lyxCode() const { return InsetOld::NO_CODE; }
 
index 88f414efe8c19febcbc448d6a029ca31bae927ec..92529d569087f703abac12d2234eacadd1134334 100644 (file)
@@ -15,7 +15,7 @@
 #include "bufferparams.h"
 #include "gettext.h"
 #include "paragraph.h"
-#include "paragraph_funcs.h"
+#include "output_latex.h"
 #include "texrow.h"
 
 #include "support/std_ostream.h"
@@ -67,7 +67,7 @@ string const InsetEnvironment::editMessage() const
 
 
 int InsetEnvironment::latex(Buffer const & buf, ostream & os,
-                           LatexRunParams const & runparams) const
+                           OutputParams const & runparams) const
 {
        os << layout_->latexheader;
        TexRow texrow;
index a53126d97af8c86926b07aa6ebef43428e41001d..8aa9079cb97e002f515e22ed6ff8693bdaaee452 100644 (file)
@@ -31,7 +31,7 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::ENVIRONMENT_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        std::string const editMessage() const;
        ///
index 96358be220e102b2b639e3a8f5cbde285b4c448e..7d51c0a0ea3fcdcb5f443bd2dcb53a5ed96fb6d1 100644 (file)
@@ -330,7 +330,7 @@ void InsetERT::lfunMouseMotion(FuncRequest const & cmd)
 
 
 int InsetERT::latex(Buffer const &, ostream & os,
-                   LatexRunParams const &) const
+                   OutputParams const &) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
@@ -361,15 +361,15 @@ int InsetERT::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetERT::ascii(Buffer const &, ostream &,
-                   LatexRunParams const & /*runparams*/) const
+int InsetERT::plaintext(Buffer const &, ostream &,
+                   OutputParams const & /*runparams*/) const
 {
        return 0;
 }
 
 
 int InsetERT::linuxdoc(Buffer const &, ostream & os,
-                      LatexRunParams const &)const
+                      OutputParams const &)const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
@@ -397,7 +397,7 @@ int InsetERT::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetERT::docbook(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+                     OutputParams const &) const
 {
        ParagraphList::iterator par = inset.paragraphs.begin();
        ParagraphList::iterator end = inset.paragraphs.end();
index 177293504e79003bca7685665ebd00ca0a6400f6..1b4b93b0af28ba0df47ea677c51182f32f8c5d27 100644 (file)
@@ -65,16 +65,16 @@ public:
        EDITABLE editable() const;
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const & runparams) const;
+                   OutputParams const & runparams) const;
        ///
        void validate(LaTeXFeatures &) const {}
        ///
index 2bc5e6fa4070d59e7896e73a284dbdf8156b8dd9..714f3327fd8a54c3a2d3066c092dfdd948da3391 100644 (file)
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "lyx_main.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
 #include "frontends/lyx_gui.h"
 #include "frontends/LyXView.h"
@@ -658,7 +658,7 @@ void InsetExternal::read(Buffer const & buffer, LyXLex & lex)
 
 
 int InsetExternal::latex(Buffer const & buf, ostream & os,
-                        LatexRunParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        // "nice" means that the buffer is exported to LaTeX format but not
        // run through the LaTeX compiler.
@@ -669,7 +669,7 @@ int InsetExternal::latex(Buffer const & buf, ostream & os,
 
        // If the template has specified a PDFLaTeX output, then we try and
        // use that.
-       if (runparams.flavor == LatexRunParams::PDFLATEX) {
+       if (runparams.flavor == OutputParams::PDFLATEX) {
                external::Template const * const et_ptr =
                        external::getTemplatePtr(params_);
                if (!et_ptr)
@@ -688,22 +688,22 @@ int InsetExternal::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetExternal::ascii(Buffer const & buf, ostream & os,
-                        LatexRunParams const &) const
+int InsetExternal::plaintext(Buffer const & buf, ostream & os,
+                        OutputParams const &) const
 {
        return external::writeExternal(params_, "Ascii", buf, os);
 }
 
 
 int InsetExternal::linuxdoc(Buffer const & buf, ostream & os,
-                           LatexRunParams const &) const
+                           OutputParams const &) const
 {
        return external::writeExternal(params_, "LinuxDoc", buf, os);
 }
 
 
 int InsetExternal::docbook(Buffer const & buf, ostream & os,
-                          LatexRunParams const &) const
+                          OutputParams const &) const
 {
        return external::writeExternal(params_, "DocBook", buf, os);
 }
@@ -755,8 +755,8 @@ bool preview_wanted(InsetExternalParams const & params)
 string const latex_string(InsetExternal const & inset, Buffer const & buffer)
 {
        ostringstream os;
-       LatexRunParams runparams;
-       runparams.flavor = LatexRunParams::LATEX;
+       OutputParams runparams;
+       runparams.flavor = OutputParams::LATEX;
        inset.latex(buffer, os, runparams);
 
        return os.str();
index 24560f8c1771cbf3b78efcec13014540d01ad639..c9d5ab2b2fb45e241fd8af8250f4170d20b8dfab 100644 (file)
@@ -121,16 +121,16 @@ public:
 
        /// \returns the number of rows (\n's) of generated code.
        virtual int latex(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
        ///
-       virtual int ascii(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+       virtual int plaintext(Buffer const &, std::ostream &,
+                         OutputParams const &) const;
        ///
        virtual int linuxdoc(Buffer const &, std::ostream &,
-                            LatexRunParams const &) const;
+                            OutputParams const &) const;
        ///
        virtual int docbook(Buffer const &, std::ostream &,
-                           LatexRunParams const &) const;
+                           OutputParams const &) const;
 
        /// Update needed features for this inset.
        virtual void validate(LaTeXFeatures & features) const;
index 6c3aca0cdd12f49c42293b07d57270b5691175ee..b08be76012be083250f8ab43cc92d7384da9eee8 100644 (file)
@@ -24,9 +24,9 @@
 #include "gettext.h"
 #include "iterators.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlex.h"
+#include "outputparams.h"
 #include "paragraph.h"
 
 #include "support/lstrings.h"
@@ -272,7 +272,7 @@ string const InsetFloat::editMessage() const
 
 
 int InsetFloat::latex(Buffer const & buf, ostream & os,
-                     LatexRunParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        FloatList const & floats = buf.params().getLyXTextClass().floats();
        string const tmptype = (params_.wide ? params_.type + "*" : params_.type);
@@ -314,7 +314,7 @@ int InsetFloat::latex(Buffer const & buf, ostream & os,
 
 
 int InsetFloat::linuxdoc(Buffer const & buf, ostream & os,
-                        LatexRunParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        FloatList const & floats = buf.params().getLyXTextClass().floats();
        string const tmptype =  params_.type;
@@ -352,7 +352,7 @@ int InsetFloat::linuxdoc(Buffer const & buf, ostream & os,
 
 
 int InsetFloat::docbook(Buffer const & buf, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        os << '<' << params_.type << '>';
        int const i = inset.docbook(buf, os, runparams);
index 4420dcf66122300bf6bd3a819ceb4575876bdb4d..c2d83abc36d2159069ec24735686f8ac40a7c24c 100644 (file)
@@ -56,13 +56,13 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::FLOAT_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        std::string const editMessage() const;
        ///
index d869762847b06c92144abccfec83587e747ec67f..7977d54656d5e1f945936601f4971d3b1f23fd35 100644 (file)
@@ -140,7 +140,7 @@ InsetFloatList::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetFloatList::latex(Buffer const & buf, ostream & os,
-                         LatexRunParams const &) const
+                         OutputParams const &) const
 {
        FloatList const & floats = buf.params().getLyXTextClass().floats();
        FloatList::const_iterator cit = floats[getCmdName()];
@@ -169,7 +169,7 @@ int InsetFloatList::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetFloatList::ascii(Buffer const & buffer, ostream & os, LatexRunParams const &) const
+int InsetFloatList::plaintext(Buffer const & buffer, ostream & os, OutputParams const &) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
index f3f0d20c3df88031b2d50779e7c7de39b0ec5c18..50dd2aba0948c10a84172db42321f4ee7fed07e0 100644 (file)
@@ -47,16 +47,16 @@ public:
        void read(Buffer const &, LyXLex &);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const { return 0; }
+                    OutputParams const &) const { return 0; }
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const { return 0; }
+                   OutputParams const &) const { return 0; }
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams) const;
        ///
        void validate(LaTeXFeatures & features) const;
 protected:
index c3937a0572f7228a0637d0467d0598b716789f86..530efdd1b55af46059e0218cfffec14241602573 100644 (file)
 #include "insetfoot.h"
 
 #include "gettext.h"
-#include "latexrunparams.h"
 // the following are needed just to get the layout of the enclosing
 // paragraph. This seems a bit too much to me (JMarc)
 #include "lyxlayout.h"
+#include "outputparams.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
 
@@ -58,9 +58,9 @@ string const InsetFoot::editMessage() const
 
 
 int InsetFoot::latex(Buffer const & buf, ostream & os,
-                    LatexRunParams const & runparams_in) const
+                    OutputParams const & runparams_in) const
 {
-       LatexRunParams runparams = runparams_in;
+       OutputParams runparams = runparams_in;
        runparams.moving_arg |= ownerPar(buf, this).layout()->intitle;
 
        os << "%\n\\footnote{";
@@ -73,7 +73,7 @@ int InsetFoot::latex(Buffer const & buf, ostream & os,
 
 
 int InsetFoot::docbook(Buffer const & buf, ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        os << "<footnote>";
        int const i = inset.docbook(buf, os, runparams);
index 4d0331c79c463bd1eb879fcaa8c68cd2d6f904d8..e99370063d8d67c86fb238138cbc5debf7d34170 100644 (file)
@@ -30,10 +30,10 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::FOOT_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const & runparams) const;
+                   OutputParams const & runparams) const;
        ///
        std::string const editMessage() const;
 };
index fa0b84d122f57aed005bc6e35b16b17d7dff9453..ec3387a4c8918410ee28318e2a4cb865074bd676 100644 (file)
@@ -64,11 +64,11 @@ TODO
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "lyx_main.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
 #include "frontends/Alert.h"
 #include "frontends/LyXView.h"
@@ -133,10 +133,10 @@ string const uniqueID()
 }
 
 
-string findTargetFormat(string const & suffix, LatexRunParams const & runparams)
+string findTargetFormat(string const & suffix, OutputParams const & runparams)
 {
        // Are we using latex or pdflatex).
-       if (runparams.flavor == LatexRunParams::PDFLATEX) {
+       if (runparams.flavor == OutputParams::PDFLATEX) {
                lyxerr[Debug::GRAPHICS] << "findTargetFormat: PDF mode" << endl;
                if (contains(suffix, "ps") || suffix == "pdf")
                        return "pdf";
@@ -416,7 +416,7 @@ string const stripExtensionIfPossible(string const & file, string const & to)
 
 
 string const InsetGraphics::prepareFile(Buffer const & buf,
-                                       LatexRunParams const & runparams) const
+                                       OutputParams const & runparams) const
 {
        string orig_file = params().filename.absFilename();
        string const rel_file = params().filename.relFilename(buf.filePath());
@@ -539,7 +539,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf,
 
 
 int InsetGraphics::latex(Buffer const & buf, ostream & os,
-                        LatexRunParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        // If there is no file specified or not existing,
        // just output a message about it in the latex output.
@@ -616,8 +616,8 @@ int InsetGraphics::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetGraphics::ascii(Buffer const &, ostream & os,
-                        LatexRunParams const &) const
+int InsetGraphics::plaintext(Buffer const &, ostream & os,
+                        OutputParams const &) const
 {
        // No graphics in ascii output. Possible to use gifscii to convert
        // images to ascii approximation.
@@ -631,7 +631,7 @@ int InsetGraphics::ascii(Buffer const &, ostream & os,
 
 
 int InsetGraphics::linuxdoc(Buffer const & buf, ostream & os,
-                           LatexRunParams const &) const
+                           OutputParams const &) const
 {
        string const file_name = buf.niceFile() ?
                                params().filename.relFilename(buf.filePath()):
@@ -647,7 +647,7 @@ int InsetGraphics::linuxdoc(Buffer const & buf, ostream & os,
 // http://en.tldp.org/LDP/LDP-Author-Guide/inserting-pictures.html
 // See also the docbook guide at http://www.docbook.org/
 int InsetGraphics::docbook(Buffer const &, ostream & os,
-                          LatexRunParams const &) const
+                          OutputParams const &) const
 {
        // In DocBook v5.0, the graphic tag will be eliminated from DocBook, will
        // need to switch to MediaObject. However, for now this is sufficient and
index 997d3ad804b8adde8a79db1f3991782c6cd6cf13..7efcf15ceba99ed9a9984e61e6bbd7f3f4579d16 100644 (file)
@@ -46,16 +46,16 @@ public:
         fragile commands by adding a #\protect# before.
         */
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 
        /** Tell LyX what the latex features you need i.e. what latex packages
            you need to be included.
@@ -101,7 +101,7 @@ private:
        /// Create the options for the latex command.
        std::string const createLatexOptions() const;
        /// Convert the file if needed, and return the location of the file.
-       std::string const prepareFile(Buffer const & buf, LatexRunParams const &) const;
+       std::string const prepareFile(Buffer const & buf, OutputParams const &) const;
 
        ///
        InsetGraphicsParams params_;
index 7f29a628667234e04c2663ea3cefe5d26ba98bdf..2fc778ced0a447ed55cc8045a7004c82e9e506a5 100644 (file)
@@ -44,15 +44,15 @@ std::string const InsetHFill::getScreenLabel(Buffer const &) const
 
 
 int InsetHFill::latex(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+                     OutputParams const &) const
 {
        os << getCommand();
        return 0;
 }
 
 
-int InsetHFill::ascii(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+int InsetHFill::plaintext(Buffer const &, ostream & os,
+                     OutputParams const &) const
 {
        os << '\t';
        return 0;
@@ -60,7 +60,7 @@ int InsetHFill::ascii(Buffer const &, ostream & os,
 
 
 int InsetHFill::linuxdoc(Buffer const &, std::ostream & os,
-                        LatexRunParams const &) const
+                        OutputParams const &) const
 {
        os << '\n';
        return 0;
@@ -68,7 +68,7 @@ int InsetHFill::linuxdoc(Buffer const &, std::ostream & os,
 
 
 int InsetHFill::docbook(Buffer const &, std::ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        os << '\n';
        return 0;
index 4b46d913353b32aa5e647ff01fa235e1775f6d22..a258686647793ab7813bc29e833525d710e0bbab 100644 (file)
@@ -29,16 +29,16 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::HFILL_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const & runparams) const;
+                   OutputParams const & runparams) const;
        ///
        void write(Buffer const & buf, std::ostream & os) const;
        /// We don't need \begin_inset and \end_inset
index 6f1ae1a6703255c1fd57ae0addeed156df34274a..db89cc757cdf43996d9b8a133f89d6db8f43bef0 100644 (file)
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "lyx_main.h"
 #include "lyxlex.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
 #include "frontends/LyXView.h"
 #include "frontends/Painter.h"
@@ -294,7 +294,7 @@ bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params)
 
 
 int InsetInclude::latex(Buffer const & buffer, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        string incfile(params_.getContents());
 
@@ -364,8 +364,8 @@ int InsetInclude::latex(Buffer const & buffer, ostream & os,
 }
 
 
-int InsetInclude::ascii(Buffer const & buffer, ostream & os,
-                       LatexRunParams const &) const
+int InsetInclude::plaintext(Buffer const & buffer, ostream & os,
+                       OutputParams const &) const
 {
        if (isVerbatim(params_))
                os << GetFileContents(includedFilename(buffer, params_));
@@ -374,7 +374,7 @@ int InsetInclude::ascii(Buffer const & buffer, ostream & os,
 
 
 int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os,
-                          LatexRunParams const & runparams) const
+                          OutputParams const & runparams) const
 {
        string incfile(params_.getContents());
 
@@ -401,8 +401,8 @@ int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os,
                lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
                lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
 
-               LatexRunParams runp = runparams;
-               runp.nice = buffer.niceFile();
+               OutputParams runp = runparams;
+               runp.nice = buffer.niceFile();          
                tmp->makeLinuxDocFile(writefile, runp, true);
        }
 
@@ -418,7 +418,7 @@ int InsetInclude::linuxdoc(Buffer const & buffer, ostream & os,
 
 
 int InsetInclude::docbook(Buffer const & buffer, ostream & os,
-                         LatexRunParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        string incfile(params_.getContents());
 
@@ -444,7 +444,7 @@ int InsetInclude::docbook(Buffer const & buffer, ostream & os,
                lyxerr[Debug::LATEX] << "incfile:" << incfile << endl;
                lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
 
-               LatexRunParams runp = runparams;
+               OutputParams runp = runparams;
                runp.nice = buffer.niceFile();
                tmp->makeDocBookFile(writefile, runp, true);
        }
@@ -595,8 +595,8 @@ bool preview_wanted(InsetCommandParams const & params, Buffer const & buffer)
 string const latex_string(InsetInclude const & inset, Buffer const & buffer)
 {
        ostringstream os;
-       LatexRunParams runparams;
-       runparams.flavor = LatexRunParams::LATEX;
+       OutputParams runparams;
+       runparams.flavor = OutputParams::LATEX;
        inset.latex(buffer, os, runparams);
 
        return os.str();
index 79d52ebd5b9bc0dea8c88b08d5518bf89428a413..95247a5e5aa63a95bf4f07e5995951bdcdb14343 100644 (file)
@@ -67,16 +67,16 @@ public:
        void read(Buffer const &, LyXLex &);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
index 8ac08e7fade56758c326b00563c99eec3cb9d8e2..7eb8cd376360a987908c9f06c18f241d2a52ef6f 100644 (file)
@@ -76,7 +76,7 @@ DispatchResult InsetIndex::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetIndex::docbook(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        os << "<indexterm><primary>" << getContents()
           << "</primary></indexterm>";
index a26c1e9eb0ad9de0dc14d5c7b3ff00aa887a2713..34a634f143477703365c54d6ed3628f5eb326497 100644 (file)
@@ -37,7 +37,7 @@ public:
        InsetOld::Code lyxCode() const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        DispatchResult priv_dispatch(FuncRequest const & cmd,
                idx_type & idx, pos_type & pos);
index 032a015746d5812b3bf2304caed2381f77c9e36b..16978b739845e99c8e579be621d4c868f9a107e7 100644 (file)
@@ -94,15 +94,15 @@ InsetLabel::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetLabel::latex(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+                     OutputParams const &) const
 {
        os << escape(getCommand());
        return 0;
 }
 
 
-int InsetLabel::ascii(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+int InsetLabel::plaintext(Buffer const &, ostream & os,
+                     OutputParams const &) const
 {
        os << '<' << getContents()  << '>';
        return 0;
@@ -110,7 +110,7 @@ int InsetLabel::ascii(Buffer const &, ostream & os,
 
 
 int InsetLabel::linuxdoc(Buffer const &, ostream & os,
-                        LatexRunParams const &) const
+                        OutputParams const &) const
 {
        os << "<label id=\"" << getContents() << "\" >";
        return 0;
@@ -118,7 +118,7 @@ int InsetLabel::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetLabel::docbook(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        os << "<anchor id=\"" << getContents() << "\">";
        return 0;
index 836e10887b6ead91128f3f068864b54002e9a0e7..15cf530839633b1e3da46ba002014180dba0b307 100644 (file)
@@ -32,16 +32,16 @@ public:
        void getLabelList(Buffer const &, std::vector<std::string> & list) const;
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 protected:
        ///
        virtual
index dd9fdbb9600082987a4ef95e91a1f9ce2d89e885..2929970213e015d30e6ae00a3fcfa4220aa19872 100644 (file)
@@ -601,15 +601,15 @@ void InsetLatexAccent::read(Buffer const &, LyXLex & lex)
 
 
 int InsetLatexAccent::latex(Buffer const &, ostream & os,
-                           LatexRunParams const &) const
+                           OutputParams const &) const
 {
        os << contents;
        return 0;
 }
 
 
-int InsetLatexAccent::ascii(Buffer const &, ostream & os,
-                           LatexRunParams const &) const
+int InsetLatexAccent::plaintext(Buffer const &, ostream & os,
+                           OutputParams const &) const
 {
        os << contents;
        return 0;
@@ -617,7 +617,7 @@ int InsetLatexAccent::ascii(Buffer const &, ostream & os,
 
 
 int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os,
-                              LatexRunParams const &) const
+                              OutputParams const &) const
 {
        os << contents;
        return 0;
@@ -625,7 +625,7 @@ int InsetLatexAccent::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetLatexAccent::docbook(Buffer const &, ostream & os,
-                             LatexRunParams const &) const
+                             OutputParams const &) const
 {
        os << contents;
        return 0;
index 3609675bdfe7c2e7a214811e1247b167a85692c3..d35f71bd2580c1f7eafc5ffd84d44358eb83ec72 100644 (file)
@@ -48,16 +48,16 @@ public:
        void read(Buffer const &, LyXLex & lex);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        bool directWrite() const;
        ///
index 398e0ff4e7b1a2123a858dbb213bd1c7de9688d9..221b48570ba8d77f3b2fd14697047f622dc367fb 100644 (file)
@@ -53,7 +53,7 @@ void InsetLine::draw(PainterInfo & pi, int x, int y) const
 
 
 int InsetLine::latex(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        os << "\\lyxline{}";
 
@@ -67,8 +67,8 @@ int InsetLine::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetLine::ascii(Buffer const &, ostream & os,
-                    LatexRunParams const &) const
+int InsetLine::plaintext(Buffer const &, ostream & os,
+                    OutputParams const &) const
 {
        os << "-------------------------------------------";
        return 0;
@@ -76,7 +76,7 @@ int InsetLine::ascii(Buffer const &, ostream & os,
 
 
 int InsetLine::linuxdoc(Buffer const &, std::ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        os << '\n';
        return 0;
@@ -84,7 +84,7 @@ int InsetLine::linuxdoc(Buffer const &, std::ostream & os,
 
 
 int InsetLine::docbook(Buffer const &, std::ostream & os,
-                      LatexRunParams const &) const
+                      OutputParams const &) const
 {
        os << '\n';
        return 0;
index 8c579071a255ff1174c8f537a4e8b9f894bf114f..9e5fb6c1871d1eb004415040348b7e1148b4ac35 100644 (file)
@@ -31,16 +31,16 @@ public:
        void draw(PainterInfo & pi, int x, int y) const;
 
        int latex(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
 
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
 
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
 
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 
        void read(Buffer const &, LyXLex & lex);
 
index bcabf905ddfcbe8402a402929c5a8a60c84e96ff..5be21a4fa314d8f86f05f1b910fa822b4e320485 100644 (file)
@@ -65,7 +65,7 @@ string const InsetList::editMessage() const
 
 
 int InsetList::latex(Buffer const * buf, ostream & os,
-                    LatexRunParams const & runparams) const
+                    OutputParams const & runparams) const
 {
        os << "\\footnote{%\n";
 
index ae460312410763cf6404889e5f466b66e461972c..6f03874cea31813c8750ae24c468d62382e683a9 100644 (file)
@@ -28,7 +28,7 @@ public:
        Inset::Code lyxCode() const { return Inset::FOOT_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        string const editMessage() const;
 };
index 05d377ee4610d4afae9943e9b9beffc680ac86f1..6fafd8950c3f6d4a2073a8292e55bf625800bbd8 100644 (file)
@@ -53,7 +53,7 @@ string const InsetMarginal::editMessage() const
 
 
 int InsetMarginal::latex(Buffer const & buf, ostream & os,
-                        LatexRunParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        os << "%\n\\marginpar{";
 
index b0f13ed0d9aa05ea59e6217620fbd42bc0b4355f..bc51d737569f16d3534b7885f419eebaab8d18d4 100644 (file)
@@ -31,7 +31,7 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::MARGIN_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        std::string const editMessage() const;
 };
index 29d82bb4733ade335be17d7aaf6bfc259425056c..8de88ef3abb029692755cf0561be66e850aa294d 100644 (file)
@@ -242,7 +242,7 @@ string const InsetMinipage::editMessage() const
 
 
 int InsetMinipage::latex(Buffer const & buf, ostream & os,
-                        LatexRunParams const & runparams) const
+                        OutputParams const & runparams) const
 {
        string s_pos;
        switch (params_.pos) {
index cdfaaa1f88a27345c9ba758253ade549f0e643de..828d885bca24530cbebea05f71cd64e8b5bd60e3 100644 (file)
@@ -71,7 +71,7 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::MINIPAGE_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        std::string const editMessage() const;
        ///
index 80ffec67634ac70b6ffffececd3267ed604cb8cb..1ce8398eb391b4c8af5647af00b9a781753a921a 100644 (file)
@@ -50,15 +50,15 @@ void InsetNewline::metrics(MetricsInfo & mi, Dimension & dim) const
 
 
 int InsetNewline::latex(Buffer const &, ostream &,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        lyxerr << "Eek, calling InsetNewline::latex !" << endl;
        return 0;
 }
 
 
-int InsetNewline::ascii(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+int InsetNewline::plaintext(Buffer const &, ostream & os,
+                       OutputParams const &) const
 {
        os << '\n';
        return 0;
@@ -66,7 +66,7 @@ int InsetNewline::ascii(Buffer const &, ostream & os,
 
 
 int InsetNewline::linuxdoc(Buffer const &, std::ostream & os,
-                          LatexRunParams const &) const
+                          OutputParams const &) const
 {
        os << '\n';
        return 0;
@@ -74,7 +74,7 @@ int InsetNewline::linuxdoc(Buffer const &, std::ostream & os,
 
 
 int InsetNewline::docbook(Buffer const &, std::ostream & os,
-                         LatexRunParams const &) const
+                         OutputParams const &) const
 {
        os << '\n';
        return 0;
index 140bbe9d4b1afc1bc040c00f7b2b3da6a1d9cbe2..d89a41723a1da6ca03a93dea28bfdc2ae7b37b57 100644 (file)
@@ -31,16 +31,16 @@ public:
        virtual void draw(PainterInfo & pi, int x, int y) const;
 
        virtual int latex(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
 
-       virtual int ascii(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+       virtual int plaintext(Buffer const &, std::ostream &,
+                         OutputParams const &) const;
 
        virtual int linuxdoc(Buffer const &, std::ostream &,
-                            LatexRunParams const &) const;
+                            OutputParams const &) const;
 
        virtual int docbook(Buffer const &, std::ostream &,
-                           LatexRunParams const &) const;
+                           OutputParams const &) const;
 
        virtual void read(Buffer const &, LyXLex & lex);
 
index 7cbf9b77a9d90ed1a7e84ce7b3d57ab7a2eaa5bd..1717ce70c38089d141bb0f3ab426a4ca24bfb184 100644 (file)
@@ -163,7 +163,7 @@ InsetNote::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetNote::latex(Buffer const & buf, ostream & os,
-                    LatexRunParams const & runparams) const
+                    OutputParams const & runparams) const
 {
        string const pt = params_.type;
 
@@ -190,7 +190,7 @@ int InsetNote::latex(Buffer const & buf, ostream & os,
 
 
 int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        string const pt = params_.type;
 
@@ -210,7 +210,7 @@ int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os,
 
 
 int InsetNote::docbook(Buffer const & buf, std::ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        string const pt = params_.type;
 
@@ -229,14 +229,14 @@ int InsetNote::docbook(Buffer const & buf, std::ostream & os,
 }
 
 
-int InsetNote::ascii(Buffer const & buf, std::ostream & os,
-                    LatexRunParams const & runparams) const
+int InsetNote::plaintext(Buffer const & buf, std::ostream & os,
+                    OutputParams const & runparams) const
 {
        int i = 0;
        string const pt = params_.type;
        if (pt != "Note") {
                os << "[";
-               i = inset.ascii(buf, os, runparams);
+               i = inset.plaintext(buf, os, runparams);
                os << "]";
        }
        return i;
index 7c08678bf9b31a3bb42ab39281b753e61aef5fc3..98a8b6687d2e79e07566ecfcbabe20049e25d947 100644 (file)
@@ -56,16 +56,16 @@ public:
        bool showInsetDialog(BufferView * bv) const;
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
index 94da626e58d9e55a3f50c3b5ee8d930d38e69255..55a8f2b380237299a65c1dff506d77ff40776a64 100644 (file)
@@ -63,14 +63,14 @@ void InsetOptArg::write(Buffer const & buf, ostream & os) const
 
 
 int InsetOptArg::latex(Buffer const &, ostream &,
-                      LatexRunParams const &) const
+                      OutputParams const &) const
 {
        return 0;
 }
 
 
 int InsetOptArg::latexOptional(Buffer const & buf, ostream & os,
-                              LatexRunParams const & runparams) const
+                              OutputParams const & runparams) const
 {
        os << '[';
        int const i = inset.latex(buf, os, runparams);
index 65a482e50f7b7b892dbaf0d4ceb570eb07479bc9..60828016c25003a78e327fc15f0a5521c77da1f3 100644 (file)
@@ -36,10 +36,10 @@ public:
 
        /// Standard LaTeX output -- short-circuited
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        /// Outputting the optional parameter of a LaTeX command
        int latexOptional(Buffer const &, std::ostream &,
-                         LatexRunParams const &) const;
+                         OutputParams const &) const;
        /// Write out tothe .lyx file
        void write(Buffer const & buf, std::ostream & os) const;
 };
index 9521a4a04ae0a6dfd35ec18d6592c24948169c1d..60fe40e25ecde576e891241261464e58dc838902 100644 (file)
@@ -73,15 +73,15 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const
 
 
 int InsetPagebreak::latex(Buffer const &, ostream & os,
-                         LatexRunParams const &) const
+                         OutputParams const &) const
 {
        os << "\\newpage{}";
        return 0;
 }
 
 
-int InsetPagebreak::ascii(Buffer const &, ostream & os,
-                         LatexRunParams const &) const
+int InsetPagebreak::plaintext(Buffer const &, ostream & os,
+                         OutputParams const &) const
 {
        os << '\n';
        return 0;
@@ -89,7 +89,7 @@ int InsetPagebreak::ascii(Buffer const &, ostream & os,
 
 
 int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os,
-                            LatexRunParams const &) const
+                            OutputParams const &) const
 {
        os << '\n';
        return 0;
@@ -97,7 +97,7 @@ int InsetPagebreak::linuxdoc(Buffer const &, std::ostream & os,
 
 
 int InsetPagebreak::docbook(Buffer const &, std::ostream & os,
-                           LatexRunParams const &) const
+                           OutputParams const &) const
 {
        os << '\n';
        return 0;
index f3a6118ebc7f60ba4edc274d4f696ece1172ab1b..bbcda7852249c38bfcce86acb5cb97ee7a7c095e 100644 (file)
@@ -31,16 +31,16 @@ public:
        void draw(PainterInfo & pi, int x, int y) const;
 
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
 
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
 
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
 
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 
        void read(Buffer const &, LyXLex & lex);
 
index 074d7f67f4f4431d50bc149f91d3ebca0c13a897..3a21ce6bf774655b4b8210247448edb8fb9767a6 100644 (file)
 #include "debug.h"
 #include "language.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
 
@@ -254,7 +254,7 @@ void InsetQuotes::read(Buffer const &, LyXLex & lex)
 
 
 int InsetQuotes::latex(Buffer const & buf, ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        // How do we get the local language here??
        lyx::pos_type curr_pos = ownerPar(buf, this).getPositionOfInset(this);
@@ -305,8 +305,8 @@ int InsetQuotes::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetQuotes::ascii(Buffer const &, ostream & os,
-                      LatexRunParams const &) const
+int InsetQuotes::plaintext(Buffer const &, ostream & os,
+                      OutputParams const &) const
 {
        os << '"';
        return 0;
@@ -314,7 +314,7 @@ int InsetQuotes::ascii(Buffer const &, ostream & os,
 
 
 int InsetQuotes::linuxdoc(Buffer const &, ostream & os,
-                         LatexRunParams const &) const
+                         OutputParams const &) const
 {
        os << '"';
        return 0;
@@ -322,7 +322,7 @@ int InsetQuotes::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetQuotes::docbook(Buffer const &, ostream & os,
-                        LatexRunParams const &) const
+                        OutputParams const &) const
 {
        if (times_ == DoubleQ) {
                if (side_ == LeftQ)
index a7ef065802eb8c400bb8058597e7a1d055c3532c..dc35fb800d515665a066148f5f05af107f8b7437 100644 (file)
@@ -83,16 +83,16 @@ public:
        void read(Buffer const &, LyXLex & lex);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        void validate(LaTeXFeatures &) const;
        ///
index 673b96bb0b8cd2ae7c9571432aca324f95879a67..e0ce44def7bd32eda67171b3a6055c8fa7802dca 100644 (file)
@@ -86,7 +86,7 @@ string const InsetRef::getScreenLabel(Buffer const &) const
 
 
 int InsetRef::latex(Buffer const &, ostream & os,
-                   LatexRunParams const &) const
+                   OutputParams const &) const
 {
        if (getOptions().empty())
                os << escape(getCommand());
@@ -98,8 +98,8 @@ int InsetRef::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetRef::ascii(Buffer const &, ostream & os,
-                   LatexRunParams const &) const
+int InsetRef::plaintext(Buffer const &, ostream & os,
+                   OutputParams const &) const
 {
        os << '[' << getContents() << ']';
        return 0;
@@ -107,7 +107,7 @@ int InsetRef::ascii(Buffer const &, ostream & os,
 
 
 int InsetRef::linuxdoc(Buffer const &, ostream & os,
-                      LatexRunParams const &) const
+                      OutputParams const &) const
 {
        os << "<ref id=\"" << getContents()
           << "\" name=\"" << getOptions() << "\" >";
@@ -116,7 +116,7 @@ int InsetRef::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetRef::docbook(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+                     OutputParams const &) const
 {
        if (getOptions().empty()) {
                os << "<xref linkend=\"" << getContents() << "\">";
index e2cd6f33e06e71237118cc6513f6861578f2bb13..13d32ce260598a194890baf4c7cff2e227a9f1d5 100644 (file)
@@ -55,16 +55,16 @@ public:
        bool display() const { return false; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        void validate(LaTeXFeatures & features) const;
 protected:
index 0d22a6ad4f7092e21318942246ba1f528cc8c707..60e62a8ad8a6a8fb47f7e67a632bbbe3318d8551 100644 (file)
 #include "insetspace.h"
 
 #include "debug.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlex.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 
 #include "frontends/font_metrics.h"
 #include "frontends/Painter.h"
@@ -162,7 +162,7 @@ void InsetSpace::read(Buffer const &, LyXLex & lex)
 
 
 int InsetSpace::latex(Buffer const &, ostream & os,
-                     LatexRunParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        switch (kind_) {
        case NORMAL:
@@ -194,8 +194,8 @@ int InsetSpace::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetSpace::ascii(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+int InsetSpace::plaintext(Buffer const &, ostream & os,
+                     OutputParams const &) const
 {
        switch (kind_) {
        case NORMAL:
@@ -214,7 +214,7 @@ int InsetSpace::ascii(Buffer const &, ostream & os,
 
 
 int InsetSpace::linuxdoc(Buffer const &, ostream & os,
-                        LatexRunParams const &) const
+                        OutputParams const &) const
 {
        switch (kind_) {
        case NORMAL:
@@ -235,7 +235,7 @@ int InsetSpace::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetSpace::docbook(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+                       OutputParams const &) const
 {
        switch (kind_) {
        case NORMAL:
index ad6bbc1b30d0bebac10488d52c113872c9959e3a..6e5aa846eb5445202949a83af584285fd95b4f02 100644 (file)
@@ -62,16 +62,16 @@ public:
        void read(Buffer const &, LyXLex & lex);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        virtual std::auto_ptr<InsetBase> clone() const;
        ///
index da11a2350fc6fcf9d2800b04531dd24fceb0779e..331afb76fc0dfddb83b94479a6a7e71bcebfe11a 100644 (file)
@@ -157,7 +157,7 @@ void InsetSpecialChar::read(Buffer const &, LyXLex & lex)
 
 
 int InsetSpecialChar::latex(Buffer const &, ostream & os,
-                           LatexRunParams const &) const
+                           OutputParams const &) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -180,8 +180,8 @@ int InsetSpecialChar::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetSpecialChar::ascii(Buffer const &, ostream & os,
-                           LatexRunParams const &) const
+int InsetSpecialChar::plaintext(Buffer const &, ostream & os,
+                           OutputParams const &) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -202,7 +202,7 @@ int InsetSpecialChar::ascii(Buffer const &, ostream & os,
 
 
 int InsetSpecialChar::linuxdoc(Buffer const &, ostream & os,
-                              LatexRunParams const &) const
+                              OutputParams const &) const
 {
        switch (kind_) {
        case HYPHENATION:
@@ -223,7 +223,7 @@ int InsetSpecialChar::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetSpecialChar::docbook(Buffer const &, ostream & os,
-                             LatexRunParams const &) const
+                             OutputParams const &) const
 {
        switch (kind_) {
        case HYPHENATION:
index ddcd542a6fcd9696cc9d821b9411d9b244e2dc3e..a0187b3c96e39b8c716bcc561e54a479eec05a19 100644 (file)
@@ -54,16 +54,16 @@ public:
        void read(Buffer const &, LyXLex & lex);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        virtual std::auto_ptr<InsetBase> clone() const;
        ///
index ba85379c967b49f52eb025e17bac97cd4ae798e1..a28ee59e9d6a454fc217f8d43799f987f5533a5b 100644 (file)
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "language.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyx_cb.h"
 #include "lyxlex.h"
 #include "metricsinfo.h"
+#include "outputparams.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
@@ -1117,32 +1117,32 @@ InsetTabular::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetTabular::latex(Buffer const & buf, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        return tabular.latex(buf, os, runparams);
 }
 
 
-int InsetTabular::ascii(Buffer const & buf, ostream & os,
-                       LatexRunParams const & runparams) const
+int InsetTabular::plaintext(Buffer const & buf, ostream & os,
+                       OutputParams const & runparams) const
 {
        if (runparams.linelen > 0)
-               return tabular.ascii(buf, os, runparams,
+               return tabular.plaintext(buf, os, runparams,
                                     ownerPar(buf, this).params().depth(),
                                     false, 0);
-       return tabular.ascii(buf, os, runparams, 0, false, 0);
+       return tabular.plaintext(buf, os, runparams, 0, false, 0);
 }
 
 
 int InsetTabular::linuxdoc(Buffer const & buf, ostream & os,
-                          LatexRunParams const & runparams) const
+                          OutputParams const & runparams) const
 {
        return tabular.linuxdoc(buf,os, runparams);
 }
 
 
 int InsetTabular::docbook(Buffer const & buf, ostream & os,
-                         LatexRunParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        int ret = 0;
        InsetOld * master;
@@ -2267,9 +2267,9 @@ bool InsetTabular::copySelection(BufferView * bv)
                                    true, true);
 
        ostringstream os;
-       LatexRunParams const runparams;
-       paste_tabular->ascii(*bv->buffer(), os, runparams,
-                            ownerPar(*bv->buffer(), this).params().depth(), true, '\t');
+       OutputParams const runparams;   
+       paste_tabular->plaintext(*bv->buffer(), os, runparams,
+                                ownerPar(*bv->buffer(), this).params().depth(), true, '\t');
        bv->stuffClipboard(os.str());
        return true;
 }
index 43efc29fbc17f5e62e61ff723e742a8d533dfbb5..f449498bf3e9b23e44d018cc766176307affee7d 100644 (file)
@@ -106,16 +106,16 @@ public:
        bool display() const { return tabular.isLongTabular(); }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        void validate(LaTeXFeatures & features) const;
        ///
index 0b04019abc32b03d43a020c46e3618f8354b9a28..4963779a62f4b9b9e28804f2ed983aee9def4dc1 100644 (file)
 #include "lyxlex.h"
 #include "lyxrc.h"
 #include "metricsinfo.h"
+#include "output_docbook.h"
+#include "output_latex.h"
+#include "output_linuxdoc.h"
+#include "output_plaintext.h"
 #include "paragraph.h"
 #include "paragraph_funcs.h"
 #include "ParagraphParameters.h"
@@ -954,7 +958,7 @@ InsetText::priv_dispatch(FuncRequest const & cmd,
 
 
 int InsetText::latex(Buffer const & buf, ostream & os,
-                    LatexRunParams const & runparams) const
+                    OutputParams const & runparams) const
 {
        TexRow texrow;
        latexParagraphs(buf, paragraphs, os, texrow, runparams);
@@ -962,8 +966,8 @@ int InsetText::latex(Buffer const & buf, ostream & os,
 }
 
 
-int InsetText::ascii(Buffer const & buf, ostream & os,
-                    LatexRunParams const & runparams) const
+int InsetText::plaintext(Buffer const & buf, ostream & os,
+                    OutputParams const & runparams) const
 {
        ParagraphList::const_iterator beg = paragraphs.begin();
        ParagraphList::const_iterator end = paragraphs.end();
@@ -977,7 +981,7 @@ int InsetText::ascii(Buffer const & buf, ostream & os,
 
 
 int InsetText::linuxdoc(Buffer const & buf, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        linuxdocParagraphs(buf, paragraphs, os, runparams);
        return 0;
@@ -985,7 +989,7 @@ int InsetText::linuxdoc(Buffer const & buf, ostream & os,
 
 
 int InsetText::docbook(Buffer const & buf, ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        docbookParagraphs(buf, paragraphs, os, runparams);
        return 0;
index 02b3da1c5c87cfe1eaa3d2578ab8b4b04b08f836..d9ea980c4d50c6928d73de2cda3a4e7877623ebd 100644 (file)
@@ -81,16 +81,16 @@ public:
                                UpdatableInset *, bool lr = false);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const ;
+                    OutputParams const &) const ;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const ;
+                   OutputParams const &) const ;
        ///
        void validate(LaTeXFeatures & features) const;
        ///
index 100330498f347142bb76a7fa250c19ddd65da9e6..9f1ee9f0a023ccf97ffa404393e4c370e895b8dc 100644 (file)
@@ -89,7 +89,7 @@ string const InsetTheorem::editMessage() const
 
 
 int InsetTheorem::latex(Buffer const * buf, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        os << "\\begin{theorem}%\n";
 
index 465479ba0b5d970b5236d26db124e8ff9c7537ba..ce91284428c9d06323760bcd56f0d744d3a07e50 100644 (file)
@@ -34,7 +34,7 @@ public:
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        string const editMessage() const;
 private:
index 8854a3a17e4b73150f7a9eed26ae976ec21b720e..c345421baad024de2889a59498dc645728d56ad2 100644 (file)
@@ -94,8 +94,8 @@ InsetTOC::priv_dispatch(FuncRequest const & cmd,
 }
 
 
-int InsetTOC::ascii(Buffer const & buffer, ostream & os,
-                   LatexRunParams const &) const
+int InsetTOC::plaintext(Buffer const & buffer, ostream & os,
+                   OutputParams const &) const
 {
        os << getScreenLabel(buffer) << "\n\n";
 
@@ -107,7 +107,7 @@ int InsetTOC::ascii(Buffer const & buffer, ostream & os,
 
 
 int InsetTOC::linuxdoc(Buffer const &, ostream & os,
-                      LatexRunParams const &) const
+                      OutputParams const &) const
 {
        if (getCmdName() == "tableofcontents")
                os << "<toc>";
@@ -116,7 +116,7 @@ int InsetTOC::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetTOC::docbook(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+                     OutputParams const &) const
 {
        if (getCmdName() == "tableofcontents")
                os << "<toc></toc>";
index a35682e32acbd012131671685c56bf504ba37418..45c2f76663e54744ffd1f6d6da634d48cd50eb5a 100644 (file)
@@ -41,14 +41,14 @@ public:
        ///
        bool display() const { return true; }
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 protected:
        ///
        virtual
index ec996776aebed6753a716172a85658b57ad04107..741dc0220a1a982a78cde6cae6581c178cc1ae4b 100644 (file)
@@ -14,9 +14,9 @@
 
 #include "dispatchresult.h"
 #include "funcrequest.h"
-#include "latexrunparams.h"
 #include "LaTeXFeatures.h"
 #include "gettext.h"
+#include "outputparams.h"
 
 #include "support/lstrings.h"
 
@@ -83,7 +83,7 @@ string const InsetUrl::getScreenLabel(Buffer const &) const
 
 
 int InsetUrl::latex(Buffer const &, ostream & os,
-                   LatexRunParams const & runparams) const
+                   OutputParams const & runparams) const
 {
        if (!getOptions().empty())
                os << getOptions() + ' ';
@@ -94,8 +94,8 @@ int InsetUrl::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetUrl::ascii(Buffer const &, ostream & os,
-                   LatexRunParams const &) const
+int InsetUrl::plaintext(Buffer const &, ostream & os,
+                   OutputParams const &) const
 {
        if (getOptions().empty())
                os << '[' << getContents() << ']';
@@ -106,7 +106,7 @@ int InsetUrl::ascii(Buffer const &, ostream & os,
 
 
 int InsetUrl::linuxdoc(Buffer const &, ostream & os,
-                      LatexRunParams const &) const
+                      OutputParams const &) const
 {
        os << '<' << getCmdName()
           << " url=\""  << getContents() << "\""
@@ -117,7 +117,7 @@ int InsetUrl::linuxdoc(Buffer const &, ostream & os,
 
 
 int InsetUrl::docbook(Buffer const &, ostream & os,
-                     LatexRunParams const &) const
+                     OutputParams const &) const
 {
        os << "<ulink url=\"" << subst(getContents(),"&","&amp;")
           << "\">" << getOptions() << "</ulink>";
index 9979a41cf79a01ae5b9e4be39804961f2e9f449f..8555331683ae7a367f85deaeb2b49f12c4ca6977 100644 (file)
@@ -42,16 +42,16 @@ public:
        bool display() const { return false; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 protected:
        ///
        virtual
index e6795dbcc2c1433b4036ebced50e8e12ee936c70..372dcf1f05da887116583bf7572d3bc4bbeb31d7 100644 (file)
@@ -22,9 +22,9 @@
 #include "funcrequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlex.h"
+#include "outputparams.h"
 #include "paragraph.h"
 
 #include "support/tostr.h"
@@ -185,7 +185,7 @@ string const InsetWrap::editMessage() const
 
 
 int InsetWrap::latex(Buffer const & buf, ostream & os,
-                    LatexRunParams const & runparams) const
+                    OutputParams const & runparams) const
 {
        os << "\\begin{floating" << params_.type << '}';
        if (!params_.placement.empty()) {
@@ -201,7 +201,7 @@ int InsetWrap::latex(Buffer const & buf, ostream & os,
 
 
 int InsetWrap::docbook(Buffer const & buf, ostream & os,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        os << '<' << params_.type << '>';
        int const i = inset.docbook(buf, os, runparams);
index 515984f7be12a45d36503a1641e9d22d30cccb02..fc4513916b9c3928ebebbf7c9e8bdd5ab2fc3c70 100644 (file)
@@ -53,10 +53,10 @@ public:
        InsetOld::Code lyxCode() const { return InsetOld::WRAP_CODE; }
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
        std::string const editMessage() const;
        ///
diff --git a/src/latexrunparams.h b/src/latexrunparams.h
deleted file mode 100644 (file)
index c310819..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// -*- C++ -*-
-/**
- * \file latexrunparams.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- *  \author Angus Leeming
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef LatexRunParams_H
-#define LatexRunParams_H
-
-struct LatexRunParams {
-        enum FLAVOR {
-                LATEX,
-                PDFLATEX
-        };
-
-        LatexRunParams() : flavor(LATEX), nice(false),
-                          moving_arg(false), free_spacing(false),
-                          use_babel(false), mixed_content(false),
-                          linelen(0) {}
-
-       /** The latex that we export depends occasionally on what is to
-           compile the file.
-       */
-        FLAVOR flavor;
-
-       /** Are we to write a 'nice' LaTeX file or not.
-           This esentially seems to mean whether InsetInclude, InsetGraphics
-           and InsetExternal should add the absolute path to any external
-           files or not.
-       */
-       bool nice;
-
-       /** moving_arg == true means that the environment in which the inset
-           is typeset is a moving argument. The inset should take care about
-           fragile commands by preceding the latex with \protect.
-       */
-       bool moving_arg;
-
-       /** free_spacing == true means that the inset is in a free-spacing
-           paragraph.
-       */
-       bool free_spacing;
-
-       /** This var is set by the return value from BufferParams::writeLaTeX
-        */
-       bool use_babel;
-
-       /** Used for docbook to see if inside a region of mixed content.
-           In that case all the white spaces are significant and can not appear
-           at the begin or end.
-        */
-       bool mixed_content;
-
-       /** Line lenght to use with ascii export.
-        */
-       int linelen;
-};
-
-#endif // LATEXRUNPARAMS_H
index 6f96b85f11f544f71a32527bf9adcc48cb2e2be9..a535381b8f96aa502b8c78219188e0de63bc9dcf 100644 (file)
@@ -1,3 +1,11 @@
+2003-11-05  José Matos  <jamatos@lyx.org>
+
+       * formula.[Ch] (ascii, linuxdoc, docbook):
+       * formulamacro.[Ch] (ascii, linuxdoc, docbook):
+       * math_inset.[Ch] (ascii, linuxdoc, docbook):
+       * ref_inset.[Ch] (ascii, linuxdoc, docbook):
+       rename ascii to plaintext and LatexRunParams to OutputParams.
+
 2003-11-03  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * Adjust for new DispatchResult semantics.
@@ -23,7 +31,6 @@
        * formula.[Ch] (ascii, linuxdoc, docbook):
        * formulamacro.[Ch] (ascii, linuxdoc, docbook):
        * math_inset.[Ch] (ascii, linuxdoc, docbook):
-       * math_inset.[Ch] (ascii, linuxdoc, docbook):
        * ref_inset.[Ch] (ascii, linuxdoc, docbook):
        add LatexRunParams argument.
 
index 6e2529af5a6a9471ca4b9cc09063a7c618bc3525..63cffade24a91543e4c2fa98288dd58cc22aa496 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "BufferView.h"
 #include "debug.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyx_main.h"
+#include "outputparams.h"
 
 #include "frontends/Painter.h"
 
@@ -100,7 +100,7 @@ void InsetFormula::write(Buffer const &, ostream & os) const
 
 
 int InsetFormula::latex(Buffer const &, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        WriteStream wi(os, runparams.moving_arg, true);
        par_->write(wi);
@@ -108,8 +108,8 @@ int InsetFormula::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetFormula::ascii(Buffer const &, ostream & os,
-                       LatexRunParams const &) const
+int InsetFormula::plaintext(Buffer const &, ostream & os,
+                       OutputParams const &) const
 {
        if (0 && display()) {
                Dimension dim;
@@ -130,20 +130,20 @@ int InsetFormula::ascii(Buffer const &, ostream & os,
 
 
 int InsetFormula::linuxdoc(Buffer const & buf, ostream & os,
-                          LatexRunParams const & runparams) const
+                          OutputParams const & runparams) const
 {
        return docbook(buf, os, runparams);
 }
 
 
 int InsetFormula::docbook(Buffer const & buf, ostream & os,
-                         LatexRunParams const & runparams) const
+                         OutputParams const & runparams) const
 {
        MathMLStream ms(os);
        ms << MTag("equation");
        ms <<   MTag("alt");
        ms <<    "<[CDATA[";
-       int res = ascii(buf, ms.os(), runparams);
+       int res = plaintext(buf, ms.os(), runparams);
        ms <<    "]]>";
        ms <<   ETag("alt");
        ms <<   MTag("math");
index 76510dd0b1e00135f512df405ccba9e62fb93b23..19acb55cea660525d64b3a5d227ca580b292cd26 100644 (file)
@@ -45,16 +45,16 @@ public:
        void read(Buffer const &, LyXLex & lex);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream &,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 
        ///
        virtual std::auto_ptr<InsetBase> clone() const;
index ae49819f1f8c73107dbcfbd6a67c4b95fa9a5903..9ea39270e6d16d04a3ef8ebe3b5b243a4048d863 100644 (file)
@@ -18,9 +18,9 @@
 #include "math_mathmlstream.h"
 
 #include "gettext.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlex.h"
+#include "outputparams.h"
 
 #include "frontends/Painter.h"
 #include "frontends/font_metrics.h"
@@ -75,7 +75,7 @@ void InsetFormulaMacro::write(Buffer const &, ostream & os) const
 
 
 int InsetFormulaMacro::latex(Buffer const &, ostream & os,
-                            LatexRunParams const & runparams) const
+                            OutputParams const & runparams) const
 {
        WriteStream wi(os, runparams.moving_arg, true);
        par()->write(wi);
@@ -83,8 +83,8 @@ int InsetFormulaMacro::latex(Buffer const &, ostream & os,
 }
 
 
-int InsetFormulaMacro::ascii(Buffer const &, ostream & os,
-                            LatexRunParams const &) const
+int InsetFormulaMacro::plaintext(Buffer const &, ostream & os,
+                            OutputParams const &) const
 {
        WriteStream wi(os, false, true);
        par()->write(wi);
@@ -93,16 +93,16 @@ int InsetFormulaMacro::ascii(Buffer const &, ostream & os,
 
 
 int InsetFormulaMacro::linuxdoc(Buffer const & buf, ostream & os,
-                               LatexRunParams const & runparams) const
+                               OutputParams const & runparams) const
 {
-       return ascii(buf, os, runparams);
+       return plaintext(buf, os, runparams);
 }
 
 
 int InsetFormulaMacro::docbook(Buffer const & buf, ostream & os,
-                              LatexRunParams const & runparams) const
+                              OutputParams const & runparams) const
 {
-       return ascii(buf, os, runparams);
+       return plaintext(buf, os, runparams);
 }
 
 
index ceb0d55abd4c34a7d6b052d27b3a5ac622d26338..b13d26713e5a0b6958f2f1f7ee5aed2a6d0642ce 100644 (file)
@@ -40,17 +40,17 @@ public:
        ///
        void write(Buffer const &, std::ostream & os) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const &) const;
        ///
        int latex(Buffer const &, std::ostream & os,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        ///
        int linuxdoc(Buffer const &, std::ostream & os,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const &, std::ostream &,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
 
        ///
        virtual std::auto_ptr<InsetBase> clone() const;
index 972503938a48c098603a4aedbcc895adef663111..9c6299646d46591fbb3ae9df6eecf3efaa27b5dd 100644 (file)
@@ -210,19 +210,19 @@ void MathInset::mathmlize(MathMLStream & os) const
 }
 
 
-int MathInset::ascii(std::ostream &, LatexRunParams const &) const
+int MathInset::plaintext(std::ostream &, OutputParams const &) const
 {
        return 0;
 }
 
 
-int MathInset::linuxdoc(std::ostream &, LatexRunParams const &) const
+int MathInset::linuxdoc(std::ostream &, OutputParams const &) const
 {
        return 0;
 }
 
 
-int MathInset::docbook(std::ostream &, LatexRunParams const &) const
+int MathInset::docbook(std::ostream &, OutputParams const &) const
 {
        return 0;
 }
index f7b247f8cba2dd41d12bddceb15607faa9915a9f..168727061d97f62aedb897b339a4d0d4e460bd45 100644 (file)
@@ -31,7 +31,7 @@ inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset.
 
 */
 
-class LatexRunParams;
+class OutputParams;
 class MathArrayInset;
 class MathAMSArrayInset;
 class MathCharInset;
@@ -237,11 +237,11 @@ public:
        /// describe content if cursor behind
        virtual void infoize2(std::ostream &) const {}
        /// plain ascii output
-       virtual int ascii(std::ostream & os, LatexRunParams const &) const;
+       virtual int plaintext(std::ostream & os, OutputParams const &) const;
        /// linuxdoc output
-       virtual int linuxdoc(std::ostream & os, LatexRunParams const &) const;
+       virtual int linuxdoc(std::ostream & os, OutputParams const &) const;
        /// docbook output
-       virtual int docbook(std::ostream & os, LatexRunParams const &) const;
+       virtual int docbook(std::ostream & os, OutputParams const &) const;
 
        /// dump content to stderr for debugging
        virtual void dump() const;
index d157c34b75077e520aabb8caaf7497b2adf1b12d..2e749924bb3a2e854d5c54a8fed146620bcaf913 100644 (file)
@@ -123,14 +123,14 @@ void RefInset::validate(LaTeXFeatures & features) const
 }
 
 
-int RefInset::ascii(std::ostream & os, LatexRunParams const &) const
+int RefInset::plaintext(std::ostream & os, OutputParams const &) const
 {
        os << '[' << asString(cell(0)) << ']';
        return 0;
 }
 
 
-int RefInset::linuxdoc(std::ostream & os, LatexRunParams const &) const
+int RefInset::linuxdoc(std::ostream & os, OutputParams const &) const
 {
        os << "<ref id=\"" << asString(cell(0))
           << "\" name=\"" << asString(cell(1)) << "\" >";
@@ -138,7 +138,7 @@ int RefInset::linuxdoc(std::ostream & os, LatexRunParams const &) const
 }
 
 
-int RefInset::docbook(std::ostream & os, LatexRunParams const &) const
+int RefInset::docbook(std::ostream & os, OutputParams const &) const
 {
        if (cell(1).empty()) {
                os << "<xref linkend=\"" << asString(cell(0)) << "\">";
index 094f098ef4e95a2c2ea6ef76892c91d3013f7b19..d5de1403dda6178dc09e3c22998faa48325f1293 100644 (file)
@@ -36,11 +36,11 @@ public:
        virtual RefInset * asRefInset() { return this; }
 
        /// plain ascii output
-       int ascii(std::ostream & os, LatexRunParams const &) const;
+       int plaintext(std::ostream & os, OutputParams const &) const;
        /// linuxdoc output
-       int linuxdoc(std::ostream & os, LatexRunParams const &) const;
+       int linuxdoc(std::ostream & os, OutputParams const &) const;
        /// docbook output
-       int docbook(std::ostream & os, LatexRunParams const &) const;
+       int docbook(std::ostream & os, OutputParams const &) const;
 
        /// small wrapper for the time being
        DispatchResult localDispatch(FuncRequest const & cmd);
diff --git a/src/output.C b/src/output.C
new file mode 100644 (file)
index 0000000..5c9b57f
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * \file output.C
+ * 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 "output.h"
+
+#include "gettext.h"
+
+#include "frontends/Alert.h"
+
+#include "support/filetools.h"
+
+#include <fstream>
+
+using lyx::support::bformat;
+using lyx::support::MakeDisplayPath;
+
+using std::ofstream;
+using std::string;
+
+bool openFileWrite(ofstream & ofs, string const & fname)
+{
+       ofs.open(fname.c_str());
+       if (!ofs) {
+               string const file = MakeDisplayPath(fname, 50);
+               string text = bformat(_("Could not open the specified "
+                                       "document\n%1$s."), file);
+               Alert::error(_("Could not open file"), text);
+               return false;
+       }
+       return true;
+}
diff --git a/src/output.h b/src/output.h
new file mode 100644 (file)
index 0000000..9749288
--- /dev/null
@@ -0,0 +1,19 @@
+// -*- C++ -*-
+/**
+ * \file output.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 OUTPUT_H
+#define OUTPUT_H
+
+#include <iosfwd>
+
+bool openFileWrite(std::ofstream & ofs, std::string const & fname);
+
+#endif
diff --git a/src/output_docbook.C b/src/output_docbook.C
new file mode 100644 (file)
index 0000000..cd099f7
--- /dev/null
@@ -0,0 +1,251 @@
+/**
+ * \file output_docbook.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author José Matos
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "output_docbook.h"
+
+#include "buffer.h"
+#include "bufferparams.h"
+#include "paragraph.h"
+#include "paragraph_funcs.h"
+#include "ParagraphParameters.h"
+#include "sgml.h"
+
+#include "insets/insetcommand.h"
+
+#include "support/lstrings.h"
+#include "support/lyxlib.h"
+
+#include <stack>
+
+#ifdef HAVE_LOCALE
+#endif
+
+using lyx::support::atoi;
+using lyx::support::split;
+
+using std::endl;
+using std::ostream;
+using std::stack;
+using std::vector;
+using std::string;
+
+
+void docbookParagraphs(Buffer const & buf,
+                      ParagraphList const & paragraphs,
+                      ostream & os,
+                      OutputParams const & runparams)
+{
+       vector<string> environment_stack(10);
+       vector<string> environment_inner(10);
+       vector<string> command_stack(10);
+
+       bool command_flag = false;
+       Paragraph::depth_type command_depth = 0;
+       Paragraph::depth_type command_base = 0;
+       Paragraph::depth_type cmd_depth = 0;
+       Paragraph::depth_type depth = 0; // paragraph depth
+
+       string item_name;
+       string command_name;
+
+       ParagraphList::iterator par = const_cast<ParagraphList&>(paragraphs).begin();
+       ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
+
+       for (; par != pend; ++par) {
+               string sgmlparam;
+               string c_depth;
+               string c_params;
+               int desc_on = 0; // description mode
+
+               LyXLayout_ptr const & style = par->layout();
+
+               // environment tag closing
+               for (; depth > par->params().depth(); --depth) {
+                       if (!environment_inner[depth].empty()) 
+                       sgml::closeEnvTags(os, false, environment_inner[depth], 
+                                       command_depth + depth);
+                       sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
+                       environment_stack[depth].erase();
+                       environment_inner[depth].erase();
+               }
+
+               if (depth == par->params().depth()
+                  && environment_stack[depth] != style->latexname()
+                  && !environment_stack[depth].empty()) {
+                               sgml::closeEnvTags(os, false, environment_inner[depth], 
+                                       command_depth + depth);
+                       sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
+
+                       environment_stack[depth].erase();
+                       environment_inner[depth].erase();
+               }
+
+               // Write opening SGML tags.
+               switch (style->latextype) {
+               case LATEX_PARAGRAPH:
+                       sgml::openTag(os, depth + command_depth,
+                                   false, style->latexname());
+                       break;
+
+               case LATEX_COMMAND:
+                       if (depth != 0)
+                               //error(ErrorItem(_("Error"), _("Wrong depth for LatexType Command."), par->id(), 0, par->size()));
+                               ;
+                       
+                       command_name = style->latexname();
+
+                       sgmlparam = style->latexparam();
+                       c_params = split(sgmlparam, c_depth,'|');
+
+                       cmd_depth = atoi(c_depth);
+
+                       if (command_flag) {
+                               if (cmd_depth < command_base) {
+                                       for (Paragraph::depth_type j = command_depth;
+                                            j >= command_base; --j) {
+                                               sgml::closeTag(os, j, false, command_stack[j]);
+                                               os << endl;
+                                       }
+                                       command_depth = command_base = cmd_depth;
+                               } else if (cmd_depth <= command_depth) {
+                                       for (int j = command_depth;
+                                            j >= int(cmd_depth); --j) {
+                                               sgml::closeTag(os, j, false, command_stack[j]);
+                                               os << endl;
+                                       }
+                                       command_depth = cmd_depth;
+                               } else
+                                       command_depth = cmd_depth;
+                       } else {
+                               command_depth = command_base = cmd_depth;
+                               command_flag = true;
+                       }
+                       if (command_stack.size() == command_depth + 1)
+                               command_stack.push_back(string());
+                       command_stack[command_depth] = command_name;
+
+                       // treat label as a special case for
+                       // more WYSIWYM handling.
+                       // This is a hack while paragraphs can't have
+                       // attributes, like id in this case.
+                       if (par->isInset(0)) {
+                               InsetOld * inset = par->getInset(0);
+                               InsetOld::Code lyx_code = inset->lyxCode();
+                               if (lyx_code == InsetOld::LABEL_CODE) {
+                                       command_name += " id=\"";
+                                       command_name += (static_cast<InsetCommand *>(inset))->getContents();
+                                       command_name += '"';
+                                       desc_on = 3;
+                               }
+                       }
+
+                       sgml::openTag(os, depth + command_depth, false, command_name);
+
+                       item_name = c_params.empty() ? "title" : c_params;
+                       sgml::openTag(os, depth + 1 + command_depth, false, item_name);
+                       break;
+
+               case LATEX_ENVIRONMENT:
+               case LATEX_ITEM_ENVIRONMENT:
+                       if (depth < par->params().depth()) {
+                               depth = par->params().depth();
+                               environment_stack[depth].erase();
+                       }
+
+                       if (environment_stack[depth] != style->latexname()) {
+                               if (environment_stack.size() == depth + 1) {
+                                       environment_stack.push_back("!-- --");
+                                       environment_inner.push_back("!-- --");
+                               }
+                               environment_stack[depth] = style->latexname();
+                               environment_inner[depth] = "!-- --";
+                               sgml::openTag(os, depth + command_depth, false, environment_stack[depth]);
+                       } else {
+                                       sgml::closeEnvTags(os, false, environment_inner[depth], 
+                                               command_depth + depth);
+                       }
+
+                       if (style->latextype == LATEX_ENVIRONMENT) {
+                               if (!style->latexparam().empty()) {
+                                       if (style->latexparam() == "CDATA")
+                                               os << "<![CDATA[";
+                                       else
+                                               sgml::openTag(os, depth + command_depth, false, style->latexparam());
+                               }
+                               break;
+                       }
+
+                       desc_on = (style->labeltype == LABEL_MANUAL);
+
+                       environment_inner[depth] = desc_on ? "varlistentry" : "listitem";
+                       sgml::openTag(os, depth + 1 + command_depth,
+                                   false, environment_inner[depth]);
+
+                       item_name = desc_on ? "term" : "para";
+                       sgml::openTag(os, depth + 1 + command_depth,
+                                   false, item_name);
+                       break;
+               default:
+                       sgml::openTag(os, depth + command_depth,
+                                   false, style->latexname());
+                       break;
+               }
+
+               par->simpleDocBookOnePar(buf, os, outerFont(par, paragraphs), desc_on,
+                                        runparams, depth + 1 + command_depth);
+
+               string end_tag;
+               // write closing SGML tags
+               switch (style->latextype) {
+               case LATEX_COMMAND:
+                       end_tag = c_params.empty() ? "title" : c_params;
+                       sgml::closeTag(os, depth + command_depth,
+                                    false, end_tag);
+                       break;
+               case LATEX_ENVIRONMENT:
+                       if (!style->latexparam().empty()) {
+                               if (style->latexparam() == "CDATA")
+                                       os << "]]>";
+                               else
+                                       sgml::closeTag(os, depth + command_depth, false, style->latexparam());
+                       }
+                       break;
+               case LATEX_ITEM_ENVIRONMENT:
+                       if (desc_on == 1) break;
+                       end_tag = "para";
+                       sgml::closeTag(os, depth + 1 + command_depth, false, end_tag);
+                       break;
+               case LATEX_PARAGRAPH:
+                       sgml::closeTag(os, depth + command_depth, false, style->latexname());
+                       break;
+               default:
+                       sgml::closeTag(os, depth + command_depth, false, style->latexname());
+                       break;
+               }
+       }
+
+       // Close open tags
+       for (int d = depth; d >= 0; --d) {
+               if (!environment_stack[depth].empty()) {
+                               sgml::closeEnvTags(os, false, environment_inner[depth], 
+                                       command_depth + depth);
+               }
+       }
+
+       for (int j = command_depth; j >= 0 ; --j)
+               if (!command_stack[j].empty()) {
+                       sgml::closeTag(os, j, false, command_stack[j]);
+                       os << endl;
+               }
+}
+
diff --git a/src/output_docbook.h b/src/output_docbook.h
new file mode 100644 (file)
index 0000000..1e3d837
--- /dev/null
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+/**
+ * \file output_docbook.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 José Matos
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef OUTPUT_DOCBOOK_H
+#define OUTPUT_DOCBOOK_H
+
+#include "ParagraphList_fwd.h"
+
+
+class Buffer;
+class OutputParams;
+
+///
+
+void docbookParagraphs(Buffer const & buf,
+                      ParagraphList const & paragraphs,
+                      std::ostream & os,
+                      OutputParams const & runparams);
+
+#endif
diff --git a/src/output_latex.C b/src/output_latex.C
new file mode 100644 (file)
index 0000000..3b6b344
--- /dev/null
@@ -0,0 +1,530 @@
+/**
+ * \file output_latex.C
+ * 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 "output_latex.h"
+
+#include "buffer.h"
+#include "bufferparams.h"
+#include "debug.h"
+#include "encoding.h"
+#include "language.h"
+#include "lyxrc.h"
+#include "paragraph.h"
+#include "paragraph_funcs.h"
+#include "ParagraphParameters.h"
+#include "texrow.h"
+#include "vspace.h"
+
+#include "insets/insetoptarg.h"
+
+#include "support/lstrings.h"
+
+#ifdef HAVE_LOCALE
+#endif
+
+using lyx::support::subst;
+
+using std::endl;
+using std::ostream;
+using std::string;
+
+extern string bibitemWidest(Buffer const &);
+
+
+namespace {
+
+ParagraphList::iterator
+TeXEnvironment(Buffer const & buf,
+              ParagraphList const & paragraphs,
+              ParagraphList::iterator pit,
+              ostream & os, TexRow & texrow,
+              OutputParams const & runparams);
+
+ParagraphList::iterator
+TeXOnePar(Buffer const & buf,
+         ParagraphList const & paragraphs,
+         ParagraphList::iterator pit,
+         ostream & os, TexRow & texrow,
+         OutputParams const & runparams,
+         string const & everypar = string());
+
+
+ParagraphList::iterator
+TeXDeeper(Buffer const & buf,
+         ParagraphList const & paragraphs,
+         ParagraphList::iterator pit,
+         ostream & os, TexRow & texrow,
+         OutputParams const & runparams)
+{
+       lyxerr[Debug::LATEX] << "TeXDeeper...     " << &*pit << endl;
+       ParagraphList::iterator par = pit;
+
+       while (par != const_cast<ParagraphList&>(paragraphs).end() &&
+                    par->params().depth() == pit->params().depth()) {
+               if (par->layout()->isEnvironment()) {
+                       par = TeXEnvironment(buf, paragraphs, par,
+                                            os, texrow, runparams);
+               } else {
+                       par = TeXOnePar(buf, paragraphs, par,
+                                            os, texrow, runparams);
+               }
+       }
+       lyxerr[Debug::LATEX] << "TeXDeeper...done " << &*par << endl;
+
+       return par;
+}
+
+
+ParagraphList::iterator
+TeXEnvironment(Buffer const & buf,
+              ParagraphList const & paragraphs,
+              ParagraphList::iterator pit,
+              ostream & os, TexRow & texrow,
+              OutputParams const & runparams)
+{
+       lyxerr[Debug::LATEX] << "TeXEnvironment...     " << &*pit << endl;
+
+       BufferParams const & bparams = buf.params();
+
+       LyXLayout_ptr const & style = pit->layout();
+
+       Language const * language = pit->getParLanguage(bparams);
+       Language const * doc_language = bparams.language;
+       Language const * previous_language =
+               (pit != const_cast<ParagraphList&>(paragraphs).begin())
+               ? boost::prior(pit)->getParLanguage(bparams)
+               : doc_language;
+       if (language->babel() != previous_language->babel()) {
+
+               if (!lyxrc.language_command_end.empty() &&
+                   previous_language->babel() != doc_language->babel()) {
+                       os << subst(lyxrc.language_command_end, "$$lang",
+                                   previous_language->babel())
+                          << endl;
+                       texrow.newline();
+               }
+
+               if (lyxrc.language_command_end.empty() ||
+                   language->babel() != doc_language->babel()) {
+                       os << subst(lyxrc.language_command_begin, "$$lang",
+                                   language->babel())
+                          << endl;
+                       texrow.newline();
+               }
+       }
+
+       bool leftindent_open = false;
+       if (!pit->params().leftIndent().zero()) {
+               os << "\\begin{LyXParagraphLeftIndent}{" <<
+                       pit->params().leftIndent().asLatexString() << "}\n";
+               texrow.newline();
+               leftindent_open = true;
+       }
+
+       if (style->isEnvironment()) {
+               if (style->latextype == LATEX_LIST_ENVIRONMENT) {
+                       os << "\\begin{" << style->latexname() << "}{"
+                          << pit->params().labelWidthString() << "}\n";
+               } else if (style->labeltype == LABEL_BIBLIO) {
+                       // ale970405
+                       os << "\\begin{" << style->latexname() << "}{"
+                          <<  bibitemWidest(buf)
+                          << "}\n";
+               } else if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
+                       os << "\\begin{" << style->latexname() << '}'
+                          << style->latexparam() << '\n';
+               } else
+                       os << "\\begin{" << style->latexname() << '}'
+                          << style->latexparam() << '\n';
+               texrow.newline();
+       }
+       ParagraphList::iterator par = pit;
+       do {
+               par = TeXOnePar(buf, paragraphs, par, os, texrow, runparams);
+
+               if (par != const_cast<ParagraphList&>(paragraphs).end() && par->params().depth() > pit->params().depth()) {
+                           if (par->layout()->isParagraph()) {
+
+                           // Thinko!
+                           // How to handle this? (Lgb)
+                           //&& !suffixIs(os, "\n\n")
+                                   //) {
+                               // There should be at least one '\n' already
+                               // but we need there to be two for Standard
+                               // paragraphs that are depth-increment'ed to be
+                               // output correctly.  However, tables can
+                               // also be paragraphs so don't adjust them.
+                               // ARRae
+                               // Thinkee:
+                               // Will it ever harm to have one '\n' too
+                               // many? i.e. that we sometimes will have
+                               // three in a row. (Lgb)
+                               os << '\n';
+                               texrow.newline();
+                       }
+                       par = TeXDeeper(buf, paragraphs, par, os, texrow,
+                                       runparams);
+               }
+       } while (par != const_cast<ParagraphList&>(paragraphs).end()
+                && par->layout() == pit->layout()
+                && par->params().depth() == pit->params().depth()
+                && par->params().leftIndent() == pit->params().leftIndent());
+
+       if (style->isEnvironment()) {
+               os << "\\end{" << style->latexname() << "}\n";
+               texrow.newline();
+       }
+
+       if (leftindent_open) {
+               os << "\\end{LyXParagraphLeftIndent}\n";
+               texrow.newline();
+       }
+
+       lyxerr[Debug::LATEX] << "TeXEnvironment...done " << &*par << endl;
+       return par;  // ale970302
+}
+
+
+InsetOptArg * optArgInset(Paragraph const & par)
+{
+       // Find the entry.
+       InsetList::const_iterator it = par.insetlist.begin();
+       InsetList::const_iterator end = par.insetlist.end();
+       for (; it != end; ++it) {
+               InsetOld * ins = it->inset;
+               if (ins->lyxCode() == InsetOld::OPTARG_CODE) {
+                       return static_cast<InsetOptArg *>(ins);
+               }
+       }
+       return 0;
+}
+
+
+ParagraphList::iterator
+TeXOnePar(Buffer const & buf,
+         ParagraphList const & paragraphs,
+         ParagraphList::iterator pit,
+         ostream & os, TexRow & texrow,
+         OutputParams const & runparams,
+         string const & everypar)
+{
+       lyxerr[Debug::LATEX] << "TeXOnePar...     " << &*pit << " '"
+               << everypar << "'" << endl;
+       BufferParams const & bparams = buf.params();
+
+       InsetOld const * in = pit->inInset();
+       bool further_blank_line = false;
+       LyXLayout_ptr style;
+
+       // well we have to check if we are in an inset with unlimited
+       // length (all in one row) if that is true then we don't allow
+       // any special options in the paragraph and also we don't allow
+       // any environment other then "Standard" to be valid!
+       if (in == 0 || !in->forceDefaultParagraphs(in)) {
+               style = pit->layout();
+
+               if (pit->params().startOfAppendix()) {
+                       os << "\\appendix\n";
+                       texrow.newline();
+               }
+
+               if (!pit->params().spacing().isDefault()
+                       && (pit == const_cast<ParagraphList&>(paragraphs).begin()
+                           || !boost::prior(pit)->hasSameLayout(*pit)))
+               {
+                       os << pit->params().spacing().writeEnvirBegin() << '\n';
+                       texrow.newline();
+               }
+
+               if (style->isCommand()) {
+                       os << '\n';
+                       texrow.newline();
+               }
+
+               if (pit->params().spaceTop().kind() != VSpace::NONE) {
+                       os << pit->params().spaceTop().asLatexCommand(bparams);
+                       further_blank_line = true;
+               }
+
+               if (further_blank_line) {
+                       os << '\n';
+                       texrow.newline();
+               }
+       } else {
+               style = bparams.getLyXTextClass().defaultLayout();
+       }
+
+       Language const * language = pit->getParLanguage(bparams);
+       Language const * doc_language = bparams.language;
+       Language const * previous_language =
+               (pit != const_cast<ParagraphList&>(paragraphs).begin())
+               ? boost::prior(pit)->getParLanguage(bparams)
+               : doc_language;
+
+       if (language->babel() != previous_language->babel()
+           // check if we already put language command in TeXEnvironment()
+           && !(style->isEnvironment()
+                && (pit == const_cast<ParagraphList&>(paragraphs).begin() ||
+                    (boost::prior(pit)->layout() != pit->layout() &&
+                     boost::prior(pit)->getDepth() <= pit->getDepth())
+                    || boost::prior(pit)->getDepth() < pit->getDepth())))
+       {
+               if (!lyxrc.language_command_end.empty() &&
+                   previous_language->babel() != doc_language->babel())
+               {
+                       os << subst(lyxrc.language_command_end, "$$lang",
+                                   previous_language->babel())
+                          << endl;
+                       texrow.newline();
+               }
+
+               if (lyxrc.language_command_end.empty() ||
+                   language->babel() != doc_language->babel())
+               {
+                       os << subst(lyxrc.language_command_begin, "$$lang",
+                                   language->babel())
+                          << endl;
+                       texrow.newline();
+               }
+       }
+
+       if (bparams.inputenc == "auto" &&
+           language->encoding() != previous_language->encoding()) {
+               os << "\\inputencoding{"
+                  << language->encoding()->LatexName()
+                  << "}\n";
+               texrow.newline();
+       }
+
+       switch (style->latextype) {
+       case LATEX_COMMAND:
+               os << '\\' << style->latexname();
+
+               // Separate handling of optional argument inset.
+               if (style->optionalargs == 1) {
+                       InsetOptArg * it = optArgInset(*pit);
+                       if (it)
+                               it->latexOptional(buf, os, runparams);
+               }
+               else
+                       os << style->latexparam();
+               break;
+       case LATEX_ITEM_ENVIRONMENT:
+       case LATEX_LIST_ENVIRONMENT:
+               os << "\\item ";
+               break;
+       case LATEX_BIB_ENVIRONMENT:
+               // ignore this, the inset will write itself
+               break;
+       default:
+               break;
+       }
+
+       os << everypar;
+       bool need_par = pit->simpleTeXOnePar(buf, bparams,
+                                            outerFont(pit, paragraphs),
+                                            os, texrow, runparams);
+
+       // Make sure that \\par is done with the font of the last
+       // character if this has another size as the default.
+       // This is necessary because LaTeX (and LyX on the screen)
+       // calculates the space between the baselines according
+       // to this font. (Matthias)
+       //
+       // Is this really needed ? (Dekel)
+       // We do not need to use to change the font for the last paragraph
+       // or for a command.
+       LyXFont const outerfont(outerFont(pit, paragraphs));
+
+       LyXFont const font =
+               (pit->empty()
+                ? pit->getLayoutFont(bparams, outerfont)
+                : pit->getFont(bparams, pit->size() - 1, outerfont));
+
+       bool is_command = style->isCommand();
+
+       if (style->resfont.size() != font.size()
+           && boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()
+           && !is_command) {
+               if (!need_par)
+                       os << '{';
+               os << "\\" << font.latexSize() << " \\par}";
+       } else if (need_par) {
+               os << "\\par}";
+       } else if (is_command)
+               os << '}';
+
+       switch (style->latextype) {
+       case LATEX_ITEM_ENVIRONMENT:
+       case LATEX_LIST_ENVIRONMENT:
+               if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()
+                   && (pit->params().depth() < boost::next(pit)->params().depth())) {
+                       os << '\n';
+                       texrow.newline();
+               }
+               break;
+       case LATEX_ENVIRONMENT: {
+               // if its the last paragraph of the current environment
+               // skip it otherwise fall through
+               ParagraphList::iterator next = boost::next(pit);
+
+               if (next != const_cast<ParagraphList&>(paragraphs).end()
+                   && (next->layout() != pit->layout()
+                       || next->params().depth() != pit->params().depth()))
+                       break;
+       }
+
+               // fall through possible
+       default:
+               // we don't need it for the last paragraph!!!
+               if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()) {
+                       os << '\n';
+                       texrow.newline();
+               }
+       }
+
+       if (in == 0 || !in->forceDefaultParagraphs(in)) {
+               further_blank_line = false;
+
+               if (pit->params().spaceBottom().kind() != VSpace::NONE) {
+                       os << pit->params().spaceBottom().asLatexCommand(bparams);
+                       further_blank_line = true;
+               }
+
+               if (further_blank_line) {
+                       os << '\n';
+                       texrow.newline();
+               }
+
+               if (!pit->params().spacing().isDefault()
+                       && (boost::next(pit) == const_cast<ParagraphList&>(paragraphs).end()
+                           || !boost::next(pit)->hasSameLayout(*pit)))
+               {
+                       os << pit->params().spacing().writeEnvirEnd() << '\n';
+                       texrow.newline();
+               }
+       }
+
+       // we don't need it for the last paragraph!!!
+       if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()) {
+               os << '\n';
+               texrow.newline();
+       } else {
+               // Since \selectlanguage write the language to the aux file,
+               // we need to reset the language at the end of footnote or
+               // float.
+
+               if (language->babel() != doc_language->babel()) {
+                       if (lyxrc.language_command_end.empty())
+                               os << subst(lyxrc.language_command_begin,
+                                           "$$lang",
+                                           doc_language->babel())
+                                  << endl;
+                       else
+                               os << subst(lyxrc.language_command_end,
+                                           "$$lang",
+                                           language->babel())
+                                  << endl;
+                       texrow.newline();
+               }
+       }
+
+       lyxerr[Debug::LATEX] << "TeXOnePar...done " << &*boost::next(pit) << endl;
+       return ++pit;
+}
+
+} //anon namespace
+
+//
+// LaTeX all paragraphs from par to endpar, if endpar == 0 then to the end
+//
+void latexParagraphs(Buffer const & buf,
+                    ParagraphList const & paragraphs,
+                    ostream & os,
+                    TexRow & texrow,
+                    OutputParams const & runparams,
+                    string const & everypar)
+{
+       bool was_title = false;
+       bool already_title = false;
+       LyXTextClass const & tclass = buf.params().getLyXTextClass();
+       ParagraphList::iterator par = const_cast<ParagraphList&>(paragraphs).begin();
+       ParagraphList::iterator endpar = const_cast<ParagraphList&>(paragraphs).end();
+
+       // if only_body
+       while (par != endpar) {
+               InsetOld * in = par->inInset();
+               // well we have to check if we are in an inset with unlimited
+               // length (all in one row) if that is true then we don't allow
+               // any special options in the paragraph and also we don't allow
+               // any environment other then "Standard" to be valid!
+               if (in == 0 || !in->forceDefaultParagraphs(in)) {
+                       LyXLayout_ptr const & layout = par->layout();
+
+                       if (layout->intitle) {
+                               if (already_title) {
+                                       lyxerr <<"Error in latexParagraphs: You"
+                                               " should not mix title layouts"
+                                               " with normal ones." << endl;
+                               } else if (!was_title) {
+                                       was_title = true;
+                                       if (tclass.titletype() == TITLE_ENVIRONMENT) {
+                                               os << "\\begin{"
+                                                   << tclass.titlename()
+                                                   << "}\n";
+                                               texrow.newline();
+                                       }
+                               }
+                       } else if (was_title && !already_title) {
+                               if (tclass.titletype() == TITLE_ENVIRONMENT) {
+                                       os << "\\end{" << tclass.titlename()
+                                           << "}\n";
+                               }
+                               else {
+                                       os << "\\" << tclass.titlename()
+                                           << "\n";
+                               }
+                               texrow.newline();
+                               already_title = true;
+                               was_title = false;
+                       }
+
+                       if (layout->is_environment) {
+                               par = TeXOnePar(buf, paragraphs, par, os, texrow,
+                                               runparams, everypar);
+                       } else if (layout->isEnvironment() ||
+                               !par->params().leftIndent().zero())
+                       {
+                               par = TeXEnvironment(buf, paragraphs, par, os,
+                                                    texrow, runparams);
+                       } else {
+                               par = TeXOnePar(buf, paragraphs, par, os, texrow,
+                                               runparams, everypar);
+                       }
+               } else {
+                       par = TeXOnePar(buf, paragraphs, par, os, texrow,
+                                       runparams, everypar);
+               }
+       }
+       // It might be that we only have a title in this document
+       if (was_title && !already_title) {
+               if (tclass.titletype() == TITLE_ENVIRONMENT) {
+                       os << "\\end{" << tclass.titlename()
+                           << "}\n";
+               }
+               else {
+                       os << "\\" << tclass.titlename()
+                           << "\n";
+                               }
+               texrow.newline();
+       }
+}
diff --git a/src/output_latex.h b/src/output_latex.h
new file mode 100644 (file)
index 0000000..f2a47b0
--- /dev/null
@@ -0,0 +1,32 @@
+// -*- C++ -*-
+/**
+ * \file output_latex.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 OUTPUT_LATEX_H
+#define OUTPUT_LATEX_H
+
+#include "ParagraphList_fwd.h"
+
+#include <string>
+
+class Buffer;
+class OutputParams;
+class TexRow;
+
+/// Just a wrapper for the method below, first creating the ofstream.
+
+void latexParagraphs(Buffer const & buf,
+                    ParagraphList const & paragraphs,
+                    std::ostream & ofs,
+                    TexRow & texrow,
+                    OutputParams const &,
+                    std::string const & everypar = std::string());
+
+#endif
diff --git a/src/output_linuxdoc.C b/src/output_linuxdoc.C
new file mode 100644 (file)
index 0000000..213112b
--- /dev/null
@@ -0,0 +1,164 @@
+/**
+ * \file output_linuxdoc.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Lars Gullik Bjønnes
+ * \author José Matos
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "output_linuxdoc.h"
+
+#include "buffer.h"
+#include "bufferparams.h"
+#include "paragraph.h"
+#include "paragraph_funcs.h"
+#include "ParagraphParameters.h"
+#include "sgml.h"
+
+#include <stack>
+
+#ifdef HAVE_LOCALE
+#endif
+
+using std::ostream;
+using std::stack;
+using std::vector;
+using std::string;
+
+void linuxdocParagraphs(Buffer const & buf,
+                       ParagraphList const & paragraphs,
+                       ostream & os,
+                       OutputParams const & runparams)
+{
+       
+       Paragraph::depth_type depth = 0; // paragraph depth
+       string item_name;
+       vector<string> environment_stack(5);
+
+       ParagraphList::iterator pit = const_cast<ParagraphList&>(paragraphs).begin();
+       ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
+       for (; pit != pend; ++pit) {
+               LyXLayout_ptr const & style = pit->layout();
+               // treat <toc> as a special case for compatibility with old code
+               if (pit->isInset(0)) {
+                       InsetOld * inset = pit->getInset(0);
+                       InsetOld::Code lyx_code = inset->lyxCode();
+                       if (lyx_code == InsetOld::TOC_CODE) {
+                               string const temp = "toc";
+                               sgml::openTag(os, depth, false, temp);
+                               continue;
+                       }
+               }
+
+               // environment tag closing
+               for (; depth > pit->params().depth(); --depth) {
+                       sgml::closeTag(os, depth, false, environment_stack[depth]);
+                       environment_stack[depth].erase();
+               }
+
+               // write opening SGML tags
+               switch (style->latextype) {
+               case LATEX_PARAGRAPH:
+                       if (depth == pit->params().depth()
+                          && !environment_stack[depth].empty()) {
+                               sgml::closeTag(os, depth, false, environment_stack[depth]);
+                               environment_stack[depth].erase();
+                               if (depth)
+                                       --depth;
+                               else
+                                       os << "</p>";
+                       }
+                       sgml::openTag(os, depth, false, style->latexname());
+                       break;
+
+               case LATEX_COMMAND:
+                       if (depth != 0)
+                               //error(ErrorItem(_("Error:"), _("Wrong depth for LatexType Command.\n"), pit->id(), 0, pit->size()));
+                               ;
+
+                       if (!environment_stack[depth].empty()) {
+                               sgml::closeTag(os, depth, false, environment_stack[depth]);
+                               os << "</p>";
+                       }
+
+                       environment_stack[depth].erase();
+                       sgml::openTag(os, depth, false, style->latexname());
+                       break;
+
+               case LATEX_ENVIRONMENT:
+               case LATEX_ITEM_ENVIRONMENT:
+               case LATEX_BIB_ENVIRONMENT:
+               {
+                       string const & latexname = style->latexname();
+
+                       if (depth == pit->params().depth()
+                           && environment_stack[depth] != latexname) {
+                               sgml::closeTag(os, depth, false,
+                                            environment_stack[depth]);
+                               environment_stack[depth].erase();
+                       }
+                       if (depth < pit->params().depth()) {
+                              depth = pit->params().depth();
+                              environment_stack[depth].erase();
+                       }
+                       if (environment_stack[depth] != latexname) {
+                               if (depth == 0) {
+                                       sgml::openTag(os, depth, false, "p");
+                               }
+                               sgml::openTag(os, depth, false, latexname);
+
+                               if (environment_stack.size() == depth + 1)
+                                       environment_stack.push_back("!-- --");
+                               environment_stack[depth] = latexname;
+                       }
+
+                       if (style->latexparam() == "CDATA")
+                               os << "<![CDATA[";
+
+                       if (style->latextype == LATEX_ENVIRONMENT) break;
+
+                       if (style->labeltype == LABEL_MANUAL)
+                               item_name = "tag";
+                       else
+                               item_name = "item";
+
+                       sgml::openTag(os, depth + 1, false, item_name);
+               }
+               break;
+
+               default:
+                       sgml::openTag(os, depth, false, style->latexname());
+                       break;
+               }
+
+               pit->simpleLinuxDocOnePar(buf, os, outerFont(pit, paragraphs),
+                                         runparams, depth);
+
+               os << "\n";
+               // write closing SGML tags
+               switch (style->latextype) {
+               case LATEX_COMMAND:
+                       break;
+               case LATEX_ENVIRONMENT:
+               case LATEX_ITEM_ENVIRONMENT:
+               case LATEX_BIB_ENVIRONMENT:
+                       if (style->latexparam() == "CDATA")
+                               os << "]]>";
+                       break;
+               default:
+                       sgml::closeTag(os, depth, false, style->latexname());
+                       break;
+               }
+       }
+
+       // Close open tags
+       for (int i = depth; i >= 0; --i)
+               sgml::closeTag(os, depth, false, environment_stack[i]);
+}
+
+
diff --git a/src/output_linuxdoc.h b/src/output_linuxdoc.h
new file mode 100644 (file)
index 0000000..9c8261c
--- /dev/null
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+/**
+ * \file output_linuxdoc.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 José Matos
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef OUTPUT_LINUXDOC_H
+#define OUTPUT_LINUXDOC_H
+
+#include "ParagraphList_fwd.h"
+
+
+class Buffer;
+class OutputParams;
+
+///
+void linuxdocParagraphs(Buffer const & buf,
+                       ParagraphList const & paragraphs,
+                       std::ostream & os,
+                       OutputParams const & runparams);
+       
+
+#endif
diff --git a/src/output_plaintext.C b/src/output_plaintext.C
new file mode 100644 (file)
index 0000000..835ef66
--- /dev/null
@@ -0,0 +1,260 @@
+/**
+ * \file output_plaintext.C
+ * 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 "output_plaintext.h"
+
+#include "buffer.h"
+#include "bufferparams.h"
+#include "debug.h"
+#include "gettext.h"
+#include "output.h"
+#include "outputparams.h"
+#include "paragraph.h"
+#include "ParagraphParameters.h"
+
+#include "support/gzstream.h"
+#include "support/lstrings.h"
+
+#ifdef HAVE_LOCALE
+#endif
+
+using lyx::support::ascii_lowercase;
+using lyx::support::compare_ascii_no_case;
+using lyx::support::compare_no_case;
+using lyx::support::contains;
+
+using lyx::pos_type;
+using std::endl;
+using std::ostream;
+using std::ofstream;
+using std::pair;
+using std::string;
+
+
+void writeFileAscii(Buffer const & buf,
+                   string const & fname,
+                   OutputParams const & runparams)
+{
+       ofstream ofs;
+       if (!::openFileWrite(ofs, fname))
+               return;
+       writeFileAscii(buf, ofs, runparams);
+}
+
+
+void writeFileAscii(Buffer const & buf,
+                   ostream & os,
+                   OutputParams const & runparams)
+{
+       Buffer & tmp = const_cast<Buffer &>(buf);
+       ParagraphList par = const_cast<ParagraphList&>(tmp.paragraphs());
+       ParagraphList::iterator beg = par.begin();
+       ParagraphList::iterator end = par.end();
+       ParagraphList::iterator it = beg;
+       for (; it != end; ++it) {
+               asciiParagraph(buf, *it, os, runparams, it == beg);
+       }
+       os << "\n";
+}
+
+
+namespace {
+
+pair<int, string> const addDepth(int depth, int ldepth)
+{
+       int d = depth * 2;
+       if (ldepth > depth)
+               d += (ldepth - depth) * 2;
+       return make_pair(d, string(d, ' '));
+}
+
+}
+
+
+void asciiParagraph(Buffer const & buf,
+                   Paragraph const & par,
+                   ostream & os,
+                   OutputParams const & runparams,
+                   bool noparbreak)
+{
+       int ltype = 0;
+       Paragraph::depth_type ltype_depth = 0;
+       bool ref_printed = false;
+       Paragraph::depth_type depth = par.params().depth();
+
+       // First write the layout
+       string const & tmp = par.layout()->name();
+       if (compare_no_case(tmp, "itemize") == 0) {
+               ltype = 1;
+               ltype_depth = depth + 1;
+       } else if (compare_ascii_no_case(tmp, "enumerate") == 0) {
+               ltype = 2;
+               ltype_depth = depth + 1;
+       } else if (contains(ascii_lowercase(tmp), "ection")) {
+               ltype = 3;
+               ltype_depth = depth + 1;
+       } else if (contains(ascii_lowercase(tmp), "aragraph")) {
+               ltype = 4;
+               ltype_depth = depth + 1;
+       } else if (compare_ascii_no_case(tmp, "description") == 0) {
+               ltype = 5;
+               ltype_depth = depth + 1;
+       } else if (compare_ascii_no_case(tmp, "abstract") == 0) {
+               ltype = 6;
+               ltype_depth = 0;
+       } else if (compare_ascii_no_case(tmp, "bibliography") == 0) {
+               ltype = 7;
+               ltype_depth = 0;
+       } else {
+               ltype = 0;
+               ltype_depth = 0;
+       }
+
+       /* maybe some vertical spaces */
+
+       /* the labelwidthstring used in lists */
+
+       /* some lines? */
+
+       /* some pagebreaks? */
+
+       /* noindent ? */
+
+       /* what about the alignment */
+
+       // runparams.linelen <= 0 is special and means we don't have paragraph breaks
+
+       string::size_type currlinelen = 0;
+
+       if (!noparbreak) {
+               if (runparams.linelen > 0)
+                       os << "\n\n";
+
+               os << string(depth * 2, ' ');
+               currlinelen += depth * 2;
+
+               //--
+               // we should probably change to the paragraph language in the
+               // gettext here (if possible) so that strings are outputted in
+               // the correct language! (20012712 Jug)
+               //--
+               switch (ltype) {
+               case 0: // Standard
+               case 4: // (Sub)Paragraph
+               case 5: // Description
+                       break;
+               case 6: // Abstract
+                       if (runparams.linelen > 0) {
+                               os << _("Abstract") << "\n\n";
+                               currlinelen = 0;
+                       } else {
+                               string const abst = _("Abstract: ");
+                               os << abst;
+                               currlinelen += abst.length();
+                       }
+                       break;
+               case 7: // Bibliography
+                       if (!ref_printed) {
+                               if (runparams.linelen > 0) {
+                                       os << _("References") << "\n\n";
+                                       currlinelen = 0;
+                               } else {
+                                       string const refs = _("References: ");
+                                       os << refs;
+                                       currlinelen += refs.length();
+                               }
+
+                               ref_printed = true;
+                       }
+                       break;
+               default:
+               {
+                       string const parlab = par.params().labelString();
+                       os << parlab << ' ';
+                       currlinelen += parlab.length() + 1;
+               }
+               break;
+
+               }
+       }
+
+       if (!currlinelen) {
+               pair<int, string> p = addDepth(depth, ltype_depth);
+               os << p.second;
+               currlinelen += p.first;
+       }
+
+       // this is to change the linebreak to do it by word a bit more
+       // intelligent hopefully! (only in the case where we have a
+       // max runparams.linelength!) (Jug)
+
+       string word;
+
+       for (pos_type i = 0; i < par.size(); ++i) {
+               char c = par.getUChar(buf.params(), i);
+               switch (c) {
+               case Paragraph::META_INSET:
+               {
+                       InsetOld const * inset = par.getInset(i);
+                       if (inset) {
+                               if (runparams.linelen > 0) {
+                                       os << word;
+                                       currlinelen += word.length();
+                                       word.erase();
+                               }
+                               if (inset->plaintext(buf, os, runparams)) {
+                                       // to be sure it breaks paragraph
+                                       currlinelen += runparams.linelen;
+                               }
+                       }
+               }
+               break;
+
+               default:
+                       if (c == ' ') {
+                               if (runparams.linelen > 0 &&
+                                   currlinelen + word.length() > runparams.linelen - 10) {
+                                       os << "\n";
+                                       pair<int, string> p = addDepth(depth, ltype_depth);
+                                       os << p.second;
+                                       currlinelen = p.first;
+                               }
+
+                               os << word << ' ';
+                               currlinelen += word.length() + 1;
+                               word.erase();
+
+                       } else {
+                               if (c != '\0') {
+                                       word += c;
+                               } else {
+                                       lyxerr[Debug::INFO] <<
+                                               "writeAsciiFile: NULL char in structure." << endl;
+                               }
+                               if ((runparams.linelen > 0) &&
+                                       (currlinelen + word.length()) > runparams.linelen)
+                               {
+                                       os << "\n";
+
+                                       pair<int, string> p =
+                                               addDepth(depth, ltype_depth);
+                                       os << p.second;
+                                       currlinelen = p.first;
+                               }
+                       }
+                       break;
+               }
+       }
+       os << word;
+}
+
+
diff --git a/src/output_plaintext.h b/src/output_plaintext.h
new file mode 100644 (file)
index 0000000..e535430
--- /dev/null
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+/**
+ * \file output_plaintext.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 OUTPUT_PLAINTEXT_H
+#define OUTPUT_PLAINTEXT_H
+
+#include "ParagraphList_fwd.h"
+
+
+class Buffer;
+class OutputParams;
+
+///
+void writeFileAscii(Buffer const & buf, std::string const &, OutputParams const &);
+///
+void writeFileAscii(Buffer const & buf, std::ostream &, OutputParams const &);
+
+///
+void asciiParagraph(Buffer const & buf,
+                   Paragraph const & paragraphs,
+                   std::ostream & ofs,
+                   OutputParams const &,
+                   bool noparbreak = false);
+
+#endif
diff --git a/src/outputparams.h b/src/outputparams.h
new file mode 100644 (file)
index 0000000..a0aaabd
--- /dev/null
@@ -0,0 +1,64 @@
+// -*- C++ -*-
+/**
+ * \file outputparams.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ *  \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef OUTPUTPARAMS_H
+#define OUTPUTPARAMS_H
+
+struct OutputParams {
+        enum FLAVOR {
+                LATEX,
+                PDFLATEX
+        };
+
+        OutputParams() : flavor(LATEX), nice(false),
+                          moving_arg(false), free_spacing(false),
+                          use_babel(false), mixed_content(false),
+                          linelen(0) {}
+
+       /** The latex that we export depends occasionally on what is to
+           compile the file.
+       */
+        FLAVOR flavor;
+
+       /** Are we to write a 'nice' LaTeX file or not.
+           This esentially seems to mean whether InsetInclude, InsetGraphics
+           and InsetExternal should add the absolute path to any external
+           files or not.
+       */
+       bool nice;
+
+       /** moving_arg == true means that the environment in which the inset
+           is typeset is a moving argument. The inset should take care about
+           fragile commands by preceding the latex with \protect.
+       */
+       bool moving_arg;
+
+       /** free_spacing == true means that the inset is in a free-spacing
+           paragraph.
+       */
+       bool free_spacing;
+
+       /** This var is set by the return value from BufferParams::writeLaTeX
+        */
+       bool use_babel;
+
+       /** Used for docbook to see if inside a region of mixed content.
+           In that case all the white spaces are significant and can not appear
+           at the begin or end.
+        */
+       bool mixed_content;
+
+       /** Line lenght to use with ascii export.
+        */
+       int linelen;
+};
+
+#endif // LATEXRUNPARAMS_H
index aedb75733811d8aaf06aba07a1dc90bdfb97a574..1fcb9c84f2ed07e6c6405a0bd7a758129bd8188e 100644 (file)
 #include "debug.h"
 #include "gettext.h"
 #include "language.h"
-#include "latexrunparams.h"
 #include "lyxfont.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
+#include "outputparams.h"
 #include "paragraph_funcs.h"
 #include "sgml.h"
 #include "texrow.h"
@@ -877,7 +877,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                                BufferParams const & bparams,
                                LyXFont const & outerfont,
                                ostream & os, TexRow & texrow,
-                               LatexRunParams const & runparams)
+                               OutputParams const & runparams)
 {
        lyxerr[Debug::LATEX] << "SimpleTeXOnePar...     " << this << endl;
 
@@ -1023,7 +1023,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
                column += Changes::latexMarkChange(os, running_change, change);
                running_change = change;
 
-               LatexRunParams rp = runparams;
+               OutputParams rp = runparams;
                rp.moving_arg = moving_arg;
                rp.free_spacing = style->free_spacing;
                pimpl_->simpleTeXSpecialChars(buf, bparams,
@@ -1133,7 +1133,7 @@ void reset(PAR_TAG & p1, PAR_TAG const & p2)
 void Paragraph::simpleLinuxDocOnePar(Buffer const & buf,
                                     ostream & os,
                                     LyXFont const & outerfont,
-                                    LatexRunParams const & runparams,
+                                    OutputParams const & runparams,
                                     lyx::depth_type /*depth*/) const
 {
        LyXLayout_ptr const & style = layout();
@@ -1329,7 +1329,7 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf,
                                    ostream & os,
                                    LyXFont const & outerfont,
                                    int & desc_on,
-                                   LatexRunParams const & runparams,
+                                   OutputParams const & runparams,
                                    lyx::depth_type depth) const
 {
        bool emph_flag = false;
@@ -1544,13 +1544,13 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams)
 string const Paragraph::asString(Buffer const & buffer,
                                 bool label) const
 {
-       LatexRunParams runparams;
+       OutputParams runparams;
        return asString(buffer, runparams, label);
 }
 
 
 string const Paragraph::asString(Buffer const & buffer,
-                                LatexRunParams const & runparams,
+                                OutputParams const & runparams,
                                 bool label) const
 {
 #if 0
@@ -1565,7 +1565,7 @@ string const Paragraph::asString(Buffer const & buffer,
                else if (c == META_INSET &&
                         getInset(i)->lyxCode() == InsetOld::MATH_CODE) {
                        ostringstream os;
-                       getInset(i)->ascii(buffer, os, runparams);
+                       getInset(i)->plaintext(buffer, os, runparams);
                        s += subst(STRCONV(os.str()),'\n',' ');
                }
        }
@@ -1583,13 +1583,13 @@ string const Paragraph::asString(Buffer const & buffer,
                                 pos_type beg, pos_type end, bool label) const
 {
 
-       LatexRunParams const runparams;
+       OutputParams const runparams;
        return asString(buffer, runparams, beg, end, label);
 }
 
 
 string const Paragraph::asString(Buffer const & buffer,
-                                LatexRunParams const & runparams,
+                                OutputParams const & runparams,
                                 pos_type beg, pos_type end, bool label) const
 {
        ostringstream os;
@@ -1602,7 +1602,7 @@ string const Paragraph::asString(Buffer const & buffer,
                if (IsPrintable(c))
                        os << c;
                else if (c == META_INSET)
-                       getInset(i)->ascii(buffer, os, runparams);
+                       getInset(i)->plaintext(buffer, os, runparams);
        }
 
        return os.str();
index d0338cd4c45656e29003c0cbbb8e7efeaa400735..169fdc6a793591da96aac15d24e624d4fcc7d70a 100644 (file)
@@ -33,7 +33,7 @@ class InsetBibitem;
 class InsetOld_code;
 class Language;
 class LaTeXFeatures;
-class LatexRunParams;
+class OutputParams;
 class LyXFont;
 class LyXFont_size;
 class ParagraphParameters;
@@ -84,7 +84,7 @@ public:
 
        ///
        std::string const asString(Buffer const &,
-                                  LatexRunParams const & runparams,
+                                  OutputParams const & runparams,
                                   bool label) const;
        ///
        std::string const asString(Buffer const &, bool label) const;
@@ -95,7 +95,7 @@ public:
                                              bool label) const;
        ///
        std::string const asString(Buffer const &,
-                                  LatexRunParams const & runparams,
+                                  OutputParams const & runparams,
                                   lyx::pos_type beg,
                                   lyx::pos_type end,
                                   bool label) const;
@@ -116,13 +116,13 @@ public:
        ///
        bool simpleTeXOnePar(Buffer const &, BufferParams const &,
                             LyXFont const & outerfont, std::ostream &,
-                            TexRow & texrow, LatexRunParams const &);
+                            TexRow & texrow, OutputParams const &);
 
        ///
        void simpleLinuxDocOnePar(Buffer const & buf,
                                  std::ostream & os,
                                  LyXFont const & outerfont,
-                                 LatexRunParams const & runparams,
+                                 OutputParams const & runparams,
                                  lyx::depth_type depth) const;
 
        ///
@@ -130,7 +130,7 @@ public:
                                 std::ostream &,
                                 LyXFont const & outerfont,
                                 int & desc_on,
-                                LatexRunParams const & runparams,
+                                OutputParams const & runparams,
                                 lyx::depth_type depth) const;
 
        ///
index d2c6cef87fcfbd1e790e62084930c70f4fa586a9..10b10573056557d13840f0d747dde7885445ea46 100644 (file)
@@ -22,9 +22,9 @@
 #include "gettext.h"
 #include "iterators.h"
 #include "language.h"
-#include "latexrunparams.h"
 #include "lyxlex.h"
 #include "lyxrc.h"
+#include "outputparams.h"
 #include "paragraph_pimpl.h"
 #include "sgml.h"
 #include "texrow.h"
@@ -67,8 +67,6 @@ using std::istringstream;
 using std::ostream;
 using std::pair;
 
-extern string bibitemWidest(Buffer const &);
-
 
 namespace {
 
@@ -310,1029 +308,6 @@ int getEndLabel(ParagraphList::iterator p, ParagraphList const & plist)
 }
 
 
-namespace {
-
-ParagraphList::iterator
-TeXEnvironment(Buffer const & buf,
-              ParagraphList const & paragraphs,
-              ParagraphList::iterator pit,
-              ostream & os, TexRow & texrow,
-              LatexRunParams const & runparams);
-
-ParagraphList::iterator
-TeXOnePar(Buffer const & buf,
-         ParagraphList const & paragraphs,
-         ParagraphList::iterator pit,
-         ostream & os, TexRow & texrow,
-         LatexRunParams const & runparams,
-         string const & everypar = string());
-
-
-ParagraphList::iterator
-TeXDeeper(Buffer const & buf,
-         ParagraphList const & paragraphs,
-         ParagraphList::iterator pit,
-         ostream & os, TexRow & texrow,
-         LatexRunParams const & runparams)
-{
-       lyxerr[Debug::LATEX] << "TeXDeeper...     " << &*pit << endl;
-       ParagraphList::iterator par = pit;
-
-       while (par != const_cast<ParagraphList&>(paragraphs).end() &&
-                    par->params().depth() == pit->params().depth()) {
-               if (par->layout()->isEnvironment()) {
-                       par = TeXEnvironment(buf, paragraphs, par,
-                                            os, texrow, runparams);
-               } else {
-                       par = TeXOnePar(buf, paragraphs, par,
-                                            os, texrow, runparams);
-               }
-       }
-       lyxerr[Debug::LATEX] << "TeXDeeper...done " << &*par << endl;
-
-       return par;
-}
-
-
-ParagraphList::iterator
-TeXEnvironment(Buffer const & buf,
-              ParagraphList const & paragraphs,
-              ParagraphList::iterator pit,
-              ostream & os, TexRow & texrow,
-              LatexRunParams const & runparams)
-{
-       lyxerr[Debug::LATEX] << "TeXEnvironment...     " << &*pit << endl;
-
-       BufferParams const & bparams = buf.params();
-
-       LyXLayout_ptr const & style = pit->layout();
-
-       Language const * language = pit->getParLanguage(bparams);
-       Language const * doc_language = bparams.language;
-       Language const * previous_language =
-               (pit != const_cast<ParagraphList&>(paragraphs).begin())
-               ? boost::prior(pit)->getParLanguage(bparams)
-               : doc_language;
-       if (language->babel() != previous_language->babel()) {
-
-               if (!lyxrc.language_command_end.empty() &&
-                   previous_language->babel() != doc_language->babel()) {
-                       os << subst(lyxrc.language_command_end, "$$lang",
-                                   previous_language->babel())
-                          << endl;
-                       texrow.newline();
-               }
-
-               if (lyxrc.language_command_end.empty() ||
-                   language->babel() != doc_language->babel()) {
-                       os << subst(lyxrc.language_command_begin, "$$lang",
-                                   language->babel())
-                          << endl;
-                       texrow.newline();
-               }
-       }
-
-       bool leftindent_open = false;
-       if (!pit->params().leftIndent().zero()) {
-               os << "\\begin{LyXParagraphLeftIndent}{" <<
-                       pit->params().leftIndent().asLatexString() << "}\n";
-               texrow.newline();
-               leftindent_open = true;
-       }
-
-       if (style->isEnvironment()) {
-               if (style->latextype == LATEX_LIST_ENVIRONMENT) {
-                       os << "\\begin{" << style->latexname() << "}{"
-                          << pit->params().labelWidthString() << "}\n";
-               } else if (style->labeltype == LABEL_BIBLIO) {
-                       // ale970405
-                       os << "\\begin{" << style->latexname() << "}{"
-                          <<  bibitemWidest(buf)
-                          << "}\n";
-               } else if (style->latextype == LATEX_ITEM_ENVIRONMENT) {
-                       os << "\\begin{" << style->latexname() << '}'
-                          << style->latexparam() << '\n';
-               } else
-                       os << "\\begin{" << style->latexname() << '}'
-                          << style->latexparam() << '\n';
-               texrow.newline();
-       }
-       ParagraphList::iterator par = pit;
-       do {
-               par = TeXOnePar(buf, paragraphs, par, os, texrow, runparams);
-
-               if (par != const_cast<ParagraphList&>(paragraphs).end() && par->params().depth() > pit->params().depth()) {
-                           if (par->layout()->isParagraph()) {
-
-                           // Thinko!
-                           // How to handle this? (Lgb)
-                           //&& !suffixIs(os, "\n\n")
-                                   //) {
-                               // There should be at least one '\n' already
-                               // but we need there to be two for Standard
-                               // paragraphs that are depth-increment'ed to be
-                               // output correctly.  However, tables can
-                               // also be paragraphs so don't adjust them.
-                               // ARRae
-                               // Thinkee:
-                               // Will it ever harm to have one '\n' too
-                               // many? i.e. that we sometimes will have
-                               // three in a row. (Lgb)
-                               os << '\n';
-                               texrow.newline();
-                       }
-                       par = TeXDeeper(buf, paragraphs, par, os, texrow,
-                                       runparams);
-               }
-       } while (par != const_cast<ParagraphList&>(paragraphs).end()
-                && par->layout() == pit->layout()
-                && par->params().depth() == pit->params().depth()
-                && par->params().leftIndent() == pit->params().leftIndent());
-
-       if (style->isEnvironment()) {
-               os << "\\end{" << style->latexname() << "}\n";
-               texrow.newline();
-       }
-
-       if (leftindent_open) {
-               os << "\\end{LyXParagraphLeftIndent}\n";
-               texrow.newline();
-       }
-
-       lyxerr[Debug::LATEX] << "TeXEnvironment...done " << &*par << endl;
-       return par;  // ale970302
-}
-
-
-InsetOptArg * optArgInset(Paragraph const & par)
-{
-       // Find the entry.
-       InsetList::const_iterator it = par.insetlist.begin();
-       InsetList::const_iterator end = par.insetlist.end();
-       for (; it != end; ++it) {
-               InsetOld * ins = it->inset;
-               if (ins->lyxCode() == InsetOld::OPTARG_CODE) {
-                       return static_cast<InsetOptArg *>(ins);
-               }
-       }
-       return 0;
-}
-
-
-ParagraphList::iterator
-TeXOnePar(Buffer const & buf,
-         ParagraphList const & paragraphs,
-         ParagraphList::iterator pit,
-         ostream & os, TexRow & texrow,
-         LatexRunParams const & runparams,
-         string const & everypar)
-{
-       lyxerr[Debug::LATEX] << "TeXOnePar...     " << &*pit << " '"
-               << everypar << "'" << endl;
-       BufferParams const & bparams = buf.params();
-
-       InsetOld const * in = pit->inInset();
-       bool further_blank_line = false;
-       LyXLayout_ptr style;
-
-       // well we have to check if we are in an inset with unlimited
-       // length (all in one row) if that is true then we don't allow
-       // any special options in the paragraph and also we don't allow
-       // any environment other then "Standard" to be valid!
-       if (in == 0 || !in->forceDefaultParagraphs(in)) {
-               style = pit->layout();
-
-               if (pit->params().startOfAppendix()) {
-                       os << "\\appendix\n";
-                       texrow.newline();
-               }
-
-               if (!pit->params().spacing().isDefault()
-                       && (pit == const_cast<ParagraphList&>(paragraphs).begin()
-                           || !boost::prior(pit)->hasSameLayout(*pit)))
-               {
-                       os << pit->params().spacing().writeEnvirBegin() << '\n';
-                       texrow.newline();
-               }
-
-               if (style->isCommand()) {
-                       os << '\n';
-                       texrow.newline();
-               }
-
-               if (pit->params().spaceTop().kind() != VSpace::NONE) {
-                       os << pit->params().spaceTop().asLatexCommand(bparams);
-                       further_blank_line = true;
-               }
-
-               if (further_blank_line) {
-                       os << '\n';
-                       texrow.newline();
-               }
-       } else {
-               style = bparams.getLyXTextClass().defaultLayout();
-       }
-
-       Language const * language = pit->getParLanguage(bparams);
-       Language const * doc_language = bparams.language;
-       Language const * previous_language =
-               (pit != const_cast<ParagraphList&>(paragraphs).begin())
-               ? boost::prior(pit)->getParLanguage(bparams)
-               : doc_language;
-
-       if (language->babel() != previous_language->babel()
-           // check if we already put language command in TeXEnvironment()
-           && !(style->isEnvironment()
-                && (pit == const_cast<ParagraphList&>(paragraphs).begin() ||
-                    (boost::prior(pit)->layout() != pit->layout() &&
-                     boost::prior(pit)->getDepth() <= pit->getDepth())
-                    || boost::prior(pit)->getDepth() < pit->getDepth())))
-       {
-               if (!lyxrc.language_command_end.empty() &&
-                   previous_language->babel() != doc_language->babel())
-               {
-                       os << subst(lyxrc.language_command_end, "$$lang",
-                                   previous_language->babel())
-                          << endl;
-                       texrow.newline();
-               }
-
-               if (lyxrc.language_command_end.empty() ||
-                   language->babel() != doc_language->babel())
-               {
-                       os << subst(lyxrc.language_command_begin, "$$lang",
-                                   language->babel())
-                          << endl;
-                       texrow.newline();
-               }
-       }
-
-       if (bparams.inputenc == "auto" &&
-           language->encoding() != previous_language->encoding()) {
-               os << "\\inputencoding{"
-                  << language->encoding()->LatexName()
-                  << "}\n";
-               texrow.newline();
-       }
-
-       switch (style->latextype) {
-       case LATEX_COMMAND:
-               os << '\\' << style->latexname();
-
-               // Separate handling of optional argument inset.
-               if (style->optionalargs == 1) {
-                       InsetOptArg * it = optArgInset(*pit);
-                       if (it)
-                               it->latexOptional(buf, os, runparams);
-               }
-               else
-                       os << style->latexparam();
-               break;
-       case LATEX_ITEM_ENVIRONMENT:
-       case LATEX_LIST_ENVIRONMENT:
-               os << "\\item ";
-               break;
-       case LATEX_BIB_ENVIRONMENT:
-               // ignore this, the inset will write itself
-               break;
-       default:
-               break;
-       }
-
-       os << everypar;
-       bool need_par = pit->simpleTeXOnePar(buf, bparams,
-                                            outerFont(pit, paragraphs),
-                                            os, texrow, runparams);
-
-       // Make sure that \\par is done with the font of the last
-       // character if this has another size as the default.
-       // This is necessary because LaTeX (and LyX on the screen)
-       // calculates the space between the baselines according
-       // to this font. (Matthias)
-       //
-       // Is this really needed ? (Dekel)
-       // We do not need to use to change the font for the last paragraph
-       // or for a command.
-       LyXFont const outerfont(outerFont(pit, paragraphs));
-
-       LyXFont const font =
-               (pit->empty()
-                ? pit->getLayoutFont(bparams, outerfont)
-                : pit->getFont(bparams, pit->size() - 1, outerfont));
-
-       bool is_command = style->isCommand();
-
-       if (style->resfont.size() != font.size()
-           && boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()
-           && !is_command) {
-               if (!need_par)
-                       os << '{';
-               os << "\\" << font.latexSize() << " \\par}";
-       } else if (need_par) {
-               os << "\\par}";
-       } else if (is_command)
-               os << '}';
-
-       switch (style->latextype) {
-       case LATEX_ITEM_ENVIRONMENT:
-       case LATEX_LIST_ENVIRONMENT:
-               if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()
-                   && (pit->params().depth() < boost::next(pit)->params().depth())) {
-                       os << '\n';
-                       texrow.newline();
-               }
-               break;
-       case LATEX_ENVIRONMENT: {
-               // if its the last paragraph of the current environment
-               // skip it otherwise fall through
-               ParagraphList::iterator next = boost::next(pit);
-
-               if (next != const_cast<ParagraphList&>(paragraphs).end()
-                   && (next->layout() != pit->layout()
-                       || next->params().depth() != pit->params().depth()))
-                       break;
-       }
-
-               // fall through possible
-       default:
-               // we don't need it for the last paragraph!!!
-               if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()) {
-                       os << '\n';
-                       texrow.newline();
-               }
-       }
-
-       if (in == 0 || !in->forceDefaultParagraphs(in)) {
-               further_blank_line = false;
-
-               if (pit->params().spaceBottom().kind() != VSpace::NONE) {
-                       os << pit->params().spaceBottom().asLatexCommand(bparams);
-                       further_blank_line = true;
-               }
-
-               if (further_blank_line) {
-                       os << '\n';
-                       texrow.newline();
-               }
-
-               if (!pit->params().spacing().isDefault()
-                       && (boost::next(pit) == const_cast<ParagraphList&>(paragraphs).end()
-                           || !boost::next(pit)->hasSameLayout(*pit)))
-               {
-                       os << pit->params().spacing().writeEnvirEnd() << '\n';
-                       texrow.newline();
-               }
-       }
-
-       // we don't need it for the last paragraph!!!
-       if (boost::next(pit) != const_cast<ParagraphList&>(paragraphs).end()) {
-               os << '\n';
-               texrow.newline();
-       } else {
-               // Since \selectlanguage write the language to the aux file,
-               // we need to reset the language at the end of footnote or
-               // float.
-
-               if (language->babel() != doc_language->babel()) {
-                       if (lyxrc.language_command_end.empty())
-                               os << subst(lyxrc.language_command_begin,
-                                           "$$lang",
-                                           doc_language->babel())
-                                  << endl;
-                       else
-                               os << subst(lyxrc.language_command_end,
-                                           "$$lang",
-                                           language->babel())
-                                  << endl;
-                       texrow.newline();
-               }
-       }
-
-       lyxerr[Debug::LATEX] << "TeXOnePar...done " << &*boost::next(pit) << endl;
-       return ++pit;
-}
-
-} // anon namespace
-
-
-//
-// LaTeX all paragraphs from par to endpar, if endpar == 0 then to the end
-//
-void latexParagraphs(Buffer const & buf,
-                    ParagraphList const & paragraphs,
-                    ostream & os,
-                    TexRow & texrow,
-                    LatexRunParams const & runparams,
-                    string const & everypar)
-{
-       bool was_title = false;
-       bool already_title = false;
-       LyXTextClass const & tclass = buf.params().getLyXTextClass();
-       ParagraphList::iterator par = const_cast<ParagraphList&>(paragraphs).begin();
-       ParagraphList::iterator endpar = const_cast<ParagraphList&>(paragraphs).end();
-
-       // if only_body
-       while (par != endpar) {
-               InsetOld * in = par->inInset();
-               // well we have to check if we are in an inset with unlimited
-               // length (all in one row) if that is true then we don't allow
-               // any special options in the paragraph and also we don't allow
-               // any environment other then "Standard" to be valid!
-               if (in == 0 || !in->forceDefaultParagraphs(in)) {
-                       LyXLayout_ptr const & layout = par->layout();
-
-                       if (layout->intitle) {
-                               if (already_title) {
-                                       lyxerr <<"Error in latexParagraphs: You"
-                                               " should not mix title layouts"
-                                               " with normal ones." << endl;
-                               } else if (!was_title) {
-                                       was_title = true;
-                                       if (tclass.titletype() == TITLE_ENVIRONMENT) {
-                                               os << "\\begin{"
-                                                   << tclass.titlename()
-                                                   << "}\n";
-                                               texrow.newline();
-                                       }
-                               }
-                       } else if (was_title && !already_title) {
-                               if (tclass.titletype() == TITLE_ENVIRONMENT) {
-                                       os << "\\end{" << tclass.titlename()
-                                           << "}\n";
-                               }
-                               else {
-                                       os << "\\" << tclass.titlename()
-                                           << "\n";
-                               }
-                               texrow.newline();
-                               already_title = true;
-                               was_title = false;
-                       }
-
-                       if (layout->is_environment) {
-                               par = TeXOnePar(buf, paragraphs, par, os, texrow,
-                                               runparams, everypar);
-                       } else if (layout->isEnvironment() ||
-                               !par->params().leftIndent().zero())
-                       {
-                               par = TeXEnvironment(buf, paragraphs, par, os,
-                                                    texrow, runparams);
-                       } else {
-                               par = TeXOnePar(buf, paragraphs, par, os, texrow,
-                                               runparams, everypar);
-                       }
-               } else {
-                       par = TeXOnePar(buf, paragraphs, par, os, texrow,
-                                       runparams, everypar);
-               }
-       }
-       // It might be that we only have a title in this document
-       if (was_title && !already_title) {
-               if (tclass.titletype() == TITLE_ENVIRONMENT) {
-                       os << "\\end{" << tclass.titlename()
-                           << "}\n";
-               }
-               else {
-                       os << "\\" << tclass.titlename()
-                           << "\n";
-                               }
-               texrow.newline();
-       }
-}
-
-
-namespace {
-
-pair<int, string> const addDepth(int depth, int ldepth)
-{
-       int d = depth * 2;
-       if (ldepth > depth)
-               d += (ldepth - depth) * 2;
-       return make_pair(d, string(d, ' '));
-}
-
-}
-
-
-void asciiParagraph(Buffer const & buf,
-                   Paragraph const & par,
-                   ostream & os,
-                   LatexRunParams const & runparams,
-                   bool noparbreak)
-{
-       int ltype = 0;
-       Paragraph::depth_type ltype_depth = 0;
-       bool ref_printed = false;
-       Paragraph::depth_type depth = par.params().depth();
-
-       // First write the layout
-       string const & tmp = par.layout()->name();
-       if (compare_no_case(tmp, "itemize") == 0) {
-               ltype = 1;
-               ltype_depth = depth + 1;
-       } else if (compare_ascii_no_case(tmp, "enumerate") == 0) {
-               ltype = 2;
-               ltype_depth = depth + 1;
-       } else if (contains(ascii_lowercase(tmp), "ection")) {
-               ltype = 3;
-               ltype_depth = depth + 1;
-       } else if (contains(ascii_lowercase(tmp), "aragraph")) {
-               ltype = 4;
-               ltype_depth = depth + 1;
-       } else if (compare_ascii_no_case(tmp, "description") == 0) {
-               ltype = 5;
-               ltype_depth = depth + 1;
-       } else if (compare_ascii_no_case(tmp, "abstract") == 0) {
-               ltype = 6;
-               ltype_depth = 0;
-       } else if (compare_ascii_no_case(tmp, "bibliography") == 0) {
-               ltype = 7;
-               ltype_depth = 0;
-       } else {
-               ltype = 0;
-               ltype_depth = 0;
-       }
-
-       /* maybe some vertical spaces */
-
-       /* the labelwidthstring used in lists */
-
-       /* some lines? */
-
-       /* some pagebreaks? */
-
-       /* noindent ? */
-
-       /* what about the alignment */
-
-       // runparams.linelen <= 0 is special and means we don't have paragraph breaks
-
-       string::size_type currlinelen = 0;
-
-       if (!noparbreak) {
-               if (runparams.linelen > 0)
-                       os << "\n\n";
-
-               os << string(depth * 2, ' ');
-               currlinelen += depth * 2;
-
-               //--
-               // we should probably change to the paragraph language in the
-               // gettext here (if possible) so that strings are outputted in
-               // the correct language! (20012712 Jug)
-               //--
-               switch (ltype) {
-               case 0: // Standard
-               case 4: // (Sub)Paragraph
-               case 5: // Description
-                       break;
-               case 6: // Abstract
-                       if (runparams.linelen > 0) {
-                               os << _("Abstract") << "\n\n";
-                               currlinelen = 0;
-                       } else {
-                               string const abst = _("Abstract: ");
-                               os << abst;
-                               currlinelen += abst.length();
-                       }
-                       break;
-               case 7: // Bibliography
-                       if (!ref_printed) {
-                               if (runparams.linelen > 0) {
-                                       os << _("References") << "\n\n";
-                                       currlinelen = 0;
-                               } else {
-                                       string const refs = _("References: ");
-                                       os << refs;
-                                       currlinelen += refs.length();
-                               }
-
-                               ref_printed = true;
-                       }
-                       break;
-               default:
-               {
-                       string const parlab = par.params().labelString();
-                       os << parlab << ' ';
-                       currlinelen += parlab.length() + 1;
-               }
-               break;
-
-               }
-       }
-
-       if (!currlinelen) {
-               pair<int, string> p = addDepth(depth, ltype_depth);
-               os << p.second;
-               currlinelen += p.first;
-       }
-
-       // this is to change the linebreak to do it by word a bit more
-       // intelligent hopefully! (only in the case where we have a
-       // max runparams.linelength!) (Jug)
-
-       string word;
-
-       for (pos_type i = 0; i < par.size(); ++i) {
-               char c = par.getUChar(buf.params(), i);
-               switch (c) {
-               case Paragraph::META_INSET:
-               {
-                       InsetOld const * inset = par.getInset(i);
-                       if (inset) {
-                               if (runparams.linelen > 0) {
-                                       os << word;
-                                       currlinelen += word.length();
-                                       word.erase();
-                               }
-                               if (inset->ascii(buf, os, runparams)) {
-                                       // to be sure it breaks paragraph
-                                       currlinelen += runparams.linelen;
-                               }
-                       }
-               }
-               break;
-
-               default:
-                       if (c == ' ') {
-                               if (runparams.linelen > 0 &&
-                                   currlinelen + word.length() > runparams.linelen - 10) {
-                                       os << "\n";
-                                       pair<int, string> p = addDepth(depth, ltype_depth);
-                                       os << p.second;
-                                       currlinelen = p.first;
-                               }
-
-                               os << word << ' ';
-                               currlinelen += word.length() + 1;
-                               word.erase();
-
-                       } else {
-                               if (c != '\0') {
-                                       word += c;
-                               } else {
-                                       lyxerr[Debug::INFO] <<
-                                               "writeAsciiFile: NULL char in structure." << endl;
-                               }
-                               if ((runparams.linelen > 0) &&
-                                       (currlinelen + word.length()) > runparams.linelen)
-                               {
-                                       os << "\n";
-
-                                       pair<int, string> p =
-                                               addDepth(depth, ltype_depth);
-                                       os << p.second;
-                                       currlinelen = p.first;
-                               }
-                       }
-                       break;
-               }
-       }
-       os << word;
-}
-
-
-void linuxdocParagraphs(Buffer const & buf,
-                       ParagraphList const & paragraphs,
-                       ostream & os,
-                       LatexRunParams const & runparams)
-{
-
-       Paragraph::depth_type depth = 0; // paragraph depth
-       string item_name;
-       vector<string> environment_stack(5);
-
-       ParagraphList::iterator pit = const_cast<ParagraphList&>(paragraphs).begin();
-       ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
-       for (; pit != pend; ++pit) {
-               LyXLayout_ptr const & style = pit->layout();
-               // treat <toc> as a special case for compatibility with old code
-               if (pit->isInset(0)) {
-                       InsetOld * inset = pit->getInset(0);
-                       InsetOld::Code lyx_code = inset->lyxCode();
-                       if (lyx_code == InsetOld::TOC_CODE) {
-                               string const temp = "toc";
-                               sgml::openTag(os, depth, false, temp);
-                               continue;
-                       }
-               }
-
-               // environment tag closing
-               for (; depth > pit->params().depth(); --depth) {
-                       sgml::closeTag(os, depth, false, environment_stack[depth]);
-                       environment_stack[depth].erase();
-               }
-
-               // write opening SGML tags
-               switch (style->latextype) {
-               case LATEX_PARAGRAPH:
-                       if (depth == pit->params().depth()
-                          && !environment_stack[depth].empty()) {
-                               sgml::closeTag(os, depth, false, environment_stack[depth]);
-                               environment_stack[depth].erase();
-                               if (depth)
-                                       --depth;
-                               else
-                                       os << "</p>";
-                       }
-                       sgml::openTag(os, depth, false, style->latexname());
-                       break;
-
-               case LATEX_COMMAND:
-                       if (depth != 0)
-                               //error(ErrorItem(_("Error:"), _("Wrong depth for LatexType Command.\n"), pit->id(), 0, pit->size()));
-                               ;
-
-                       if (!environment_stack[depth].empty()) {
-                               sgml::closeTag(os, depth, false, environment_stack[depth]);
-                               os << "</p>";
-                       }
-
-                       environment_stack[depth].erase();
-                       sgml::openTag(os, depth, false, style->latexname());
-                       break;
-
-               case LATEX_ENVIRONMENT:
-               case LATEX_ITEM_ENVIRONMENT:
-               case LATEX_BIB_ENVIRONMENT:
-               {
-                       string const & latexname = style->latexname();
-
-                       if (depth == pit->params().depth()
-                           && environment_stack[depth] != latexname) {
-                               sgml::closeTag(os, depth, false,
-                                            environment_stack[depth]);
-                               environment_stack[depth].erase();
-                       }
-                       if (depth < pit->params().depth()) {
-                              depth = pit->params().depth();
-                              environment_stack[depth].erase();
-                       }
-                       if (environment_stack[depth] != latexname) {
-                               if (depth == 0) {
-                                       sgml::openTag(os, depth, false, "p");
-                               }
-                               sgml::openTag(os, depth, false, latexname);
-
-                               if (environment_stack.size() == depth + 1)
-                                       environment_stack.push_back("!-- --");
-                               environment_stack[depth] = latexname;
-                       }
-
-                       if (style->latexparam() == "CDATA")
-                               os << "<![CDATA[";
-
-                       if (style->latextype == LATEX_ENVIRONMENT) break;
-
-                       if (style->labeltype == LABEL_MANUAL)
-                               item_name = "tag";
-                       else
-                               item_name = "item";
-
-                       sgml::openTag(os, depth + 1, false, item_name);
-               }
-               break;
-
-               default:
-                       sgml::openTag(os, depth, false, style->latexname());
-                       break;
-               }
-
-               pit->simpleLinuxDocOnePar(buf, os, outerFont(pit, paragraphs),
-                                         runparams, depth);
-
-               os << "\n";
-               // write closing SGML tags
-               switch (style->latextype) {
-               case LATEX_COMMAND:
-                       break;
-               case LATEX_ENVIRONMENT:
-               case LATEX_ITEM_ENVIRONMENT:
-               case LATEX_BIB_ENVIRONMENT:
-                       if (style->latexparam() == "CDATA")
-                               os << "]]>";
-                       break;
-               default:
-                       sgml::closeTag(os, depth, false, style->latexname());
-                       break;
-               }
-       }
-
-       // Close open tags
-       for (int i = depth; i >= 0; --i)
-               sgml::closeTag(os, depth, false, environment_stack[i]);
-}
-
-
-void docbookParagraphs(Buffer const & buf,
-                      ParagraphList const & paragraphs,
-                      ostream & os,
-                      LatexRunParams const & runparams)
-{
-       vector<string> environment_stack(10);
-       vector<string> environment_inner(10);
-       vector<string> command_stack(10);
-
-       bool command_flag = false;
-       Paragraph::depth_type command_depth = 0;
-       Paragraph::depth_type command_base = 0;
-       Paragraph::depth_type cmd_depth = 0;
-       Paragraph::depth_type depth = 0; // paragraph depth
-
-       string item_name;
-       string command_name;
-
-       ParagraphList::iterator par = const_cast<ParagraphList&>(paragraphs).begin();
-       ParagraphList::iterator pend = const_cast<ParagraphList&>(paragraphs).end();
-
-       for (; par != pend; ++par) {
-               string sgmlparam;
-               string c_depth;
-               string c_params;
-               int desc_on = 0; // description mode
-
-               LyXLayout_ptr const & style = par->layout();
-
-               // environment tag closing
-               for (; depth > par->params().depth(); --depth) {
-                       if (!environment_inner[depth].empty())
-                       sgml::closeEnvTags(os, false, environment_inner[depth],
-                                       command_depth + depth);
-                       sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
-                       environment_stack[depth].erase();
-                       environment_inner[depth].erase();
-               }
-
-               if (depth == par->params().depth()
-                  && environment_stack[depth] != style->latexname()
-                  && !environment_stack[depth].empty()) {
-                               sgml::closeEnvTags(os, false, environment_inner[depth],
-                                       command_depth + depth);
-                       sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]);
-
-                       environment_stack[depth].erase();
-                       environment_inner[depth].erase();
-               }
-
-               // Write opening SGML tags.
-               switch (style->latextype) {
-               case LATEX_PARAGRAPH:
-                       sgml::openTag(os, depth + command_depth,
-                                   false, style->latexname());
-                       break;
-
-               case LATEX_COMMAND:
-                       if (depth != 0)
-                               //error(ErrorItem(_("Error"), _("Wrong depth for LatexType Command."), par->id(), 0, par->size()));
-                               ;
-
-                       command_name = style->latexname();
-
-                       sgmlparam = style->latexparam();
-                       c_params = split(sgmlparam, c_depth,'|');
-
-                       cmd_depth = atoi(c_depth);
-
-                       if (command_flag) {
-                               if (cmd_depth < command_base) {
-                                       for (Paragraph::depth_type j = command_depth;
-                                            j >= command_base; --j) {
-                                               sgml::closeTag(os, j, false, command_stack[j]);
-                                               os << endl;
-                                       }
-                                       command_depth = command_base = cmd_depth;
-                               } else if (cmd_depth <= command_depth) {
-                                       for (int j = command_depth;
-                                            j >= int(cmd_depth); --j) {
-                                               sgml::closeTag(os, j, false, command_stack[j]);
-                                               os << endl;
-                                       }
-                                       command_depth = cmd_depth;
-                               } else
-                                       command_depth = cmd_depth;
-                       } else {
-                               command_depth = command_base = cmd_depth;
-                               command_flag = true;
-                       }
-                       if (command_stack.size() == command_depth + 1)
-                               command_stack.push_back(string());
-                       command_stack[command_depth] = command_name;
-
-                       // treat label as a special case for
-                       // more WYSIWYM handling.
-                       // This is a hack while paragraphs can't have
-                       // attributes, like id in this case.
-                       if (par->isInset(0)) {
-                               InsetOld * inset = par->getInset(0);
-                               InsetOld::Code lyx_code = inset->lyxCode();
-                               if (lyx_code == InsetOld::LABEL_CODE) {
-                                       command_name += " id=\"";
-                                       command_name += (static_cast<InsetCommand *>(inset))->getContents();
-                                       command_name += '"';
-                                       desc_on = 3;
-                               }
-                       }
-
-                       sgml::openTag(os, depth + command_depth, false, command_name);
-
-                       item_name = c_params.empty() ? "title" : c_params;
-                       sgml::openTag(os, depth + 1 + command_depth, false, item_name);
-                       break;
-
-               case LATEX_ENVIRONMENT:
-               case LATEX_ITEM_ENVIRONMENT:
-                       if (depth < par->params().depth()) {
-                               depth = par->params().depth();
-                               environment_stack[depth].erase();
-                       }
-
-                       if (environment_stack[depth] != style->latexname()) {
-                               if (environment_stack.size() == depth + 1) {
-                                       environment_stack.push_back("!-- --");
-                                       environment_inner.push_back("!-- --");
-                               }
-                               environment_stack[depth] = style->latexname();
-                               environment_inner[depth] = "!-- --";
-                               sgml::openTag(os, depth + command_depth, false, environment_stack[depth]);
-                       } else {
-                                       sgml::closeEnvTags(os, false, environment_inner[depth],
-                                               command_depth + depth);
-                       }
-
-                       if (style->latextype == LATEX_ENVIRONMENT) {
-                               if (!style->latexparam().empty()) {
-                                       if (style->latexparam() == "CDATA")
-                                               os << "<![CDATA[";
-                                       else
-                                               sgml::openTag(os, depth + command_depth, false, style->latexparam());
-                               }
-                               break;
-                       }
-
-                       desc_on = (style->labeltype == LABEL_MANUAL);
-
-                       environment_inner[depth] = desc_on ? "varlistentry" : "listitem";
-                       sgml::openTag(os, depth + 1 + command_depth,
-                                   false, environment_inner[depth]);
-
-                       item_name = desc_on ? "term" : "para";
-                       sgml::openTag(os, depth + 1 + command_depth,
-                                   false, item_name);
-                       break;
-               default:
-                       sgml::openTag(os, depth + command_depth,
-                                   false, style->latexname());
-                       break;
-               }
-
-               par->simpleDocBookOnePar(buf, os, outerFont(par, paragraphs), desc_on,
-                                        runparams, depth + 1 + command_depth);
-
-               string end_tag;
-               // write closing SGML tags
-               switch (style->latextype) {
-               case LATEX_COMMAND:
-                       end_tag = c_params.empty() ? "title" : c_params;
-                       sgml::closeTag(os, depth + command_depth,
-                                    false, end_tag);
-                       break;
-               case LATEX_ENVIRONMENT:
-                       if (!style->latexparam().empty()) {
-                               if (style->latexparam() == "CDATA")
-                                       os << "]]>";
-                               else
-                                       sgml::closeTag(os, depth + command_depth, false, style->latexparam());
-                       }
-                       break;
-               case LATEX_ITEM_ENVIRONMENT:
-                       if (desc_on == 1) break;
-                       end_tag = "para";
-                       sgml::closeTag(os, depth + 1 + command_depth, false, end_tag);
-                       break;
-               case LATEX_PARAGRAPH:
-                       sgml::closeTag(os, depth + command_depth, false, style->latexname());
-                       break;
-               default:
-                       sgml::closeTag(os, depth + command_depth, false, style->latexname());
-                       break;
-               }
-       }
-
-       // Close open tags
-       for (int d = depth; d >= 0; --d) {
-               if (!environment_stack[depth].empty()) {
-                               sgml::closeEnvTags(os, false, environment_inner[depth],
-                                       command_depth + depth);
-               }
-       }
-
-       for (int j = command_depth; j >= 0 ; --j)
-               if (!command_stack[j].empty()) {
-                       sgml::closeTag(os, j, false, command_stack[j]);
-                       os << endl;
-               }
-}
-
 namespace {
 
 int readParToken(Buffer & buf, Paragraph & par, LyXLex & lex, string const & token)
index 7eef615309b3439c3b04c5f8dabf85623b65137b..dc282599e1411f6229a264113273c5a0ac32da9d 100644 (file)
@@ -20,8 +20,6 @@
 
 class Buffer;
 class BufferParams;
-class TexRow;
-class LatexRunParams;
 class LyXFont;
 class LyXLex;
 class InsetOld;
@@ -65,31 +63,6 @@ bool isFirstInSequence(ParagraphList::iterator par,
 int getEndLabel(ParagraphList::iterator pit,
                ParagraphList const & plist);
 
-
-void latexParagraphs(Buffer const & buf,
-                    ParagraphList const & paragraphs,
-                    std::ostream & ofs,
-                    TexRow & texrow,
-                    LatexRunParams const &,
-                    std::string const & everypar = std::string());
-
-///
-void asciiParagraph(Buffer const & buf,
-                   Paragraph const & paragraphs,
-                   std::ostream & ofs,
-                   LatexRunParams const &,
-                   bool noparbreak = false);
-
-void linuxdocParagraphs(Buffer const & buf,
-                       ParagraphList const & paragraphs,
-                       std::ostream & os,
-                       LatexRunParams const & runparams);
-
-void docbookParagraphs(Buffer const & buf,
-                      ParagraphList const & paragraphs,
-                      std::ostream & os,
-                      LatexRunParams const & runparams);
-       
 /// read a paragraph from a .lyx file. Returns number of unrecognised tokens
 int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex);
 
index 4942a2452af3ae9de05b12b390a301d297be4e15..9b71f30898a0dee69162e622a0405fb84208ce7a 100644 (file)
 #include "encoding.h"
 #include "language.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "LColor.h"
 #include "lyxlength.h"
 #include "lyxrc.h"
+#include "outputparams.h"
 #include "texrow.h"
 
 
@@ -454,7 +454,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                             BufferParams const & bparams,
                                             ostream & os,
                                             TexRow & texrow,
-                                            LatexRunParams const & runparams,
+                                            OutputParams const & runparams,
                                             LyXFont & font,
                                             LyXFont & running_font,
                                             LyXFont & basefont,
@@ -472,7 +472,7 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
                                os << c;
                } else {
                        InsetOld const * inset = owner_->getInset(i);
-                       inset->ascii(buf, os, runparams);
+                       inset->plaintext(buf, os, runparams);
                }
                return;
        }
index 1ed47c4f7b9884b74e5063dc2d1c43726b0633b1..906e59a8b8a6a36d4f642fdfa284c7e20a0efb3d 100644 (file)
@@ -148,7 +148,7 @@ struct Paragraph::Pimpl {
        ///
        void simpleTeXSpecialChars(Buffer const &, BufferParams const &,
                                   std::ostream &, TexRow & texrow,
-                                  LatexRunParams const &,
+                                  OutputParams const &,
                                   LyXFont & font, LyXFont & running_font,
                                   LyXFont & basefont,
                                   LyXFont const & outerfont,
index 82fb4afb8ba5c4abde9b09204eff028a90aba816..33a81a2ff29f2df24125fba8c7a09622ddf915b6 100644 (file)
@@ -23,8 +23,8 @@
 #include "bufferparams.h"
 #include "debug.h"
 #include "LaTeXFeatures.h"
-#include "latexrunparams.h"
 #include "lyxlex.h"
+#include "outputparams.h"
 #include "paragraph.h"
 
 #include "insets/insettabular.h"
@@ -1905,7 +1905,7 @@ int LyXTabular::TeXCellPostamble(ostream & os, int cell) const
 
 
 int LyXTabular::TeXLongtableHeaderFooter(ostream & os, Buffer const & buf,
-                                        LatexRunParams const & runparams) const
+                                        OutputParams const & runparams) const
 {
        if (!is_long_tabular)
                return 0;
@@ -2005,7 +2005,7 @@ bool LyXTabular::isValidRow(int row) const
 
 
 int LyXTabular::TeXRow(ostream & os, int i, Buffer const & buf,
-                      LatexRunParams const & runparams) const
+                      OutputParams const & runparams) const
 {
        int ret = 0;
        int cell = getCellNumber(i, 0);
@@ -2042,7 +2042,7 @@ int LyXTabular::TeXRow(ostream & os, int i, Buffer const & buf,
 
 
 int LyXTabular::latex(Buffer const & buf, ostream & os,
-                     LatexRunParams const & runparams) const
+                     OutputParams const & runparams) const
 {
        int ret = 0;
 
@@ -2150,7 +2150,7 @@ int LyXTabular::latex(Buffer const & buf, ostream & os,
 
 
 int LyXTabular::linuxdoc(Buffer const & buf, ostream & os,
-                        const LatexRunParams & runparams) const
+                        const OutputParams & runparams) const
 {
        os << "<tabular ca=\"";
        for (int i = 0; i < columns_; ++i) {
@@ -2192,7 +2192,7 @@ int LyXTabular::linuxdoc(Buffer const & buf, ostream & os,
 
 
 int LyXTabular::docbookRow(Buffer const & buf, ostream & os, int row,
-                          LatexRunParams const & runparams) const
+                          OutputParams const & runparams) const
 {
        int ret = 0;
        int cell = getFirstCellInRow(row);
@@ -2234,7 +2234,7 @@ int LyXTabular::docbookRow(Buffer const & buf, ostream & os, int row,
                }
 
                os << '>';
-               LatexRunParams runp = runparams;
+               OutputParams runp = runparams;
                runp.mixed_content = true;
                ret += getCellInset(cell).docbook(buf, os, runp);
                os << "</entry>\n";
@@ -2246,7 +2246,7 @@ int LyXTabular::docbookRow(Buffer const & buf, ostream & os, int row,
 
 
 int LyXTabular::docbook(Buffer const & buf, ostream & os,
-                       LatexRunParams const & runparams) const
+                       OutputParams const & runparams) const
 {
        int ret = 0;
 
@@ -2422,13 +2422,13 @@ int LyXTabular::asciiBottomHLine(ostream & os, int row,
 
 
 int LyXTabular::asciiPrintCell(Buffer const & buf, ostream & os,
-                              LatexRunParams const & runparams,
+                              OutputParams const & runparams,
                               int cell, int row, int column,
                               vector<unsigned int> const & clen,
                               bool onlydata) const
 {
        ostringstream sstr;
-       int ret = getCellInset(cell).ascii(buf, sstr, runparams);
+       int ret = getCellInset(cell).plaintext(buf, sstr, runparams);
 
        if (onlydata) {
                os << sstr.str();
@@ -2472,8 +2472,8 @@ int LyXTabular::asciiPrintCell(Buffer const & buf, ostream & os,
 }
 
 
-int LyXTabular::ascii(Buffer const & buf, ostream & os,
-                     LatexRunParams const & runparams,
+int LyXTabular::plaintext(Buffer const & buf, ostream & os,
+                     OutputParams const & runparams,
                      int const depth,
                      bool onlydata, unsigned char delim) const
 {
@@ -2491,7 +2491,7 @@ int LyXTabular::ascii(Buffer const & buf, ostream & os,
                                if (isMultiColumnReal(cell))
                                        continue;
                                ostringstream sstr;
-                               getCellInset(cell).ascii(buf, sstr, runparams);
+                               getCellInset(cell).plaintext(buf, sstr, runparams);
                                if (clen[j] < sstr.str().length())
                                        clen[j] = sstr.str().length();
                        }
@@ -2503,7 +2503,7 @@ int LyXTabular::ascii(Buffer const & buf, ostream & os,
                                if (!isMultiColumnReal(cell) || isPartOfMultiColumn(i, j))
                                        continue;
                                ostringstream sstr;
-                               getCellInset(cell).ascii(buf, sstr, runparams);
+                               getCellInset(cell).plaintext(buf, sstr, runparams);
                                int len = int(sstr.str().length());
                                int const n = cells_in_multicolumn(cell);
                                for (int k = j; len > 0 && k < j + n - 1; ++k)
index ea67f9588288638543487ec209ec8d3237a91082..ad2818fc890180f5b12e894d999276b9cb4b65d1 100644 (file)
@@ -22,7 +22,7 @@
 #include <vector>
 
 class InsetTabular;
-class LatexRunParams;
+class OutputParams;
 
 /* The features the text class offers for tables */
 
@@ -277,16 +277,16 @@ public:
        void read(Buffer const &, LyXLex &);
        ///
        int latex(Buffer const &, std::ostream &,
-                 LatexRunParams const &) const;
+                 OutputParams const &) const;
        //
        int linuxdoc(Buffer const & buf, std::ostream & os,
-                    LatexRunParams const &) const;
+                    OutputParams const &) const;
        ///
        int docbook(Buffer const & buf, std::ostream & os,
-                   LatexRunParams const &) const;
+                   OutputParams const &) const;
        ///
-       int ascii(Buffer const &, std::ostream &,
-                 LatexRunParams const & runparams,
+       int plaintext(Buffer const &, std::ostream &,
+                 OutputParams const & runparams,
                  int const depth,
                  bool onlydata, unsigned char delim) const;
        ///
@@ -537,12 +537,12 @@ public:
        int TeXCellPostamble(std::ostream &, int cell) const;
        ///
        int TeXLongtableHeaderFooter(std::ostream &, Buffer const & buf,
-                                    LatexRunParams const &) const;
+                                    OutputParams const &) const;
        ///
        bool isValidRow(int const row) const;
        ///
        int TeXRow(std::ostream &, int const row, Buffer const & buf,
-                  LatexRunParams const &) const;
+                  OutputParams const &) const;
        ///
        // helper function for ASCII returns number of newlines
        ///
@@ -553,13 +553,13 @@ public:
                             std::vector<unsigned int> const &) const;
        ///
        int asciiPrintCell(Buffer const &, std::ostream &,
-                          LatexRunParams const &,
+                          OutputParams const &,
                           int cell, int row, int column,
                           std::vector<unsigned int> const &,
                                           bool onlydata) const;
        /// auxiliary function for docbook
        int docbookRow(Buffer const & buf, std::ostream & os, int,
-                      LatexRunParams const &) const;
+                      OutputParams const &) const;
 
 private:
        /// renumber cells after structural changes