#include <sstream>
+namespace lyx {
+
using std::string;
using std::istringstream;
using std::ostream;
string const & mailer_name)
: p_(p),
mailer_name_(mailer_name),
+ mouse_hover_(false),
updateButtonLabel_(true)
{}
}
-void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
{
if (updateButtonLabel_) {
updateButtonLabel_ = false;
editable() != NOT_EDITABLE);
}
button_.metrics(mi, dim);
+ bool const changed = dim_ != dim;
dim_ = dim;
+ return changed;
+}
+
+
+bool InsetCommand::setMouseHover(bool mouse_hover)
+{
+ mouse_hover_ = mouse_hover;
+ return true;
}
void InsetCommand::draw(PainterInfo & pi, int x, int y) const
{
setPosCache(pi, x, y);
+ button_.setRenderState(mouse_hover_);
button_.draw(pi, x, y);
}
}
-int InsetCommand::latex(Buffer const &, ostream & os,
+int InsetCommand::latex(Buffer const &, odocstream & os,
OutputParams const &) const
{
os << getCommand();
}
-int InsetCommand::plaintext(Buffer const &, lyx::odocstream &,
+int InsetCommand::plaintext(Buffer const &, odocstream &,
OutputParams const &) const
{
return 0;
}
-int InsetCommand::docbook(Buffer const &, ostream &,
+int InsetCommand::docbook(Buffer const &, odocstream &,
OutputParams const &) const
{
return 0;
case LFUN_INSET_MODIFY: {
InsetCommandParams p(p_.getCmdName());
- InsetCommandMailer::string2params(mailer_name_, lyx::to_utf8(cmd.argument()), p);
+ InsetCommandMailer::string2params(mailer_name_, to_utf8(cmd.argument()), p);
if (p.getCmdName().empty())
cur.noUpdate();
else
}
case LFUN_INSET_DIALOG_UPDATE: {
- string const name = lyx::to_utf8(cmd.argument());
+ string const name = to_utf8(cmd.argument());
InsetCommandMailer(name, *this).updateDialog(&cur.bv());
break;
}
data << "\\end_inset\n";
return data.str();
}
+
+
+} // namespace lyx