X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetExternal.cpp;h=426aee5891405250b8e60c1359ab10d540d51615;hb=f5123ccfa82215030c70561af881175d92244492;hp=e7f2994c84f3977298938e53faef78a473cb7ce8;hpb=b79d8e5e2d20e8f294d47fe924c20de17dbd5c0b;p=lyx.git diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index e7f2994c84..426aee5891 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -45,7 +45,7 @@ #include "support/lyxlib.h" #include "support/Translator.h" -#include +#include "support/bind.h" #include @@ -71,7 +71,7 @@ TempName::TempName() { FileName const tempname = FileName::tempName("lyxext"); // must have an extension for the converter code to work correctly. - tempname_ = FileName(tempname.absFilename() + ".tmp"); + tempname_ = FileName(tempname.absFileName() + ".tmp"); } @@ -161,7 +161,7 @@ void InsetExternalParams::write(Buffer const & buf, ostream & os) const << "\ttemplate " << templatename() << '\n'; if (!filename.empty()) - os << "\tfilename " << filename.outputFilename(buf.filePath()) << '\n'; + os << "\tfilename " << filename.outputFileName(buf.filePath()) << '\n'; if (!display) os << "\tdisplay false\n"; @@ -371,6 +371,7 @@ InsetExternal::InsetExternal(Buffer * buf) } +// Mouse hover is not copied and remains empty InsetExternal::InsetExternal(InsetExternal const & other) : Inset(other), boost::signals::trackable(), @@ -382,6 +383,19 @@ InsetExternal::InsetExternal(InsetExternal const & other) InsetExternal::~InsetExternal() { hideDialogs("external", this); + + map::iterator it = mouse_hover_.begin(); + map::iterator end = mouse_hover_.end(); + for (; it != end; ++it) + if (it->second) + it->first->clearLastInset(this); +} + + +bool InsetExternal::setMouseHover(BufferView const * bv, bool mouse_hover) +{ + mouse_hover_[bv] = mouse_hover; + return true; } @@ -454,6 +468,8 @@ void InsetExternal::metrics(MetricsInfo & mi, Dimension & dim) const void InsetExternal::draw(PainterInfo & pi, int x, int y) const { + if (renderer_->asButton()) + renderer_->setRenderState(mouse_hover_[pi.base.bv]); renderer_->draw(pi, x, y); } @@ -571,7 +587,7 @@ void InsetExternal::setParams(InsetExternalParams const & p) RenderMonitoredPreview * preview_ptr = renderer_->asMonitoredPreview(); renderer_.reset(new RenderMonitoredPreview(this)); preview_ptr = renderer_->asMonitoredPreview(); - preview_ptr->fileChanged(boost::bind(&InsetExternal::fileChanged, this)); + preview_ptr->fileChanged(bind(&InsetExternal::fileChanged, this)); if (preview_ptr->monitoring()) preview_ptr->stopMonitoring(); add_preview_and_start_loading(*preview_ptr, *this, buffer()); @@ -623,7 +639,7 @@ int InsetExternal::latex(odocstream & os, OutputParams const & runparams) const if (params_.draft) { // FIXME UNICODE os << "\\fbox{\\ttfamily{}" - << from_utf8(params_.filename.outputFilename(buffer().filePath())) + << from_utf8(params_.filename.outputFileName(buffer().filePath())) << "}\n"; return 1; }