Herbert's graphics14.diff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3578 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2002-02-20 16:34:53 +00:00
parent a53810d986
commit fae3fd8ab1
9 changed files with 43 additions and 26 deletions

View File

@ -1,3 +1,7 @@
2002-02-18 Herbert Voss <voss@lyx.org>
* ControlGraphics.[C]: remove help-file call
2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
* helper_funcs.h: wrap the structs firster and seconder up in a

View File

@ -131,8 +131,4 @@ string const ControlGraphics::readBB(string const & file)
return string();
}
void ControlGraphics::help() const
{
lv_.getDialogs()->showFile(i18nLibFileSearch("help","Graphics.hlp"));
}

View File

@ -40,8 +40,6 @@ public:
string const readBB(string const & file);
/// Control the bb
bool bbChanged;
/// Show Help file
void help() const;
private:
/// Dispatch the changed parameters to the kernel.

View File

@ -9,6 +9,10 @@
* xforms_helpers.h: remove incorrect comment.
2002-02-18 Herbert Voss <voss@lyx.org>
* FormGraphics.C: same units for LyX and Latex view, cosmetics
2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
* Timeout_pimpl.[Ch] (running): new method.

View File

@ -106,8 +106,8 @@ void FormGraphics::build()
fl_set_input_return (lyxview_->input_lyxheight, FL_RETURN_CHANGED);
fl_set_input_return (lyxview_->input_lyxscale, FL_RETURN_CHANGED);
fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_WithUnit.c_str());
fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_WithUnit.c_str());
fl_addto_choice(lyxview_->choice_width_lyxwidth, choice_Length_All.c_str());
fl_addto_choice(lyxview_->choice_width_lyxheight, choice_Length_All.c_str());
bc().addReadOnly(lyxview_->radio_pref);
bc().addReadOnly(lyxview_->radio_mono);
@ -385,9 +385,10 @@ void FormGraphics::update() {
// path, because the controller knows nothing about the doc-dir
controller().bbChanged = false;
if (igp.bb.empty()) {
string const fileWithAbsPath =
lyxerr[Debug::GRAPHICS] << "update:: no BoundingBox" << endl;
string const fileWithAbsPath =
MakeAbsPath(igp.filename, OnlyPath(igp.filename));
string const bb = controller().readBB(fileWithAbsPath);
string const bb = controller().readBB(fileWithAbsPath);
if (!bb.empty()) {
// get the values from the file
// in this case we always have the point-unit
@ -401,9 +402,9 @@ void FormGraphics::update() {
fl_set_input(bbox_->input_bb_x1, bb.c_str());
fl_set_input(bbox_->input_bb_y1, bb.c_str());
}
string const unit("pt");
fl_set_choice_text(bbox_->choice_bb_units, unit.c_str());
fl_set_choice(bbox_->choice_bb_units, 1); // "pt"
} else { // get the values from the inset
lyxerr[Debug::GRAPHICS] << "update:: igp has BoundingBox" << endl;
controller().bbChanged = true;
LyXLength anyLength;
anyLength = LyXLength(token(igp.bb,' ',0));

View File

@ -35,6 +35,10 @@
(docbook):
(validate): the file locatation is given by an entity reference.
2002-02-18 Herbert Voss <voss@lyx.org>
* insetgraphics.C: use [Debug::GRAPHICS] for lyxerr
2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
* insetexternal.C Changes due to the renaming of support/syscall.[Ch]

View File

@ -350,7 +350,7 @@ void InsetGraphics::read(Buffer const * buf, LyXLex & lex)
else if (token == "Figure") // Compatibility reading of FigInset figures.
readFigInset(buf, lex);
else
lyxerr[Debug::INFO] << "Not a Graphics or Figure inset!\n";
lyxerr[Debug::GRAPHICS] << "Not a Graphics or Figure inset!\n";
updateInset();
}
@ -363,7 +363,7 @@ void InsetGraphics::readInsetGraphics(Buffer const * buf, LyXLex & lex)
lex.next();
string const token = lex.getString();
lyxerr[Debug::INFO] << "Token: '" << token << '\''
lyxerr[Debug::GRAPHICS] << "Token: '" << token << '\''
<< endl;
if (token.empty()) {
@ -408,7 +408,7 @@ void InsetGraphics::readFigInset(Buffer const * buf, LyXLex & lex)
lex.next();
string const token = lex.getString();
lyxerr[Debug::INFO] << "Token: " << token << endl;
lyxerr[Debug::GRAPHICS] << "Token: " << token << endl;
if (token.empty())
continue;
@ -526,7 +526,7 @@ string decideOutputImageFormat(string const & suffix)
// lyxrc.pdf_mode means:
// Are we creating a PDF or a PS file?
// (Should actually mean, are we using latex or pdflatex).
lyxerr[Debug::INFO] << "decideOutput::lyxrc.pdf_mode = " << lyxrc.pdf_mode << "\n";
lyxerr[Debug::GRAPHICS] << "decideOutput::lyxrc.pdf_mode = " << lyxrc.pdf_mode << "\n";
if (lyxrc.pdf_mode) {
if (contains(suffix,"ps") || suffix == "pdf")
return "pdf";
@ -536,7 +536,7 @@ string decideOutputImageFormat(string const & suffix)
return "png";
}
// If it's postscript, we always do eps.
lyxerr[Debug::INFO] << "decideOutput: we have PostScript mode\n";
lyxerr[Debug::GRAPHICS] << "decideOutput: we have PostScript mode\n";
if (suffix != "ps")
return "eps";
else
@ -561,7 +561,7 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
//
// if it's a zipped one, than let LaTeX do the rest!!!
if ((zippedFile(params.filename) && params.noUnzip) || buf->niceFile) {
lyxerr[Debug::INFO] << "don't unzip file or export latex"
lyxerr[Debug::GRAPHICS] << "don't unzip file or export latex"
<< params.filename << endl;
return params.filename;
}
@ -586,10 +586,10 @@ string const InsetGraphics::prepareFile(Buffer const *buf) const
string outfile;
string const temp = AddName(buf->tmppath, filename_);
outfile = RemoveExtension(temp);
lyxerr[Debug::INFO] << "tempname = " << temp << "\n";
lyxerr[Debug::INFO] << "buf::tmppath = " << buf->tmppath << "\n";
lyxerr[Debug::INFO] << "filename_ = " << filename_ << "\n";
lyxerr[Debug::INFO] << "outfile = " << outfile << endl;
lyxerr[Debug::GRAPHICS] << "tempname = " << temp << "\n";
lyxerr[Debug::GRAPHICS] << "buf::tmppath = " << buf->tmppath << "\n";
lyxerr[Debug::GRAPHICS] << "filename_ = " << filename_ << "\n";
lyxerr[Debug::GRAPHICS] << "outfile = " << outfile << endl;
converters.convert(buf, filename_, outfile, extension, image_target);
return outfile;
}

View File

@ -1,3 +1,8 @@
2002-02-18 Herbert Voss <voss@perce.de>
* filetools.C: (getExtFromContents) return the fileextension
if no format is detected.
2002-02-18 Angus Leeming <a.leeming@ic.ac.uk>
* syscall.[Ch]: renamed as systemcall.[Ch]. class Systemcalls renamed

View File

@ -980,7 +980,10 @@ string const GetExtension(string const & name)
// GZIP \037\213\010\010... http://www.ietf.org/rfc/rfc1952.txt
// ZIP PK... http://www.halyava.ru/document/ind_arch.htm
// Z \037\177 UNIX compress
/// return the "extension" which belongs to the contents
/// for no knowing contents return the extension. Without
/// an extension and unknown contents we return "user"
string const getExtFromContents(string const & filename) {
if (filename.empty() || !IsFileReadable(filename))
return string(); // paranoia check
@ -996,7 +999,7 @@ string const getExtFromContents(string const & filename) {
bool zipChecked = false;
for (; count < max_count; ++count) {
if (ifs.eof()) {
lyxerr[Debug::INFO] << "filetools(getExtFromContents)"
lyxerr[Debug::GRAPHICS] << "filetools(getExtFromContents)"
" End of file reached and it wasn't found to be a known Type!" << endl;
break;
}
@ -1027,7 +1030,6 @@ string const getExtFromContents(string const & filename) {
else if (contains(str,"PNG"))
return "png";
else if (contains(str,"%!PS-Adobe")) { // eps or ps
// test if it's ps or eps
ifs >> str;
if (contains(str,"EPSF"))
return "eps";
@ -1038,9 +1040,12 @@ string const getExtFromContents(string const & filename) {
else if (contains(str,"XPM"))
return "xpm";
}
lyxerr[Debug::INFO] << "filetools(getExtFromContents)\n"
lyxerr[Debug::GRAPHICS] << "filetools(getExtFromContents)\n"
"\tCouldn't find a known Type!"
"\twill use a \"user\" defined format (based on file extension)" << endl;
"\twill use ext or a \"user\" defined format" << endl;
string const ext(GetExtension(filename));
if (!ext.empty())
return ext;
return "user";
}