Rob's followup (nr. 1 ;)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5127 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Levon 2002-08-27 20:30:20 +00:00
parent b9d544874e
commit 6af5ac769a
27 changed files with 475 additions and 436 deletions

View File

@ -1,3 +1,7 @@
2002-08-28 Rob Lahaye <lahaye@snu.ac.kr>
* lyx2lyx/lyx2lyx: add new format number "221"
2002-08-25 John Levon <levon@movementarian.org> 2002-08-25 John Levon <levon@movementarian.org>
* images/find-replace.xpm: add * images/find-replace.xpm: add

View File

@ -65,7 +65,7 @@
\bind "C-S-V" "layout-paste" \bind "C-S-V" "layout-paste"
\bind "C-z" "undo" \bind "C-z" "undo"
\bind "C-S-Z" "redo" \bind "C-S-z" "redo"
\bind "~S-C-quotedbl" "self-insert \"" \bind "~S-C-quotedbl" "self-insert \""
\bind "C-minus" "hyphenation-point-insert" \bind "C-minus" "hyphenation-point-insert"

View File

@ -37,7 +37,7 @@ opt.quiet = 0
format = re.compile(r"(\d)[\.,]?(\d\d)") format = re.compile(r"(\d)[\.,]?(\d\d)")
fileformat = re.compile(r"\\lyxformat\s*(\S*)") fileformat = re.compile(r"\\lyxformat\s*(\S*)")
lst_ft = ["210", "215", "216", "217", "218", "220"] lst_ft = ["210", "215", "216", "217", "218", "220", "221"]
def usage(): def usage():
print """Usage: lyx2lyx [options] file1 print """Usage: lyx2lyx [options] file1

View File

@ -8,7 +8,6 @@ src/converter.C
src/CutAndPaste.C src/CutAndPaste.C
src/debug.C src/debug.C
src/exporter.C src/exporter.C
src/ext_l10n.h
src/FloatList.C src/FloatList.C
src/frontends/controllers/biblio.C src/frontends/controllers/biblio.C
src/frontends/controllers/ButtonController.h src/frontends/controllers/ButtonController.h

View File

@ -1,3 +1,13 @@
2002-08-28 Rob Lahaye <lahaye@snu.ac.kr>
* buffer.C: increment LYX_FORMAT to 221
* lyxrc.[Ch]: declare display_graphics as grfx::DisplayType and use
grfx::displayTranslator.find(foo); include graphics/GraphicsTypes.h.
* lyxrc.C: use more "if (...) { } else { }" style (John's advice).
* lyx_main.C: call once the setDisplayTranslator(); is that okay here?
2002-08-27 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr> 2002-08-27 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* factory.C (createInset): use LyXTextClass::floats * factory.C (createInset): use LyXTextClass::floats

View File

@ -147,7 +147,7 @@ extern BufferList bufferlist;
namespace { namespace {
const int LYX_FORMAT = 220; const int LYX_FORMAT = 221;
} // namespace anon } // namespace anon

View File

@ -88,10 +88,8 @@ void changeDepth(BufferView * bv, LyXText * text, int decInc)
else else
text->decDepth(bv); text->decDepth(bv);
if (text->inset_owner) if (text->inset_owner)
bv->updateInset((Inset *)text->inset_owner, true); bv->updateInset((Inset *)text->inset_owner, true);
bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE); bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
bv->owner()->message(_("Changed environment depth "
"(in possible range, maybe not)"));
} }

View File

@ -1,3 +1,8 @@
2002-08-25 Rob Lahaye <lahaye@snu.ac.kr>
* QLImage.C: replace redundant xoffset_l and yoffset_t
calculation by something better.
2002-08-25 John Levon <levon@movementarian.org> 2002-08-25 John Levon <levon@movementarian.org>
* FileDialog.C: * FileDialog.C:

View File

@ -214,8 +214,9 @@ void QLImage::clip(Params const & params)
if (new_width == pixmap_.width() && new_height == pixmap_.height()) if (new_width == pixmap_.width() && new_height == pixmap_.height())
return; return;
int const xoffset_l = std::max(0, int(params.bb.xl)); int const xoffset_l = params.bb.xl;
int const yoffset_t = std::max(0, pixmap_.height() - int(params.bb.yt)); int const yoffset_t = ( pixmap_.height() > params.bb.yt ?
pixmap_.height() - params.bb.yt : 0 );
xformed_pixmap_.resize(new_width, new_height); xformed_pixmap_.resize(new_width, new_height);
QPainter p; QPainter p;

View File

@ -1,3 +1,14 @@
2002-08-28 Rob Lahaye <lahaye@snu.ac.kr>
* forms/form_graphics.fd:
* FormGraphics.C: re-implement the use of text_warning box.
* forms/form_preferences.fd:
* FormPreferences.C: use displayTranslator, change display mode
from four radio buttons into one choice button.
* FormBibtex.C: fix SIGSEGV with [Choose] when no style is selected.
2002-08-24 John Levon <levon@movementarian.org> 2002-08-24 John Levon <levon@movementarian.org>
* xformsImage.C: fix build, add FIXME for Rob * xformsImage.C: fix build, add FIXME for Rob

View File

