+2002-07-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * configure.m4: fix definition of the lyxpreview2ppm converter;
+ add ppm format. All should work out of the box now, even though
+ all may not be pretty
+
2002-07-18 Angus Leeming <leeming@lyx.org>
- * lyxpreview2ppm.sh: clean-up. Get it to work with scary_eqns.lyx.
+ * scripts/lyxpreview2ppm.sh: clean-up. Get it to work with
+ scary_eqns.lyx.
2002-07-17 André Pönitz <poenitz@gmx.net>
SEARCH_PROG([for a DVI to PDF converter],dvi_to_pdf_command,dvipdfm)
test $dvi_to_pdf_command = "dvipdfm" && dvi_to_pdf_command="dvipdfm \$\$i"
-# Search for a program to convert previewlyx to eps
-SEARCH_PROG([for a LyX preview converter],lyxpreview_to_xpm_command,lyxpreview2xpm.sh)
-test $lyxpreview_to_xpm_command = "lyxpreview2xpm.sh" && lyxpreview_to_xpm_command="lyxpreview2xpm.sh \$\$i \$\$o"
+# We have a script to convert previewlyx to ppm
+lyxpreview_to_ppm_command="lyxpreview2ppm.sh"
# Search a *roff program (used to translate tables in ASCII export)
LYXRC_PROG([for a *roff formatter], \ascii_roff_command, dnl
\\Format pdf2 pdf "PDF (pdflatex)" F
\\Format pdf3 pdf "PDF (dvipdfm)" m
\\Format png png PNG ""
+\\Format ppm ppm PPM ""
\\Format ps ps Postscript t
\\Format program "" Program ""
\\Format tgif obj TGIF ""
\\Format tiff tif TIFF ""
\\Format word doc Word W
\\Format xpm xpm XPM ""
-\\Format lyxpreview lyxpreview LYXPREVIEW ""
+\\Format lyxpreview lyxpreview "LyX Preview" ""
\\converter latex dvi "$latex_to_dvi" "latex"
\\converter latex pdf2 "$latex_to_pdf" "latex"
\\converter linuxdoc html "$linuxdoc_to_html_command" ""
\\converter docbook dvi "$docbook_to_dvi_command" ""
\\converter docbook html "$docbook_to_html_command" ""
-\\converter lyxpreview xpm "$lyxpreview_to_xpm_command" ""
+\\converter lyxpreview ppm "$lyxpreview_to_ppm_command" ""
\\converter latex lyx "$tex_to_lyx_command" ""
\\converter literate lyx "$literate_to_lyx_command" ""
src/frontends/xforms/FormVCLog.C
src/frontends/xforms/input_validators.C
src/frontends/xforms/Menubar_pimpl.C
-src/frontends/xforms/xfont_loader.C
src/frontends/xforms/xforms_helpers.C
src/frontends/xforms/XMiniBuffer.C
src/gettext.h
+2002-07-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * text2.C (toggleInset): if cursor is inside an inset, close the
+ inset and leave cursor _after_ it
+
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* lyxfunc.C: move minibuffer completion handling out of here
+2002-04-28 Herbert Voss <voss@perce.de>
+
+ * FormGraphics.C:
+ * forms/form_graphics.fd: add a new check button for LyXAspectRatio.
+
2002-07-19 John Levon <moz@compsoc.man.ac.uk>
* DropDown.h:
bc().addReadOnly(lyxview_->radio_gray);
bc().addReadOnly(lyxview_->radio_color);
bc().addReadOnly(lyxview_->radio_nodisplay);
+ bc().addReadOnly(lyxview_->check_lyxaspectratio);
// the size section
size_.reset(build_graphics_size(this));
lyxview_->choice_lyxheight);
igp.lyxscale = strToInt(getStringFromInput(lyxview_->input_lyxscale));
+ igp.keepLyXAspectRatio = fl_get_button(lyxview_->check_lyxaspectratio);
// the size section
if (fl_get_button(size_->radio_asis))
setEnabled(lyxview_->choice_lyxwidth, 0);
setEnabled(lyxview_->input_lyxheight, 0);
setEnabled(lyxview_->choice_lyxheight, 0);
+ setEnabled(lyxview_->check_lyxaspectratio, 0);
setEnabled(lyxview_->input_lyxscale, 0);
break;
}
setEnabled(lyxview_->choice_lyxwidth, 1);
setEnabled(lyxview_->input_lyxheight, 1);
setEnabled(lyxview_->choice_lyxheight, 1);
+ setEnabled(lyxview_->check_lyxaspectratio, 1);
setEnabled(lyxview_->input_lyxscale, 0);
break;
}
setEnabled(lyxview_->choice_lyxwidth, 0);
setEnabled(lyxview_->input_lyxheight, 0);
setEnabled(lyxview_->choice_lyxheight, 0);
+ setEnabled(lyxview_->check_lyxaspectratio, 0);
setEnabled(lyxview_->input_lyxscale, 1);
break;
}
}
+ fl_set_button(lyxview_->check_lyxaspectratio, igp.keepLyXAspectRatio);
+
// the size section
// Update the draft and clip mode
updateWidgetsFromLength(size_->input_width,
setEnabled(lyxview_->choice_lyxwidth, 0);
setEnabled(lyxview_->input_lyxheight, 0);
setEnabled(lyxview_->choice_lyxheight, 0);
+ setEnabled(lyxview_->check_lyxaspectratio, 0);
setEnabled(lyxview_->input_lyxscale, 0);
} else if (ob == lyxview_->radio_lyxwh) {
setEnabled(lyxview_->input_lyxwidth, 1);
setEnabled(lyxview_->choice_lyxwidth, 1);
setEnabled(lyxview_->input_lyxheight, 1);
setEnabled(lyxview_->choice_lyxheight, 1);
+ setEnabled(lyxview_->check_lyxaspectratio, 1);
setEnabled(lyxview_->input_lyxscale, 0);
} else if (ob == lyxview_->radio_lyxscale) {
setEnabled(lyxview_->input_lyxwidth, 0);
setEnabled(lyxview_->choice_lyxwidth, 0);
setEnabled(lyxview_->input_lyxheight, 0);
setEnabled(lyxview_->choice_lyxheight, 0);
+ setEnabled(lyxview_->check_lyxaspectratio, 0);
setEnabled(lyxview_->input_lyxscale, 1);
} else if (ob == lyxview_->button_latex_values) {
if (contains(fl_get_choice_text(size_->choice_width),'%') ||
setEnabled(lyxview_->choice_lyxwidth, 0);
setEnabled(lyxview_->input_lyxheight, 0);
setEnabled(lyxview_->choice_lyxheight, 0);
+ setEnabled(lyxview_->check_lyxaspectratio, 0);
setEnabled(lyxview_->input_lyxscale, 0);
} else if (fl_get_button (size_->radio_wh) == 1) {
fl_set_button (lyxview_->radio_lyxwh, 1);
setEnabled(lyxview_->choice_lyxwidth, 1);
setEnabled(lyxview_->input_lyxheight, 1);
setEnabled(lyxview_->choice_lyxheight, 1);
+ setEnabled(lyxview_->check_lyxaspectratio, 1);
setEnabled(lyxview_->input_lyxscale, 0);
} else if (fl_get_button (size_->radio_scale) ==1) {
fl_set_button (lyxview_->radio_lyxscale, 1);
setEnabled(lyxview_->choice_lyxwidth, 0);
setEnabled(lyxview_->input_lyxheight, 0);
setEnabled(lyxview_->choice_lyxheight, 0);
+ setEnabled(lyxview_->check_lyxaspectratio, 0);
setEnabled(lyxview_->input_lyxscale, 1);
}
}
+ fl_set_button(lyxview_->check_lyxaspectratio,
+ fl_get_button(size_->check_aspectratio));
// the bb section
} else if (!controller().bbChanged &&
setEnabled(size_->check_aspectratio, 0);
setEnabled(size_->input_scale, 1);
}
+ fl_set_button(size_->check_aspectratio,
+ fl_get_button(lyxview_->check_lyxaspectratio));
}
// check if the input is valid
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 0 0 0
+box: 0 10 10 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name:
+name:
callback:
argument:
Name: form_graphics_lyxview
Width: 500
Height: 245
-Number of Objects: 23
+Number of Objects: 24
--------------------
class: FL_BOX
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 350 95 70 30
+box: 350 75 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 0 0 0
+box: 0 10 10 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
-box: 255 25 30 30
+box: 170 25 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_LEFT
+alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
-box: 255 90 30 30
+box: 170 75 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_LEFT
+alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
--------------------
class: FL_ROUND3DBUTTON
type: RADIO_BUTTON
-box: 255 155 30 30
+box: 170 140 30 30
boxtype: FL_NO_BOX
colors: FL_COL1 FL_YELLOW
-alignment: FL_ALIGN_LEFT
+alignment: FL_ALIGN_RIGHT
style: FL_NORMAL_STYLE
size: FL_NORMAL_SIZE
lcol: FL_BLACK
--------------------
class: FL_TEXT
type: NORMAL_TEXT
-box: 420 95 25 30
+box: 420 75 25 30
boxtype: FL_FLAT_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE
--------------------
class: FL_BEGIN_GROUP
type: 0
-box: 0 0 0 0
+box: 0 10 10 0
boxtype: FL_NO_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_CENTER
shortcut:
resize: FL_RESIZE_ALL
gravity: FL_NoGravity FL_NoGravity
-name:
+name:
callback:
argument:
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 350 155 70 30
+box: 350 135 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 425 155 50 30
+box: 425 135 50 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
--------------------
class: FL_INPUT
type: NORMAL_INPUT
-box: 350 190 70 30
+box: 350 170 70 30
boxtype: FL_DOWN_BOX
colors: FL_COL1 FL_MCOL
alignment: FL_ALIGN_LEFT
--------------------
class: FL_CHOICE
type: NORMAL_CHOICE
-box: 425 190 50 30
+box: 425 170 50 30
boxtype: FL_FRAME_BOX
colors: FL_COL1 FL_BLACK
alignment: FL_ALIGN_LEFT
callback: C_FormBaseInputCB
argument: 0
+--------------------
+class: FL_CHECKBUTTON
+type: PUSH_BUTTON
+box: 210 200 30 30
+boxtype: FL_NO_BOX
+colors: FL_COL1 FL_YELLOW
+alignment: FL_ALIGN_RIGHT
+style: FL_NORMAL_STYLE
+size: FL_NORMAL_SIZE
+lcol: FL_BLACK
+label: keep Aspect ratio|#A
+shortcut:
+resize: FL_RESIZE_ALL
+gravity: FL_NoGravity FL_NoGravity
+name: check_lyxaspectratio
+callback: C_FormBaseInputCB
+argument: 0
+
==============================
--------------------
+2002-07-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * PreviewLoader.C (startLoading): use LibScriptSearch to find the
+ preview converter script
+
2002-07-18 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* GraphicsCacheItem.C (reset): use erase() instead of clear() for
cs << pconverter_->command << " " << latexfile << " "
<< font_scaling_factor_;
- string const command = cs.str().c_str();
+ string const command = LibScriptSearch(cs.str().c_str());
// Initiate the conversion from LaTeX to bitmap images files.
Forkedcall::SignalTypePtr convert_ptr;
+2002-07-19 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
+
+ * insetgraphicsParams.C (as_grfxParams): use the new
+ keepLyXAspectRatio parameter. Note that this is an adaptation of a
+ 1.2.0 patch, and I do not really know how to adapt it to the new
+ grfx::Cache world. Angus, please could you have a look?
+
+2002-05-01 Herbert Voss <voss@lyx.org>
+
+ * insetgraphicsParams.[Ch]: define a new keepLyXAspectRatio parameter.
+
2002-07-18 Angus Leeming <leeming@lyx.org>
* insetgraphics.C: clean-up comments (from Herbert).
#include "insetgraphicsParams.h"
#include "graphics/GraphicsParams.h"
+#include "graphics/GraphicsCache.h"
#include "support/translator.h"
#include "support/filetools.h"
lyxscale = 0; // same for lyxview
size_type = DEFAULT_SIZE; // do nothing
lyxsize_type = DEFAULT_SIZE; // do nothing
+ keepLyXAspectRatio = false; // only for LyXview
keepAspectRatio = false; // only for latex
rotate = false; // Rotating
rotateOrigin = "center"; // Origin
lyxsize_type = igp.lyxsize_type;
lyxwidth = igp.lyxwidth;
lyxheight = igp.lyxheight;
+ keepLyXAspectRatio = igp.keepLyXAspectRatio;
lyxscale = igp.lyxscale;
rotate = igp.rotate;
rotateOrigin = igp.rotateOrigin;
left.lyxsize_type == right.lyxsize_type &&
left.lyxwidth == right.lyxwidth &&
left.lyxheight == right.lyxheight &&
+ left.keepLyXAspectRatio == right.keepLyXAspectRatio &&
left.lyxscale == right.lyxscale &&
left.rotate == right.rotate &&
left.rotateOrigin == right.rotateOrigin &&
os << "\tlyxwidth " << lyxwidth.asString() << '\n';
if (!lyxheight.zero())
os << "\tlyxheight " << lyxheight.asString();
+ if (keepLyXAspectRatio)
+ os << "\tkeepLyXAspectRatio\n";
if (lyxscale != 0)
os << "\tlyxscale " << lyxscale << '\n';
}
} else if (token == "lyxheight") {
lex.next();
lyxheight = LyXLength(lex.getString());
+ } else if (token == "keepLyXAspectRatio") {
+ keepLyXAspectRatio = true;
} else if (token == "lyxscale") {
lex.next();
lyxscale = lex.getInteger();
double const scaling_factor = 100.0 / double(lyxrc.zoom);
pars.width = uint(scaling_factor * pars.width);
pars.height = uint(scaling_factor * pars.height);
+
+#if 0
+#warning Angus, could you please adapt this code? (JMarc)
+ if (keepLyXAspectRatio) {
+ // get the imagesize from the cache
+ grfx::Cache & gc = grfx::Cache::get();
+ float const rw = gc.raw_width(filename);
+ float const rh = gc.raw_height(filename);
+ float const ratio = (rw > 0.001) ? rh/rw : 1.0;
+ lyxerr[Debug::GRAPHICS]
+ << "Value of LyXAspectRatio: "
+ << ratio << std::endl;
+ if (!lyxwidth.zero() && !lyxheight.zero()) {
+ if (width < height)
+ height = int(ratio * width);
+ else
+ width = int(ratio * height);
+ } else if (lyxwidth.zero())
+ width = int(ratio * height);
+ else if (lyxheight.zero())
+ height = int(ratio * width);
+ }
+#endif
}
+
return pars;
}
LyXLength lyxwidth;
///
LyXLength lyxheight;
+ /// Keep the ratio between lyxheight and lyxwidth when resizing.
+ bool keepLyXAspectRatio;
/// Typ of rescaling the Screen inside lyx
int lyxscale;
///
&& inset_owner->owner()->isOpen()) {
bview->unlockInset(static_cast<UpdatableInset *>(inset_owner->owner()));
inset_owner->owner()->close(bview);
+ bview->getLyXText()->cursorRight(bview);
}
return;
}