#include "support/lyxlib.h"
#include "support/Translator.h"
-#include <boost/bind.hpp>
+#include "support/bind.h"
#include <sstream>
{
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");
}
<< "\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";
}
+// Mouse hover is not copied and remains empty
InsetExternal::InsetExternal(InsetExternal const & other)
: Inset(other),
boost::signals::trackable(),
InsetExternal::~InsetExternal()
{
hideDialogs("external", this);
+
+ map<BufferView const *, bool>::iterator it = mouse_hover_.begin();
+ map<BufferView const *, bool>::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;
}
void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT: {
InsetExternalParams p = params();
bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
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);
}
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());
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;
}
}
-void InsetExternal::addPreview(graphics::PreviewLoader & ploader) const
+void InsetExternal::addPreview(DocIterator const & /*inset_pos*/,
+ graphics::PreviewLoader & ploader) const
{
RenderMonitoredPreview * const ptr = renderer_->asMonitoredPreview();
if (!ptr)