+2002-08-28 Rob Lahaye <lahaye@snu.ac.kr>
+
+ * lyx2lyx/lyx2lyx: add new format number "221"
+
2002-08-25 John Levon <levon@movementarian.org>
* images/find-replace.xpm: add
\bind "C-S-V" "layout-paste"
\bind "C-z" "undo"
-\bind "C-S-Z" "redo"
+\bind "C-S-z" "redo"
\bind "~S-C-quotedbl" "self-insert \""
\bind "C-minus" "hyphenation-point-insert"
format = re.compile(r"(\d)[\.,]?(\d\d)")
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():
print """Usage: lyx2lyx [options] file1
src/CutAndPaste.C
src/debug.C
src/exporter.C
-src/ext_l10n.h
src/FloatList.C
src/frontends/controllers/biblio.C
src/frontends/controllers/ButtonController.h
+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>
* factory.C (createInset): use LyXTextClass::floats
namespace {
-const int LYX_FORMAT = 220;
+const int LYX_FORMAT = 221;
} // namespace anon
else
text->decDepth(bv);
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->owner()->message(_("Changed environment depth "
- "(in possible range, maybe not)"));
}
+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>
* FileDialog.C:
if (new_width == pixmap_.width() && new_height == pixmap_.height())
return;
- int const xoffset_l = std::max(0, int(params.bb.xl));
- int const yoffset_t = std::max(0, pixmap_.height() - int(params.bb.yt));
+ int const xoffset_l = params.bb.xl;
+ int const yoffset_t = ( pixmap_.height() > params.bb.yt ?
+ pixmap_.height() - params.bb.yt : 0 );
xformed_pixmap_.resize(new_width, new_height);
QPainter p;
+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>
* xformsImage.C: fix build, add FIXME for Rob
}
} else if (ob == dialog_->button_style_choose) {
unsigned int selection = fl_get_browser(dialog_->browser_styles);
- string const out_name =
- fl_get_browser_line(dialog_->browser_styles, selection);
+ if (!selection)
+ return ButtonPolicy::SMI_NOOP;
+
+ string const out_name = fl_get_browser_line(dialog_->browser_styles,
+ selection);
fl_set_input(dialog_->input_style,
- ChangeExtension(out_name, string()).c_str());
+ ChangeExtension(out_name, string()).c_str());
} else if (ob == dialog_->button_rescan) {
fl_clear_browser(dialog_->browser_styles);
controller().rescanBibStyles();
namespace {
// Bound the number of input characters
+int const SIZE_MAXDIGITS = 10;
int const FILENAME_MAXCHARS = 1024;
string defaultUnit("cm");
// 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_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());
bc().addReadOnly(file_->button_browse);
igp.filename = getString(file_->input_filename);
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)) {
case 5: igp.display = grfx::NoDisplay; break;
// first item in choice_width means scaling
if (fl_get_choice(file_->choice_width) == 1) {
igp.scale = strToInt(getString(file_->input_width));
- if (igp.scale == 0) igp.scale = 100;
+ if (igp.scale == 0) {
+ igp.scale = 100;
+ }
igp.width = LyXLength();
- }
- else {
+ } else {
igp.scale = 0;
igp.width = getLyXLengthFromWidgets(file_->input_width,
file_->choice_width);
igp.noUnzip = fl_get_button(file_->check_nounzip);
// the bb section
- if (!controller().bbChanged) // different to the original one?
- igp.bb = string(); // don't write anything
- else {
+ if (!controller().bbChanged) { // different to the original one?
+ igp.bb = string(); // don't write anything
+ } else {
string bb;
if (getString(bbox_->input_bb_x0).empty())
bb = "0 ";
igp.rotateAngle = strToDbl(getString(extra_->input_rotate_angle));
// 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) igp.rotateAngle -= 360.0;
+ while (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());
int const origin_pos = fl_get_choice(extra_->choice_origin);
// set width input fields according to scaling or width/height input
if (igp.scale) {
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_choice(file_->choice_width, 1);
- }
- else {
- 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);
updateWidgetsFromLength(file_->input_width,
file_->choice_width, igp.width, defaultUnit);
}
// the extra section
fl_set_input(extra_->input_rotate_angle,
tostr(igp.rotateAngle).c_str());
- if (igp.rotateOrigin.empty())
- fl_set_choice(extra_->choice_origin, 1);
- else
- fl_set_choice(extra_->choice_origin,
- 1 + int(findPos(origins_, igp.rotateOrigin)) );
+
+ int const origin_pos = findPos(origins_, igp.rotateOrigin);
+ fl_set_choice(extra_->choice_origin, 1 + origin_pos);
+
fl_set_button(extra_->check_subcaption, igp.subcaption);
fl_set_input(extra_->input_subcaption, igp.subcaptionText.c_str());
setEnabled(extra_->input_subcaption,
fl_set_input(extra_->input_special, igp.special.c_str());
// 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);
+ }
}
// path, because the controller knows nothing about the doc-dir
controller().bbChanged = false;
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);
if (!bb.empty()) {
// get the values from the file
} else {
// get the values from the inset
- lyxerr[Debug::GRAPHICS] << "update:: igp has BoundingBox"
+ lyxerr[Debug::GRAPHICS] << "FormGraphics::updateBB(): igp has BoundingBox"
+ << " ["<< bb_inset << "]"
<< endl;
controller().bbChanged = true;
+
LyXLength anyLength;
anyLength = LyXLength(token(bb_inset,' ',0));
updateWidgetsFromLength(bbox_->input_bb_x0,
}
}
+
namespace {
bool isValid(FL_OBJECT * ob)
fl_set_input(file_->input_filename, out_name.c_str());
}
if (controller().isFilenameValid(out_name) &&
- !controller().bbChanged)
+ !controller().bbChanged) {
updateBB(out_name, string());
+ }
} else if (ob == file_->input_width || ob == file_->input_height) {
// disable aspectratio button in case of scaling or one of width/height is empty
bool const disable = fl_get_choice(file_->choice_width) == 1 ||
setEnabled(file_->choice_height, !scaling);
// allow only integer intput for scaling; float otherwise
- if (scaling)
+ if (scaling) {
fl_set_input_filter(file_->input_width, fl_unsigned_int_filter);
- else
- fl_set_input_filter(file_->input_width, fl_unsigned_float_filter);
-
+ fl_set_input_maxchars(file_->input_width, 0);
+ } 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
bool const disable_aspectratio = scaling || getString(file_->input_height).empty();
}
- // deactivate OK/ Apply buttons and
- // spit out warnings if invalid
- 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;
- }
- }
+ // check if the input is valid
+ bool const invalid = !isValid(file_->input_width) || !isValid(file_->input_height);
- 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;
+ }
}
#include "support/LAssert.h"
#include "graphics/GraphicsCache.h"
+#include "graphics/GraphicsTypes.h"
#include <boost/bind.hpp>
lyxrc.wheel_jump = static_cast<unsigned int>
(fl_get_counter_value(dialog_->counter_wm_jump));
- string const old_value = lyxrc.display_graphics;
- if (fl_get_button(dialog_->radio_display_monochrome)) {
- lyxrc.display_graphics = "monochrome";
- } else if (fl_get_button(dialog_->radio_display_grayscale)) {
- lyxrc.display_graphics = "grayscale";
- } else if (fl_get_button(dialog_->radio_display_color)) {
- lyxrc.display_graphics = "color";
- } else {
- lyxrc.display_graphics = "none";
+ // See FIXME below
+ // grfx::DisplayType old_value = lyxrc.display_graphics;
+ switch (fl_get_choice(dialog_->choice_display)) {
+ case 4: lyxrc.display_graphics = grfx::NoDisplay; break;
+ case 3: lyxrc.display_graphics = grfx::ColorDisplay; break;
+ case 2: lyxrc.display_graphics = grfx::GrayscaleDisplay; break;
+ case 1: lyxrc.display_graphics = grfx::MonochromeDisplay; break;
+ default: lyxrc.display_graphics = grfx::ColorDisplay; break;
}
#ifdef WITH_WARNINGS
setPrehandler(dialog_->check_dialogs_iconify_with_main);
setPrehandler(dialog_->check_preview_latex);
setPrehandler(dialog_->counter_wm_jump);
- setPrehandler(dialog_->radio_display_monochrome);
- setPrehandler(dialog_->radio_display_grayscale);
- setPrehandler(dialog_->radio_display_color);
- setPrehandler(dialog_->radio_no_display);
+
+ fl_addto_choice(dialog_->choice_display, _("Monochrome|Grayscale|Color|Do not display"));
}
return lyxrc.getDescription(LyXRC::RC_AUTOSAVE);
if (ob == dialog_->counter_wm_jump)
return lyxrc.getDescription(LyXRC::RC_WHEEL_JUMP);
- if (ob == dialog_->radio_display_monochrome ||
- ob == dialog_->radio_display_grayscale ||
- ob == dialog_->radio_display_color ||
- ob == dialog_->radio_no_display)
+ if (ob == dialog_->choice_display)
return lyxrc.getDescription(LyXRC::RC_DISPLAY_GRAPHICS);
return string();
}
fl_set_counter_value(dialog_->counter_autosave, lyxrc.autosave);
fl_set_counter_value(dialog_->counter_wm_jump, lyxrc.wheel_jump);
- if (lyxrc.display_graphics == "monochrome") {
- fl_set_button(dialog_->radio_display_monochrome, 1);
- } else if (lyxrc.display_graphics == "grayscale") {
- fl_set_button(dialog_->radio_display_grayscale, 1);
- } else if (lyxrc.display_graphics == "color") {
- fl_set_button(dialog_->radio_display_color, 1);
- } else {
- fl_set_button(dialog_->radio_no_display, 1);
+ switch (lyxrc.display_graphics) {
+ case grfx::NoDisplay: fl_set_choice(dialog_->choice_display, 4); break;
+ case grfx::ColorDisplay: fl_set_choice(dialog_->choice_display, 3); break;
+ case grfx::GrayscaleDisplay: fl_set_choice(dialog_->choice_display, 2); break;
+ case grfx::MonochromeDisplay: fl_set_choice(dialog_->choice_display, 1); break;
+ default: fl_set_choice(dialog_->choice_display, 3); break;
}
}
=============== FORM ===============
Name: form_graphics
Width: 510
-Height: 345
+Height: 340
Number of Objects: 7
--------------------
class: FL_BOX
type: FLAT_BOX
-box: 0 0 510 345
+box: 0 0 510 340
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 5 310 100 30
+box: 5 305 100 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: RETURN_BUTTON
-box: 225 310 90 30
+box: 225 305 90 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 415 310 90 30
+box: 415 305 90 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_BUTTON
type: NORMAL_BUTTON
-box: 320 310 90 30
+box: 320 305 90 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_COL1
alignment: FL_ALIGN_CENTER
--------------------
class: FL_TEXT
type: NORMAL_TEXT
-box: 5 280 500 25
+box: 5 275 500 25
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Don't unzip, when\nexporting to LaTeX|#u
+label: Do not unzip|#u
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_CHECKBUTTON
type: PUSH_BUTTON
-box: 95 205 30 30
+box: 175 205 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_RIGHT
+alignment: FL_ALIGN_LEFT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: keep Aspect ratio|#A
+label: Maintain aspect ratio|#M
shortcut:
resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 315 75 115 30
+box: 315 75 100 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
Name: form_preferences_lnf_misc
Width: 450
Height: 350
-Number of Objects: 16
+Number of Objects: 8
--------------------
class: FL_BOX
callback:
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
type: PUSH_BUTTON
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Cursor follows scrollbar|#f
+label: Cursor follows scrollbar|#C
shortcut:
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: check_cursor_follows_scrollbar
callback: C_FormBaseDeprecatedInputCB
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: Dialogs iconify with main window|#i
+label: Dialogs iconify with main window|#D
shortcut:
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: check_dialogs_iconify_with_main
callback: C_FormBaseDeprecatedInputCB
--------------------
class: FL_COUNTER
type: NORMAL_COUNTER
-box: 20 235 115 30
+box: 310 190 115 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE
-alignment: FL_ALIGN_RIGHT
+alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Wheel mouse jump
shortcut:
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: counter_wm_jump
callback: C_FormBaseDeprecatedInputCB
--------------------
class: FL_COUNTER
type: NORMAL_COUNTER
-box: 20 270 115 30
+box: 310 115 115 30
boxtype: FL_UP_BOX
colors: FL_COL1 FL_BLUE
-alignment: FL_ALIGN_RIGHT
+alignment: FL_ALIGN_TOP
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
label: Autosave interval
shortcut:
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
name: counter_autosave
callback: C_FormBaseDeprecatedInputCB
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
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 15 185 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
alignment: FL_ALIGN_CENTER
style: FL_NORMAL_STYLE
-size: FL_DEFAULT_SIZE
+size: FL_NORMAL_SIZE
lcol: FL_BLACK
-label: in Monochrome|#M
+label: Instant Preview|#P
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name: radio_display_monochrome
+name: check_preview_latex
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
+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:
-shortcut:
-resize: FL_RESIZE_ALL
-gravity: FL_NoGravity FL_NoGravity
-name:
-callback:
-argument:
-
---------------------
-class: FL_CHECKBUTTON
-type: PUSH_BUTTON
-box: 15 185 30 30
-boxtype: FL_NO_BOX
-colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_CENTER
-style: FL_NORMAL_STYLE
-size: FL_NORMAL_SIZE
-lcol: FL_BLACK
-label: Instant Preview|#P
+label: Graphics display|#G
shortcut:
-resize: FL_RESIZE_ALL
+resize: FL_RESIZE_NONE
gravity: FL_NoGravity FL_NoGravity
-name: check_preview_latex
+name: choice_display
callback: C_FormBaseDeprecatedInputCB
argument: 0
- value: 1
=============== FORM ===============
Name: form_preferences_spelloptions
+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>
* GraphicsImage.C:
std::pair<unsigned int, unsigned int>
Image::getScaledDimensions(Params const & params) const
{
- unsigned int width = getWidth();
- unsigned int height = getHeight();
-
- // scale only when value makes sense, i.e. not zero
+ // scale only when value > 0
+ unsigned int width;
+ unsigned int height;
if (params.scale) {
- width = (width * params.scale) / 100;
- height = (height * params.scale) / 100;
+ width = (getWidth() * params.scale) / 100;
+ height = (getHeight() * params.scale) / 100;
+ } else {
+ width = getWidth();
+ height = getHeight();
}
lyxerr[Debug::GRAPHICS]
--- /dev/null
+// -*- 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
#ifndef GRAPHICSTYPES_H
#define GRAPHICSTYPES_H
+#include "support/translator.h"
+
#ifdef __GNUG__
#pragma interface
#endif
///
NoDisplay
};
-}
+
+ /// The translator between the Display enum and corresponding lyx string.
+ extern Translator< DisplayType, string > displayTranslator;
+
+ void setDisplayTranslator();
+
+} // namespace grfx
#endif // GRAPHICSTYPES_H
GraphicsSupport.h \
GraphicsSupport.C \
GraphicsTypes.h \
+ GraphicsTypes.C \
PreviewImage.h \
PreviewImage.C \
PreviewLoader.h \
+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>
* insetfloat.C (wide): add BufferParams parameter
os << "cite";
#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
// The current strange code
#include "graphics/GraphicsParams.h"
-#include "support/translator.h"
#include "support/filetools.h"
#include "support/lyxlib.h"
#include "support/LOstream.h"
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()
{
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)
if (lyxscale != 100)
os << "\tlyxscale " << lyxscale << '\n';
if (display != grfx::DefaultDisplay)
- os << "\tdisplay " << displayTranslator.find(display) << '\n';
+ os << "\tdisplay " << grfx::displayTranslator.find(display) << '\n';
if (scale) {
if (scale != 100)
os << "\tscale " << scale << '\n';
} else if (token == "display") {
lex.next();
string const type = lex.getString();
- display = displayTranslator.find(type);
+ display = grfx::displayTranslator.find(type);
} else if (token == "scale") {
lex.next();
scale = lex.getInteger();
}
}
- string mode;
- if (display != grfx::DefaultDisplay)
- mode = displayTranslator.find(display);
- else
- mode = displayTranslator.find(lyxrc.display_graphics);
- pars.display = displayTranslator.find(mode);
+ if (display == grfx::DefaultDisplay) {
+ pars.display = lyxrc.display_graphics;
+ } else {
+ pars.display = display;
+ }
// Override the above if we're not using a gui
if (!lyxrc.use_gui) {
#include "gettext.h"
#include "lyxlex.h"
+#include "graphics/GraphicsTypes.h"
+
#include "bufferlist.h"
#include "buffer.h"
#include "lyxserver.h"
toplevel_keymap.reset(new kb_keymap);
defaultKeyBindings(toplevel_keymap.get());
+ // set the DisplayTranslator only once; should that be done here??
+ // if this should not be in this file, please also remove
+ // #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye.
+ grfx::setDisplayTranslator();
+
if (want_gui) {
lyx_gui::parse_init(argc, argv);
}
check_lastfiles = true;
make_backup = true;
backupdir_path.erase();
- display_graphics = "color";
+ display_graphics = grfx::ColorDisplay;
// Spellchecker settings:
#ifdef USE_PSPELL
use_pspell = true;
case RC_BINDFILE: // RVDK_PATCH_5
if (lexrc.next()) {
string const tmp(lexrc.getString());
- if (hasBindFile)
+ if (hasBindFile) {
// We are already in the
// "actually read bind file"
// mode.
ReadBindFile(tmp);
- else
+ } else {
// We are still in the "just
// remember the name of the
// bind file" mode.
bind_file = tmp;
+ }
}
break;
break;
case RC_AUTORESET_OPTIONS:
- if (lexrc.next())
+ if (lexrc.next()) {
auto_reset_options = lexrc.getBool();
+ }
break;
case RC_DISPLAY_GRAPHICS:
if (lexrc.next()) {
- display_graphics = 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";
+ display_graphics = grfx::displayTranslator.find(lexrc.getString());
}
break;
case RC_KBMAP:
- if (lexrc.next())
+ if (lexrc.next()) {
use_kbmap = lexrc.getBool();
+ }
break;
case RC_KBMAP_PRIMARY:
if (kmap.empty()) {
// nothing
} else if (!LibFileSearch("kbd", kmap,
- "kmap").empty())
+ "kmap").empty()) {
primary_kbmap = kmap;
- else
+ } else {
lexrc.printError("LyX: Keymap `$$Token' not found");
+ }
}
break;
if (kmap.empty()) {
// nothing
} else if (!LibFileSearch("kbd", kmap,
- "kmap").empty())
+ "kmap").empty()) {
secondary_kbmap = kmap;
- else
+ } else {
lexrc.printError("LyX: Keymap `$$Token' not found");
+ }
}
break;
case RC_FONT_ENCODING:
- if (lexrc.next())
+ if (lexrc.next()) {
fontenc = lexrc.getString();
+ }
break;
case RC_PRINTER:
- if (lexrc.next())
+ if (lexrc.next()) {
printer = lexrc.getString();
+ }
break;
case RC_PRINT_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
print_command = lexrc.getString();
+ }
break;
case RC_PRINTEVENPAGEFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_evenpage_flag = lexrc.getString();
+ }
break;
case RC_PRINTODDPAGEFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_oddpage_flag = lexrc.getString();
+ }
break;
case RC_PRINTPAGERANGEFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_pagerange_flag = lexrc.getString();
+ }
break;
case RC_PRINTCOPIESFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_copies_flag = lexrc.getString();
+ }
break;
case RC_PRINTCOLLCOPIESFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_collcopies_flag = lexrc.getString();
+ }
break;
case RC_PRINTREVERSEFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_reverse_flag = lexrc.getString();
+ }
break;
case RC_PRINTLANDSCAPEFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_landscape_flag = lexrc.getString();
+ }
break;
case RC_PRINTTOPRINTER:
- if (lexrc.next())
+ if (lexrc.next()) {
print_to_printer = lexrc.getString();
+ }
break;
case RC_PRINT_ADAPTOUTPUT:
- if (lexrc.next())
+ if (lexrc.next()) {
print_adapt_output = lexrc.getBool();
+ }
break;
case RC_PRINTTOFILE:
- if (lexrc.next())
+ if (lexrc.next()) {
print_to_file = lexrc.getString();
+ }
break;
case RC_PRINTFILEEXTENSION:
- if (lexrc.next())
+ if (lexrc.next()) {
print_file_extension = lexrc.getString();
+ }
break;
case RC_PRINTEXSTRAOPTIONS:
- if (lexrc.next())
+ if (lexrc.next()) {
print_extra_options = lexrc.getString();
+ }
break;
case RC_PRINTSPOOL_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
print_spool_command = lexrc.getString();
+ }
break;
case RC_PRINTSPOOL_PRINTERPREFIX:
- if (lexrc.next())
+ if (lexrc.next()) {
print_spool_printerprefix = lexrc.getString();
+ }
break;
case RC_PRINTPAPERDIMENSIONFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_paper_dimension_flag = lexrc.getString();
+ }
break;
case RC_PRINTPAPERFLAG:
- if (lexrc.next())
+ if (lexrc.next()) {
print_paper_flag = lexrc.getString();
+ }
break;
case RC_CUSTOM_EXPORT_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
custom_export_command = lexrc.getString();
+ }
break;
case RC_CUSTOM_EXPORT_FORMAT:
- if (lexrc.next())
+ if (lexrc.next()) {
custom_export_format = lexrc.getString();
+ }
break;
case RC_DEFAULT_PAPERSIZE:
break;
case RC_VIEWDVI_PAPEROPTION:
- if (lexrc.next())
+ if (lexrc.next()) {
view_dvi_paper_option = lexrc.getString();
- else
+ } else {
view_dvi_paper_option.erase();
+ }
break;
case RC_PS_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
ps_command = lexrc.getString();
+ }
break;
case RC_CHKTEX_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
chktex_command = lexrc.getString();
+ }
break;
case RC_SCREEN_DPI:
- if (lexrc.next())
+ if (lexrc.next()) {
dpi = lexrc.getInteger();
+ }
break;
case RC_SCREEN_ZOOM:
- if (lexrc.next())
+ if (lexrc.next()) {
zoom = lexrc.getInteger();
+ }
break;
case RC_WHEEL_JUMP:
- if (lexrc.next())
+ if (lexrc.next()) {
wheel_jump = lexrc.getInteger();
+ }
break;
case RC_SCREEN_FONT_SIZES:
- if (lexrc.next())
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_TINY] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_SCRIPT] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_FOOTNOTE] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_SMALL] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_NORMAL] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_LARGE] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_LARGER] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_LARGEST] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_HUGE] =
lexrc.getFloat();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
font_sizes[LyXFont::SIZE_HUGER] =
lexrc.getFloat();
+ }
break;
case RC_SCREEN_FONT_SCALABLE:
- if (lexrc.next())
+ if (lexrc.next()) {
use_scalable_fonts = lexrc.getBool();
+ }
break;
case RC_AUTOSAVE:
- if (lexrc.next())
+ if (lexrc.next()) {
autosave = lexrc.getInteger();
+ }
break;
case RC_DOCUMENTPATH:
break;
case RC_TEMPLATEPATH:
- if (lexrc.next())
+ if (lexrc.next()) {
template_path = ExpandPath(lexrc.getString());
+ }
break;
case RC_TEMPDIRPATH:
- if (lexrc.next())
+ if (lexrc.next()) {
tempdir_path = ExpandPath(lexrc.getString());
+ }
break;
case RC_USETEMPDIR:
- if (lexrc.next())
+ if (lexrc.next()) {
use_tempdir = lexrc.getBool();
+ }
break;
case RC_LASTFILES:
- if (lexrc.next())
+ if (lexrc.next()) {
lastfiles = ExpandPath(lexrc.getString());
+ }
break;
case RC_NUMLASTFILES:
- if (lexrc.next())
+ if (lexrc.next()) {
num_lastfiles = lexrc.getInteger();
+ }
break;
case RC_CHECKLASTFILES:
- if (lexrc.next())
+ if (lexrc.next()) {
check_lastfiles = lexrc.getBool();
+ }
break;
case RC_SCREEN_FONT_ROMAN:
- if (lexrc.next())
+ if (lexrc.next()) {
roman_font_name = lexrc.getString();
+ }
break;
case RC_SCREEN_FONT_SANS:
- if (lexrc.next())
+ if (lexrc.next()) {
sans_font_name = lexrc.getString();
+ }
break;
case RC_SCREEN_FONT_TYPEWRITER:
- if (lexrc.next())
+ if (lexrc.next()) {
typewriter_font_name = lexrc.getString();
+ }
break;
case RC_SCREEN_FONT_ENCODING:
break;
case RC_POPUP_BOLD_FONT:
- if (lexrc.next())
+ if (lexrc.next()) {
popup_bold_font = lexrc.getString();
+ }
break;
case RC_POPUP_NORMAL_FONT:
- if (lexrc.next())
+ if (lexrc.next()) {
popup_normal_font = lexrc.getString();
+ }
break;
case RC_POPUP_FONT_ENCODING:
- if (lexrc.next())
+ if (lexrc.next()) {
popup_font_encoding = lexrc.getString();
+ }
break;
case RC_SET_COLOR:
break;
}
- if (!lcolor.setColor(lyx_name, x11_name))
+ if (!lcolor.setColor(lyx_name, x11_name)) {
lyxerr << "Bad lyxrc set_color for "
<< lyx_name << endl;
+ }
break;
}
case RC_AUTOREGIONDELETE:
// Auto region delete defaults to true
- if (lexrc.next())
+ if (lexrc.next()) {
auto_region_delete = lexrc.getBool();
+ }
break;
case RC_BIND:
break;
}
case RC_OVERRIDE_X_DEADKEYS:
- if (lexrc.next())
+ if (lexrc.next()) {
override_x_deadkeys = lexrc.getBool();
+ }
break;
case RC_SERVERPIPE:
- if (lexrc.next())
+ if (lexrc.next()) {
lyxpipes = ExpandPath(lexrc.getString());
+ }
break;
case RC_CURSOR_FOLLOWS_SCROLLBAR:
- if (lexrc.next())
+ if (lexrc.next()) {
cursor_follows_scrollbar = lexrc.getBool();
+ }
break;
case RC_DIALOGS_ICONIFY_WITH_MAIN:
- if (lexrc.next())
+ if (lexrc.next()) {
dialogs_iconify_with_main = lexrc.getBool();
+ }
break;
case RC_ASCIIROFF_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
ascii_roff_command = lexrc.getString();
+ }
break;
case RC_ASCII_LINELEN:
- if (lexrc.next())
+ if (lexrc.next()) {
ascii_linelen = lexrc.getInteger();
+ }
break;
// Spellchecker settings:
#ifdef USE_PSPELL
case RC_USE_PSPELL:
- if (lexrc.next())
+ if (lexrc.next()) {
use_pspell = lexrc.getBool();
+ }
break;
#endif
case RC_SPELL_COMMAND:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_command = lexrc.getString();
+ }
break;
case RC_ACCEPT_COMPOUND:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_accept_compound = lexrc.getBool();
+ }
break;
case RC_USE_INP_ENC:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_use_input_encoding = lexrc.getBool();
+ }
break;
case RC_USE_ALT_LANG:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_use_alt_lang = lexrc.getBool();
+ }
break;
case RC_USE_PERS_DICT:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_use_pers_dict = lexrc.getBool();
+ }
break;
case RC_USE_ESC_CHARS:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_use_esc_chars = lexrc.getBool();
+ }
break;
case RC_ALT_LANG:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_alt_lang = lexrc.getString();
+ }
break;
case RC_PERS_DICT:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_pers_dict = lexrc.getString();
+ }
break;
case RC_ESC_CHARS:
- if (lexrc.next())
+ if (lexrc.next()) {
isp_esc_chars = lexrc.getString();
+ }
break;
case RC_MAKE_BACKUP:
- if (lexrc.next())
+ if (lexrc.next()) {
make_backup = lexrc.getBool();
+ }
break;
case RC_BACKUPDIR_PATH:
- if (lexrc.next())
+ if (lexrc.next()) {
backupdir_path = ExpandPath(lexrc.getString());
+ }
break;
case RC_DATE_INSERT_FORMAT:
- if (lexrc.next())
+ if (lexrc.next()) {
date_insert_format = lexrc.getString();
+ }
break;
case RC_LANGUAGE_PACKAGE:
- if (lexrc.next())
+ if (lexrc.next()) {
language_package = lexrc.getString();
+ }
break;
case RC_LANGUAGE_AUTO_BEGIN:
- if (lexrc.next())
+ if (lexrc.next()) {
language_auto_begin = lexrc.getBool();
+ }
break;
case RC_LANGUAGE_AUTO_END:
- if (lexrc.next())
+ if (lexrc.next()) {
language_auto_end = lexrc.getBool();
+ }
break;
case RC_LANGUAGE_GLOBAL_OPTIONS:
- if (lexrc.next())
+ if (lexrc.next()) {
language_global_options = lexrc.getBool();
+ }
break;
case RC_LANGUAGE_USE_BABEL:
- if (lexrc.next())
+ if (lexrc.next()) {
language_use_babel = lexrc.getBool();
+ }
break;
case RC_LANGUAGE_COMMAND_BEGIN:
- if (lexrc.next())
+ if (lexrc.next()) {
language_command_begin = lexrc.getString();
+ }
break;
case RC_LANGUAGE_COMMAND_END:
- if (lexrc.next())
+ if (lexrc.next()) {
language_command_end = lexrc.getString();
+ }
break;
case RC_LANGUAGE_COMMAND_LOCAL:
- if (lexrc.next())
+ if (lexrc.next()) {
language_command_local = lexrc.getString();
+ }
break;
case RC_RTL_SUPPORT:
- if (lexrc.next())
+ if (lexrc.next()) {
rtl_support = lexrc.getBool();
+ }
break;
case RC_AUTO_NUMBER:
- if (lexrc.next())
+ if (lexrc.next()) {
auto_number = lexrc.getBool();
+ }
break;
case RC_MARK_FOREIGN_LANGUAGE:
- if (lexrc.next())
+ if (lexrc.next()) {
mark_foreign_language = lexrc.getBool();
+ }
break;
case RC_CONVERTER: {
string from, to, command, flags;
- if (lexrc.next())
+ if (lexrc.next()) {
from = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
to = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
command = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
flags = lexrc.getString();
- if (command.empty() || command == "none")
+ }
+ if (command.empty() || command == "none") {
converters.erase(from, to);
- else
+ } else {
converters.add(from, to, command, flags);
+ }
break;
}
case RC_VIEWER: {
string format, command;
- if (lexrc.next())
+ if (lexrc.next()) {
format = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
command = lexrc.getString();
+ }
formats.setViewer(format, command);
break;
}
case RC_FORMAT: {
string format, extension, prettyname, shortcut;
- if (lexrc.next())
+ if (lexrc.next()) {
format = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
extension = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
prettyname = lexrc.getString();
- if (lexrc.next())
+ }
+ if (lexrc.next()) {
shortcut = lexrc.getString();
+ }
if (prettyname.empty()) {
- if (converters.formatIsUsed(format))
+ if (converters.formatIsUsed(format)) {
lyxerr << "Can't delete format "
<< format << endl;
- else
+ } else {
formats.erase(format);
-
- } else
+ }
+ } else {
formats.add(format, extension, prettyname,
shortcut);
+ }
break;
}
case RC_DEFAULT_LANGUAGE:
- if (lexrc.next())
+ if (lexrc.next()) {
default_language = lexrc.getString();
+ }
break;
case RC_LABEL_INIT_LENGTH:
- if (lexrc.next())
+ if (lexrc.next()) {
label_init_length = lexrc.getInteger();
+ }
break;
case RC_SHOW_BANNER:
- if (lexrc.next())
+ if (lexrc.next()) {
show_banner = lexrc.getBool();
+ }
break;
case RC_PREVIEW:
- if (lexrc.next())
+ if (lexrc.next()) {
preview = lexrc.getBool();
+ }
break;
case RC_PREVIEW_HASHED_LABELS:
- if (lexrc.next())
+ if (lexrc.next()) {
preview_hashed_labels = lexrc.getBool();
+ }
break;
case RC_PREVIEW_SCALE_FACTOR:
- if (lexrc.next())
+ if (lexrc.next()) {
preview_scale_factor = lexrc.getFloat();
+ }
break;
case RC_LAST: break; // this is just a dummy
if (display_graphics != system_lyxrc.display_graphics) {
os << "# Display graphics within LyX\n"
<< "# monochrome|grayscale|color|none\n"
- << "\\display_graphics " << display_graphics
+ << "\\display_graphics " << grfx::displayTranslator.find(display_graphics)
<< "\n";
}
#endif
#include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
+#include "graphics/GraphicsTypes.h"
// #include <boost/utility.hpp>
///
int label_init_length;
///
- string display_graphics;
+ grfx::DisplayType display_graphics;
///
bool show_banner;
///
extern bool textRedo(BufferView *);
/// makes sure the next operation will be stored
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();
-/// this is dangerous and for internal use only
+/// Track undos again
extern void unFreezeUndo();
/// FIXME
extern void setUndo(BufferView *, Undo::undo_kind kind,
/// FIXME
extern void setCursorParUndo(BufferView *);
-// This is only used in one place. Need a nicer way.
-/// is the undo frozen
+/// Are we avoiding tracking undos currently ?
extern bool undo_frozen;
#endif // UNDO_FUNCS_H