]> git.lyx.org Git - features.git/commitdiff
move reading of bind files from lyxrc.C to kbmap.C; do not read bindings or menus...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 26 Jul 2003 23:04:39 +0000 (23:04 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 26 Jul 2003 23:04:39 +0000 (23:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7372 a592a061-630c-0410-9148-cb99ea01b6c8

39 files changed:
lib/ChangeLog
lib/ui/stdmenus.ui
src/ChangeLog
src/buffer.C
src/bufferparams.C
src/bufferparams.h
src/converter.C
src/encoding.h
src/format.C
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlTabular.C
src/frontends/qt2/ChangeLog
src/frontends/qt2/QDocument.C
src/frontends/qt2/QDocumentDialog.C
src/frontends/qt2/QGraphics.C
src/frontends/qt2/QPrefs.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPreferences.C
src/frontends/xforms/XPainter.C
src/graphics/ChangeLog
src/graphics/GraphicsTypes.C
src/graphics/GraphicsTypes.h
src/insets/ChangeLog
src/insets/insetexternal.C
src/insets/insetgraphicsParams.C
src/insets/renderers.C
src/ispell.C
src/kbmap.C
src/kbmap.h
src/lyx_main.C
src/lyxrc.C
src/lyxrc.h
src/paper.h [new file with mode: 0644]
src/tex2lyx/ChangeLog
src/tex2lyx/text.C
src/text3.C

index ac5d602982c0ccd5b4be0a82a54994fb8cfb6438..9957af29144f1771f05ab04ec21ed69b025cf8c7 100644 (file)
@@ -1,6 +1,11 @@
+2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * ui/stdmenus.ui: fix mnemonic for "Display Tooltips"
+
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
-       * layouts/linuxdoc.layout: add support for tables and figures (linuxdoc).
+       * layouts/linuxdoc.layout: add support for tables and figures
+       (linuxdoc). 
 
 2003-07-22  John Levon  <levon@movementarian.org>
 
index 3bfde10ccb14372244d7317a0930e6f971d8a7c4..8c3134d3c0eeae4894af10d00fb8854383c3b5f1 100644 (file)
@@ -196,7 +196,7 @@ Menuset
 # A common feature request JMarc wants to see
 #      Item "Open All Footnotes|F" "open-footnotes"
 #      Item "Close All Footnotes|C" "close-footnotes"
-               Item "Display Tooltips|D" "toggle-tooltips"
+               Item "Display Tooltips|i" "toggle-tooltips"
                Separator
                Submenu "Update|U" "document_update"
                ViewFormats
index 49ef22ee51f70a9f7620e9842b11c4e0f225d3ae..8f2cf258ef66441419a719b48bdec73092f6d9c1 100644 (file)
@@ -1,6 +1,35 @@
+2003-07-27  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * ispell.C: 
+       * encoding.h: add includes
+
+       * lyxrc.C: remove reading of bind files
+
+       * lyx_main.C (init): setup bindings and menus only if we have a
+       gui. 
+
+       * kbmap.C (read): new method. Do the actual reading of bind
+       files. 
+
+       * converter.C (dvipdfm_options): 
+       * bufferparams.C: 
+       * lyxrc.C (read): 
+       (output): adapt PAPER_* enums.
+
+       * lyxrc.h: include paper.h instead of bufferparams.h (mucho lighter)
+
+       * bufferparams.h: remove paper-related enums from there
+
+       * paper.h: New file. A trivial header file to hold paper-related
+       enums. It should later expand to contain many paper-related
+       horrors access.
+
+       * lyxrc.C: declare extern displayTranslator
+
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
-       * tabular.[Ch] (linuxdoc): add support for tables and figures (linuxdoc).
+       * tabular.[Ch] (linuxdoc): add support for tables and figures
+       (linuxdoc). 
 
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
index efb8945115ba09e442ce90402a205a4cbf607547..b7afa7c11a69504c38f2178cd4b89e22159cfea6 100644 (file)
@@ -55,6 +55,7 @@
 
 #include "graphics/Previews.h"
 
+#include "support/LAssert.h"
 #include "support/textutils.h"
 #include "support/filetools.h"
 #include "support/path.h"
index 7743aa2c694cbbb6f9682754546394752c72f5f6..d560eaff6c381545889e9ef07d9f13146756cd3e 100644 (file)
@@ -119,7 +119,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                if (tmpret == -1)
                        ++tmpret;
                paragraph_separation =
-                       static_cast<BufferParams::PARSEP>(tmpret);
+                       static_cast<PARSEP>(tmpret);
        } else if (token == "\\defskip") {
                lex.nextToken();
                defskip = VSpace(lex.getString());
@@ -172,7 +172,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                int tmpret = lex.findToken(string_paperpackages);
                if (tmpret == -1) {
                        ++tmpret;
-                       paperpackage = BufferParams::PACKAGE_NONE;
+                       paperpackage = PACKAGE_NONE;
                } else
                        paperpackage = PAPER_PACKAGES(tmpret);
        } else if (token == "\\use_geometry") {
@@ -180,7 +180,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                use_geometry = lex.getInteger();
        } else if (token == "\\use_amsmath") {
                lex.nextToken();
-               use_amsmath = static_cast<BufferParams::AMS>(
+               use_amsmath = static_cast<AMS>(
                        lex.getInteger());
        } else if (token == "\\use_natbib") {
                lex.nextToken();
@@ -202,7 +202,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                if (tmpret == -1)
                        ++tmpret;
                orientation =
-                       static_cast<BufferParams::PAPER_ORIENTATION>(tmpret);
+                       static_cast<PAPER_ORIENTATION>(tmpret);
        } else if (token == "\\paperwidth") {
                lex.next();
                paperwidth = lex.getString();
index 23ba28c271dca6c0a55d8e59c6d04fe702f24691..dc0782d5d10101cea2e3d1ddf12df4dfe0adafc6 100644 (file)
@@ -20,6 +20,7 @@
 #include "LaTeXFeatures.h"
 #include "texrow.h"
 #include "author.h"
+#include "paper.h"
 
 #include "insets/insetquotes.h"
 
@@ -38,61 +39,6 @@ struct Language;
 */
 class BufferParams {
 public:
-       ///
-       enum PAPER_SIZE {
-               ///
-               PAPER_DEFAULT,
-               ///
-               PAPER_USLETTER,
-               ///
-               PAPER_LEGALPAPER,
-               ///
-               PAPER_EXECUTIVEPAPER,
-               ///
-               PAPER_A3PAPER,
-               ///
-               PAPER_A4PAPER,
-               ///
-               PAPER_A5PAPER,
-               ///
-               PAPER_B5PAPER
-       };
-       ///
-       enum PAPER_PACKAGES {
-               ///
-               PACKAGE_NONE,
-               ///
-               PACKAGE_A4,
-               ///
-               PACKAGE_A4WIDE,
-               ///
-               PACKAGE_WIDEMARGINSA4
-       };
-       ///
-       enum VMARGIN_PAPER_TYPE {
-               ///
-               VM_PAPER_DEFAULT,
-               ///
-               VM_PAPER_CUSTOM,
-               ///
-               VM_PAPER_USLETTER,
-               ///
-               VM_PAPER_USLEGAL,
-               ///
-               VM_PAPER_USEXECUTIVE,
-               ///
-               VM_PAPER_A3,
-               ///
-               VM_PAPER_A4,
-               ///
-               VM_PAPER_A5,
-               ///
-               VM_PAPER_B3,
-               ///
-               VM_PAPER_B4,
-               ///
-               VM_PAPER_B5
-       };
        ///
        enum PARSEP {
                ///
@@ -101,13 +47,6 @@ public:
                PARSEP_SKIP
        };
        ///
-       enum PAPER_ORIENTATION {
-               ///
-               ORIENTATION_PORTRAIT,
-               ///
-               ORIENTATION_LANDSCAPE
-       };
-       ///
        BufferParams();
 
        /// read a header token, if unrecognised, return it or an unknown class name
index 482059b7c1edb746cb99ef9858dc5b6403867dee..9de2dc5ed7758b2fb55e0c9bfacb8474a6f73776 100644 (file)
@@ -68,12 +68,12 @@ string const dvipdfm_options(BufferParams const & bp)
 {
        string result;
 
-       if (bp.papersize2 != BufferParams::VM_PAPER_CUSTOM) {
+       if (bp.papersize2 != VM_PAPER_CUSTOM) {
                string const paper_size = bp.paperSizeName();
                if (paper_size != "b5" && paper_size != "foolscap")
                        result = "-p "+ paper_size;
 
-               if (bp.orientation == BufferParams::ORIENTATION_LANDSCAPE)
+               if (bp.orientation == ORIENTATION_LANDSCAPE)
                        result += " -l";
        }
 
index 15684639e71fdbed7c914f26c8b6bfb372f3499e..c64a84517ac7f5e22dfdef7d3631e41c0face36d 100644 (file)
@@ -15,6 +15,8 @@
 #include "LString.h"
 #include "lyxrc.h"
 
+#include <map>
+
 ///
 typedef unsigned short int Uchar;
 
index b8a0844bd1d1bd3d3d1d22ab05a5fe43d760f004..a84ec86d56d78dd5c226bcb45499b20d708617de 100644 (file)
@@ -179,7 +179,7 @@ bool Formats::view(Buffer const * buffer, string const & filename,
                        paper_size = "us";
                command += ' ' + paper_size;
                if (buffer->params.orientation
-                   == BufferParams::ORIENTATION_LANDSCAPE)
+                   == ORIENTATION_LANDSCAPE)
                        command += 'r';
        }
 
index f344c80a08aebbd546cceda5df59c6917236b58c..d118a302d2ec258eb850337727a0f9f0e5bf2ade 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * ControlTabular.C (useMetricUnits): adapt PAPER_* enums
+
 2003-07-23  Angus Leeming  <leeming@lyx.org>
 
        * ControlExternal.C: pass a Buffer const & rather than a Buffer const *
index d403a09de1fdd06aa77406b39a4e32a77cb39b53..40d4854fb023517e56064861d9bd64e39becf5d0 100644 (file)
@@ -70,7 +70,7 @@ void ControlTabular::set(LyXTabular::Feature f, string const & arg)
 
 bool ControlTabular::useMetricUnits() const
 {
-       return lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER;
+       return lyxrc.default_papersize > PAPER_EXECUTIVEPAPER;
 }
 
 
index 3b75a43a45420057e455123daee60184af269df3..4f935a69b3a11fcbaa81d9a94bd056c76b1391ac 100644 (file)
@@ -1,3 +1,10 @@
+2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * QPrefs.C: 
+       * QDocumentDialog.C: 
+       * QDocument.C: 
+       * QGraphics.C: adapt PAPER_* enums
+
 2003-07-25  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * QLMenubar.h: 
index 4207074450c070f98be53f169d60be31680515ba..f88c46dd2a91d3a3532640fae1da4b907fd07fa0 100644 (file)
@@ -335,7 +335,7 @@ void QDocument::apply()
        params.float_placement = dialog_->floatModule->get();
 
        // paper
-       params.papersize2 = BufferParams::VMARGIN_PAPER_TYPE(
+       params.papersize2 = VMARGIN_PAPER_TYPE(
                dialog_->pageLayoutModule->papersizeCO->currentItem());
 
        params.paperwidth = widgetsToLength(dialog_->pageLayoutModule->paperwidthLE,
@@ -350,9 +350,9 @@ void QDocument::apply()
                params.sides = LyXTextClass::OneSide;
 
        if (dialog_->pageLayoutModule->landscapeRB->isChecked())
-               params.orientation = BufferParams::ORIENTATION_LANDSCAPE;
+               params.orientation = ORIENTATION_LANDSCAPE;
        else
-               params.orientation = BufferParams::ORIENTATION_PORTRAIT;
+               params.orientation = ORIENTATION_PORTRAIT;
 
        // margins
        params.use_geometry =
@@ -362,7 +362,7 @@ void QDocument::apply()
        if (margin > 0) {
                margin = margin - 1;
        }
-       params.paperpackage = BufferParams::PAPER_PACKAGES(margin);
+       params.paperpackage = PAPER_PACKAGES(margin);
 
        // set params.papersize from params.papersize2
        // and params.paperpackage
@@ -416,18 +416,18 @@ void QDocument::update_contents()
        // FIXME: move to controller
        LyXLength::UNIT defaultUnit = LyXLength::CM;
        switch (lyxrc.default_papersize) {
-               case BufferParams::PAPER_DEFAULT: break;
+               case PAPER_DEFAULT: break;
 
-               case BufferParams::PAPER_USLETTER:
-               case BufferParams::PAPER_LEGALPAPER:
-               case BufferParams::PAPER_EXECUTIVEPAPER:
+               case PAPER_USLETTER:
+               case PAPER_LEGALPAPER:
+               case PAPER_EXECUTIVEPAPER:
                        defaultUnit = LyXLength::IN;
                        break;
 
-               case BufferParams::PAPER_A3PAPER:
-               case BufferParams::PAPER_A4PAPER:
-               case BufferParams::PAPER_A5PAPER:
-               case BufferParams::PAPER_B5PAPER:
+               case PAPER_A3PAPER:
+               case PAPER_A4PAPER:
+               case PAPER_A5PAPER:
+               case PAPER_B5PAPER:
                        defaultUnit = LyXLength::CM;
                        break;
        }
@@ -581,7 +581,7 @@ void QDocument::update_contents()
        dialog_->setCustomPapersize(psize);
 
        bool const landscape =
-               params.orientation == BufferParams::ORIENTATION_LANDSCAPE;
+               params.orientation == ORIENTATION_LANDSCAPE;
        dialog_->pageLayoutModule->landscapeRB->setChecked(landscape);
        dialog_->pageLayoutModule->portraitRB->setChecked(!landscape);
 
index 10956f6101f90eb70f8de0121f6c58e5e0bef4a6..2715ae04514149bc6ed46959d3021b3f8a61ea4c 100644 (file)
@@ -243,7 +243,7 @@ void QDocumentDialog::setMargins(int papersize)
        marginsModule->marginCO->insertItem(qt_("Default"));
        marginsModule->marginCO->insertItem(qt_("Custom"));
        bool a4size = (papersize == 6 || papersize == 0
-                       && lyxrc.default_papersize == BufferParams::PAPER_A4PAPER);
+                       && lyxrc.default_papersize == PAPER_A4PAPER);
        if (a4size && pageLayoutModule->portraitRB->isChecked()) {
                marginsModule->marginCO->insertItem(qt_("Small margins"));
                marginsModule->marginCO->insertItem(qt_("Very small margins"));
index 2528fc6a8071e68cabd7a7a0b06ac7c34882bd8f..bb05c5b6668e2ef06a189194e9f70bfabe59237d 100644 (file)
@@ -21,7 +21,7 @@
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 #include "insets/insetgraphicsParams.h"
-#include "bufferparams.h"
+//#include "bufferparams.h"
 #include "lyxrc.h"
 #include "lengthcombo.h"
 #include "qt_helpers.h"
@@ -144,18 +144,18 @@ void QGraphics::update_contents()
        // set the right default unit
        LyXLength::UNIT unitDefault = LyXLength::CM;
        switch (lyxrc.default_papersize) {
-               case BufferParams::PAPER_DEFAULT: break;
+               case PAPER_DEFAULT: break;
 
-               case BufferParams::PAPER_USLETTER:
-               case BufferParams::PAPER_LEGALPAPER:
-               case BufferParams::PAPER_EXECUTIVEPAPER:
+               case PAPER_USLETTER:
+               case PAPER_LEGALPAPER:
+               case PAPER_EXECUTIVEPAPER:
                        unitDefault = LyXLength::IN;
                        break;
 
-               case BufferParams::PAPER_A3PAPER:
-               case BufferParams::PAPER_A4PAPER:
-               case BufferParams::PAPER_A5PAPER:
-               case BufferParams::PAPER_B5PAPER:
+               case PAPER_A3PAPER:
+               case PAPER_A4PAPER:
+               case PAPER_A5PAPER:
+               case PAPER_B5PAPER:
                        unitDefault = LyXLength::CM;
                        break;
        }
index d8d9ef4387712e8acfe0092717ed005985d67c1b..8c2075270833dfecb1df110cef3b1135c9d6d123 100644 (file)
@@ -36,6 +36,7 @@
 #include "QPrefs.h"
 #include "Qt2BC.h"
 #include "lyxrc.h"
+#include "lyxfont.h"
 #include "frnt_lang.h"
 #include "helper_funcs.h"
 #include "qt_helpers.h"
@@ -164,8 +165,7 @@ void QPrefs::apply()
        rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
        rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
        rc.default_papersize =
-               static_cast<BufferParams::PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
-
+               static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
 
        QPrefDisplayModule * displaymod(dialog_->displayModule);
 
index c1cd64ac4d830ab1b4b93e125d9b450296fab759..9c398de5ca6685f0b42b92c7e1f8cdbd2eb88632 100644 (file)
@@ -1,3 +1,11 @@
+2003-07-27  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * XPainter.C: include lyxfont.h
+
+       * FormParagraph.C: 
+       * FormGraphics.C:
+       * FormDocument.C: adapt PAPER_* enums
+
 2003-07-25  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * XFormsMenubar.h: 
index 276c7d48ead9b9540c9ab0cb982b165b80e34258..4799da42273fa751e5e8f2d220a2963b063b6564 100644 (file)
@@ -444,7 +444,7 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
                // Default unit choice is cm if metric, inches if US paper.
                // If papersize is default, check the lyxrc-settings
                int const paperchoice = fl_get_choice(paper_->choice_papersize);
-               bool const metric = (paperchoice == 1 && lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER)
+               bool const metric = (paperchoice == 1 && lyxrc.default_papersize > PAPER_EXECUTIVEPAPER)
                        || paperchoice == 2 || paperchoice > 5;
                string const default_unit = metric ? "cm" : "in";
                if (getString(class_->input_skip).empty())
@@ -467,7 +467,7 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
 
        } else if (ob == paper_->radio_landscape) {
                fl_set_choice(paper_->choice_paperpackage,
-                             BufferParams::PACKAGE_NONE + 1);
+                             PACKAGE_NONE + 1);
 
        } else if (ob == paper_->choice_papersize) {
                int const paperchoice = fl_get_choice(paper_->choice_papersize);
@@ -510,7 +510,7 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
 
                // Default unit choice is cm if metric, inches if US paper.
                // If papersize is default, use the lyxrc-settings
-               bool const metric = (defsize && lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER)
+               bool const metric = (defsize && lyxrc.default_papersize > PAPER_EXECUTIVEPAPER)
                        || paperchoice == 2 || paperchoice > 5;
                string const default_unit = metric ? "cm" : "in";
                if (getString(paper_->input_custom_width).empty())
@@ -568,7 +568,7 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
                        fl_set_button(paper_->check_use_geometry, 1);
 
                fl_set_choice(paper_->choice_paperpackage,
-                             BufferParams::PACKAGE_NONE + 1);
+                             PACKAGE_NONE + 1);
 
                bool const use_geom = fl_get_button(paper_->check_use_geometry);
                setEnabled(paper_->input_top_margin,    use_geom);
@@ -592,11 +592,11 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
                // either default papersize (preferences) or document
                // papersize has to be A4
                bool const enable = ( fl_get_choice(paper_->choice_papersize) == 1
-                                     && lyxrc.default_papersize == BufferParams::PAPER_A4PAPER )
+                                     && lyxrc.default_papersize == PAPER_A4PAPER )
                        || fl_get_choice(paper_->choice_papersize) == 7;
                if (!enable)
                        fl_set_choice(paper_->choice_paperpackage,
-                                     BufferParams::PACKAGE_NONE + 1);
+                                     PACKAGE_NONE + 1);
                setEnabled(paper_->choice_paperpackage,
                           enable && fl_get_button(paper_->radio_portrait));
        }
@@ -697,10 +697,10 @@ bool FormDocument::class_apply(BufferParams &params)
 
 void FormDocument::paper_apply(BufferParams & params)
 {
-       params.papersize2 = BufferParams::VMARGIN_PAPER_TYPE(fl_get_choice(paper_->choice_papersize) - 1);
+       params.papersize2 = VMARGIN_PAPER_TYPE(fl_get_choice(paper_->choice_papersize) - 1);
 
        params.paperpackage =
-               BufferParams::PAPER_PACKAGES(fl_get_choice(paper_->choice_paperpackage) - 1);
+               PAPER_PACKAGES(fl_get_choice(paper_->choice_paperpackage) - 1);
 
        // set params.papersize from params.papersize2 and params.paperpackage
        params.setPaperStuff();
@@ -708,9 +708,9 @@ void FormDocument::paper_apply(BufferParams & params)
        params.use_geometry = fl_get_button(paper_->check_use_geometry);
 
        if (fl_get_button(paper_->radio_landscape))
-               params.orientation = BufferParams::ORIENTATION_LANDSCAPE;
+               params.orientation = ORIENTATION_LANDSCAPE;
        else
-               params.orientation = BufferParams::ORIENTATION_PORTRAIT;
+               params.orientation = ORIENTATION_PORTRAIT;
 
        params.paperwidth =
                getLengthFromWidgets(paper_->input_custom_width,
@@ -890,7 +890,7 @@ void FormDocument::class_update(BufferParams const & params)
        bool const length_input = pos == 4;
        if (length_input) {
                int const paperchoice = fl_get_choice(paper_->choice_papersize);
-               bool const metric = (paperchoice == 1 && lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER)
+               bool const metric = (paperchoice == 1 && lyxrc.default_papersize > PAPER_EXECUTIVEPAPER)
                        || paperchoice == 2 || paperchoice > 5;
                string const default_unit = metric ? "cm" : "in";
                string const length = params.getDefSkip().asLyXCommand();
@@ -999,7 +999,7 @@ void FormDocument::paper_update(BufferParams const & params)
        fl_set_button(paper_->radio_landscape, 0);
        setEnabled(paper_->radio_landscape, !useCustom);
 
-       if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE)
+       if (params.orientation == ORIENTATION_LANDSCAPE)
                fl_set_button(paper_->radio_landscape, 1);
        else
                fl_set_button(paper_->radio_portrait, 1);
@@ -1007,11 +1007,11 @@ void FormDocument::paper_update(BufferParams const & params)
                   //either default papersize (preferences)
                   //or document papersize has to be A4
                   (paperchoice == 7
-                   || paperchoice == 1 && lyxrc.default_papersize == BufferParams::PAPER_A4PAPER)
+                   || paperchoice == 1 && lyxrc.default_papersize == PAPER_A4PAPER)
                   && fl_get_button(paper_->radio_portrait));
 
        // Default unit choice is cm if metric, inches if US paper.
-       bool const metric = (paperchoice == 1 && lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER)
+       bool const metric = (paperchoice == 1 && lyxrc.default_papersize > PAPER_EXECUTIVEPAPER)
                || paperchoice == 2 || paperchoice > 5;
        string const default_unit = metric ? "cm" : "in";
        updateWidgetsFromLengthString(paper_->input_custom_width,
index dcdc701fd2ab58ee830d3fc09286169033970e29..de005b8904a530a6bdb84060b6f444df2e23cb42 100644 (file)
@@ -274,14 +274,14 @@ void FormGraphics::build()
 
        // set the right default unit
        switch (lyxrc.default_papersize) {
-       case BufferParams::PAPER_DEFAULT: break;
-       case BufferParams::PAPER_USLETTER:
-       case BufferParams::PAPER_LEGALPAPER:
-       case BufferParams::PAPER_EXECUTIVEPAPER: defaultUnit = "in"; break;
-       case BufferParams::PAPER_A3PAPER:
-       case BufferParams::PAPER_A4PAPER:
-       case BufferParams::PAPER_A5PAPER:
-       case BufferParams::PAPER_B5PAPER: defaultUnit = "cm"; break;
+       case PAPER_DEFAULT: break;
+       case PAPER_USLETTER:
+       case PAPER_LEGALPAPER:
+       case PAPER_EXECUTIVEPAPER: defaultUnit = "in"; break;
+       case PAPER_A3PAPER:
+       case PAPER_A4PAPER:
+       case PAPER_A5PAPER:
+       case PAPER_B5PAPER: defaultUnit = "cm"; break;
        }
 }
 
index 6b45eb0f258467cf0572c338c8b3ec3815972bf1..c2a99adbc47eb058e821e268d363bc7cb45f494e 100644 (file)
@@ -167,16 +167,16 @@ void FormParagraph::build()
 
        // set default unit for custom length
        switch (lyxrc.default_papersize) {
-               case BufferParams::PAPER_DEFAULT:
-               case BufferParams::PAPER_USLETTER:
-               case BufferParams::PAPER_LEGALPAPER:
-               case BufferParams::PAPER_EXECUTIVEPAPER:
+               case PAPER_DEFAULT:
+               case PAPER_USLETTER:
+               case PAPER_LEGALPAPER:
+               case PAPER_EXECUTIVEPAPER:
                        defaultUnit = "in";
                        break;
-               case BufferParams::PAPER_A3PAPER:
-               case BufferParams::PAPER_A4PAPER:
-               case BufferParams::PAPER_A5PAPER:
-               case BufferParams::PAPER_B5PAPER:
+               case PAPER_A3PAPER:
+               case PAPER_A4PAPER:
+               case PAPER_A5PAPER:
+               case PAPER_B5PAPER:
                        defaultUnit = "cm";
                        break;
        }
index b80e30eca8854e9527e6e757cbb95c423730ed2d..3ba45d7652671c2eff8a9f5de17c20920d9be618 100644 (file)
@@ -1753,7 +1753,7 @@ void FormPreferences::OutputsMisc::apply(LyXRC & rc) const
 
        int const choice =
                fl_get_choice(dialog_->choice_default_papersize) - 1;
-       rc.default_papersize = static_cast<BufferParams::PAPER_SIZE>(choice);
+       rc.default_papersize = static_cast<PAPER_SIZE>(choice);
 
        rc.ascii_roff_command = fl_get_input(dialog_->input_ascii_roff);
        rc.chktex_command = fl_get_input(dialog_->input_checktex);
index 2849928b8e92c2c4dba8166c425ed5c109087574..2ddedc1a7eb54527379209742d574a091db64cd9 100644 (file)
@@ -16,6 +16,7 @@
 #include "debug.h"
 #include "XWorkArea.h"
 #include "xfont_metrics.h"
+#include "lyxfont.h"
 #include "ColorHandler.h"
 #include "lyxrc.h"
 #include "encoding.h"
index 787bf3c3a9831b9208812c743efb81a96704f9f3..9f82eb3abece29de60ce08a430cd64f7d873438b 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * GraphicsTypes.h: do not declare displayTranstor here (and remove
+       extra include)
+
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
        * PreviewLoader.C (Impl::dumpPreamble): comply with makeLaTeXFile
index bb79a8b3a3549138adcde7322074fe2627e826e9..9b54901488c96bead9388ea6b4c427b154089005 100644 (file)
@@ -12,7 +12,7 @@
 #include <config.h>
 
 #include "graphics/GraphicsTypes.h"
-
+#include "support/translator.h"
 
 namespace lyx {
 namespace graphics {
index 5893c529e0a443b5841d3846e2f12fb65b0edfa3..a11f80c95219fa65f9e6ffa6b319d9380e90e4f5 100644 (file)
@@ -16,7 +16,6 @@
 #define GRAPHICSTYPES_H
 
 #include "LString.h"
-#include "support/translator.h"
 
 namespace lyx {
 namespace graphics {
@@ -63,8 +62,6 @@ enum DisplayType {
        NoDisplay
 };
 
-/// The translator between the DisplayType and the corresponding lyx string.
-extern Translator<DisplayType, string> displayTranslator;
 
 ///
 void setDisplayTranslator();
index 9355d078a9817e33bf1c97d6ed02aa1d5f09ac24..65895918e4ab9858aef68ffc0f321048545db77c 100644 (file)
@@ -1,9 +1,18 @@
+2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * insetgraphicsParams.C: 
+       * insetexternal.C: declare extern displayTranslator
+       
+       * insetexternal.C: 
+       * renderers.C: add #include "support/LAssert.h"
+
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
        * insetfloat.[Ch] (linuxdoc):
        * insetgraphics.C (linuxdoc):
        * insettabular.C (linuxdoc):
-       * insettext.[Ch] (linuxdoc): add support for tables and figures (linuxdoc).
+       * insettext.[Ch] (linuxdoc): add support for tables and figures
+       (linuxdoc). 
 
 2003-07-27  José Matos  <jamatos@fep.up.pt>
 
index c04fb78434875c4f2bb08bfeaf7aa8eb5f5edb31..5d660a98a0fbc2eeeff8baa537274d224f4938b2 100644 (file)
@@ -38,6 +38,8 @@
 #include "support/lyxalgo.h"
 #include "support/path.h"
 #include "support/tostr.h"
+#include "support/LAssert.h"
+#include "support/translator.h"
 
 #include <boost/bind.hpp>
 
@@ -50,6 +52,13 @@ using std::ostream;
 using std::endl;
 using std::auto_ptr;
 
+namespace lyx {
+namespace graphics {
+/// The translator between the DisplayType and the corresponding lyx string.
+extern Translator<DisplayType, string> displayTranslator;
+}
+}
+
 namespace {
 
 lyx::graphics::DisplayType const defaultDisplayType = lyx::graphics::NoDisplay;
index 60aae033ee6462561c2f6446f3ec56820fc0bf9b..12ab7177709bbfd5c069082726a9c8747dd604cc 100644 (file)
@@ -21,6 +21,7 @@
 #include "support/LOstream.h"
 #include "support/LAssert.h"
 #include "support/lstrings.h"
+#include "support/translator.h"
 #include "lyxrc.h"
 #include "debug.h"
 #include "lyxlex.h"
@@ -30,6 +31,13 @@ using namespace lyx::support;
 
 using std::ostream;
 
+namespace lyx {
+namespace graphics {
+/// The translator between the DisplayType and the corresponding lyx string.
+extern Translator<DisplayType, string> displayTranslator;
+}
+}
+
 
 InsetGraphicsParams::InsetGraphicsParams()
 {
index e62d7776543844cc2e17b5918d8f816642d3d3d7..b9c52c1920b53f8a6091a2445428138ea1dd6904 100644 (file)
@@ -24,7 +24,7 @@
 #include "graphics/GraphicsImage.h"
 
 #include "support/filetools.h"
-
+#include "support/LAssert.h"
 
 using namespace lyx::support;
 
index c04e1a38e3314fdc7089322a423a587d74dd1572..419623033be8fc3549d6092dbe05fb0a5eec2b70 100644 (file)
@@ -17,6 +17,7 @@
 #include "ispell.h"
 #include "WordLangTuple.h"
 #include "gettext.h"
+#include "bufferparams.h"
 
 #include "support/forkedcall.h"
 #include "support/lstrings.h"
index 9ac6de0943ca555fb82005b12181d42516a90765..e1a0cce71e5f2a95e985c175d78d8fe4aad9e487 100644 (file)
 #include "kbmap.h"
 #include "lfuns.h"
 #include "kbsequence.h"
+#include "LyXAction.h"
+#include "support/filetools.h"
+#include "lyxlex.h"
 #include "debug.h"
 
 using std::endl;
+using lyx::support::i18nLibFileSearch;
 
 string const kb_keymap::printKeysym(LyXKeySymPtr key,
                                    key_modifier::state mod)
@@ -64,6 +68,93 @@ string::size_type kb_keymap::bind(string const & seq, int action)
 }
 
 
+namespace {
+
+enum BindTags {
+       BN_BIND,
+       BN_BINDFILE
+};
+
+keyword_item bindTags[] = {
+       { "\\bind", BN_BIND },
+       { "\\bind_file", BN_BINDFILE }
+};
+
+}
+
+
+bool kb_keymap::read(string const & bind_file) 
+{
+       const int bindCount = sizeof(bindTags) / sizeof(keyword_item);
+
+       LyXLex lexrc(bindTags, bindCount);
+       if (lyxerr.debugging(Debug::PARSER))
+               lexrc.printTable(lyxerr);
+
+       string const tmp = i18nLibFileSearch("bind", bind_file, "bind");
+       lexrc.setFile(tmp);
+       if (!lexrc.isOK()) return false;
+
+       lyxerr[Debug::KBMAP] << "Reading bindfile:" << tmp << endl;
+
+       bool error = false;
+       while (lexrc.isOK()) {
+               switch (lexrc.lex()) {
+               case LyXLex::LEX_UNDEF:
+                       lexrc.printError("Unknown tag `$$Token'");
+                       continue;
+               case LyXLex::LEX_FEOF:
+                       continue;
+               case BN_BIND:
+               {
+                       string seq, cmd;
+                       
+                       if (lexrc.next()) {
+                               seq = lexrc.getString();
+                       } else {
+                               lexrc.printError("BN_BIND: Missing key sequence");
+                               break;
+                       }
+                       
+                       if (lexrc.next(true)) {
+                               cmd = lexrc.getString();
+                       } else {
+                               lexrc.printError("BN_BIND: missing command");
+                               break;
+                       }
+                       
+                       int action = lyxaction.LookupFunc(cmd);
+                       if (!action == LFUN_UNKNOWN_ACTION) {
+                               lexrc.printError("BN_BIND: Unknown LyX"
+                                                " function `$$Token'");
+                               break;
+                       }
+                       
+                       error = (bind(seq, kb_action(action)) != string::npos);
+                       break;
+               }
+               case BN_BINDFILE:
+                       if (lexrc.next()) {
+                               string const tmp(lexrc.getString());
+                               error = read(tmp);
+                       } else {
+                               lexrc.printError("BN_BINDFILE: Missing file name");
+                               error = true;
+                               break;
+
+                       }
+                       break;
+               }
+       }
+
+       if (error) {
+               lyxerr << "Error reading bind file: " << tmp << endl;
+       }
+
+       return error;
+}
+
+
 int kb_keymap::lookup(LyXKeySymPtr key,
                      key_modifier::state mod, kb_sequence * seq) const
 {
index 70dc5e81920932a40a0df8131bdb689afdb143cf..3b1818e5fb6a3f827e86fba2f43d0f4c78eb588a 100644 (file)
@@ -30,6 +30,9 @@ public:
         */
        string::size_type bind(string const & seq, int action);
 
+       // Parse a bind file
+       bool kb_keymap::read(string const & bind_file);
+
        /// print all available keysyms
        string const print() const;
 
index 20ba091dd9e950026763bd8bcd5734929d76c844..eb44e0bb296fd3749ce492e21d616b733bf54166 100644 (file)
@@ -96,10 +96,6 @@ LyX::LyX(int & argc, char * argv[])
        // we need to parse for "-dbg" and "-help"
        bool const want_gui = easyParse(argc, argv);
 
-       // Global bindings (this must be done as early as possible.) (Lgb)
-       toplevel_keymap.reset(new kb_keymap);
-       defaultKeyBindings(toplevel_keymap.get());
-
        // set the DisplayTranslator only once; should that be done here??
        // if this should not be in this file, please also remove
        // #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye.
@@ -470,12 +466,15 @@ void LyX::init(bool gui)
        lyxerr[Debug::INIT] << "Reading layouts..." << endl;
        LyXSetStyle();
 
-       // Ensure that we have really read a bind file, so that LyX is
-       // usable.
-       lyxrc.readBindFileIfNeeded();
+       if (gui) {
+               // Set up bindings
+               toplevel_keymap.reset(new kb_keymap);
+               defaultKeyBindings(toplevel_keymap.get());
+               toplevel_keymap->read(lyxrc.bind_file);
 
-       // Read menus
-       readUIFile(lyxrc.ui_file);
+               // Read menus
+               readUIFile(lyxrc.ui_file);
+       }
 
        if (lyxerr.debugging(Debug::LYXRC))
                lyxrc.print();
index 70f3d0ab857ef95d6a1fceef8f0b916af6c94f61..f768bbe806000caa0ef2d11559467076d6b0bc74 100644 (file)
 #include "lyxrc.h"
 
 #include "debug.h"
-#include "kbmap.h"
-#include "LyXAction.h"
 #include "intl.h"
 #include "converter.h"
 #include "format.h"
 #include "gettext.h"
 #include "lyxlex.h"
+#include "lyxfont.h"
 
 #include "support/path.h"
 #include "support/tostr.h"
@@ -30,6 +29,7 @@
 #include "support/LAssert.h"
 #include "support/lstrings.h"
 #include "support/userinfo.h"
+#include "support/translator.h"
 
 using namespace lyx::support;
 
@@ -40,9 +40,12 @@ using std::ios;
 using std::endl;
 using std::vector;
 
-class kb_keymap;
-
-extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
+namespace lyx {
+namespace graphics {
+/// The translator between the DisplayType and the corresponding lyx string.
+extern Translator<DisplayType, string> displayTranslator;
+}
+}
 
 namespace {
 
@@ -57,7 +60,6 @@ keyword_item lyxrcTags[] = {
        { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
        { "\\autosave", LyXRC::RC_AUTOSAVE },
        { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
-       { "\\bind", LyXRC::RC_BIND },
        { "\\bind_file", LyXRC::RC_BINDFILE },
        { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
        { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
@@ -170,7 +172,6 @@ LyXRC::LyXRC()
 
 void LyXRC::setDefaults() {
        bind_file = "cua";
-       hasBindFile = false;
        ui_file = "default";
        // Get printer from the environment. If fail, use default "",
        // assuming that everything is set up correctly.
@@ -194,7 +195,7 @@ void LyXRC::setDefaults() {
        use_tempdir = true;
        ps_command = "gs";
        view_dvi_paper_option.erase();
-       default_papersize = BufferParams::PAPER_USLETTER;
+       default_papersize = PAPER_USLETTER;
        custom_export_format = "ps";
        chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
        fontenc = "default";
@@ -271,25 +272,6 @@ void LyXRC::setDefaults() {
 }
 
 
-int LyXRC::ReadBindFile(string const & name)
-{
-       hasBindFile = true;
-       string const tmp = i18nLibFileSearch("bind", name, "bind");
-       lyxerr[Debug::LYXRC] << "Reading bindfile:" << tmp << endl;
-       int const result = read(tmp);
-       if (result) {
-               lyxerr << "Error reading bind file: " << tmp << endl;
-       }
-       return result;
-}
-
-void LyXRC::readBindFileIfNeeded()
-{
-       if (!hasBindFile)
-               ReadBindFile(bind_file);
-}
-
-
 namespace {
 
 void oldFontFormat(string & family, string & foundry)
@@ -347,18 +329,7 @@ int LyXRC::read(string const & filename)
                        break;
                case RC_BINDFILE:                     // RVDK_PATCH_5
                        if (lexrc.next()) {
-                               string const tmp(lexrc.getString());
-                               if (hasBindFile) {
-                                       // We are already in the
-                                       // "actually read bind file"
-                                       // mode.
-                                       ReadBindFile(tmp);
-                               } else {
-                                       // We are still in the "just
-                                       // remember the name of the
-                                       // bind file" mode.
-                                       bind_file = tmp;
-                               }
+                               bind_file = lexrc.getString();
                        }
                        break;
 
@@ -546,25 +517,25 @@ int LyXRC::read(string const & filename)
                                        ascii_lowercase(lexrc.getString());
                                if (size == "usletter")
                                        default_papersize =
-                                               BufferParams::PAPER_USLETTER;
+                                               PAPER_USLETTER;
                                else if (size == "legal")
                                        default_papersize =
-                                               BufferParams::PAPER_LEGALPAPER;
+                                               PAPER_LEGALPAPER;
                                else if (size == "executive")
-                                       default_papersize =
-                                               BufferParams::PAPER_EXECUTIVEPAPER;
+                                       default_papersize = 
+                                               PAPER_EXECUTIVEPAPER;
                                else if (size == "a3")
                                        default_papersize =
-                                               BufferParams::PAPER_A3PAPER;
+                                               PAPER_A3PAPER;
                                else if (size == "a4")
                                        default_papersize =
-                                               BufferParams::PAPER_A4PAPER;
+                                               PAPER_A4PAPER;
                                else if (size == "a5")
                                        default_papersize =
-                                               BufferParams::PAPER_A5PAPER;
+                                               PAPER_A5PAPER;
                                else if (size == "b5")
                                        default_papersize =
-                                               BufferParams::PAPER_B5PAPER;
+                                               PAPER_B5PAPER;
                        }
                        break;
 
@@ -801,53 +772,6 @@ int LyXRC::read(string const & filename)
                        }
                        break;
 
-               case RC_BIND:
-               {
-                       // we should not do an explicit binding before
-                       // loading a bind file. So, in this case, load
-                       // the default bind file.
-                       readBindFileIfNeeded();
-
-                       // !!!chb, dynamic key binding...
-                       int action = 0;
-                       string::size_type res = 0;
-                       string seq, cmd;
-
-                       if (lexrc.next()) {
-                               seq = lexrc.getString();
-                       } else {
-                               lexrc.printError("RC_BIND: Missing key sequence");
-                               break;
-                       }
-
-                       if (lexrc.next(true)) {
-                               cmd = lexrc.getString();
-                       } else {
-                               lexrc.printError("RC_BIND: missing command");
-                               break;
-                       }
-
-                       if ((action = lyxaction.LookupFunc(cmd)) >= 0) {
-                               if (lyxerr.debugging(Debug::LYXRC)) {
-                                       lyxerr << "RC_BIND: Sequence `"
-                                              << seq << "' Command `"
-                                              << cmd << "' Action `"
-                                              << action << '\'' << endl;
-                               }
-                               res = toplevel_keymap->bind(seq, kb_action(action));
-                               if (res != string::npos
-                                   && lyxerr.debugging(Debug::LYXRC)) {
-                                       lexrc.printError(
-                                               "RC_BIND: "
-                                               "Invalid key sequence `"
-                                               + seq + '\'');
-                               }
-                       } else {// cmd is the last token read.
-                               lexrc.printError(
-                                       "Unknown LyX function `$$Token'");
-                       }
-                       break;
-               }
                case RC_SERVERPIPE:
                        if (lexrc.next()) {
                                lyxpipes = ExpandPath(lexrc.getString());
@@ -1160,8 +1084,6 @@ void LyXRC::output(ostream & os) const
        case RC_LAST:
        case RC_INPUT:
                // input/include files are not done here
-       case RC_BIND:
-               // bindings is not written to the preferences file.
        case RC_BINDFILE:
                if (bind_file != system_lyxrc.bind_file) {
                        os << "\\bind_file " << bind_file << "\n";
@@ -1219,21 +1141,21 @@ void LyXRC::output(ostream & os) const
                        os << "# The default papersize to use.\n"
                           << "\\default_papersize \"";
                        switch (default_papersize) {
-                       case BufferParams::PAPER_USLETTER:
+                       case PAPER_USLETTER:
                                os << "usletter"; break;
-                       case BufferParams::PAPER_LEGALPAPER:
+                       case PAPER_LEGALPAPER:
                                os << "legal"; break;
-                       case BufferParams::PAPER_EXECUTIVEPAPER:
+                       case PAPER_EXECUTIVEPAPER:
                                os << "executive"; break;
-                       case BufferParams::PAPER_A3PAPER:
+                       case PAPER_A3PAPER:
                                os << "a3"; break;
-                       case BufferParams::PAPER_A4PAPER:
+                       case PAPER_A4PAPER:
                                os << "a4"; break;
-                       case BufferParams::PAPER_A5PAPER:
+                       case PAPER_A5PAPER:
                                os << "a5"; break;
-                       case BufferParams::PAPER_B5PAPER:
+                       case PAPER_B5PAPER:
                                os << "b5"; break;
-                       case BufferParams::PAPER_DEFAULT: break;
+                       case PAPER_DEFAULT: break;
                        }
                        os << "\"\n";
                }
index 9d70eacee8e6bb2d9cb2836e93a0da6ca0f9fa9e..0be918fb900e2b81c67d9f1e8aaa8e1e563d65c0 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef LYXRC_H
 #define LYXRC_H
 
-#include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
+#include "paper.h" 
 #include "graphics/GraphicsTypes.h"
 
 // #include <boost/utility.hpp>
@@ -65,7 +65,6 @@ enum LyXRCTags {
        RC_LASTFILES,
        RC_AUTOREGIONDELETE,
        RC_AUTORESET_OPTIONS,
-       RC_BIND,
        RC_SERVERPIPE,
        RC_INPUT,
        RC_BINDFILE,
@@ -132,8 +131,6 @@ enum LyXRCTags {
        ///
        int read(string const & filename);
        ///
-       void readBindFileIfNeeded();
-       ///
        void write(string const & filename) const;
        ///
        void print() const;
@@ -190,7 +187,7 @@ enum LyXRCTags {
        /// option for telling the dvi viewer about the paper size
        string view_dvi_paper_option;
        /// default paper size for local xdvi/dvips/ghostview/whatever
-       BufferParams::PAPER_SIZE default_papersize;
+       PAPER_SIZE default_papersize;
        /// command to run chktex incl. options
        string chktex_command;
        ///
@@ -350,12 +347,6 @@ enum LyXRCTags {
        string user_name;
        /// user email
        string user_email;
-
-private:
-       /// Is a bind file already (or currently) read?
-       bool hasBindFile;
-       ///
-       int ReadBindFile(string const & name);
 };
 
 ///
diff --git a/src/paper.h b/src/paper.h
new file mode 100644 (file)
index 0000000..07c2f52
--- /dev/null
@@ -0,0 +1,83 @@
+// -*- C++ -*-
+/**
+ *  \file paper.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ *  \author Jean-Marc Lasgouttes
+ *
+ *  Full author contact details are available in file CREDITS
+ *
+ *  A trivial header file to hold paper-related enums. It should later
+ *  expand to contain many paper-related horrors access.
+ */
+
+#ifndef PAPER_H
+#define PAPER_H
+
+ ///
+ enum PAPER_SIZE {
+        ///
+        PAPER_DEFAULT,
+        ///
+        PAPER_USLETTER,
+        ///
+        PAPER_LEGALPAPER,
+        ///
+        PAPER_EXECUTIVEPAPER,
+        ///
+        PAPER_A3PAPER,
+        ///
+        PAPER_A4PAPER,
+        ///
+        PAPER_A5PAPER,
+        ///
+        PAPER_B5PAPER
+ };
+
+///
+enum PAPER_PACKAGES {
+       ///
+       PACKAGE_NONE,
+       ///
+       PACKAGE_A4,
+       ///
+       PACKAGE_A4WIDE,
+       ///
+       PACKAGE_WIDEMARGINSA4
+};
+
+///
+enum VMARGIN_PAPER_TYPE {
+       ///
+       VM_PAPER_DEFAULT,
+       ///
+       VM_PAPER_CUSTOM,
+       ///
+       VM_PAPER_USLETTER,
+       ///
+       VM_PAPER_USLEGAL,
+       ///
+       VM_PAPER_USEXECUTIVE,
+       ///
+       VM_PAPER_A3,
+       ///
+       VM_PAPER_A4,
+       ///
+       VM_PAPER_A5,
+       ///
+       VM_PAPER_B3,
+       ///
+       VM_PAPER_B4,
+       ///
+       VM_PAPER_B5
+};
+
+///
+enum PAPER_ORIENTATION {
+       ///
+       ORIENTATION_PORTRAIT,
+       ///
+       ORIENTATION_LANDSCAPE
+};
+#endif
index 6d9ba1d79ecf6931a2855206f18c6be22c670603..5971822b06a8e9bcbdf530c35123d1fa6c82a46e 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-26  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * text.C (parse_text): fix handling of \LaTeXe macro
+
 2003-07-26  Angus Leeming  <leeming@lyx.org>
 
        * Spacing.h:
index 524605b529ad7b3f4fe090b2919fc969a9bd894b..79ad1057d89231a12bb85daf05d9c4bfc8507941 100644 (file)
@@ -510,12 +510,17 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                        os << "\n\\size " << known_coded_sizes[where - known_sizes] << "\n";
                }
 
-               else if (t.cs() == "LyX" || t.cs() == "TeX"
-                     || t.cs() == "LaTeX" || t.cs() == "LaTeXe") {
+               else if (t.cs() == "LyX" || t.cs() == "TeX" 
+                        || t.cs() == "LaTeX") {
                        os << t.cs();
                        skip_braces(p); // eat {}
                }
 
+               else if (t.cs() == "LaTeXe") {
+                       os << "LaTeX2e";
+                       skip_braces(p); // eat {}
+               }
+
                else if (t.cs() == "lyxarrow") {
                        os << "\\SpecialChar \\menuseparator\n";
                        skip_braces(p);
index 7ae6c2bafb030adfae5ae9e2ed0ea30b17f61b94..647ccbb0ebf564c0346662d78e456deb5f14d6a3 100644 (file)
@@ -29,6 +29,7 @@
 #include "language.h"
 #include "support/tostr.h"
 #include "support/lstrings.h"
+#include "support/LAssert.h"
 #include "frontends/LyXView.h"
 #include "frontends/screen.h"
 #include "frontends/Dialogs.h"