move reading of bind files from lyxrc.C to kbmap.C; do not read bindings or menus when not using gui; move paper related enums to a new paper.h; remove dependency on bufferparams.h from lyxrc.h; small bugfix to tex2lyx; fix bad menu shortcut

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7372 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2003-07-26 23:04:39 +00:00
parent 6a2f81278d
commit 80d7f70dc3
39 changed files with 385 additions and 261 deletions

View 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> 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> 2003-07-22 John Levon <levon@movementarian.org>

View File

@ -196,7 +196,7 @@ Menuset
# A common feature request JMarc wants to see # A common feature request JMarc wants to see
# Item "Open All Footnotes|F" "open-footnotes" # Item "Open All Footnotes|F" "open-footnotes"
# Item "Close All Footnotes|C" "close-footnotes" # Item "Close All Footnotes|C" "close-footnotes"
Item "Display Tooltips|D" "toggle-tooltips" Item "Display Tooltips|i" "toggle-tooltips"
Separator Separator
Submenu "Update|U" "document_update" Submenu "Update|U" "document_update"
ViewFormats ViewFormats

View 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> 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> 2003-07-27 José Matos <jamatos@fep.up.pt>

View File

@ -55,6 +55,7 @@
#include "graphics/Previews.h" #include "graphics/Previews.h"
#include "support/LAssert.h"
#include "support/textutils.h" #include "support/textutils.h"
#include "support/filetools.h" #include "support/filetools.h"
#include "support/path.h" #include "support/path.h"

View File

