#include "InsetCollapsable.h"
-#include "buffer.h"
-#include "bufferparams.h"
+#include "Buffer.h"
+#include "BufferParams.h"
#include "BufferView.h"
-#include "cursor.h"
+#include "Cursor.h"
#include "debug.h"
-#include "dispatchresult.h"
+#include "DispatchResult.h"
#include "FloatList.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "LColor.h"
-#include "lyxlex.h"
-#include "funcrequest.h"
-#include "metricsinfo.h"
-#include "paragraph.h"
+#include "Color.h"
+#include "Lexer.h"
+#include "FuncRequest.h"
+#include "MetricsInfo.h"
+#include "Paragraph.h"
#include "frontends/FontMetrics.h"
#include "frontends/Painter.h"
{
setAutoBreakRows(true);
setDrawFrame(true);
- setFrameColor(LColor::collapsableframe);
- setInsetName(from_ascii("Collapsable"));
+ setFrameColor(Color::collapsableframe);
setButtonLabel();
}
-InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs):
- InsetText(rhs),
- labelfont_(rhs.labelfont_),
- button_dim(rhs.button_dim),
- topx(rhs.topx),
- topbaseline(rhs.topbaseline),
- label(rhs.label),
- status_(rhs.status_),
- openinlined_(rhs.openinlined_),
- autoOpen_(rhs.autoOpen_),
- textdim_(rhs.textdim_),
- // the sole purpose of this copy constructor
- mouse_hover_(false)
+InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs)
+ : InsetText(rhs),
+ labelfont_(rhs.labelfont_),
+ button_dim(rhs.button_dim),
+ topx(rhs.topx),
+ topbaseline(rhs.topbaseline),
+ label(rhs.label),
+ status_(rhs.status_),
+ openinlined_(rhs.openinlined_),
+ autoOpen_(rhs.autoOpen_),
+ textdim_(rhs.textdim_),
+ // the sole purpose of this copy constructor
+ mouse_hover_(false)
{
}
}
-void InsetCollapsable::read(Buffer const & buf, LyXLex & lex)
+void InsetCollapsable::read(Buffer const & buf, Lexer & lex)
{
bool token_found = false;
if (lex.isOK()) {
}
-InsetBase::EDITABLE InsetCollapsable::editable() const
+Inset::EDITABLE InsetCollapsable::editable() const
{
return status() != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE;
}
}
-void InsetCollapsable::edit(LCursor & cur, bool left)
+void InsetCollapsable::edit(Cursor & cur, bool left)
{
//lyxerr << "InsetCollapsable: edit left/right" << endl;
cur.push(*this);
}
-InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y)
+Inset * InsetCollapsable::editXY(Cursor & cur, int x, int y)
{
//lyxerr << "InsetCollapsable: edit xy" << endl;
if (status() == Collapsed || (button_dim.contains(x, y) && status() != Inlined))
}
-void InsetCollapsable::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd)
{
//lyxerr << "InsetCollapsable::doDispatch (begin): cmd: " << cmd
// << " cur: " << cur << " bvcur: " << cur.bv().cursor() << endl;
}
-bool InsetCollapsable::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
switch (cmd.action) {
}
-void InsetCollapsable::setStatus(LCursor & cur, CollapseStatus status)
+void InsetCollapsable::setStatus(Cursor & cur, CollapseStatus status)
{
status_ = status;
setButtonLabel();
}
-void InsetCollapsable::setLabelFont(LyXFont & font)
+void InsetCollapsable::setLabelFont(Font & font)
{
labelfont_ = font;
}
docstring InsetCollapsable::floatName(string const & type, BufferParams const & bp) const
{
- FloatList const & floats = bp.getLyXTextClass().floats();
+ FloatList const & floats = bp.getTextClass().floats();
FloatList::const_iterator it = floats[type];
// FIXME UNICODE
- return (it == floats.end()) ? from_ascii(type) : _(it->second.name());
+ return (it == floats.end()) ? from_ascii(type) : bp.B_(it->second.name());
}