]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetgraphics.C
some reindentation, revert workarea xpos++, constify, remove all traces of LyXParagra...
[lyx.git] / src / insets / insetgraphics.C
index b24dc7423eb178f41dff27f5e046f6a56618e3fa..ff31082778143597bfcda2651bb6c485b2f5cd89 100644 (file)
@@ -43,7 +43,11 @@ Known BUGS:
                it is done in-place, into the same directory as the original image.
                This needs to be fixed in the src/converter.C file
                [ This is presumed to be fixed, needs testing.]
+
+       * We do not dither or resize the image in a WYSIWYM way, we load it at
+               its original size and color, resizing is done in the final output,
+               but not in the LyX window.
+               
 TODO Before initial production release:
     * Replace insetfig everywhere
         * Read it's file format
@@ -141,6 +145,7 @@ TODO Extended features:
 #include <algorithm> // For the std::max
 #include "support/lyxmanip.h"
 #include "debug.h"
+#include "gettext.h"
 
 extern string system_tempdir;
 
@@ -159,12 +164,14 @@ InsetGraphics::InsetGraphics()
        : cacheHandle(0), imageLoaded(false)
 {}
 
+
 InsetGraphics::~InsetGraphics()
 {
        // Emits the hide signal to the dialog connected (if any)
        hideDialog();
 }
 
+
 char const *
 InsetGraphics::statusMessage() const
 {
@@ -197,6 +204,7 @@ InsetGraphics::statusMessage() const
        return msg;
 }
 
+
 int InsetGraphics::ascent(BufferView *, LyXFont const &) const
 {
        LyXImage * pixmap = 0;
@@ -231,6 +239,7 @@ int InsetGraphics::width(BufferView *, LyXFont const & font) const
        }
 }
 
+
 void InsetGraphics::draw(BufferView * bv, LyXFont const & font,
                          int baseline, float & x, bool) const
 {
@@ -346,7 +355,9 @@ void InsetGraphics::Read(Buffer const * buf, LyXLex & lex)
        updateInset();
 }
 
-static
+
+namespace {
+
 void formatResize(ostream & os, string const & key,
                  InsetGraphicsParams::Resize resizeType, double size)
 {
@@ -373,6 +384,9 @@ void formatResize(ostream & os, string const & key,
        }
 }
 
+} // namespace anon
+
+
 string const
 InsetGraphics::createLatexOptions() const
 {
@@ -396,7 +410,6 @@ InsetGraphics::createLatexOptions() const
 }
 
 
-
 string const 
 InsetGraphics::prepareFile(Buffer const *buf) const
 {
@@ -447,6 +460,7 @@ InsetGraphics::prepareFile(Buffer const *buf) const
        return outfile;
 }
 
+
 int InsetGraphics::Latex(Buffer const *buf, ostream & os,
                bool /*fragile*/, bool/*fs*/) const
 {
@@ -532,6 +546,7 @@ int InsetGraphics::Linuxdoc(Buffer const *, ostream &) const
        return 0;
 }
 
+
 // For explanation on inserting graphics into DocBook checkout:
 // http://linuxdoc.org/LDP/LDP-Author-Guide/inserting-pictures.html
 // See also the docbook guide at http://www.docbook.org/
@@ -561,6 +576,7 @@ void InsetGraphics::Validate(LaTeXFeatures & features) const
                features.subfigure = true;
 }
 
+
 // Update the inset after parameters changed (read from file or changed in
 // dialog.
 void InsetGraphics::updateInset() const
@@ -580,6 +596,7 @@ void InsetGraphics::updateInset() const
        cacheHandle = temp;
 }
 
+
 bool InsetGraphics::setParams(InsetGraphicsParams const & params)
 {
        // If nothing is changed, just return and say so.
@@ -596,13 +613,16 @@ bool InsetGraphics::setParams(InsetGraphicsParams const & params)
        return true;
 }
 
+
 InsetGraphicsParams InsetGraphics::getParams() const
 {
        return params;
 }
 
+
 Inset * InsetGraphics::Clone(Buffer const &) const
 {
+#warning use the copy constructor instead. (Lgb)
        InsetGraphics * newInset = new InsetGraphics;
 
        newInset->cacheHandle = cacheHandle;