@ -119,7 +119,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
if (tmpret == -1) if (tmpret == -1)
++tmpret; ++tmpret;
paragraph_separation = paragraph_separation =
static_cast<BufferParams::PARSEP>(tmpret); static_cast<PARSEP>(tmpret);
} else if (token == "\\defskip") { } else if (token == "\\defskip") {
lex.nextToken(); lex.nextToken();
defskip = VSpace(lex.getString()); defskip = VSpace(lex.getString());
@ -172,7 +172,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
int tmpret = lex.findToken(string_paperpackages); int tmpret = lex.findToken(string_paperpackages);
if (tmpret == -1) { if (tmpret == -1) {
++tmpret; ++tmpret;
paperpackage = BufferParams::PACKAGE_NONE; paperpackage = PACKAGE_NONE;
} else } else
paperpackage = PAPER_PACKAGES(tmpret); paperpackage = PAPER_PACKAGES(tmpret);
} else if (token == "\\use_geometry") { } else if (token == "\\use_geometry") {
@ -180,7 +180,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
use_geometry = lex.getInteger(); use_geometry = lex.getInteger();
} else if (token == "\\use_amsmath") { } else if (token == "\\use_amsmath") {
lex.nextToken(); lex.nextToken();
use_amsmath = static_cast<BufferParams::AMS>( use_amsmath = static_cast<AMS>(
lex.getInteger()); lex.getInteger());
} else if (token == "\\use_natbib") { } else if (token == "\\use_natbib") {
lex.nextToken(); lex.nextToken();
@ -202,7 +202,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
if (tmpret == -1) if (tmpret == -1)
++tmpret; ++tmpret;
orientation = orientation =
static_cast<BufferParams::PAPER_ORIENTATION>(tmpret); static_cast<PAPER_ORIENTATION>(tmpret);
} else if (token == "\\paperwidth") { } else if (token == "\\paperwidth") {
lex.next(); lex.next();
paperwidth = lex.getString(); paperwidth = lex.getString();

View File

@ -20,6 +20,7 @@
#include "LaTeXFeatures.h" #include "LaTeXFeatures.h"
#include "texrow.h" #include "texrow.h"
#include "author.h" #include "author.h"
#include "paper.h"
#include "insets/insetquotes.h" #include "insets/insetquotes.h"
@ -38,61 +39,6 @@ struct Language;
*/ */
class BufferParams { class BufferParams {
public: 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 { enum PARSEP {
/// ///
@ -101,13 +47,6 @@ public:
PARSEP_SKIP PARSEP_SKIP
}; };
/// ///
enum PAPER_ORIENTATION {
///
ORIENTATION_PORTRAIT,
///
ORIENTATION_LANDSCAPE
};
///
BufferParams(); BufferParams();
/// read a header token, if unrecognised, return it or an unknown class name /// read a header token, if unrecognised, return it or an unknown class name

View File

@ -68,12 +68,12 @@ string const dvipdfm_options(BufferParams const & bp)
{ {
string result; string result;
if (bp.papersize2 != BufferParams::VM_PAPER_CUSTOM) { if (bp.papersize2 != VM_PAPER_CUSTOM) {
string const paper_size = bp.paperSizeName(); string const paper_size = bp.paperSizeName();
if (paper_size != "b5" && paper_size != "foolscap") if (paper_size != "b5" && paper_size != "foolscap")
result = "-p "+ paper_size; result = "-p "+ paper_size;
if (bp.orientation == BufferParams::ORIENTATION_LANDSCAPE) if (bp.orientation == ORIENTATION_LANDSCAPE)
result += " -l"; result += " -l";
} }

View File

@ -15,6 +15,8 @@
#include "LString.h" #include "LString.h"
#include "lyxrc.h" #include "lyxrc.h"
#include <map>
/// ///
typedef unsigned short int Uchar; typedef unsigned short int Uchar;

View File

@ -179,7 +179,7 @@ bool Formats::view(Buffer const * buffer, string const & filename,
paper_size = "us"; paper_size = "us";
command += ' ' + paper_size; command += ' ' + paper_size;
if (buffer->params.orientation if (buffer->params.orientation
== BufferParams::ORIENTATION_LANDSCAPE) == ORIENTATION_LANDSCAPE)
command += 'r'; command += 'r';
} }

View 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> 2003-07-23 Angus Leeming <leeming@lyx.org>
* ControlExternal.C: pass a Buffer const & rather than a Buffer const * * ControlExternal.C: pass a Buffer const & rather than a Buffer const *

View File

@ -70,7 +70,7 @@ void ControlTabular::set(LyXTabular::Feature f, string const & arg)
bool ControlTabular::useMetricUnits() const bool ControlTabular::useMetricUnits() const
{ {
return lyxrc.default_papersize > BufferParams::PAPER_EXECUTIVEPAPER; return lyxrc.default_papersize > PAPER_EXECUTIVEPAPER;
} }

View 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> 2003-07-25 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* QLMenubar.h: * QLMenubar.h:

View File

@ -335,7 +335,7 @@ void QDocument::apply()
params.float_placement = dialog_->floatModule->get(); params.float_placement = dialog_->floatModule->get();
// paper // paper
params.papersize2 = BufferParams::VMARGIN_PAPER_TYPE( params.papersize2 = VMARGIN_PAPER_TYPE(
dialog_->pageLayoutModule->papersizeCO->currentItem()); dialog_->pageLayoutModule->papersizeCO->currentItem());
params.paperwidth = widgetsToLength(dialog_->pageLayoutModule->paperwidthLE, params.paperwidth = widgetsToLength(dialog_->pageLayoutModule->paperwidthLE,
@ -350,9 +350,9 @@ void QDocument::apply()
params.sides = LyXTextClass::OneSide; params.sides = LyXTextClass::OneSide;
if (dialog_->pageLayoutModule->landscapeRB->isChecked()) if (dialog_->pageLayoutModule->landscapeRB->isChecked())
params.orientation = BufferParams::ORIENTATION_LANDSCAPE; params.orientation = ORIENTATION_LANDSCAPE;
else else
params.orientation = BufferParams::ORIENTATION_PORTRAIT; params.orientation = ORIENTATION_PORTRAIT;
// margins // margins
params.use_geometry = params.use_geometry =
@ -362,7 +362,7 @@ void QDocument::apply()
if (margin > 0) { if (margin > 0) {
margin = margin - 1; margin = margin - 1;
} }
params.paperpackage = BufferParams::PAPER_PACKAGES(margin); params.paperpackage = PAPER_PACKAGES(margin);
// set params.papersize from params.papersize2 // set params.papersize from params.papersize2
// and params.paperpackage // and params.paperpackage
@ -416,18 +416,18 @@ void QDocument::update_contents()
// FIXME: move to controller // FIXME: move to controller
LyXLength::UNIT defaultUnit = LyXLength::CM; LyXLength::UNIT defaultUnit = LyXLength::CM;
switch (lyxrc.default_papersize) { switch (lyxrc.default_papersize) {
case BufferParams::PAPER_DEFAULT: break; case PAPER_DEFAULT: break;
case BufferParams::PAPER_USLETTER: case PAPER_USLETTER:
case BufferParams::PAPER_LEGALPAPER: case PAPER_LEGALPAPER:
case BufferParams::PAPER_EXECUTIVEPAPER: case PAPER_EXECUTIVEPAPER:
defaultUnit = LyXLength::IN; defaultUnit = LyXLength::IN;
break; break;
case BufferParams::PAPER_A3PAPER: case PAPER_A3PAPER:
case BufferParams::PAPER_A4PAPER: case PAPER_A4PAPER:
case BufferParams::PAPER_A5PAPER: case PAPER_A5PAPER:
case BufferParams::PAPER_B5PAPER: case PAPER_B5PAPER:
defaultUnit = LyXLength::CM; defaultUnit = LyXLength::CM;
break; break;
} }
@ -581,7 +581,7 @@ void QDocument::update_contents()
dialog_->setCustomPapersize(psize); dialog_->setCustomPapersize(psize);
bool const landscape = bool const landscape =
params.orientation == BufferParams::ORIENTATION_LANDSCAPE; params.orientation == ORIENTATION_LANDSCAPE;
dialog_->pageLayoutModule->landscapeRB->setChecked(landscape); dialog_->pageLayoutModule->landscapeRB->setChecked(landscape);
dialog_->pageLayoutModule->portraitRB->setChecked(!landscape); dialog_->pageLayoutModule->portraitRB->setChecked(!landscape);

View File

@ -243,7 +243,7 @@ void QDocumentDialog::setMargins(int papersize)
marginsModule->marginCO->insertItem(qt_("Default")); marginsModule->marginCO->insertItem(qt_("Default"));
marginsModule->marginCO->insertItem(qt_("Custom")); marginsModule->marginCO->insertItem(qt_("Custom"));
bool a4size = (papersize == 6 || papersize == 0 bool a4size = (papersize == 6 || papersize == 0
&& lyxrc.default_papersize == BufferParams::PAPER_A4PAPER); && lyxrc.default_papersize == PAPER_A4PAPER);
if (a4size && pageLayoutModule->portraitRB->isChecked()) { if (a4size && pageLayoutModule->portraitRB->isChecked()) {
marginsModule->marginCO->insertItem(qt_("Small margins")); marginsModule->marginCO->insertItem(qt_("Small margins"));
marginsModule->marginCO->insertItem(qt_("Very small margins")); marginsModule->marginCO->insertItem(qt_("Very small margins"));

View File

@ -21,7 +21,7 @@
#include "support/filetools.h" #include "support/filetools.h"
#include "support/lyxlib.h" #include "support/lyxlib.h"
#include "insets/insetgraphicsParams.h" #include "insets/insetgraphicsParams.h"
#include "bufferparams.h" //#include "bufferparams.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "lengthcombo.h" #include "lengthcombo.h"
#include "qt_helpers.h" #include "qt_helpers.h"
@ -144,18 +144,18 @@ void QGraphics::update_contents()
// set the right default unit // set the right default unit
LyXLength::UNIT unitDefault = LyXLength::CM; LyXLength::UNIT unitDefault = LyXLength::CM;
switch (lyxrc.default_papersize) { switch (lyxrc.default_papersize) {
case BufferParams::PAPER_DEFAULT: break; case PAPER_DEFAULT: break;
case BufferParams::PAPER_USLETTER: case PAPER_USLETTER:
case BufferParams::PAPER_LEGALPAPER: case PAPER_LEGALPAPER:
case BufferParams::PAPER_EXECUTIVEPAPER: case PAPER_EXECUTIVEPAPER:
unitDefault = LyXLength::IN; unitDefault = LyXLength::IN;
break; break;
case BufferParams::PAPER_A3PAPER: case PAPER_A3PAPER:
case BufferParams::PAPER_A4PAPER: case PAPER_A4PAPER:
case BufferParams::PAPER_A5PAPER: case PAPER_A5PAPER:
case BufferParams::PAPER_B5PAPER: case PAPER_B5PAPER:
unitDefault = LyXLength::CM; unitDefault = LyXLength::CM;
break; break;
} }

View File

@ -36,6 +36,7 @@
#include "QPrefs.h" #include "QPrefs.h"
#include "Qt2BC.h" #include "Qt2BC.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "lyxfont.h"
#include "frnt_lang.h" #include "frnt_lang.h"
#include "helper_funcs.h" #include "helper_funcs.h"
#include "qt_helpers.h" #include "qt_helpers.h"
@ -164,8 +165,7 @@ void QPrefs::apply()
rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked(); rc.auto_reset_options = latexmod->latexAutoresetCB->isChecked();
rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text()); rc.view_dvi_paper_option = fromqstr(latexmod->latexDviPaperED->text());
rc.default_papersize = rc.default_papersize =
static_cast<BufferParams::PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem()); static_cast<PAPER_SIZE>(latexmod->latexPaperSizeCO->currentItem());
QPrefDisplayModule * displaymod(dialog_->displayModule); QPrefDisplayModule * displaymod(dialog_->displayModule);

View 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> 2003-07-25 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* XFormsMenubar.h: * XFormsMenubar.h:

View File

@ -444,7 +444,7 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
// Default unit choice is cm if metric, inches if US paper. // Default unit choice is cm if metric, inches if US paper.
// If papersize is default, check the lyxrc-settings // If papersize is default, check the lyxrc-settings
int const paperchoice = fl_get_choice(paper_->choice_papersize); 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; || paperchoice == 2 || paperchoice > 5;
string const default_unit = metric ? "cm" : "in"; string const default_unit = metric ? "cm" : "in";
if (getString(class_->input_skip).empty()) if (getString(class_->input_skip).empty())
@ -467,7 +467,7 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long)
} else if (ob == paper_->radio_landscape) { } else if (ob == paper_->radio_landscape) {
fl_set_choice(paper_->choice_paperpackage, fl_set_choice(paper_->choice_paperpackage,
BufferParams::PACKAGE_NONE + 1); PACKAGE_NONE + 1);
} else if (ob == paper_->choice_papersize) { } else if (ob == paper_->choice_papersize) {
int const paperchoice = fl_get_choice(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. // Default unit choice is cm if metric, inches if US paper.
// If papersize is default, use the lyxrc-settings // 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; || paperchoice == 2 || paperchoice > 5;
string const default_unit = metric ? "cm" : "in"; string const default_unit = metric ? "cm" : "in";
if (getString(paper_->input_custom_width).empty()) 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_button(paper_->check_use_geometry, 1);
fl_set_choice(paper_->choice_paperpackage, fl_set_choice(paper_->choice_paperpackage,
BufferParams::PACKAGE_NONE + 1); PACKAGE_NONE + 1);
bool const use_geom = fl_get_button(paper_->check_use_geometry); bool const use_geom = fl_get_button(paper_->check_use_geometry);
setEnabled(paper_->input_top_margin, use_geom); 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 // either default papersize (preferences) or document
// papersize has to be A4 // papersize has to be A4
bool const enable = ( fl_get_choice(paper_->choice_papersize) == 1 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; || fl_get_choice(paper_->choice_papersize) == 7;
if (!enable) if (!enable)
fl_set_choice(paper_->choice_paperpackage, fl_set_choice(paper_->choice_paperpackage,
BufferParams::PACKAGE_NONE + 1); PACKAGE_NONE + 1);
setEnabled(paper_->choice_paperpackage, setEnabled(paper_->choice_paperpackage,
enable && fl_get_button(paper_->radio_portrait)); enable && fl_get_button(paper_->radio_portrait));
} }
@ -697,10 +697,10 @@ bool FormDocument::class_apply(BufferParams &params)
void FormDocument::paper_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 = 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 // set params.papersize from params.papersize2 and params.paperpackage
params.setPaperStuff(); params.setPaperStuff();
@ -708,9 +708,9 @@ void FormDocument::paper_apply(BufferParams & params)
params.use_geometry = fl_get_button(paper_->check_use_geometry); params.use_geometry = fl_get_button(paper_->check_use_geometry);
if (fl_get_button(paper_->radio_landscape)) if (fl_get_button(paper_->radio_landscape))
params.orientation = BufferParams::ORIENTATION_LANDSCAPE; params.orientation = ORIENTATION_LANDSCAPE;
else else
params.orientation = BufferParams::ORIENTATION_PORTRAIT; params.orientation = ORIENTATION_PORTRAIT;
params.paperwidth = params.paperwidth =
getLengthFromWidgets(paper_->input_custom_width, getLengthFromWidgets(paper_->input_custom_width,
@ -890,7 +890,7 @@ void FormDocument::class_update(BufferParams const & params)
bool const length_input = pos == 4; bool const length_input = pos == 4;
if (length_input) { if (length_input) {
int const paperchoice = fl_get_choice(paper_->choice_papersize); 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; || paperchoice == 2 || paperchoice > 5;
string const default_unit = metric ? "cm" : "in"; string const default_unit = metric ? "cm" : "in";
string const length = params.getDefSkip().asLyXCommand(); string const length = params.getDefSkip().asLyXCommand();
@ -999,7 +999,7 @@ void FormDocument::paper_update(BufferParams const & params)
fl_set_button(paper_->radio_landscape, 0); fl_set_button(paper_->radio_landscape, 0);
setEnabled(paper_->radio_landscape, !useCustom); setEnabled(paper_->radio_landscape, !useCustom);
if (params.orientation == BufferParams::ORIENTATION_LANDSCAPE) if (params.orientation == ORIENTATION_LANDSCAPE)
fl_set_button(paper_->radio_landscape, 1); fl_set_button(paper_->radio_landscape, 1);
else else
fl_set_button(paper_->radio_portrait, 1); fl_set_button(paper_->radio_portrait, 1);
@ -1007,11 +1007,11 @@ void FormDocument::paper_update(BufferParams const & params)
//either default papersize (preferences) //either default papersize (preferences)
//or document papersize has to be A4 //or document papersize has to be A4
(paperchoice == 7 (paperchoice == 7
|| paperchoice == 1 && lyxrc.default_papersize == BufferParams::PAPER_A4PAPER) || paperchoice == 1 && lyxrc.default_papersize == PAPER_A4PAPER)
&& fl_get_button(paper_->radio_portrait)); && fl_get_button(paper_->radio_portrait));
// Default unit choice is cm if metric, inches if US paper. // 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; || paperchoice == 2 || paperchoice > 5;
string const default_unit = metric ? "cm" : "in"; string const default_unit = metric ? "cm" : "in";
updateWidgetsFromLengthString(paper_->input_custom_width, updateWidgetsFromLengthString(paper_->input_custom_width,

View File

@ -274,14 +274,14 @@ void FormGraphics::build()
// set the right default unit // set the right default unit
switch (lyxrc.default_papersize) { switch (lyxrc.default_papersize) {
case BufferParams::PAPER_DEFAULT: break; case PAPER_DEFAULT: break;
case BufferParams::PAPER_USLETTER: case PAPER_USLETTER:
case BufferParams::PAPER_LEGALPAPER: case PAPER_LEGALPAPER:
case BufferParams::PAPER_EXECUTIVEPAPER: defaultUnit = "in"; break; case PAPER_EXECUTIVEPAPER: defaultUnit = "in"; break;
case BufferParams::PAPER_A3PAPER: case PAPER_A3PAPER:
case BufferParams::PAPER_A4PAPER: case PAPER_A4PAPER:
case BufferParams::PAPER_A5PAPER: case PAPER_A5PAPER:
case BufferParams::PAPER_B5PAPER: defaultUnit = "cm"; break; case PAPER_B5PAPER: defaultUnit = "cm"; break;
} }
} }

View File

@ -167,16 +167,16 @@ void FormParagraph::build()
// set default unit for custom length // set default unit for custom length
switch (lyxrc.default_papersize) { switch (lyxrc.default_papersize) {
case BufferParams::PAPER_DEFAULT: case PAPER_DEFAULT:
case BufferParams::PAPER_USLETTER: case PAPER_USLETTER:
case BufferParams::PAPER_LEGALPAPER: case PAPER_LEGALPAPER:
case BufferParams::PAPER_EXECUTIVEPAPER: case PAPER_EXECUTIVEPAPER:
defaultUnit = "in"; defaultUnit = "in";
break; break;
case BufferParams::PAPER_A3PAPER: case PAPER_A3PAPER:
case BufferParams::PAPER_A4PAPER: case PAPER_A4PAPER:
case BufferParams::PAPER_A5PAPER: case PAPER_A5PAPER:
case BufferParams::PAPER_B5PAPER: case PAPER_B5PAPER:
defaultUnit = "cm"; defaultUnit = "cm";
break; break;
} }

View File

@ -1753,7 +1753,7 @@ void FormPreferences::OutputsMisc::apply(LyXRC & rc) const
int const choice = int const choice =
fl_get_choice(dialog_->choice_default_papersize) - 1; 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.ascii_roff_command = fl_get_input(dialog_->input_ascii_roff);
rc.chktex_command = fl_get_input(dialog_->input_checktex); rc.chktex_command = fl_get_input(dialog_->input_checktex);

View File

@ -16,6 +16,7 @@
#include "debug.h" #include "debug.h"
#include "XWorkArea.h" #include "XWorkArea.h"
#include "xfont_metrics.h" #include "xfont_metrics.h"
#include "lyxfont.h"
#include "ColorHandler.h" #include "ColorHandler.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "encoding.h" #include "encoding.h"

View 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> 2003-07-27 José Matos <jamatos@fep.up.pt>
* PreviewLoader.C (Impl::dumpPreamble): comply with makeLaTeXFile * PreviewLoader.C (Impl::dumpPreamble): comply with makeLaTeXFile

View File

@ -12,7 +12,7 @@
#include <config.h> #include <config.h>
#include "graphics/GraphicsTypes.h" #include "graphics/GraphicsTypes.h"
#include "support/translator.h"
namespace lyx { namespace lyx {
namespace graphics { namespace graphics {

View File

@ -16,7 +16,6 @@
#define GRAPHICSTYPES_H #define GRAPHICSTYPES_H
#include "LString.h" #include "LString.h"
#include "support/translator.h"
namespace lyx { namespace lyx {
namespace graphics { namespace graphics {
@ -63,8 +62,6 @@ enum DisplayType {
NoDisplay NoDisplay
}; };
/// The translator between the DisplayType and the corresponding lyx string.
extern Translator<DisplayType, string> displayTranslator;
/// ///
void setDisplayTranslator(); void setDisplayTranslator();

View 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> 2003-07-27 José Matos <jamatos@fep.up.pt>
* insetfloat.[Ch] (linuxdoc): * insetfloat.[Ch] (linuxdoc):
* insetgraphics.C (linuxdoc): * insetgraphics.C (linuxdoc):
* insettabular.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> 2003-07-27 José Matos <jamatos@fep.up.pt>

View File

@ -38,6 +38,8 @@
#include "support/lyxalgo.h" #include "support/lyxalgo.h"
#include "support/path.h" #include "support/path.h"
#include "support/tostr.h" #include "support/tostr.h"
#include "support/LAssert.h"
#include "support/translator.h"
#include <boost/bind.hpp> #include <boost/bind.hpp>
@ -50,6 +52,13 @@ using std::ostream;
using std::endl; using std::endl;
using std::auto_ptr; using std::auto_ptr;
namespace lyx {
namespace graphics {
/// The translator between the DisplayType and the corresponding lyx string.
extern Translator<DisplayType, string> displayTranslator;
}
}
namespace { namespace {
lyx::graphics::DisplayType const defaultDisplayType = lyx::graphics::NoDisplay; lyx::graphics::DisplayType const defaultDisplayType = lyx::graphics::NoDisplay;

View File

@ -21,6 +21,7 @@
#include "support/LOstream.h" #include "support/LOstream.h"
#include "support/LAssert.h" #include "support/LAssert.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "support/translator.h"
#include "lyxrc.h" #include "lyxrc.h"
#include "debug.h" #include "debug.h"
#include "lyxlex.h" #include "lyxlex.h"
@ -30,6 +31,13 @@ using namespace lyx::support;
using std::ostream; using std::ostream;
namespace lyx {
namespace graphics {
/// The translator between the DisplayType and the corresponding lyx string.
extern Translator<DisplayType, string> displayTranslator;
}
}
InsetGraphicsParams::InsetGraphicsParams() InsetGraphicsParams::InsetGraphicsParams()
{ {

View File

@ -24,7 +24,7 @@
#include "graphics/GraphicsImage.h" #include "graphics/GraphicsImage.h"
#include "support/filetools.h" #include "support/filetools.h"
#include "support/LAssert.h"
using namespace lyx::support; using namespace lyx::support;

View File

@ -17,6 +17,7 @@
#include "ispell.h" #include "ispell.h"
#include "WordLangTuple.h" #include "WordLangTuple.h"
#include "gettext.h" #include "gettext.h"
#include "bufferparams.h"
#include "support/forkedcall.h" #include "support/forkedcall.h"
#include "support/lstrings.h" #include "support/lstrings.h"

View File

@ -12,9 +12,13 @@
#include "kbmap.h" #include "kbmap.h"
#include "lfuns.h" #include "lfuns.h"
#include "kbsequence.h" #include "kbsequence.h"
#include "LyXAction.h"
#include "support/filetools.h"
#include "lyxlex.h"
#include "debug.h" #include "debug.h"
using std::endl; using std::endl;
using lyx::support::i18nLibFileSearch;
string const kb_keymap::printKeysym(LyXKeySymPtr key, string const kb_keymap::printKeysym(LyXKeySymPtr key,
key_modifier::state mod) 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, int kb_keymap::lookup(LyXKeySymPtr key,
key_modifier::state mod, kb_sequence * seq) const key_modifier::state mod, kb_sequence * seq) const
{ {

View File

@ -30,6 +30,9 @@ public:
*/ */
string::size_type bind(string const & seq, int action); 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 /// print all available keysyms
string const print() const; string const print() const;

View File

@ -96,10 +96,6 @@ LyX::LyX(int & argc, char * argv[])
// we need to parse for "-dbg" and "-help" // we need to parse for "-dbg" and "-help"
bool const want_gui = easyParse(argc, argv); 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?? // set the DisplayTranslator only once; should that be done here??
// if this should not be in this file, please also remove // if this should not be in this file, please also remove
// #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye. // #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye.
@ -470,12 +466,15 @@ void LyX::init(bool gui)
lyxerr[Debug::INIT] << "Reading layouts..." << endl; lyxerr[Debug::INIT] << "Reading layouts..." << endl;
LyXSetStyle(); LyXSetStyle();
// Ensure that we have really read a bind file, so that LyX is if (gui) {
// usable. // Set up bindings
lyxrc.readBindFileIfNeeded(); toplevel_keymap.reset(new kb_keymap);
defaultKeyBindings(toplevel_keymap.get());
toplevel_keymap->read(lyxrc.bind_file);
// Read menus // Read menus
readUIFile(lyxrc.ui_file); readUIFile(lyxrc.ui_file);
}
if (lyxerr.debugging(Debug::LYXRC)) if (lyxerr.debugging(Debug::LYXRC))
lyxrc.print(); lyxrc.print();

View File

@ -16,13 +16,12 @@
#include "lyxrc.h" #include "lyxrc.h"
#include "debug.h" #include "debug.h"
#include "kbmap.h"
#include "LyXAction.h"
#include "intl.h" #include "intl.h"
#include "converter.h" #include "converter.h"
#include "format.h" #include "format.h"
#include "gettext.h" #include "gettext.h"
#include "lyxlex.h" #include "lyxlex.h"
#include "lyxfont.h"
#include "support/path.h" #include "support/path.h"
#include "support/tostr.h" #include "support/tostr.h"
@ -30,6 +29,7 @@
#include "support/LAssert.h" #include "support/LAssert.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "support/userinfo.h" #include "support/userinfo.h"
#include "support/translator.h"
using namespace lyx::support; using namespace lyx::support;
@ -40,9 +40,12 @@ using std::ios;
using std::endl; using std::endl;
using std::vector; using std::vector;
class kb_keymap; namespace lyx {
namespace graphics {
extern boost::scoped_ptr<kb_keymap> toplevel_keymap; /// The translator between the DisplayType and the corresponding lyx string.
extern Translator<DisplayType, string> displayTranslator;
}
}
namespace { namespace {
@ -57,7 +60,6 @@ keyword_item lyxrcTags[] = {
{ "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS }, { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
{ "\\autosave", LyXRC::RC_AUTOSAVE }, { "\\autosave", LyXRC::RC_AUTOSAVE },
{ "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH }, { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
{ "\\bind", LyXRC::RC_BIND },
{ "\\bind_file", LyXRC::RC_BINDFILE }, { "\\bind_file", LyXRC::RC_BINDFILE },
{ "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES }, { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
{ "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND }, { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
@ -170,7 +172,6 @@ LyXRC::LyXRC()
void LyXRC::setDefaults() { void LyXRC::setDefaults() {
bind_file = "cua"; bind_file = "cua";
hasBindFile = false;
ui_file = "default"; ui_file = "default";
// Get printer from the environment. If fail, use default "", // Get printer from the environment. If fail, use default "",
// assuming that everything is set up correctly. // assuming that everything is set up correctly.
@ -194,7 +195,7 @@ void LyXRC::setDefaults() {
use_tempdir = true; use_tempdir = true;
ps_command = "gs"; ps_command = "gs";
view_dvi_paper_option.erase(); view_dvi_paper_option.erase();
default_papersize = BufferParams::PAPER_USLETTER; default_papersize = PAPER_USLETTER;
custom_export_format = "ps"; custom_export_format = "ps";
chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38"; chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
fontenc = "default"; 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 { namespace {
void oldFontFormat(string & family, string & foundry) void oldFontFormat(string & family, string & foundry)
@ -347,18 +329,7 @@ int LyXRC::read(string const & filename)
break; break;
case RC_BINDFILE: // RVDK_PATCH_5 case RC_BINDFILE: // RVDK_PATCH_5
if (lexrc.next()) { if (lexrc.next()) {
string const tmp(lexrc.getString()); bind_file = 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;
}
} }
break; break;
@ -546,25 +517,25 @@ int LyXRC::read(string const & filename)
ascii_lowercase(lexrc.getString()); ascii_lowercase(lexrc.getString());
if (size == "usletter") if (size == "usletter")
default_papersize = default_papersize =
BufferParams::PAPER_USLETTER; PAPER_USLETTER;
else if (size == "legal") else if (size == "legal")
default_papersize = default_papersize =
BufferParams::PAPER_LEGALPAPER; PAPER_LEGALPAPER;
else if (size == "executive") else if (size == "executive")
default_papersize = default_papersize =
BufferParams::PAPER_EXECUTIVEPAPER; PAPER_EXECUTIVEPAPER;
else if (size == "a3") else if (size == "a3")
default_papersize = default_papersize =
BufferParams::PAPER_A3PAPER; PAPER_A3PAPER;
else if (size == "a4") else if (size == "a4")
default_papersize = default_papersize =
BufferParams::PAPER_A4PAPER; PAPER_A4PAPER;
else if (size == "a5") else if (size == "a5")
default_papersize = default_papersize =
BufferParams::PAPER_A5PAPER; PAPER_A5PAPER;
else if (size == "b5") else if (size == "b5")
default_papersize = default_papersize =
BufferParams::PAPER_B5PAPER; PAPER_B5PAPER;
} }
break; break;
@ -801,53 +772,6 @@ int LyXRC::read(string const & filename)
} }
break; 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: case RC_SERVERPIPE:
if (lexrc.next()) { if (lexrc.next()) {
lyxpipes = ExpandPath(lexrc.getString()); lyxpipes = ExpandPath(lexrc.getString());
@ -1160,8 +1084,6 @@ void LyXRC::output(ostream & os) const
case RC_LAST: case RC_LAST:
case RC_INPUT: case RC_INPUT:
// input/include files are not done here // input/include files are not done here
case RC_BIND:
// bindings is not written to the preferences file.
case RC_BINDFILE: case RC_BINDFILE:
if (bind_file != system_lyxrc.bind_file) { if (bind_file != system_lyxrc.bind_file) {
os << "\\bind_file " << bind_file << "\n"; os << "\\bind_file " << bind_file << "\n";
@ -1219,21 +1141,21 @@ void LyXRC::output(ostream & os) const
os << "# The default papersize to use.\n" os << "# The default papersize to use.\n"
<< "\\default_papersize \""; << "\\default_papersize \"";
switch (default_papersize) { switch (default_papersize) {
case BufferParams::PAPER_USLETTER: case PAPER_USLETTER:
os << "usletter"; break; os << "usletter"; break;
case BufferParams::PAPER_LEGALPAPER: case PAPER_LEGALPAPER:
os << "legal"; break; os << "legal"; break;
case BufferParams::PAPER_EXECUTIVEPAPER: case PAPER_EXECUTIVEPAPER:
os << "executive"; break; os << "executive"; break;
case BufferParams::PAPER_A3PAPER: case PAPER_A3PAPER:
os << "a3"; break; os << "a3"; break;
case BufferParams::PAPER_A4PAPER: case PAPER_A4PAPER:
os << "a4"; break; os << "a4"; break;
case BufferParams::PAPER_A5PAPER: case PAPER_A5PAPER:
os << "a5"; break; os << "a5"; break;
case BufferParams::PAPER_B5PAPER: case PAPER_B5PAPER:
os << "b5"; break; os << "b5"; break;
case BufferParams::PAPER_DEFAULT: break; case PAPER_DEFAULT: break;
} }
os << "\"\n"; os << "\"\n";
} }

View File

@ -10,7 +10,7 @@
#ifndef LYXRC_H #ifndef LYXRC_H
#define 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 "graphics/GraphicsTypes.h"
// #include <boost/utility.hpp> // #include <boost/utility.hpp>
@ -65,7 +65,6 @@ enum LyXRCTags {
RC_LASTFILES, RC_LASTFILES,
RC_AUTOREGIONDELETE, RC_AUTOREGIONDELETE,
RC_AUTORESET_OPTIONS, RC_AUTORESET_OPTIONS,
RC_BIND,
RC_SERVERPIPE, RC_SERVERPIPE,
RC_INPUT, RC_INPUT,
RC_BINDFILE, RC_BINDFILE,
@ -132,8 +131,6 @@ enum LyXRCTags {
/// ///
int read(string const & filename); int read(string const & filename);
/// ///
void readBindFileIfNeeded();
///
void write(string const & filename) const; void write(string const & filename) const;
/// ///
void print() const; void print() const;
@ -190,7 +187,7 @@ enum LyXRCTags {
/// option for telling the dvi viewer about the paper size /// option for telling the dvi viewer about the paper size
string view_dvi_paper_option; string view_dvi_paper_option;
/// default paper size for local xdvi/dvips/ghostview/whatever /// default paper size for local xdvi/dvips/ghostview/whatever
BufferParams::PAPER_SIZE default_papersize; PAPER_SIZE default_papersize;
/// command to run chktex incl. options /// command to run chktex incl. options
string chktex_command; string chktex_command;
/// ///
@ -350,12 +347,6 @@ enum LyXRCTags {
string user_name; string user_name;
/// user email /// user email
string user_email; string user_email;
private:
/// Is a bind file already (or currently) read?
bool hasBindFile;
///
int ReadBindFile(string const & name);
}; };
/// ///

83
src/paper.h Normal file
View File

@ -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

View 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> 2003-07-26 Angus Leeming <leeming@lyx.org>
* Spacing.h: * Spacing.h:

View 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"; os << "\n\\size " << known_coded_sizes[where - known_sizes] << "\n";
} }
else if (t.cs() == "LyX" || t.cs() == "TeX" else if (t.cs() == "LyX" || t.cs() == "TeX"
|| t.cs() == "LaTeX" || t.cs() == "LaTeXe") { || t.cs() == "LaTeX") {
os << t.cs(); os << t.cs();
skip_braces(p); // eat {} skip_braces(p); // eat {}
} }
else if (t.cs() == "LaTeXe") {
os << "LaTeX2e";
skip_braces(p); // eat {}
}
else if (t.cs() == "lyxarrow") { else if (t.cs() == "lyxarrow") {
os << "\\SpecialChar \\menuseparator\n"; os << "\\SpecialChar \\menuseparator\n";
skip_braces(p); skip_braces(p);

View File

@ -29,6 +29,7 @@
#include "language.h" #include "language.h"
#include "support/tostr.h" #include "support/tostr.h"
#include "support/lstrings.h" #include "support/lstrings.h"
#include "support/LAssert.h"
#include "frontends/LyXView.h" #include "frontends/LyXView.h"
#include "frontends/screen.h" #include "frontends/screen.h"
#include "frontends/Dialogs.h" #include "frontends/Dialogs.h"