@ -116,10 +116,13 @@ ButtonPolicy::SMInput FormBibtex::input(FL_OBJECT * ob, long)
} }
} else if (ob == dialog_->button_style_choose) { } else if (ob == dialog_->button_style_choose) {
unsigned int selection = fl_get_browser(dialog_->browser_styles); unsigned int selection = fl_get_browser(dialog_->browser_styles);
string const out_name = if (!selection)
fl_get_browser_line(dialog_->browser_styles, selection); return ButtonPolicy::SMI_NOOP;
string const out_name = fl_get_browser_line(dialog_->browser_styles,
selection);
fl_set_input(dialog_->input_style, fl_set_input(dialog_->input_style,
ChangeExtension(out_name, string()).c_str()); ChangeExtension(out_name, string()).c_str());
} else if (ob == dialog_->button_rescan) { } else if (ob == dialog_->button_rescan) {
fl_clear_browser(dialog_->browser_styles); fl_clear_browser(dialog_->browser_styles);
controller().rescanBibStyles(); controller().rescanBibStyles();

View File

@ -36,6 +36,7 @@ using std::vector;
namespace { namespace {
// Bound the number of input characters // Bound the number of input characters
int const SIZE_MAXDIGITS = 10;
int const FILENAME_MAXCHARS = 1024; int const FILENAME_MAXCHARS = 1024;
string defaultUnit("cm"); string defaultUnit("cm");
@ -99,10 +100,15 @@ void FormGraphics::build()
// width default is scaling, thus unsigned integer input // width default is scaling, thus unsigned integer input
fl_set_input_filter(file_->input_width, fl_unsigned_int_filter); fl_set_input_filter(file_->input_width, fl_unsigned_int_filter);
fl_set_input_filter(file_->input_height, fl_unsigned_float_filter); fl_set_input_maxchars(file_->input_height, SIZE_MAXDIGITS);
string const display_List = _("Default|Monochrome|Grayscale|Color|Do not display");
fl_addto_choice(file_->choice_display, display_List.c_str());
string const width_list = _("Scale%%|") + choice_Length_All;
fl_addto_choice(file_->choice_width, width_list.c_str());
fl_addto_choice(file_->choice_display, _("Default|Monochrome|Grayscale|Color|Do not display"));
fl_addto_choice(file_->choice_width, (_("Scale%%|") + choice_Length_All).c_str());
fl_addto_choice(file_->choice_height, choice_Length_All.c_str()); fl_addto_choice(file_->choice_height, choice_Length_All.c_str());
bc().addReadOnly(file_->button_browse); bc().addReadOnly(file_->button_browse);
@ -250,7 +256,9 @@ void FormGraphics::apply()
igp.filename = getString(file_->input_filename); igp.filename = getString(file_->input_filename);
igp.lyxscale = strToInt(getString(file_->input_lyxscale)); igp.lyxscale = strToInt(getString(file_->input_lyxscale));
if (igp.lyxscale == 0) igp.lyxscale = 100; if (igp.lyxscale == 0) {
igp.lyxscale = 100;
}
switch (fl_get_choice(file_->choice_display)) { switch (fl_get_choice(file_->choice_display)) {
case 5: igp.display = grfx::NoDisplay; break; case 5: igp.display = grfx::NoDisplay; break;
@ -264,10 +272,11 @@ void FormGraphics::apply()
// first item in choice_width means scaling // first item in choice_width means scaling
if (fl_get_choice(file_->choice_width) == 1) { if (fl_get_choice(file_->choice_width) == 1) {
igp.scale = strToInt(getString(file_->input_width)); igp.scale = strToInt(getString(file_->input_width));
if (igp.scale == 0) igp.scale = 100; if (igp.scale == 0) {
igp.scale = 100;
}
igp.width = LyXLength(); igp.width = LyXLength();
} } else {
else {
igp.scale = 0; igp.scale = 0;
igp.width = getLyXLengthFromWidgets(file_->input_width, igp.width = getLyXLengthFromWidgets(file_->input_width,
file_->choice_width); file_->choice_width);
@ -280,9 +289,9 @@ void FormGraphics::apply()
igp.noUnzip = fl_get_button(file_->check_nounzip); igp.noUnzip = fl_get_button(file_->check_nounzip);
// the bb section // the bb section
if (!controller().bbChanged) // different to the original one? if (!controller().bbChanged) { // different to the original one?
igp.bb = string(); // don't write anything igp.bb = string(); // don't write anything
else { } else {
string bb; string bb;
if (getString(bbox_->input_bb_x0).empty()) if (getString(bbox_->input_bb_x0).empty())
bb = "0 "; bb = "0 ";
@ -312,8 +321,12 @@ void FormGraphics::apply()
igp.rotateAngle = strToDbl(getString(extra_->input_rotate_angle)); igp.rotateAngle = strToDbl(getString(extra_->input_rotate_angle));
// map angle into -360 (clock-wise) to +360 (counter clock-wise) // map angle into -360 (clock-wise) to +360 (counter clock-wise)
while (igp.rotateAngle <= -360.0) igp.rotateAngle += 360.0; while (igp.rotateAngle <= -360.0) {
while (igp.rotateAngle >= 360.0) igp.rotateAngle -= 360.0; igp.rotateAngle += 360.0;
}
while (igp.rotateAngle >= 360.0) {
igp.rotateAngle -= 360.0;
}
fl_set_input(extra_->input_rotate_angle, tostr(igp.rotateAngle).c_str()); fl_set_input(extra_->input_rotate_angle, tostr(igp.rotateAngle).c_str());
int const origin_pos = fl_get_choice(extra_->choice_origin); int const origin_pos = fl_get_choice(extra_->choice_origin);
@ -350,11 +363,12 @@ void FormGraphics::update() {
// set width input fields according to scaling or width/height input // set width input fields according to scaling or width/height input
if (igp.scale) { if (igp.scale) {
fl_set_input_filter(file_->input_width, fl_unsigned_int_filter); fl_set_input_filter(file_->input_width, fl_unsigned_int_filter);
fl_set_input_maxchars(file_->input_width, 0);
fl_set_input(file_->input_width, tostr(igp.scale).c_str()); fl_set_input(file_->input_width, tostr(igp.scale).c_str());
fl_set_choice(file_->choice_width, 1); fl_set_choice(file_->choice_width, 1);
} } else {
else { fl_set_input_filter(file_->input_width, NULL);
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter); fl_set_input_maxchars(file_->input_width, SIZE_MAXDIGITS);
updateWidgetsFromLength(file_->input_width, updateWidgetsFromLength(file_->input_width,
file_->choice_width, igp.width, defaultUnit); file_->choice_width, igp.width, defaultUnit);
} }
@ -382,11 +396,10 @@ void FormGraphics::update() {
// the extra section // the extra section
fl_set_input(extra_->input_rotate_angle, fl_set_input(extra_->input_rotate_angle,
tostr(igp.rotateAngle).c_str()); tostr(igp.rotateAngle).c_str());
if (igp.rotateOrigin.empty())
fl_set_choice(extra_->choice_origin, 1); int const origin_pos = findPos(origins_, igp.rotateOrigin);
else fl_set_choice(extra_->choice_origin, 1 + origin_pos);
fl_set_choice(extra_->choice_origin,
1 + int(findPos(origins_, igp.rotateOrigin)) );
fl_set_button(extra_->check_subcaption, igp.subcaption); fl_set_button(extra_->check_subcaption, igp.subcaption);
fl_set_input(extra_->input_subcaption, igp.subcaptionText.c_str()); fl_set_input(extra_->input_subcaption, igp.subcaptionText.c_str());
setEnabled(extra_->input_subcaption, setEnabled(extra_->input_subcaption,
@ -394,7 +407,9 @@ void FormGraphics::update() {
fl_set_input(extra_->input_special, igp.special.c_str()); fl_set_input(extra_->input_special, igp.special.c_str());
// open dialog in the file-tab, whenever filename is empty // open dialog in the file-tab, whenever filename is empty
if (igp.filename.empty()) fl_set_folder(dialog_->tabfolder, file_->form); if (igp.filename.empty()) {
fl_set_folder(dialog_->tabfolder, file_->form);
}
} }
@ -405,7 +420,7 @@ void FormGraphics::updateBB(string const & filename, string const & bb_inset)
// path, because the controller knows nothing about the doc-dir // path, because the controller knows nothing about the doc-dir
controller().bbChanged = false; controller().bbChanged = false;
if (bb_inset.empty()) { if (bb_inset.empty()) {
lyxerr[Debug::GRAPHICS] << "update:: no BoundingBox" << endl; lyxerr[Debug::GRAPHICS] << "FormGraphics::updateBB() [no BoundingBox]" << endl;
string const bb = controller().readBB(filename); string const bb = controller().readBB(filename);
if (!bb.empty()) { if (!bb.empty()) {
// get the values from the file // get the values from the file
@ -431,9 +446,11 @@ void FormGraphics::updateBB(string const & filename, string const & bb_inset)
} else { } else {
// get the values from the inset // get the values from the inset
lyxerr[Debug::GRAPHICS] << "update:: igp has BoundingBox" lyxerr[Debug::GRAPHICS] << "FormGraphics::updateBB(): igp has BoundingBox"
<< " ["<< bb_inset << "]"
<< endl; << endl;
controller().bbChanged = true; controller().bbChanged = true;
LyXLength anyLength; LyXLength anyLength;
anyLength = LyXLength(token(bb_inset,' ',0)); anyLength = LyXLength(token(bb_inset,' ',0));
updateWidgetsFromLength(bbox_->input_bb_x0, updateWidgetsFromLength(bbox_->input_bb_x0,
@ -450,6 +467,7 @@ void FormGraphics::updateBB(string const & filename, string const & bb_inset)
} }
} }
namespace { namespace {
bool isValid(FL_OBJECT * ob) bool isValid(FL_OBJECT * ob)
@ -474,8 +492,9 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
fl_set_input(file_->input_filename, out_name.c_str()); fl_set_input(file_->input_filename, out_name.c_str());
} }
if (controller().isFilenameValid(out_name) && if (controller().isFilenameValid(out_name) &&
!controller().bbChanged) !controller().bbChanged) {
updateBB(out_name, string()); updateBB(out_name, string());
}
} else if (ob == file_->input_width || ob == file_->input_height) { } else if (ob == file_->input_width || ob == file_->input_height) {
// disable aspectratio button in case of scaling or one of width/height is empty // disable aspectratio button in case of scaling or one of width/height is empty
bool const disable = fl_get_choice(file_->choice_width) == 1 || bool const disable = fl_get_choice(file_->choice_width) == 1 ||
@ -489,11 +508,13 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
setEnabled(file_->choice_height, !scaling); setEnabled(file_->choice_height, !scaling);
// allow only integer intput for scaling; float otherwise // allow only integer intput for scaling; float otherwise
if (scaling) if (scaling) {
fl_set_input_filter(file_->input_width, fl_unsigned_int_filter); fl_set_input_filter(file_->input_width, fl_unsigned_int_filter);
else fl_set_input_maxchars(file_->input_width, 0);
fl_set_input_filter(file_->input_width, fl_unsigned_float_filter); } else {
fl_set_input_filter(file_->input_width, NULL);
fl_set_input_maxchars(file_->input_width, SIZE_MAXDIGITS);
}
// disable aspectratio button in case of scaling or height input is empty // disable aspectratio button in case of scaling or height input is empty
bool const disable_aspectratio = scaling || getString(file_->input_height).empty(); bool const disable_aspectratio = scaling || getString(file_->input_height).empty();
@ -530,18 +551,15 @@ ButtonPolicy::SMInput FormGraphics::input(FL_OBJECT * ob, long)
} }
// deactivate OK/ Apply buttons and // check if the input is valid
// spit out warnings if invalid bool const invalid = !isValid(file_->input_width) || !isValid(file_->input_height);
if (ob == bbox_->input_bb_x0 || ob == bbox_->input_bb_x1 ||
ob == bbox_->input_bb_y0 || ob == bbox_->input_bb_y1 ||
ob == file_->input_width || ob == file_->input_height) {
if (isValid(ob))
clearMessage();
else {
postWarning(_("Invalid Length!"));
return ButtonPolicy::SMI_INVALID;
}
}
return ButtonPolicy::SMI_VALID; // deactivate OK / Apply buttons and spit out warnings if invalid
if (invalid) {
postWarning(_("Invalid Length in Output size!"));
return ButtonPolicy::SMI_INVALID;
} else {
clearMessage();
return ButtonPolicy::SMI_VALID;
}
} }

View File

@ -42,6 +42,7 @@
#include "support/LAssert.h" #include "support/LAssert.h"
#include "graphics/GraphicsCache.h" #include "graphics/GraphicsCache.h"
#include "graphics/GraphicsTypes.h"
#include <boost/bind.hpp> #include <boost/bind.hpp>
@ -1824,15 +1825,14 @@ void FormPreferences::LnFmisc::apply() const
lyxrc.wheel_jump = static_cast<unsigned int> lyxrc.wheel_jump = static_cast<unsigned int>
(fl_get_counter_value(dialog_->counter_wm_jump)); (fl_get_counter_value(dialog_->counter_wm_jump));
string const old_value = lyxrc.display_graphics; // See FIXME below
if (fl_get_button(dialog_->radio_display_monochrome)) { // grfx::DisplayType old_value = lyxrc.display_graphics;
lyxrc.display_graphics = "monochrome"; switch (fl_get_choice(dialog_->choice_display)) {
} else if (fl_get_button(dialog_->radio_display_grayscale)) { case 4: lyxrc.display_graphics = grfx::NoDisplay; break;
lyxrc.display_graphics = "grayscale"; case 3: lyxrc.display_graphics = grfx::ColorDisplay; break;
} else if (fl_get_button(dialog_->radio_display_color)) { case 2: lyxrc.display_graphics = grfx::GrayscaleDisplay; break;
lyxrc.display_graphics = "color"; case 1: lyxrc.display_graphics = grfx::MonochromeDisplay; break;
} else { default: lyxrc.display_graphics = grfx::ColorDisplay; break;
lyxrc.display_graphics = "none";
} }
#ifdef WITH_WARNINGS #ifdef WITH_WARNINGS
@ -1864,10 +1864,8 @@ void FormPreferences::LnFmisc::build()
setPrehandler(dialog_->check_dialogs_iconify_with_main); setPrehandler(dialog_->check_dialogs_iconify_with_main);
setPrehandler(dialog_->check_preview_latex); setPrehandler(dialog_->check_preview_latex);
setPrehandler(dialog_->counter_wm_jump); setPrehandler(dialog_->counter_wm_jump);
setPrehandler(dialog_->radio_display_monochrome);
setPrehandler(dialog_->radio_display_grayscale); fl_addto_choice(dialog_->choice_display, _("Monochrome|Grayscale|Color|Do not display"));
setPrehandler(dialog_->radio_display_color);
setPrehandler(dialog_->radio_no_display);
} }
@ -1886,10 +1884,7 @@ FormPreferences::LnFmisc::feedback(FL_OBJECT const * const ob) const
return lyxrc.getDescription(LyXRC::RC_AUTOSAVE); return lyxrc.getDescription(LyXRC::RC_AUTOSAVE);
if (ob == dialog_->counter_wm_jump) if (ob == dialog_->counter_wm_jump)
return lyxrc.getDescription(LyXRC::RC_WHEEL_JUMP); return lyxrc.getDescription(LyXRC::RC_WHEEL_JUMP);
if (ob == dialog_->radio_display_monochrome || if (ob == dialog_->choice_display)
ob == dialog_->radio_display_grayscale ||
ob == dialog_->radio_display_color ||
ob == dialog_->radio_no_display)
return lyxrc.getDescription(LyXRC::RC_DISPLAY_GRAPHICS); return lyxrc.getDescription(LyXRC::RC_DISPLAY_GRAPHICS);
return string(); return string();
} }
@ -1908,14 +1903,12 @@ void FormPreferences::LnFmisc::update()
fl_set_counter_value(dialog_->counter_autosave, lyxrc.autosave); fl_set_counter_value(dialog_->counter_autosave, lyxrc.autosave);
fl_set_counter_value(dialog_->counter_wm_jump, lyxrc.wheel_jump); fl_set_counter_value(dialog_->counter_wm_jump, lyxrc.wheel_jump);
if (lyxrc.display_graphics == "monochrome") { switch (lyxrc.display_graphics) {
fl_set_button(dialog_->radio_display_monochrome, 1); case grfx::NoDisplay: fl_set_choice(dialog_->choice_display, 4); break;
} else if (lyxrc.display_graphics == "grayscale") { case grfx::ColorDisplay: fl_set_choice(dialog_->choice_display, 3); break;
fl_set_button(dialog_->radio_display_grayscale, 1); case grfx::GrayscaleDisplay: fl_set_choice(dialog_->choice_display, 2); break;
} else if (lyxrc.display_graphics == "color") { case grfx::MonochromeDisplay: fl_set_choice(dialog_->choice_display, 1); break;
fl_set_button(dialog_->radio_display_color, 1); default: fl_set_choice(dialog_->choice_display, 3); break;
} else {
fl_set_button(dialog_->radio_no_display, 1);
} }
} }

View File

@ -10,13 +10,13 @@ SnapGrid: 5
=============== FORM =============== =============== FORM ===============
Name: form_graphics Name: form_graphics
Width: 510 Width: 510
Height: 345 Height: 340
Number of Objects: 7 Number of Objects: 7
-------------------- --------------------
class: FL_BOX class: FL_BOX
type: FLAT_BOX type: FLAT_BOX
box: 0 0 510 345 box: 0 0 510 340
boxtype: FL_FLAT_BOX boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -52,7 +52,7 @@ argument:
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: NORMAL_BUTTON type: NORMAL_BUTTON
box: 5 310 100 30 box: 5 305 100 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -70,7 +70,7 @@ argument: 0
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: RETURN_BUTTON type: RETURN_BUTTON
box: 225 310 90 30 box: 225 305 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -88,7 +88,7 @@ argument: 0
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: NORMAL_BUTTON type: NORMAL_BUTTON
box: 415 310 90 30 box: 415 305 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -106,7 +106,7 @@ argument: 0
-------------------- --------------------
class: FL_BUTTON class: FL_BUTTON
type: NORMAL_BUTTON type: NORMAL_BUTTON
box: 320 310 90 30 box: 320 305 90 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1 colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER alignment: FL_ALIGN_CENTER
@ -124,7 +124,7 @@ argument: 0
-------------------- --------------------
class: FL_TEXT class: FL_TEXT
type: NORMAL_TEXT type: NORMAL_TEXT
box: 5 280 500 25 box: 5 275 500 25
boxtype: FL_FLAT_BOX boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_MCOL colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
@ -263,7 +263,7 @@ alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: Don't unzip, when\nexporting to LaTeX|#u label: Do not unzip|#u
shortcut: shortcut:
resize: FL_RESIZE_NONE resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
@ -346,14 +346,14 @@ argument: 0
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
type: PUSH_BUTTON type: PUSH_BUTTON
box: 95 205 30 30 box: 175 205 30 30
boxtype: FL_NO_BOX boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_RIGHT alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: keep Aspect ratio|#A label: Maintain aspect ratio|#M
shortcut: shortcut:
resize: FL_RESIZE_NONE resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
@ -400,7 +400,7 @@ argument:
-------------------- --------------------
class: FL_CHOICE class: FL_CHOICE
type: NORMAL_CHOICE type: NORMAL_CHOICE
box: 315 75 115 30 box: 315 75 100 30
boxtype: FL_FRAME_BOX boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT alignment: FL_ALIGN_LEFT

View File

@ -1101,7 +1101,7 @@ argument: 0
Name: form_preferences_lnf_misc Name: form_preferences_lnf_misc
Width: 450 Width: 450
Height: 350 Height: 350
Number of Objects: 16 Number of Objects: 8
-------------------- --------------------
class: FL_BOX class: FL_BOX
@ -1121,24 +1121,6 @@ name:
callback: callback:
argument: argument:
--------------------
class: FL_FRAME
type: ENGRAVED_FRAME
box: 15 15 255 210
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
type: PUSH_BUTTON type: PUSH_BUTTON
@ -1168,9 +1150,9 @@ alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: Cursor follows scrollbar|#f label: Cursor follows scrollbar|#C
shortcut: shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: check_cursor_follows_scrollbar name: check_cursor_follows_scrollbar
callback: C_FormBaseDeprecatedInputCB callback: C_FormBaseDeprecatedInputCB
@ -1187,9 +1169,9 @@ alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: Dialogs iconify with main window|#i label: Dialogs iconify with main window|#D
shortcut: shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: check_dialogs_iconify_with_main name: check_dialogs_iconify_with_main
callback: C_FormBaseDeprecatedInputCB callback: C_FormBaseDeprecatedInputCB
@ -1199,16 +1181,16 @@ argument: 0
-------------------- --------------------
class: FL_COUNTER class: FL_COUNTER
type: NORMAL_COUNTER type: NORMAL_COUNTER
box: 20 235 115 30 box: 310 190 115 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE colors: FL_COL1 FL_BLUE
alignment: FL_ALIGN_RIGHT alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: Wheel mouse jump label: Wheel mouse jump
shortcut: shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: counter_wm_jump name: counter_wm_jump
callback: C_FormBaseDeprecatedInputCB callback: C_FormBaseDeprecatedInputCB
@ -1221,16 +1203,16 @@ argument: 0
-------------------- --------------------
class: FL_COUNTER class: FL_COUNTER
type: NORMAL_COUNTER type: NORMAL_COUNTER
box: 20 270 115 30 box: 310 115 115 30
boxtype: FL_UP_BOX boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE colors: FL_COL1 FL_BLUE
alignment: FL_ALIGN_RIGHT alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE size: FL_NORMAL_SIZE
lcol: FL_BLACK lcol: FL_BLACK
label: Autosave interval label: Autosave interval
shortcut: shortcut:
resize: FL_RESIZE_ALL resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity gravity: FL_NoGravity FL_NoGravity
name: counter_autosave name: counter_autosave
callback: C_FormBaseDeprecatedInputCB callback: C_FormBaseDeprecatedInputCB
@ -1240,151 +1222,6 @@ argument: 0
value: 300 value: 300
sstep: 1 sstep: 1
--------------------
class: FL_BEGIN_GROUP
type: 0
box: 0 10 10 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
box: 285 35 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: in Monochrome|#M
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_display_monochrome
callback: C_FormBaseDeprecatedInputCB
argument: 0
value: 1
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
box: 285 65 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: in Grayscale|#G
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_display_grayscale
callback: C_FormBaseDeprecatedInputCB
argument: 0
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
box: 285 95 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: in Color|#C
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_display_color
callback: C_FormBaseDeprecatedInputCB
argument: 0
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
box: 285 125 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Don't display|#D
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name: radio_no_display
callback: C_FormBaseDeprecatedInputCB
argument: 0
--------------------
class: FL_END_GROUP
type: 0
box: 0 0 0 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
--------------------
class: FL_LABELFRAME
type: ENGRAVED_FRAME
box: 275 15 160 210
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_TOP_LEFT
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Display Graphics
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
--------------------
class: FL_FRAME
type: ENGRAVED_FRAME
box: 15 230 420 75
boxtype: FL_NO_BOX
colors: FL_BLACK FL_COL1
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label:
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
name:
callback:
argument:
-------------------- --------------------
class: FL_CHECKBUTTON class: FL_CHECKBUTTON
type: PUSH_BUTTON type: PUSH_BUTTON
@ -1404,6 +1241,24 @@ callback: C_FormBaseDeprecatedInputCB
argument: 0 argument: 0
value: 1 value: 1
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
box: 305 40 130 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE
size: FL_DEFAULT_SIZE
lcol: FL_BLACK
label: Graphics display|#G
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: choice_display
callback: C_FormBaseDeprecatedInputCB
argument: 0
=============== FORM =============== =============== FORM ===============
Name: form_preferences_spelloptions Name: form_preferences_spelloptions
Width: 450 Width: 450

View File

@ -1,3 +1,12 @@
2002-08-28 Rob Lahaye <lahaye@snu.ac.kr>
* GraphicsImage.C: small style fix to width/height setting.
* GraphicsTypes.h: have a displayTranslator here.
* Makefile.am:
* GraphicsTypes.C: new file added for the setDisplayTranslator();
2002-08-23 Rob Lahaye <lahaye@snu.ac.kr> 2002-08-23 Rob Lahaye <lahaye@snu.ac.kr>
* GraphicsImage.C: * GraphicsImage.C:

View File

@ -34,13 +34,15 @@ boost::function0<Image::FormatList> Image::loadableFormats;
std::pair<unsigned int, unsigned int> std::pair<unsigned int, unsigned int>
Image::getScaledDimensions(Params const & params) const Image::getScaledDimensions(Params const & params) const
{ {
unsigned int width = getWidth(); // scale only when value > 0
unsigned int height = getHeight(); unsigned int width;
unsigned int height;
// scale only when value makes sense, i.e. not zero
if (params.scale) { if (params.scale) {
width = (width * params.scale) / 100; width = (getWidth() * params.scale) / 100;
height = (height * params.scale) / 100; height = (getHeight() * params.scale) / 100;
} else {
width = getWidth();
height = getHeight();
} }
lyxerr[Debug::GRAPHICS] lyxerr[Debug::GRAPHICS]

View File

@ -0,0 +1,37 @@
// -*- C++ -*-
/**
* \file GraphicsTypes.C
* Copyright 2002 the LyX Team
* Read the file COPYING
*/
#include "graphics/GraphicsTypes.h"
namespace grfx {
/// The translator between the Display enum and corresponding lyx string.
Translator< DisplayType, string > displayTranslator(DefaultDisplay, "default");
void setDisplayTranslator()
{
/// This variable keeps a tab on whether the translator is set.
static bool done = false;
if (!done) {
done = true;
// Fill the display translator
displayTranslator.addPair(DefaultDisplay, "default");
displayTranslator.addPair(MonochromeDisplay, "monochrome");
displayTranslator.addPair(GrayscaleDisplay, "grayscale");
displayTranslator.addPair(ColorDisplay, "color");
displayTranslator.addPair(NoDisplay, "none");
// backward compatibility for old lyxrc.display_graphics
displayTranslator.addPair(MonochromeDisplay, "mono");
displayTranslator.addPair(GrayscaleDisplay, "gray");
displayTranslator.addPair(NoDisplay, "no");
}
}
} // namespace grfx

View File

@ -13,6 +13,8 @@
#ifndef GRAPHICSTYPES_H #ifndef GRAPHICSTYPES_H
#define GRAPHICSTYPES_H #define GRAPHICSTYPES_H
#include "support/translator.h"
#ifdef __GNUG__ #ifdef __GNUG__
#pragma interface #pragma interface
#endif #endif
@ -60,6 +62,12 @@ namespace grfx {
/// ///
NoDisplay NoDisplay
}; };
}
/// The translator between the Display enum and corresponding lyx string.
extern Translator< DisplayType, string > displayTranslator;
void setDisplayTranslator();
} // namespace grfx
#endif // GRAPHICSTYPES_H #endif // GRAPHICSTYPES_H

View File

@ -26,6 +26,7 @@ libgraphics_la_SOURCES = \
GraphicsSupport.h \ GraphicsSupport.h \
GraphicsSupport.C \ GraphicsSupport.C \
GraphicsTypes.h \ GraphicsTypes.h \
GraphicsTypes.C \
PreviewImage.h \ PreviewImage.h \
PreviewImage.C \ PreviewImage.C \
PreviewLoader.h \ PreviewLoader.h \

View File

@ -1,3 +1,8 @@
2002-08-28 Rob Lahaye <lahaye@snu.ac.kr>
* insetgraphicsParams.C: remove local displayTranslator and use
the one from graphics/GraphicsTypes.h.
2002-08-27 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr> 2002-08-27 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* insetfloat.C (wide): add BufferParams parameter * insetfloat.C (wide): add BufferParams parameter

View File

@ -353,6 +353,8 @@ int InsetCitation::latex(Buffer const * buffer, ostream & os,
os << "cite"; os << "cite";
#warning What is this code supposed to do? (Lgb) #warning What is this code supposed to do? (Lgb)
// my guess is that this is just waiting for when we support before,
// so it's a oneliner. But this is very silly ! - jbl
#if 1 #if 1
// The current strange code // The current strange code

View File

@ -20,7 +20,6 @@
#include "graphics/GraphicsParams.h" #include "graphics/GraphicsParams.h"
#include "support/translator.h"
#include "support/filetools.h" #include "support/filetools.h"
#include "support/lyxlib.h" #include "support/lyxlib.h"
#include "support/LOstream.h" #include "support/LOstream.h"
@ -32,39 +31,9 @@
using std::ostream; using std::ostream;
namespace {
/// This variable keeps a tab on whether the translator was set with the
/// translations.
bool translatorsSet = false;
/// This is the translator between the Display enum and corresponding lyx
/// file strings.
Translator< grfx::DisplayType, string >
displayTranslator(grfx::DefaultDisplay, "default");
} // namespace anon
InsetGraphicsParams::InsetGraphicsParams() InsetGraphicsParams::InsetGraphicsParams()
{ {
init(); init();
// Set translators
if (! translatorsSet) {
translatorsSet = true;
// Fill the display translator
displayTranslator.addPair(grfx::DefaultDisplay, "default");
displayTranslator.addPair(grfx::MonochromeDisplay, "monochrome");
displayTranslator.addPair(grfx::GrayscaleDisplay, "grayscale");
displayTranslator.addPair(grfx::ColorDisplay, "color");
displayTranslator.addPair(grfx::NoDisplay, "none");
// backward compatibility for old lyxrc.display_graphics
displayTranslator.addPair(grfx::MonochromeDisplay, "mono");
displayTranslator.addPair(grfx::GrayscaleDisplay, "gray");
displayTranslator.addPair(grfx::NoDisplay, "no");
}
} }
InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp) InsetGraphicsParams::InsetGraphicsParams(InsetGraphicsParams const & igp)
@ -173,7 +142,7 @@ void InsetGraphicsParams::Write(ostream & os) const
if (lyxscale != 100) if (lyxscale != 100)
os << "\tlyxscale " << lyxscale << '\n'; os << "\tlyxscale " << lyxscale << '\n';
if (display != grfx::DefaultDisplay) if (display != grfx::DefaultDisplay)
os << "\tdisplay " << displayTranslator.find(display) << '\n'; os << "\tdisplay " << grfx::displayTranslator.find(display) << '\n';
if (scale) { if (scale) {
if (scale != 100) if (scale != 100)
os << "\tscale " << scale << '\n'; os << "\tscale " << scale << '\n';
@ -220,7 +189,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token)
} else if (token == "display") { } else if (token == "display") {
lex.next(); lex.next();
string const type = lex.getString(); string const type = lex.getString();
display = displayTranslator.find(type); display = grfx::displayTranslator.find(type);
} else if (token == "scale") { } else if (token == "scale") {
lex.next(); lex.next();
scale = lex.getInteger(); scale = lex.getInteger();
@ -325,12 +294,11 @@ grfx::Params InsetGraphicsParams::as_grfxParams(string const & filepath) const
} }
} }
string mode; if (display == grfx::DefaultDisplay) {
if (display != grfx::DefaultDisplay) pars.display = lyxrc.display_graphics;
mode = displayTranslator.find(display); } else {
else pars.display = display;
mode = displayTranslator.find(lyxrc.display_graphics); }
pars.display = displayTranslator.find(mode);
// Override the above if we're not using a gui // Override the above if we're not using a gui
if (!lyxrc.use_gui) { if (!lyxrc.use_gui) {

View File

@ -24,6 +24,8 @@
#include "gettext.h" #include "gettext.h"
#include "lyxlex.h" #include "lyxlex.h"
#include "graphics/GraphicsTypes.h"
#include "bufferlist.h" #include "bufferlist.h"
#include "buffer.h" #include "buffer.h"
#include "lyxserver.h" #include "lyxserver.h"
@ -85,6 +87,11 @@ LyX::LyX(int & argc, char * argv[])
toplevel_keymap.reset(new kb_keymap); toplevel_keymap.reset(new kb_keymap);
defaultKeyBindings(toplevel_keymap.get()); 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.
grfx::setDisplayTranslator();
if (want_gui) { if (want_gui) {
lyx_gui::parse_init(argc, argv); lyx_gui::parse_init(argc, argv);
} }

View File

@ -225,7 +225,7 @@ void LyXRC::setDefaults() {
check_lastfiles = true; check_lastfiles = true;
make_backup = true; make_backup = true;
backupdir_path.erase(); backupdir_path.erase();
display_graphics = "color"; display_graphics = grfx::ColorDisplay;
// Spellchecker settings: // Spellchecker settings:
#ifdef USE_PSPELL #ifdef USE_PSPELL
use_pspell = true; use_pspell = true;
@ -328,16 +328,17 @@ int LyXRC::read(string const & filename)
case RC_BINDFILE: // RVDK_PATCH_5 case RC_BINDFILE: // RVDK_PATCH_5
if (lexrc.next()) { if (lexrc.next()) {
string const tmp(lexrc.getString()); string const tmp(lexrc.getString());
if (hasBindFile) if (hasBindFile) {
// We are already in the // We are already in the
// "actually read bind file" // "actually read bind file"
// mode. // mode.
ReadBindFile(tmp); ReadBindFile(tmp);
else } else {
// We are still in the "just // We are still in the "just
// remember the name of the // remember the name of the
// bind file" mode. // bind file" mode.
bind_file = tmp; bind_file = tmp;
}
} }
break; break;
@ -348,23 +349,21 @@ int LyXRC::read(string const & filename)
break; break;
case RC_AUTORESET_OPTIONS: case RC_AUTORESET_OPTIONS:
if (lexrc.next()) if (lexrc.next()) {
auto_reset_options = lexrc.getBool(); auto_reset_options = lexrc.getBool();
}
break; break;
case RC_DISPLAY_GRAPHICS: case RC_DISPLAY_GRAPHICS:
if (lexrc.next()) { if (lexrc.next()) {
display_graphics = lexrc.getString(); display_graphics = grfx::displayTranslator.find(lexrc.getString());
// backward compatibility
if (display_graphics == "mono") display_graphics = "monochrome";
else if (display_graphics == "gray") display_graphics = "grayscale";
else if (display_graphics == "no") display_graphics = "none";
} }
break; break;
case RC_KBMAP: case RC_KBMAP:
if (lexrc.next()) if (lexrc.next()) {
use_kbmap = lexrc.getBool(); use_kbmap = lexrc.getBool();
}
break; break;
case RC_KBMAP_PRIMARY: case RC_KBMAP_PRIMARY:
@ -373,10 +372,11 @@ int LyXRC::read(string const & filename)
if (kmap.empty()) { if (kmap.empty()) {
// nothing // nothing
} else if (!LibFileSearch("kbd", kmap, } else if (!LibFileSearch("kbd", kmap,
"kmap").empty()) "kmap").empty()) {
primary_kbmap = kmap; primary_kbmap = kmap;
else } else {
lexrc.printError("LyX: Keymap `$$Token' not found"); lexrc.printError("LyX: Keymap `$$Token' not found");
}
} }
break; break;
@ -386,116 +386,138 @@ int LyXRC::read(string const & filename)
if (kmap.empty()) { if (kmap.empty()) {
// nothing // nothing
} else if (!LibFileSearch("kbd", kmap, } else if (!LibFileSearch("kbd", kmap,
"kmap").empty()) "kmap").empty()) {
secondary_kbmap = kmap; secondary_kbmap = kmap;
else } else {
lexrc.printError("LyX: Keymap `$$Token' not found"); lexrc.printError("LyX: Keymap `$$Token' not found");
}
} }
break; break;
case RC_FONT_ENCODING: case RC_FONT_ENCODING:
if (lexrc.next()) if (lexrc.next()) {
fontenc = lexrc.getString(); fontenc = lexrc.getString();
}
break; break;
case RC_PRINTER: case RC_PRINTER:
if (lexrc.next()) if (lexrc.next()) {
printer = lexrc.getString(); printer = lexrc.getString();
}
break; break;
case RC_PRINT_COMMAND: case RC_PRINT_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
print_command = lexrc.getString(); print_command = lexrc.getString();
}
break; break;
case RC_PRINTEVENPAGEFLAG: case RC_PRINTEVENPAGEFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_evenpage_flag = lexrc.getString(); print_evenpage_flag = lexrc.getString();
}
break; break;
case RC_PRINTODDPAGEFLAG: case RC_PRINTODDPAGEFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_oddpage_flag = lexrc.getString(); print_oddpage_flag = lexrc.getString();
}
break; break;
case RC_PRINTPAGERANGEFLAG: case RC_PRINTPAGERANGEFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_pagerange_flag = lexrc.getString(); print_pagerange_flag = lexrc.getString();
}
break; break;
case RC_PRINTCOPIESFLAG: case RC_PRINTCOPIESFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_copies_flag = lexrc.getString(); print_copies_flag = lexrc.getString();
}
break; break;
case RC_PRINTCOLLCOPIESFLAG: case RC_PRINTCOLLCOPIESFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_collcopies_flag = lexrc.getString(); print_collcopies_flag = lexrc.getString();
}
break; break;
case RC_PRINTREVERSEFLAG: case RC_PRINTREVERSEFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_reverse_flag = lexrc.getString(); print_reverse_flag = lexrc.getString();
}
break; break;
case RC_PRINTLANDSCAPEFLAG: case RC_PRINTLANDSCAPEFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_landscape_flag = lexrc.getString(); print_landscape_flag = lexrc.getString();
}
break; break;
case RC_PRINTTOPRINTER: case RC_PRINTTOPRINTER:
if (lexrc.next()) if (lexrc.next()) {
print_to_printer = lexrc.getString(); print_to_printer = lexrc.getString();
}
break; break;
case RC_PRINT_ADAPTOUTPUT: case RC_PRINT_ADAPTOUTPUT:
if (lexrc.next()) if (lexrc.next()) {
print_adapt_output = lexrc.getBool(); print_adapt_output = lexrc.getBool();
}
break; break;
case RC_PRINTTOFILE: case RC_PRINTTOFILE:
if (lexrc.next()) if (lexrc.next()) {
print_to_file = lexrc.getString(); print_to_file = lexrc.getString();
}
break; break;
case RC_PRINTFILEEXTENSION: case RC_PRINTFILEEXTENSION:
if (lexrc.next()) if (lexrc.next()) {
print_file_extension = lexrc.getString(); print_file_extension = lexrc.getString();
}
break; break;
case RC_PRINTEXSTRAOPTIONS: case RC_PRINTEXSTRAOPTIONS:
if (lexrc.next()) if (lexrc.next()) {
print_extra_options = lexrc.getString(); print_extra_options = lexrc.getString();
}
break; break;
case RC_PRINTSPOOL_COMMAND: case RC_PRINTSPOOL_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
print_spool_command = lexrc.getString(); print_spool_command = lexrc.getString();
}
break; break;
case RC_PRINTSPOOL_PRINTERPREFIX: case RC_PRINTSPOOL_PRINTERPREFIX:
if (lexrc.next()) if (lexrc.next()) {
print_spool_printerprefix = lexrc.getString(); print_spool_printerprefix = lexrc.getString();
}
break; break;
case RC_PRINTPAPERDIMENSIONFLAG: case RC_PRINTPAPERDIMENSIONFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_paper_dimension_flag = lexrc.getString(); print_paper_dimension_flag = lexrc.getString();
}
break; break;
case RC_PRINTPAPERFLAG: case RC_PRINTPAPERFLAG:
if (lexrc.next()) if (lexrc.next()) {
print_paper_flag = lexrc.getString(); print_paper_flag = lexrc.getString();
}
break; break;
case RC_CUSTOM_EXPORT_COMMAND: case RC_CUSTOM_EXPORT_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
custom_export_command = lexrc.getString(); custom_export_command = lexrc.getString();
}
break; break;
case RC_CUSTOM_EXPORT_FORMAT: case RC_CUSTOM_EXPORT_FORMAT:
if (lexrc.next()) if (lexrc.next()) {
custom_export_format = lexrc.getString(); custom_export_format = lexrc.getString();
}
break; break;
case RC_DEFAULT_PAPERSIZE: case RC_DEFAULT_PAPERSIZE:
@ -527,78 +549,96 @@ int LyXRC::read(string const & filename)
break; break;
case RC_VIEWDVI_PAPEROPTION: case RC_VIEWDVI_PAPEROPTION:
if (lexrc.next()) if (lexrc.next()) {
view_dvi_paper_option = lexrc.getString(); view_dvi_paper_option = lexrc.getString();
else } else {
view_dvi_paper_option.erase(); view_dvi_paper_option.erase();
}
break; break;
case RC_PS_COMMAND: case RC_PS_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
ps_command = lexrc.getString(); ps_command = lexrc.getString();
}
break; break;
case RC_CHKTEX_COMMAND: case RC_CHKTEX_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
chktex_command = lexrc.getString(); chktex_command = lexrc.getString();
}
break; break;
case RC_SCREEN_DPI: case RC_SCREEN_DPI:
if (lexrc.next()) if (lexrc.next()) {
dpi = lexrc.getInteger(); dpi = lexrc.getInteger();
}
break; break;
case RC_SCREEN_ZOOM: case RC_SCREEN_ZOOM:
if (lexrc.next()) if (lexrc.next()) {
zoom = lexrc.getInteger(); zoom = lexrc.getInteger();
}
break; break;
case RC_WHEEL_JUMP: case RC_WHEEL_JUMP:
if (lexrc.next()) if (lexrc.next()) {
wheel_jump = lexrc.getInteger(); wheel_jump = lexrc.getInteger();
}
break; break;
case RC_SCREEN_FONT_SIZES: case RC_SCREEN_FONT_SIZES:
if (lexrc.next()) if (lexrc.next()) {
font_sizes[LyXFont::SIZE_TINY] = font_sizes[LyXFont::SIZE_TINY] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_SCRIPT] = font_sizes[LyXFont::SIZE_SCRIPT] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_FOOTNOTE] = font_sizes[LyXFont::SIZE_FOOTNOTE] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_SMALL] = font_sizes[LyXFont::SIZE_SMALL] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_NORMAL] = font_sizes[LyXFont::SIZE_NORMAL] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_LARGE] = font_sizes[LyXFont::SIZE_LARGE] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_LARGER] = font_sizes[LyXFont::SIZE_LARGER] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_LARGEST] = font_sizes[LyXFont::SIZE_LARGEST] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_HUGE] = font_sizes[LyXFont::SIZE_HUGE] =
lexrc.getFloat(); lexrc.getFloat();
if (lexrc.next()) }
if (lexrc.next()) {
font_sizes[LyXFont::SIZE_HUGER] = font_sizes[LyXFont::SIZE_HUGER] =
lexrc.getFloat(); lexrc.getFloat();
}
break; break;
case RC_SCREEN_FONT_SCALABLE: case RC_SCREEN_FONT_SCALABLE:
if (lexrc.next()) if (lexrc.next()) {
use_scalable_fonts = lexrc.getBool(); use_scalable_fonts = lexrc.getBool();
}
break; break;
case RC_AUTOSAVE: case RC_AUTOSAVE:
if (lexrc.next()) if (lexrc.next()) {
autosave = lexrc.getInteger(); autosave = lexrc.getInteger();
}
break; break;
case RC_DOCUMENTPATH: case RC_DOCUMENTPATH:
@ -608,48 +648,57 @@ int LyXRC::read(string const & filename)
break; break;
case RC_TEMPLATEPATH: case RC_TEMPLATEPATH:
if (lexrc.next()) if (lexrc.next()) {
template_path = ExpandPath(lexrc.getString()); template_path = ExpandPath(lexrc.getString());
}
break; break;
case RC_TEMPDIRPATH: case RC_TEMPDIRPATH:
if (lexrc.next()) if (lexrc.next()) {
tempdir_path = ExpandPath(lexrc.getString()); tempdir_path = ExpandPath(lexrc.getString());
}
break; break;
case RC_USETEMPDIR: case RC_USETEMPDIR:
if (lexrc.next()) if (lexrc.next()) {
use_tempdir = lexrc.getBool(); use_tempdir = lexrc.getBool();
}
break; break;
case RC_LASTFILES: case RC_LASTFILES:
if (lexrc.next()) if (lexrc.next()) {
lastfiles = ExpandPath(lexrc.getString()); lastfiles = ExpandPath(lexrc.getString());
}
break; break;
case RC_NUMLASTFILES: case RC_NUMLASTFILES:
if (lexrc.next()) if (lexrc.next()) {
num_lastfiles = lexrc.getInteger(); num_lastfiles = lexrc.getInteger();
}
break; break;
case RC_CHECKLASTFILES: case RC_CHECKLASTFILES:
if (lexrc.next()) if (lexrc.next()) {
check_lastfiles = lexrc.getBool(); check_lastfiles = lexrc.getBool();
}
break; break;
case RC_SCREEN_FONT_ROMAN: case RC_SCREEN_FONT_ROMAN:
if (lexrc.next()) if (lexrc.next()) {
roman_font_name = lexrc.getString(); roman_font_name = lexrc.getString();
}
break; break;
case RC_SCREEN_FONT_SANS: case RC_SCREEN_FONT_SANS:
if (lexrc.next()) if (lexrc.next()) {
sans_font_name = lexrc.getString(); sans_font_name = lexrc.getString();
}
break; break;
case RC_SCREEN_FONT_TYPEWRITER: case RC_SCREEN_FONT_TYPEWRITER:
if (lexrc.next()) if (lexrc.next()) {
typewriter_font_name = lexrc.getString(); typewriter_font_name = lexrc.getString();
}
break; break;
case RC_SCREEN_FONT_ENCODING: case RC_SCREEN_FONT_ENCODING:
@ -660,18 +709,21 @@ int LyXRC::read(string const & filename)
break; break;
case RC_POPUP_BOLD_FONT: case RC_POPUP_BOLD_FONT:
if (lexrc.next()) if (lexrc.next()) {
popup_bold_font = lexrc.getString(); popup_bold_font = lexrc.getString();
}
break; break;
case RC_POPUP_NORMAL_FONT: case RC_POPUP_NORMAL_FONT:
if (lexrc.next()) if (lexrc.next()) {
popup_normal_font = lexrc.getString(); popup_normal_font = lexrc.getString();
}
break; break;
case RC_POPUP_FONT_ENCODING: case RC_POPUP_FONT_ENCODING:
if (lexrc.next()) if (lexrc.next()) {
popup_font_encoding = lexrc.getString(); popup_font_encoding = lexrc.getString();
}
break; break;
case RC_SET_COLOR: case RC_SET_COLOR:
@ -692,16 +744,18 @@ int LyXRC::read(string const & filename)
break; break;
} }
if (!lcolor.setColor(lyx_name, x11_name)) if (!lcolor.setColor(lyx_name, x11_name)) {
lyxerr << "Bad lyxrc set_color for " lyxerr << "Bad lyxrc set_color for "
<< lyx_name << endl; << lyx_name << endl;
}
break; break;
} }
case RC_AUTOREGIONDELETE: case RC_AUTOREGIONDELETE:
// Auto region delete defaults to true // Auto region delete defaults to true
if (lexrc.next()) if (lexrc.next()) {
auto_region_delete = lexrc.getBool(); auto_region_delete = lexrc.getBool();
}
break; break;
case RC_BIND: case RC_BIND:
@ -752,208 +806,256 @@ int LyXRC::read(string const & filename)
break; break;
} }
case RC_OVERRIDE_X_DEADKEYS: case RC_OVERRIDE_X_DEADKEYS:
if (lexrc.next()) if (lexrc.next()) {
override_x_deadkeys = lexrc.getBool(); override_x_deadkeys = lexrc.getBool();
}
break; break;
case RC_SERVERPIPE: case RC_SERVERPIPE:
if (lexrc.next()) if (lexrc.next()) {
lyxpipes = ExpandPath(lexrc.getString()); lyxpipes = ExpandPath(lexrc.getString());
}
break; break;
case RC_CURSOR_FOLLOWS_SCROLLBAR: case RC_CURSOR_FOLLOWS_SCROLLBAR:
if (lexrc.next()) if (lexrc.next()) {
cursor_follows_scrollbar = lexrc.getBool(); cursor_follows_scrollbar = lexrc.getBool();
}
break; break;
case RC_DIALOGS_ICONIFY_WITH_MAIN: case RC_DIALOGS_ICONIFY_WITH_MAIN:
if (lexrc.next()) if (lexrc.next()) {
dialogs_iconify_with_main = lexrc.getBool(); dialogs_iconify_with_main = lexrc.getBool();
}
break; break;
case RC_ASCIIROFF_COMMAND: case RC_ASCIIROFF_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
ascii_roff_command = lexrc.getString(); ascii_roff_command = lexrc.getString();
}
break; break;
case RC_ASCII_LINELEN: case RC_ASCII_LINELEN:
if (lexrc.next()) if (lexrc.next()) {
ascii_linelen = lexrc.getInteger(); ascii_linelen = lexrc.getInteger();
}
break; break;
// Spellchecker settings: // Spellchecker settings:
#ifdef USE_PSPELL #ifdef USE_PSPELL
case RC_USE_PSPELL: case RC_USE_PSPELL:
if (lexrc.next()) if (lexrc.next()) {
use_pspell = lexrc.getBool(); use_pspell = lexrc.getBool();
}
break; break;
#endif #endif
case RC_SPELL_COMMAND: case RC_SPELL_COMMAND:
if (lexrc.next()) if (lexrc.next()) {
isp_command = lexrc.getString(); isp_command = lexrc.getString();
}
break; break;
case RC_ACCEPT_COMPOUND: case RC_ACCEPT_COMPOUND:
if (lexrc.next()) if (lexrc.next()) {
isp_accept_compound = lexrc.getBool(); isp_accept_compound = lexrc.getBool();
}
break; break;
case RC_USE_INP_ENC: case RC_USE_INP_ENC:
if (lexrc.next()) if (lexrc.next()) {
isp_use_input_encoding = lexrc.getBool(); isp_use_input_encoding = lexrc.getBool();
}
break; break;
case RC_USE_ALT_LANG: case RC_USE_ALT_LANG:
if (lexrc.next()) if (lexrc.next()) {
isp_use_alt_lang = lexrc.getBool(); isp_use_alt_lang = lexrc.getBool();
}
break; break;
case RC_USE_PERS_DICT: case RC_USE_PERS_DICT:
if (lexrc.next()) if (lexrc.next()) {
isp_use_pers_dict = lexrc.getBool(); isp_use_pers_dict = lexrc.getBool();
}
break; break;
case RC_USE_ESC_CHARS: case RC_USE_ESC_CHARS:
if (lexrc.next()) if (lexrc.next()) {
isp_use_esc_chars = lexrc.getBool(); isp_use_esc_chars = lexrc.getBool();
}
break; break;
case RC_ALT_LANG: case RC_ALT_LANG:
if (lexrc.next()) if (lexrc.next()) {
isp_alt_lang = lexrc.getString(); isp_alt_lang = lexrc.getString();
}
break; break;
case RC_PERS_DICT: case RC_PERS_DICT:
if (lexrc.next()) if (lexrc.next()) {
isp_pers_dict = lexrc.getString(); isp_pers_dict = lexrc.getString();
}
break; break;
case RC_ESC_CHARS: case RC_ESC_CHARS:
if (lexrc.next()) if (lexrc.next()) {
isp_esc_chars = lexrc.getString(); isp_esc_chars = lexrc.getString();
}
break; break;
case RC_MAKE_BACKUP: case RC_MAKE_BACKUP:
if (lexrc.next()) if (lexrc.next()) {
make_backup = lexrc.getBool(); make_backup = lexrc.getBool();
}
break; break;
case RC_BACKUPDIR_PATH: case RC_BACKUPDIR_PATH:
if (lexrc.next()) if (lexrc.next()) {
backupdir_path = ExpandPath(lexrc.getString()); backupdir_path = ExpandPath(lexrc.getString());
}
break; break;
case RC_DATE_INSERT_FORMAT: case RC_DATE_INSERT_FORMAT:
if (lexrc.next()) if (lexrc.next()) {
date_insert_format = lexrc.getString(); date_insert_format = lexrc.getString();
}
break; break;
case RC_LANGUAGE_PACKAGE: case RC_LANGUAGE_PACKAGE:
if (lexrc.next()) if (lexrc.next()) {
language_package = lexrc.getString(); language_package = lexrc.getString();
}
break; break;
case RC_LANGUAGE_AUTO_BEGIN: case RC_LANGUAGE_AUTO_BEGIN:
if (lexrc.next()) if (lexrc.next()) {
language_auto_begin = lexrc.getBool(); language_auto_begin = lexrc.getBool();
}
break; break;
case RC_LANGUAGE_AUTO_END: case RC_LANGUAGE_AUTO_END:
if (lexrc.next()) if (lexrc.next()) {
language_auto_end = lexrc.getBool(); language_auto_end = lexrc.getBool();
}
break; break;
case RC_LANGUAGE_GLOBAL_OPTIONS: case RC_LANGUAGE_GLOBAL_OPTIONS:
if (lexrc.next()) if (lexrc.next()) {
language_global_options = lexrc.getBool(); language_global_options = lexrc.getBool();
}
break; break;
case RC_LANGUAGE_USE_BABEL: case RC_LANGUAGE_USE_BABEL:
if (lexrc.next()) if (lexrc.next()) {
language_use_babel = lexrc.getBool(); language_use_babel = lexrc.getBool();
}
break; break;
case RC_LANGUAGE_COMMAND_BEGIN: case RC_LANGUAGE_COMMAND_BEGIN:
if (lexrc.next()) if (lexrc.next()) {
language_command_begin = lexrc.getString(); language_command_begin = lexrc.getString();
}
break; break;
case RC_LANGUAGE_COMMAND_END: case RC_LANGUAGE_COMMAND_END:
if (lexrc.next()) if (lexrc.next()) {
language_command_end = lexrc.getString(); language_command_end = lexrc.getString();
}
break; break;
case RC_LANGUAGE_COMMAND_LOCAL: case RC_LANGUAGE_COMMAND_LOCAL:
if (lexrc.next()) if (lexrc.next()) {
language_command_local = lexrc.getString(); language_command_local = lexrc.getString();
}
break; break;
case RC_RTL_SUPPORT: case RC_RTL_SUPPORT:
if (lexrc.next()) if (lexrc.next()) {
rtl_support = lexrc.getBool(); rtl_support = lexrc.getBool();
}
break; break;
case RC_AUTO_NUMBER: case RC_AUTO_NUMBER:
if (lexrc.next()) if (lexrc.next()) {
auto_number = lexrc.getBool(); auto_number = lexrc.getBool();
}
break; break;
case RC_MARK_FOREIGN_LANGUAGE: case RC_MARK_FOREIGN_LANGUAGE:
if (lexrc.next()) if (lexrc.next()) {
mark_foreign_language = lexrc.getBool(); mark_foreign_language = lexrc.getBool();
}
break; break;
case RC_CONVERTER: { case RC_CONVERTER: {
string from, to, command, flags; string from, to, command, flags;
if (lexrc.next()) if (lexrc.next()) {
from = lexrc.getString(); from = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
to = lexrc.getString(); to = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
command = lexrc.getString(); command = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
flags = lexrc.getString(); flags = lexrc.getString();
if (command.empty() || command == "none") }
if (command.empty() || command == "none") {
converters.erase(from, to); converters.erase(from, to);
else } else {
converters.add(from, to, command, flags); converters.add(from, to, command, flags);
}
break; break;
} }
case RC_VIEWER: { case RC_VIEWER: {
string format, command; string format, command;
if (lexrc.next()) if (lexrc.next()) {
format = lexrc.getString(); format = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
command = lexrc.getString(); command = lexrc.getString();
}
formats.setViewer(format, command); formats.setViewer(format, command);
break; break;
} }
case RC_FORMAT: { case RC_FORMAT: {
string format, extension, prettyname, shortcut; string format, extension, prettyname, shortcut;
if (lexrc.next()) if (lexrc.next()) {
format = lexrc.getString(); format = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
extension = lexrc.getString(); extension = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
prettyname = lexrc.getString(); prettyname = lexrc.getString();
if (lexrc.next()) }
if (lexrc.next()) {
shortcut = lexrc.getString(); shortcut = lexrc.getString();
}
if (prettyname.empty()) { if (prettyname.empty()) {
if (converters.formatIsUsed(format)) if (converters.formatIsUsed(format)) {
lyxerr << "Can't delete format " lyxerr << "Can't delete format "
<< format << endl; << format << endl;
else } else {
formats.erase(format); formats.erase(format);
}
} else } else {
formats.add(format, extension, prettyname, formats.add(format, extension, prettyname,
shortcut); shortcut);
}
break; break;
} }
case RC_DEFAULT_LANGUAGE: case RC_DEFAULT_LANGUAGE:
if (lexrc.next()) if (lexrc.next()) {
default_language = lexrc.getString(); default_language = lexrc.getString();
}
break; break;
case RC_LABEL_INIT_LENGTH: case RC_LABEL_INIT_LENGTH:
if (lexrc.next()) if (lexrc.next()) {
label_init_length = lexrc.getInteger(); label_init_length = lexrc.getInteger();
}
break; break;
case RC_SHOW_BANNER: case RC_SHOW_BANNER:
if (lexrc.next()) if (lexrc.next()) {
show_banner = lexrc.getBool(); show_banner = lexrc.getBool();
}
break; break;
case RC_PREVIEW: case RC_PREVIEW:
if (lexrc.next()) if (lexrc.next()) {
preview = lexrc.getBool(); preview = lexrc.getBool();
}
break; break;
case RC_PREVIEW_HASHED_LABELS: case RC_PREVIEW_HASHED_LABELS:
if (lexrc.next()) if (lexrc.next()) {
preview_hashed_labels = lexrc.getBool(); preview_hashed_labels = lexrc.getBool();
}
break; break;
case RC_PREVIEW_SCALE_FACTOR: case RC_PREVIEW_SCALE_FACTOR:
if (lexrc.next()) if (lexrc.next()) {
preview_scale_factor = lexrc.getFloat(); preview_scale_factor = lexrc.getFloat();
}
break; break;
case RC_LAST: break; // this is just a dummy case RC_LAST: break; // this is just a dummy
@ -1051,7 +1153,7 @@ void LyXRC::output(ostream & os) const
if (display_graphics != system_lyxrc.display_graphics) { if (display_graphics != system_lyxrc.display_graphics) {
os << "# Display graphics within LyX\n" os << "# Display graphics within LyX\n"
<< "# monochrome|grayscale|color|none\n" << "# monochrome|grayscale|color|none\n"
<< "\\display_graphics " << display_graphics << "\\display_graphics " << grfx::displayTranslator.find(display_graphics)
<< "\n"; << "\n";
} }

