]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCollapsable.cpp
InsetListings: change the interface of diaplay function and allow AlignLeft. Applied...
[lyx.git] / src / insets / InsetCollapsable.cpp
index 2b7593c22ac58fcb6202db80fdcfdfece8278bf8..1c7ec55961c0103f498b8f8fdde3c74f3527aaa3 100644 (file)
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "debug.h"
 #include "DispatchResult.h"
 #include "FloatList.h"
 #include "FuncStatus.h"
 #include "gettext.h"
-#include "LColor.h"
-#include "LyXLex.h"
+#include "Color.h"
+#include "Lexer.h"
 #include "FuncRequest.h"
 #include "MetricsInfo.h"
 #include "Paragraph.h"
@@ -57,25 +57,24 @@ InsetCollapsable::InsetCollapsable
 {
        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)
 {
 }
 
@@ -99,7 +98,7 @@ void InsetCollapsable::write(Buffer const & buf, ostream & os) const
 }
 
 
-void InsetCollapsable::read(Buffer const & buf, LyXLex & lex)
+void InsetCollapsable::read(Buffer const & buf, Lexer & lex)
 {
        bool token_found = false;
        if (lex.isOK()) {
@@ -258,7 +257,7 @@ void InsetCollapsable::cursorPos(BufferView const & bv,
 }
 
 
-InsetBase::EDITABLE InsetCollapsable::editable() const
+Inset::EDITABLE InsetCollapsable::editable() const
 {
        return status() != Collapsed ? HIGHLY_EDITABLE : IS_EDITABLE;
 }
@@ -297,7 +296,7 @@ docstring const InsetCollapsable::getNewLabel(docstring const & l) const
 }
 
 
-void InsetCollapsable::edit(LCursor & cur, bool left)
+void InsetCollapsable::edit(Cursor & cur, bool left)
 {
        //lyxerr << "InsetCollapsable: edit left/right" << endl;
        cur.push(*this);
@@ -305,7 +304,7 @@ void InsetCollapsable::edit(LCursor & cur, bool left)
 }
 
 
-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))
@@ -315,7 +314,7 @@ InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y)
 }
 
 
-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;
@@ -412,7 +411,7 @@ void InsetCollapsable::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetCollapsable::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action) {
@@ -437,7 +436,7 @@ void InsetCollapsable::setLabel(docstring const & l)
 }
 
 
-void InsetCollapsable::setStatus(LCursor & cur, CollapseStatus status)
+void InsetCollapsable::setStatus(Cursor & cur, CollapseStatus status)
 {
        status_ = status;
        setButtonLabel();
@@ -449,17 +448,17 @@ void InsetCollapsable::setStatus(LCursor & cur, CollapseStatus status)
 }
 
 
-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());
 }