X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2FContext.h;h=ad95f02b0b8bd374be5b90532146e9faeb2f468f;hb=d3c63f97c4fce4e091277ced6c1829473c311231;hp=63f4b342f45962f71a219dc6fdba09f1ad445f0f;hpb=fc6ce7cd08562fd7bab4427880b46390bb7d2f07;p=lyx.git diff --git a/src/tex2lyx/Context.h b/src/tex2lyx/Context.h index 63f4b342f4..ad95f02b0b 100644 --- a/src/tex2lyx/Context.h +++ b/src/tex2lyx/Context.h @@ -12,7 +12,7 @@ #ifndef CONTEXT_H #define CONTEXT_H -#include "LyXTextClass.h" +#include "tex2lyx.h" #include @@ -36,15 +36,17 @@ public: } void init() { - size = "normal"; + size = "default"; family = "default"; series = "default"; shape = "default"; + language = "english"; } std::string size; std::string family; std::string series; std::string shape; + std::string language; }; @@ -77,9 +79,9 @@ void output_font_change(std::ostream & os, TeXFont const & oldfont, class Context { public: Context(bool need_layout_, - LyXTextClass const & textclass_, - LyXLayout_ptr layout_ = LyXLayout_ptr(), - LyXLayout_ptr parent_layout_= LyXLayout_ptr(), + TeX2LyXDocClass const & textclass_, + Layout const * layout_ = 0, + Layout const * parent_layout_= 0, TeXFont font_ = TeXFont()); ~Context(); @@ -111,13 +113,21 @@ public: /// Add extra stuff if not already there void add_extra_stuff(std::string const &); + /*! + * Add paragraph-level extra stuff if not already there. This + * will be reset at the next check_layout() + */ + void add_par_extra_stuff(std::string const &); + /// Do we need to output some \\begin_layout command before the /// next characters? bool need_layout; /// Do we need to output some \\end_layout command bool need_end_layout; - /// We may need to add something after this \\begin_layout command + /// We may need to add something after each \\begin_layout command std::string extra_stuff; + /// We may need to add something after this \\begin_layout command + std::string par_extra_stuff; /// If there has been an \\begin_deeper, we'll need a matching /// \\end_deeper bool need_end_deeper; @@ -136,19 +146,24 @@ public: * would not work. */ bool new_layout_allowed; + /// May -- be converted to endash and --- to emdash? + bool merging_hyphens_allowed; /// Did we output anything yet in any context? static bool empty; /// The textclass of the document. Could actually be a global variable - LyXTextClass const & textclass; + TeX2LyXDocClass const & textclass; /// The layout of the current paragraph - LyXLayout_ptr layout; + Layout const * layout; /// The layout of the outer paragraph (for environment layouts) - LyXLayout_ptr parent_layout; + Layout const * parent_layout; /// font attributes of this context TeXFont font; /// font attributes of normal text static TeXFont normalfont; + +private: + void begin_layout(std::ostream & os, Layout const * const & l); };