From 757d5d67ac47459c7814dc51db90e3593c0c1704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Sun, 29 Apr 2007 22:04:32 +0000 Subject: [PATCH] resolve the layout.h <=> Layout.h conflict git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18099 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Layout.h | 141 +++++++++++++++- src/LyXText.h | 2 +- src/Makefile.am | 5 +- src/ParagraphParameters.h | 2 +- src/frontends/controllers/ControlParagraph.h | 2 +- src/frontends/qt4/QParagraph.cpp | 1 - src/frontends/qt4/QParagraph.h | 8 +- src/layout.h | 159 ------------------- src/tex2lyx/preamble.cpp | 4 +- 9 files changed, 152 insertions(+), 172 deletions(-) delete mode 100644 src/layout.h diff --git a/src/Layout.h b/src/Layout.h index c30744f926..1c65f10467 100644 --- a/src/Layout.h +++ b/src/Layout.h @@ -15,7 +15,6 @@ #define LYX_LAYOUT_H #include "Font.h" -#include "layout.h" #include "Spacing.h" #include "support/docstring.h" @@ -27,6 +26,146 @@ namespace lyx { class Lexer; class TextClass; + +/// The different output types +enum OutputType { + /// + LATEX = 1, + /// + DOCBOOK, + /// + LITERATE +}; + + +/// The different margin types +enum LYX_MARGIN_TYPE { + /// + MARGIN_MANUAL = 1, + /// + MARGIN_FIRST_DYNAMIC, + /// + MARGIN_DYNAMIC, + /// + MARGIN_STATIC, + /// + MARGIN_RIGHT_ADDRESS_BOX +}; + + +/// +enum LyXAlignment { + /// + LYX_ALIGN_NONE = 0, + /// + LYX_ALIGN_BLOCK = 1, + /// + LYX_ALIGN_LEFT = 2, + /// + LYX_ALIGN_RIGHT = 4, + /// + LYX_ALIGN_CENTER = 8, + /// + LYX_ALIGN_LAYOUT = 16, + /// + LYX_ALIGN_SPECIAL = 32 +}; + +/// +inline +void operator|=(LyXAlignment & la1, LyXAlignment la2) { + la1 = static_cast(la1 | la2); +} + + +/// The different LaTeX-Types +enum LYX_LATEX_TYPES { + /// + LATEX_PARAGRAPH = 1, + /// + LATEX_COMMAND, + /// + LATEX_ENVIRONMENT, + /// + LATEX_ITEM_ENVIRONMENT, + /// + LATEX_BIB_ENVIRONMENT, + /// + LATEX_LIST_ENVIRONMENT +}; + + +/// The different title types +enum LYX_TITLE_LATEX_TYPES { + /// + TITLE_COMMAND_AFTER = 1, + /// + TITLE_ENVIRONMENT +}; + + +/// The different label types +enum LYX_LABEL_TYPES { + /// + LABEL_NO_LABEL, + /// + LABEL_MANUAL, + /// + LABEL_BIBLIO, + /// + LABEL_TOP_ENVIRONMENT, + /// + LABEL_CENTERED_TOP_ENVIRONMENT, + + // the flushright labels following now must start with LABEL_STATIC + /// + LABEL_STATIC, + /// + LABEL_SENSITIVE, + /// + LABEL_COUNTER, + /// + LABEL_ENUMERATE, + /// + LABEL_ITEMIZE +}; + + +/// +enum LYX_END_LABEL_TYPES { + /// + END_LABEL_NO_LABEL, + /// + END_LABEL_BOX, + /// + END_LABEL_FILLED_BOX, + /// + END_LABEL_STATIC, + /// + END_LABEL_ENUM_FIRST = END_LABEL_NO_LABEL, + /// + END_LABEL_ENUM_LAST = END_LABEL_STATIC +}; + +/* Fix labels are printed flushright, manual labels flushleft. + * MARGIN_MANUAL and MARGIN_FIRST_DYNAMIC are *only* for LABEL_MANUAL, + * MARGIN_DYNAMIC and MARGIN_STATIC are *not* for LABEL_MANUAL. + * This seems a funny restriction, but I think other combinations are + * not needed, so I will not change it yet. + * Correction: MARGIN_FIRST_DYNAMIC also usable with LABEL_STATIC + */ + + +/* There is a parindent and a parskip. Which one is used depends on the + * paragraph_separation-flag of the text-object. + * BUT: parindent is only thrown away, if a parskip is defined! So if you + * want a space between the paragraphs and a parindent at the same time, + * you should set parskip to zero and use topsep, parsep and bottomsep. + * + * The standard layout is an exception: its parindent is only set, if the + * previous paragraph is standard too. Well, this is LateX and it is good! + */ + /// class Layout { public: diff --git a/src/LyXText.h b/src/LyXText.h index af7e7da2db..9435fee01b 100644 --- a/src/LyXText.h +++ b/src/LyXText.h @@ -17,7 +17,7 @@ #include "Bidi.h" #include "DispatchResult.h" #include "Font.h" -#include "layout.h" +#include "Layout.h" #include "lyxlayout_ptr_fwd.h" #include "ParagraphList.h" diff --git a/src/Makefile.am b/src/Makefile.am index c79aa26443..3862a0cf4a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -159,7 +159,8 @@ lyx_SOURCES = \ LaTeXFeatures.cpp \ LaTeXFeatures.h \ LaTeX.h \ - layout.h \ + Layout.cpp \ + Layout.h \ Length.cpp \ Length.h \ lengthcommon.cpp \ @@ -177,8 +178,6 @@ lyx_SOURCES = \ LyXFunc.cpp \ LyXFunc.h \ LyX.h \ - Layout.cpp \ - Layout.h \ lyxlayout_ptr_fwd.h \ LyXRC.cpp \ LyXRC.h \ diff --git a/src/ParagraphParameters.h b/src/ParagraphParameters.h index cbbc2759a4..6fb9e2bc32 100644 --- a/src/ParagraphParameters.h +++ b/src/ParagraphParameters.h @@ -14,7 +14,7 @@ #ifndef PARAGRAPHPARAMETERS_H #define PARAGRAPHPARAMETERS_H -#include "layout.h" +#include "Layout.h" #include "Length.h" #include "Spacing.h" diff --git a/src/frontends/controllers/ControlParagraph.h b/src/frontends/controllers/ControlParagraph.h index 8448c85d45..f984a37b41 100644 --- a/src/frontends/controllers/ControlParagraph.h +++ b/src/frontends/controllers/ControlParagraph.h @@ -13,7 +13,7 @@ #define CONTROLPARAGRAPH_H #include "Dialog.h" -#include "layout.h" // for LyXAlignment +#include "Layout.h" // for LyXAlignment namespace lyx { diff --git a/src/frontends/qt4/QParagraph.cpp b/src/frontends/qt4/QParagraph.cpp index 00d8ee428c..6ae51fafcf 100644 --- a/src/frontends/qt4/QParagraph.cpp +++ b/src/frontends/qt4/QParagraph.cpp @@ -18,7 +18,6 @@ #include "debug.h" #include "ParagraphParameters.h" #include "Spacing.h" -#include "layout.h" #include "controllers/ControlParagraph.h" #include "controllers/frontend_helpers.h" diff --git a/src/frontends/qt4/QParagraph.h b/src/frontends/qt4/QParagraph.h index 17941db89c..1ccb8aea01 100644 --- a/src/frontends/qt4/QParagraph.h +++ b/src/frontends/qt4/QParagraph.h @@ -15,11 +15,13 @@ #include "QDialogView.h" -#include +#include "Layout.h" +#include "ui/ParagraphUi.h" + #include #include -#include "layout.h" -#include "ui/ParagraphUi.h" + +#include namespace lyx { namespace frontend { diff --git a/src/layout.h b/src/layout.h deleted file mode 100644 index 2d62584d4e..0000000000 --- a/src/layout.h +++ /dev/null @@ -1,159 +0,0 @@ -// -*- C++ -*- -/** - * \file layout.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Lars Gullik Bjønnes - * \author Jean-Marc Lasgouttes - * - * Full author contact details are available in file CREDITS. - */ - -#ifndef LAYOUT_H -#define LAYOUT_H - -namespace lyx { - -/// The different output types -enum OutputType { - /// - LATEX = 1, - /// - DOCBOOK, - /// - LITERATE -}; - - -/// The different margin types -enum LYX_MARGIN_TYPE { - /// - MARGIN_MANUAL = 1, - /// - MARGIN_FIRST_DYNAMIC, - /// - MARGIN_DYNAMIC, - /// - MARGIN_STATIC, - /// - MARGIN_RIGHT_ADDRESS_BOX -}; - - -/// -enum LyXAlignment { - /// - LYX_ALIGN_NONE = 0, - /// - LYX_ALIGN_BLOCK = 1, - /// - LYX_ALIGN_LEFT = 2, - /// - LYX_ALIGN_RIGHT = 4, - /// - LYX_ALIGN_CENTER = 8, - /// - LYX_ALIGN_LAYOUT = 16, - /// - LYX_ALIGN_SPECIAL = 32 -}; - -/// -inline -void operator|=(LyXAlignment & la1, LyXAlignment la2) { - la1 = static_cast(la1 | la2); -} - - -/// The different LaTeX-Types -enum LYX_LATEX_TYPES { - /// - LATEX_PARAGRAPH = 1, - /// - LATEX_COMMAND, - /// - LATEX_ENVIRONMENT, - /// - LATEX_ITEM_ENVIRONMENT, - /// - LATEX_BIB_ENVIRONMENT, - /// - LATEX_LIST_ENVIRONMENT -}; - - -/// The different title types -enum LYX_TITLE_LATEX_TYPES { - /// - TITLE_COMMAND_AFTER = 1, - /// - TITLE_ENVIRONMENT -}; - - -/// The different label types -enum LYX_LABEL_TYPES { - /// - LABEL_NO_LABEL, - /// - LABEL_MANUAL, - /// - LABEL_BIBLIO, - /// - LABEL_TOP_ENVIRONMENT, - /// - LABEL_CENTERED_TOP_ENVIRONMENT, - - // the flushright labels following now must start with LABEL_STATIC - /// - LABEL_STATIC, - /// - LABEL_SENSITIVE, - /// - LABEL_COUNTER, - /// - LABEL_ENUMERATE, - /// - LABEL_ITEMIZE -}; - - -/// -enum LYX_END_LABEL_TYPES { - /// - END_LABEL_NO_LABEL, - /// - END_LABEL_BOX, - /// - END_LABEL_FILLED_BOX, - /// - END_LABEL_STATIC, - /// - END_LABEL_ENUM_FIRST = END_LABEL_NO_LABEL, - /// - END_LABEL_ENUM_LAST = END_LABEL_STATIC -}; - -/* Fix labels are printed flushright, manual labels flushleft. - * MARGIN_MANUAL and MARGIN_FIRST_DYNAMIC are *only* for LABEL_MANUAL, - * MARGIN_DYNAMIC and MARGIN_STATIC are *not* for LABEL_MANUAL. - * This seems a funny restriction, but I think other combinations are - * not needed, so I will not change it yet. - * Correction: MARGIN_FIRST_DYNAMIC also usable with LABEL_STATIC - */ - - -/* There is a parindent and a parskip. Which one is used depends on the - * paragraph_separation-flag of the text-object. - * BUT: parindent is only thrown away, if a parskip is defined! So if you - * want a space between the paragraphs and a parindent at the same time, - * you should set parskip to zero and use topsep, parsep and bottomsep. - * - * The standard layout is an exception: its parindent is only set, if the - * previous paragraph is standard too. Well, this is LateX and it is good! - */ - -} // namespace lyx - -#endif diff --git a/src/tex2lyx/preamble.cpp b/src/tex2lyx/preamble.cpp index 299b48f819..bb47315d43 100644 --- a/src/tex2lyx/preamble.cpp +++ b/src/tex2lyx/preamble.cpp @@ -14,9 +14,9 @@ #include "tex2lyx.h" -#include "layout.h" -#include "TextClass.h" +#include "Layout.h" #include "Lexer.h" +#include "TextClass.h" #include "support/filetools.h" #include "support/lstrings.h"