if (argument.empty() || !lyx_view_->buffer())
break;
//view()->cursor().recordUndoFullDocument(); let inset-apply do that job
- InsetGraphics::unifyGraphicsGroups(*lyx_view_->buffer(), argument);
+ graphics::unifyGraphicsGroups(*lyx_view_->buffer(), argument);
lyx_view_->buffer()->markDirty();
updateFlags = Update::Force | Update::FitCursor;
break;
}
case LFUN_SET_GRAPHICS_GROUP: {
- InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur);
+ InsetGraphics * ins = graphics::getCurrentGraphicsInset(cur);
if (!ins)
break;
cur.recordUndoFullDocument();
string id = to_utf8(cmd.argument());
- string grp = InsetGraphics::getGroupParams(bv->buffer(), id);
+ string grp = graphics::getGroupParams(bv->buffer(), id);
InsetGraphicsParams tmp, inspar = ins->getParams();
if (id.empty())
break;
case LFUN_SET_GRAPHICS_GROUP: {
- InsetGraphics * ins = InsetGraphics::getCurrentGraphicsInset(cur);
+ InsetGraphics * ins = graphics::getCurrentGraphicsInset(cur);
if (!ins)
enable = false;
else
if (!bv)
return;
set<string> grp;
- InsetGraphics::getGraphicsGroups(bv->buffer(), grp);
+ graphics::getGraphicsGroups(bv->buffer(), grp);
if (grp.empty())
return;
return data.str();
}
+namespace graphics {
-void InsetGraphics::getGraphicsGroups(Buffer const & b, std::set<string> & ids)
+void getGraphicsGroups(Buffer const & b, std::set<string> & ids)
{
Inset & inset = b.inset();
InsetIterator it = inset_iterator_begin(inset);
}
-string InsetGraphics::getGroupParams(Buffer const & b, std::string const & groupId)
+string getGroupParams(Buffer const & b, std::string const & groupId)
{
if (groupId.empty())
return string();
if (inspar.groupId == groupId) {
InsetGraphicsParams tmp = inspar;
tmp.filename.erase();
- return params2string(tmp, b);
+ return InsetGraphics::params2string(tmp, b);
}
}
return string();
}
-void InsetGraphics::unifyGraphicsGroups(Buffer const & b, std::string const & argument)
+void unifyGraphicsGroups(Buffer const & b, std::string const & argument)
{
InsetGraphicsParams params;
InsetGraphics::string2params(argument, b, params);
}
-InsetGraphics * InsetGraphics::getCurrentGraphicsInset(Cursor const & cur)
+InsetGraphics * getCurrentGraphicsInset(Cursor const & cur)
{
Inset * instmp = &cur.inset();
if (instmp->lyxCode() != GRAPHICS_CODE)
return static_cast<InsetGraphics *>(instmp);
}
+} // namespace graphics
+
} // namespace lyx
///
static std::string params2string(InsetGraphicsParams const &,
Buffer const &);
- /// Saves the list of currently used groups in the document.
- static void getGraphicsGroups(Buffer const &, std::set<std::string> &);
- /// Returns parameters of a given graphics group (except filename).
- static std::string getGroupParams(Buffer const &,
- std::string const &);
- /** Synchronize all Graphics insets of the group.
- Both groupId and params are taken from argument.
- */
- static void unifyGraphicsGroups(Buffer const &, std::string const &);
- static InsetGraphics * getCurrentGraphicsInset(Cursor const &);
/** Set the inset parameters, used by the GUIndependent dialog.
Return true of new params are different from what was so far.
boost::scoped_ptr<RenderGraphic> const graphic_;
};
+namespace graphics {
+
+ /// Saves the list of currently used groups in the document.
+ void getGraphicsGroups(Buffer const &, std::set<std::string> &);
+
+ /// Returns parameters of a given graphics group (except filename).
+ std::string getGroupParams(Buffer const &, std::string const &);
+
+ /** Synchronize all Graphics insets of the group.
+ Both groupId and params are taken from argument.
+ */
+ void unifyGraphicsGroups(Buffer const &, std::string const &);
+ InsetGraphics * getCurrentGraphicsInset(Cursor const &);
+
+}
+
} // namespace lyx
#endif // INSET_GRAPHICS_H