On Wed, Nov 26, 2003 at 07:55:11AM +0000, Jose' Matos spake thusly:

...

> > >  and/or adding a new attribute to the layout class describing its header.
> > > This is also be usefull to linuxdoc.
> > >
> > > "  PUBLIC \"-//OASIS//DTD DocBook V4.1//EN\""  for SGML docbook
> > > " system" for linuxdoc
> > > "  PUBLIC \"-//AGU//DTD article American Geophysical Union DTD version
> > > 3.42//EN" for AGU
> > > "  PUBLIC \"-//W3C//...XHTML...//EN\"" for xhtml
> >
> > Yesss! ClassHeader.
> 
>   Could you do it please. :-)
 
Patch attached.

- Martin

-- 
Martin Vermeer  [EMAIL PROTECTED]
Helsinki University of Technology 
Dept. of Surveying, Inst. of Geodesy
P.O. Box 1200, FIN-02015 HUT, Finland
:wq
Index: lib/layouts/agu_stdclass.inc
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/agu_stdclass.inc,v
retrieving revision 1.1
diff -u -p -r1.1 agu_stdclass.inc
--- lib/layouts/agu_stdclass.inc        25 Nov 2003 17:23:32 -0000      1.1
+++ lib/layouts/agu_stdclass.inc        26 Nov 2003 14:06:21 -0000
@@ -14,6 +14,9 @@ SecNumDepth             3
 TocDepth                3
 DefaultStyle            Standard
 
+ClassOptions
+       Header              "<!DOCTYPE # PUBLIC &quot;-//AGU//DTD article American 
Geophysical Union DTD version 3.42//EN&quot; &quot;AGU-Article-3.42.dtd&quot; "
+End
 
 Style Standard
        Margin                Static
Index: lib/layouts/db_stdclass.inc
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/lib/layouts/db_stdclass.inc,v
retrieving revision 1.9
diff -u -p -r1.9 db_stdclass.inc
--- lib/layouts/db_stdclass.inc 25 Nov 2003 17:23:32 -0000      1.9
+++ lib/layouts/db_stdclass.inc 26 Nov 2003 14:06:21 -0000
@@ -13,6 +13,9 @@ SecNumDepth             3
 TocDepth                3
 DefaultStyle            Standard
 
+ClassOptions
+       Header             "<!DOCTYPE #  PUBLIC &quot;-//OASIS//DTD DocBook 
V4.1//EN&quot;"
+End
 
 Style Standard
        Margin                Static
Index: src/buffer.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/buffer.C,v
retrieving revision 1.543
diff -u -p -r1.543 buffer.C
--- src/buffer.C        25 Nov 2003 17:23:32 -0000      1.543
+++ src/buffer.C        26 Nov 2003 14:06:21 -0000
@@ -1120,8 +1120,7 @@ void Buffer::makeDocBookFile(string cons
        string top_element = tclass.latexname();
 
        if (!only_body) {
-               ofs << "<!DOCTYPE " << top_element
-                   << "  PUBLIC \"-//OASIS//DTD DocBook V4.1//EN\"";
+               ofs << subst(tclass.class_header(), "#", top_element);
 
                string preamble = params().preamble;
                string const name = runparams.nice ? ChangeExtension(pimpl_->filename, 
".sgml")
@@ -1146,7 +1145,7 @@ void Buffer::makeDocBookFile(string cons
        }
        sgml::openTag(ofs, 0, false, top);
 
-       ofs << "<!-- DocBook file was created by LyX " << lyx_version
+       ofs << "<!-- SGML/XML file was created by LyX " << lyx_version
            << "\n  See http://www.lyx.org/ for more information -->\n";
 
        params().getLyXTextClass().counters().reset();
Index: src/lyxtextclass.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtextclass.C,v
retrieving revision 1.43
diff -u -p -r1.43 lyxtextclass.C
--- src/lyxtextclass.C  12 Nov 2003 14:38:26 -0000      1.43
+++ src/lyxtextclass.C  26 Nov 2003 14:06:21 -0000
@@ -470,6 +470,7 @@ enum ClassOptionsTags {
        CO_FONTSIZE = 1,
        CO_PAGESTYLE,
        CO_OTHER,
+       CO_HEADER,
        CO_END
 };
 
@@ -479,6 +480,7 @@ void LyXTextClass::readClassOptions(LyXL
        keyword_item classOptionsTags[] = {
                {"end", CO_END },
                {"fontsize", CO_FONTSIZE },
+               {"header", CO_HEADER },
                {"other", CO_OTHER },
                {"pagestyle", CO_PAGESTYLE }
        };
@@ -506,6 +508,10 @@ void LyXTextClass::readClassOptions(LyXL
                        lexrc.next();
                        options_ = lexrc.getString();
                        break;
+               case CO_HEADER:
+                       lexrc.next();
+                       class_header_ = subst(lexrc.getString(), "&quot;", "\"");
+                       break;
                case CO_END:
                        getout = true;
                        break;
@@ -923,6 +929,12 @@ string const & LyXTextClass::opt_pagesty
 string const & LyXTextClass::options() const
 {
        return options_;
+}
+
+
+string const & LyXTextClass::class_header() const
+{
+       return class_header_;
 }
 
 
Index: src/lyxtextclass.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtextclass.h,v
retrieving revision 1.22
diff -u -p -r1.22 lyxtextclass.h
--- src/lyxtextclass.h  12 Nov 2003 14:38:26 -0000      1.22
+++ src/lyxtextclass.h  26 Nov 2003 14:06:22 -0000
@@ -111,6 +111,8 @@ public:
        ///
        std::string const & options() const;
        ///
+       std::string const & class_header() const;
+       ///
        std::string const & pagestyle() const;
        ///
        std::string const & preamble() const;
@@ -185,6 +187,8 @@ private:
        std::string options_;
        ///
        std::string pagestyle_;
+       ///
+       std::string class_header_;
        ///
        std::string defaultlayout_;
        /// preamble text to support layout styles

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to