View File

@ -17,6 +17,7 @@
#endif #endif
#include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic) #include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
#include "graphics/GraphicsTypes.h"
// #include <boost/utility.hpp> // #include <boost/utility.hpp>
@ -341,7 +342,7 @@ enum LyXRCTags {
/// ///
int label_init_length; int label_init_length;
/// ///
string display_graphics; grfx::DisplayType display_graphics;
/// ///
bool show_banner; bool show_banner;
/// ///

View File

@ -26,9 +26,10 @@ extern bool textUndo(BufferView *);
extern bool textRedo(BufferView *); extern bool textRedo(BufferView *);
/// makes sure the next operation will be stored /// makes sure the next operation will be stored
extern void finishUndo(); extern void finishUndo();
/// this is dangerous and for internal use only /// Whilst undo is frozen, all actions do not get added
/// to the undo stack
extern void freezeUndo(); extern void freezeUndo();
/// this is dangerous and for internal use only /// Track undos again
extern void unFreezeUndo(); extern void unFreezeUndo();
/// FIXME /// FIXME
extern void setUndo(BufferView *, Undo::undo_kind kind, extern void setUndo(BufferView *, Undo::undo_kind kind,
@ -39,8 +40,7 @@ extern void setRedo(BufferView *, Undo::undo_kind kind,
/// FIXME /// FIXME
extern void setCursorParUndo(BufferView *); extern void setCursorParUndo(BufferView *);
// This is only used in one place. Need a nicer way. /// Are we avoiding tracking undos currently ?
/// is the undo frozen
extern bool undo_frozen; extern bool undo_frozen;
#endif // UNDO_FUNCS_H #endif // UNDO_FUNCS_H