]> git.lyx.org Git - features.git/commitdiff
Herbert's graphics14.diff
authorAngus Leeming <leeming@lyx.org>
Wed, 20 Feb 2002 16:34:53 +0000 (16:34 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 20 Feb 2002 16:34:53 +0000 (16:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3578 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlGraphics.h
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormGraphics.C
src/insets/ChangeLog
src/insets/insetgraphics.C
src/support/ChangeLog
src/support/filetools.C

index 2539f6073859de7ce69cb625e52faee902dd8ce2..54b0de5e8c667b2a817c4a5182e64d0e4f321095 100644 (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
index 5c0972bfb867780b1875e85e3b32854956d7915b..9bf1949d3fd87d0502cb13146cd16aadc38cb494 100644 (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"));
-}
 
index 0c9dc1696f244ea7b54af5c88bd127879153d074..022e3e9564b97f7c927d9deca1c331c14a99ad40 100644 (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.
index 262d0ef064627fa2a05666460bcad160e5c1d562..18ea844eff092d43648502f8eb5dccc3d3a75238 100644 (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.
index 4222641bc64e9b50f225b44a3e2a331c6bd8f956..5cb9d4345bc83c84a319f86aee5f13bcf6e5c9ae 100644 (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));
index e94f901168d98e09e1e8a8541a703978356c8ae8..db78511f3d77bd6667c9f0b3935928de6de0dc0c 100644 (file)
        (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]
index 1dc04a8530c0eea9948d5443e3762bdede8630ab..59f463c436adbaf85eb2208ed4fa2e40ab3f95fb 100644 (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;
 }
index ac88819a6aed47ce6ee6b94c3beefd24156490ef..c12d709ad5028aade2febcf92769ae241cec8916 100644 (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
index 656e90ea64f9e5df5ec3ce87d349d8036dad3dc6..6f2376999ab61520c019a00ee0c390554d2f2e95 100644 (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";
 }