]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetFloat.cpp
InsetListings: change the interface of diaplay function and allow AlignLeft. Applied...
[lyx.git] / src / insets / InsetFloat.cpp
index 74c08f770e3d4f5a3d7e387dbff7ed2e17d7ab41..deda6e189c031aa8c2be6b842b4158047844af11 100644 (file)
 
 #include "InsetFloat.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 "Floating.h"
 #include "FloatList.h"
-#include "funcrequest.h"
+#include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "LColor.h"
-#include "lyxlex.h"
-#include "outputparams.h"
-#include "paragraph.h"
+#include "Color.h"
+#include "Lexer.h"
+#include "OutputParams.h"
+#include "Paragraph.h"
 #include "TocBackend.h"
 
 #include "support/lstrings.h"
@@ -116,16 +116,15 @@ using std::ostringstream;
 
 
 InsetFloat::InsetFloat(BufferParams const & bp, string const & type)
-       : InsetCollapsable(bp)
+       : InsetCollapsable(bp), name_(from_utf8(type))
 {
        setLabel(_("float: ") + floatName(type, bp));
-       LyXFont font(LyXFont::ALL_SANE);
+       Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
-       font.setColor(LColor::collapsable);
+       font.setColor(Color::collapsable);
        setLabelFont(font);
        params_.type = type;
-       setInsetName(from_utf8(type));
 }
 
 
@@ -135,7 +134,7 @@ InsetFloat::~InsetFloat()
 }
 
 
-void InsetFloat::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
 
@@ -171,7 +170,7 @@ void InsetFloat::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetFloat::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action) {
@@ -206,7 +205,7 @@ void InsetFloatParams::write(ostream & os) const
 }
 
 
-void InsetFloatParams::read(LyXLex & lex)
+void InsetFloatParams::read(Lexer & lex)
 {
        string token;
        lex >> token;
@@ -244,7 +243,7 @@ void InsetFloat::write(Buffer const & buf, ostream & os) const
 }
 
 
-void InsetFloat::read(Buffer const & buf, LyXLex & lex)
+void InsetFloat::read(Buffer const & buf, Lexer & lex)
 {
        params_.read(lex);
        wide(params_.wide, buf.params());
@@ -267,9 +266,9 @@ void InsetFloat::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<InsetBase> InsetFloat::doClone() const
+auto_ptr<Inset> InsetFloat::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetFloat(*this));
+       return auto_ptr<Inset>(new InsetFloat(*this));
 }
 
 
@@ -282,7 +281,7 @@ docstring const InsetFloat::editMessage() const
 int InsetFloat::latex(Buffer const & buf, odocstream & os,
                       OutputParams const & runparams) const
 {
-       FloatList const & floats = buf.params().getLyXTextClass().floats();
+       FloatList const & floats = buf.params().getTextClass().floats();
        string tmptype = (params_.wide ? params_.type + "*" : params_.type);
        if (params_.sideways) {
                if (params_.type == "table")
@@ -331,7 +330,7 @@ int InsetFloat::latex(Buffer const & buf, odocstream & os,
 int InsetFloat::plaintext(Buffer const & buf, odocstream & os,
                           OutputParams const & runparams) const
 {
-       os << '[' << _("float") << ' ' << floatName(params_.type, buf.params()) << ":\n";
+       os << '[' << buf.B_("float") << ' ' << floatName(params_.type, buf.params()) << ":\n";
        InsetText::plaintext(buf, os, runparams);
        os << "\n]";
 
@@ -351,11 +350,11 @@ int InsetFloat::docbook(Buffer const & buf, odocstream & os,
 }
 
 
-bool InsetFloat::insetAllowed(InsetBase::Code code) const
+bool InsetFloat::insetAllowed(Inset::Code code) const
 {
-       return code != InsetBase::FLOAT_CODE
-           && code != InsetBase::FOOT_CODE
-           && code != InsetBase::MARGIN_CODE;
+       return code != Inset::FLOAT_CODE
+           && code != Inset::FOOT_CODE
+           && code != Inset::MARGIN_CODE;
 }
 
 
@@ -433,7 +432,7 @@ void InsetFloatMailer::string2params(string const & in,
                return;
 
        istringstream data(in);
-       LyXLex lex(0,0);
+       Lexer lex(0,0);
        lex.setStream(data);
 
        string name;
@@ -442,7 +441,7 @@ void InsetFloatMailer::string2params(string const & in,
                return print_mailer_error("InsetFloatMailer", in, 1, name_);
 
        // This is part of the inset proper that is usually swallowed
-       // by LyXText::readInset
+       // by Text::readInset
        string id;
        lex >> id;
        if (!lex || id != "Float")