]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetGraphics.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / InsetGraphics.cpp
index 687014677b7ddf0691723012f0072ceb17538fec..421dcf1a6b3e31c7b26896275b73008415afb9ba 100644 (file)
@@ -15,7 +15,6 @@ TODO
     * What advanced features the users want to do?
       Implement them in a non latex dependent way, but a logical way.
       LyX should translate it to latex or any other fitting format.
-    * Add a way to roll the image file into the file format.
     * When loading, if the image is not found in the expected place, try
       to find it in the clipart, or in the same directory with the image.
     * The image choosing dialog could show thumbnails of the image formats
@@ -56,14 +55,12 @@ TODO
 #include "BufferView.h"
 #include "Converter.h"
 #include "Cursor.h"
-#include "support/debug.h"
 #include "DispatchResult.h"
 #include "ErrorList.h"
 #include "Exporter.h"
 #include "Format.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "support/gettext.h"
 #include "LaTeXFeatures.h"
 #include "Length.h"
 #include "Lexer.h"
@@ -76,9 +73,11 @@ TODO
 #include "frontends/alert.h"
 
 #include "support/convert.h"
+#include "support/debug.h"
 #include "support/docstream.h"
 #include "support/ExceptionMessage.h"
 #include "support/filetools.h"
+#include "support/gettext.h"
 #include "support/lyxlib.h"
 #include "support/lstrings.h"
 #include "support/os.h"
@@ -173,7 +172,7 @@ void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
                InsetGraphicsMailer::string2params(to_utf8(cmd.argument()), buffer, p);
                if (!p.filename.empty()) {
                        try {
-                               p.filename.enable(buffer.embeddedFiles().enabled(), &buffer);
+                               p.filename.enable(buffer.embedded(), &buffer);
                        } catch (ExceptionMessage const & message) {
                                Alert::error(message.title_, message.details_);
                                // do not set parameter if an error happens
@@ -217,10 +216,10 @@ bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-void InsetGraphics::registerEmbeddedFiles(Buffer const &
-       EmbeddedFiles & files) const
+void InsetGraphics::registerEmbeddedFiles(Buffer const & buffer,
+       EmbeddedFileList & files) const
 {
-       files.registerFile(params().filename, this);
+       files.registerFile(params().filename, this, buffer);
 }
 
 
@@ -229,7 +228,7 @@ void InsetGraphics::updateEmbeddedFile(Buffer const & buf,
 {
        // when embedding is enabled, change of embedding status leads to actions
        EmbeddedFile temp = file;
-       temp.enable(buf.embeddedFiles().enabled(), &buf);
+       temp.enable(buf.embedded(), &buf);
        // this will not be set if an exception is thorwn in enable()
        params_.filename = temp;
 
@@ -240,7 +239,7 @@ void InsetGraphics::updateEmbeddedFile(Buffer const & buf,
 }
 
 
-void InsetGraphics::edit(Cursor & cur, bool)
+void InsetGraphics::edit(Cursor & cur, bool, EntryDirection)
 {
        InsetGraphicsMailer(*this).showDialog(&cur.bv());
 }
@@ -280,7 +279,7 @@ void InsetGraphics::read(Buffer const & buf, Lexer & lex)
        else
                LYXERR(Debug::GRAPHICS, "Not a Graphics inset!");
 
-       params_.filename.enable(buf.embeddedFiles().enabled(), &buf);
+       params_.filename.enable(buf.embedded(), &buf);
        graphic_->update(params().as_grfxParams());
 }