From: Richard Heck Date: Thu, 6 Mar 2008 05:01:44 +0000 (+0000) Subject: Backend support for layout categorization. X-Git-Tag: 1.6.10~5846 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a307f3b9ae2d8a9b9a7f4ee2eaf632d9fcc29965;p=features.git Backend support for layout categorization. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23501 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/Layout.cpp b/src/Layout.cpp index 7fedb3209c..76e59329e7 100644 --- a/src/Layout.cpp +++ b/src/Layout.cpp @@ -37,6 +37,7 @@ enum LayoutTags { LT_ALIGNPOSSIBLE, LT_MARGIN, LT_BOTTOMSEP, + LT_CATEGORY, LT_COMMANDDEPTH, LT_COPYSTYLE, LT_DEPENDSON, @@ -137,6 +138,7 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass) { "align", LT_ALIGN }, { "alignpossible", LT_ALIGNPOSSIBLE }, { "bottomsep", LT_BOTTOMSEP }, + { "category", LT_CATEGORY }, { "commanddepth", LT_COMMANDDEPTH }, { "copystyle", LT_COPYSTYLE }, { "dependson", LT_DEPENDSON }, @@ -209,6 +211,11 @@ bool Layout::read(Lexer & lexrc, TextClass const & tclass) finished = true; break; + case LT_CATEGORY: + if (lexrc.next()) + category_ = lowercase(lexrc.getDocString()); + break; + case LT_COPYSTYLE: // initialize with a known style if (lexrc.next()) { docstring const style = subst(lexrc.getDocString(), diff --git a/src/Layout.h b/src/Layout.h index e93a9bcbc2..32abb5c520 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -83,6 +83,8 @@ public: /// docstring const & endlabelstring() const { return endlabelstring_; } /// + docstring const & category() const { return category_; } + /// docstring const & preamble() const { return preamble_; } /// std::set const & requires() const { return requires_; } @@ -254,6 +256,10 @@ private: std::string labeltag_; /// Internal tag to surround the item text in a list) std::string itemtag_; + /// This is the `category' for this layout. The following are + /// recommended basic categories: FrontMatter, BackMatter, MainText, + /// Section, Starred, List, Theorem. + docstring category_; /// Macro definitions needed for this layout docstring preamble_; /// Packages needed for this layout