]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetBox.cpp
BUG 3598: display framed and shaded notes in a separate paragraph, require package...
[lyx.git] / src / insets / InsetBox.cpp
index eae86d044070dd31e5f71832495f8d908f525f7a..dfd8fe6086ab148a4a8b8009ab05ef037bced881 100644 (file)
 #include "InsetBox.h"
 
 #include "BufferView.h"
-#include "cursor.h"
-#include "dispatchresult.h"
+#include "Cursor.h"
+#include "DispatchResult.h"
 #include "debug.h"
 #include "FuncStatus.h"
-#include "funcrequest.h"
+#include "FuncRequest.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "LColor.h"
-#include "lyxlex.h"
-#include "metricsinfo.h"
-#include "paragraph.h"
+#include "Color.h"
+#include "Lexer.h"
+#include "MetricsInfo.h"
+#include "Paragraph.h"
 #include "TextMetrics.h"
 
-#include "support/translator.h"
+#include "support/Translator.h"
 
 #include <sstream>
 
@@ -90,7 +90,6 @@ BoxTranslatorLoc const & boxtranslator_loc()
 
 void InsetBox::init()
 {
-       setInsetName(from_ascii("Box"));
        setButtonLabel();
 }
 
@@ -115,9 +114,9 @@ InsetBox::~InsetBox()
 }
 
 
-auto_ptr<InsetBase> InsetBox::doClone() const
+auto_ptr<Inset> InsetBox::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetBox(*this));
+       return auto_ptr<Inset>(new InsetBox(*this));
 }
 
 
@@ -134,7 +133,7 @@ void InsetBox::write(Buffer const & buf, ostream & os) const
 }
 
 
-void InsetBox::read(Buffer const & buf, LyXLex & lex)
+void InsetBox::read(Buffer const & buf, Lexer & lex)
 {
        params_.read(lex);
        InsetCollapsable::read(buf, lex);
@@ -144,7 +143,7 @@ void InsetBox::read(Buffer const & buf, LyXLex & lex)
 
 void InsetBox::setButtonLabel()
 {
-       LyXFont font(LyXFont::ALL_SANE);
+       Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
 
@@ -164,8 +163,8 @@ void InsetBox::setButtonLabel()
 
        setLabel(label);
 
-       font.setColor(LColor::foreground);
-       setBackgroundColor(LColor::background);
+       font.setColor(Color::foreground);
+       setBackgroundColor(Color::background);
        setLabelFont(font);
 }
 
@@ -206,7 +205,7 @@ bool InsetBox::showInsetDialog(BufferView * bv) const
 }
 
 
-void InsetBox::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
 
@@ -236,7 +235,7 @@ void InsetBox::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetBox::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action) {
@@ -485,7 +484,7 @@ void InsetBoxMailer::string2params(string const & in,
                return;
 
        istringstream data(in);
-       LyXLex lex(0,0);
+       Lexer lex(0,0);
        lex.setStream(data);
 
        string name;
@@ -494,7 +493,7 @@ void InsetBoxMailer::string2params(string const & in,
                return print_mailer_error("InsetBoxMailer", 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 != "Box")
@@ -508,12 +507,12 @@ InsetBoxParams::InsetBoxParams(string const & label)
        : type(label),
          use_parbox(false),
          inner_box(true),
-         width(LyXLength("100col%")),
+         width(Length("100col%")),
          special("none"),
          pos('t'),
          hor_pos('c'),
          inner_pos('t'),
-         height(LyXLength("1in")),
+         height(Length("1in")),
          height_special("totalheight") // default is 1\\totalheight
 {}
 
@@ -533,7 +532,7 @@ void InsetBoxParams::write(ostream & os) const
 }
 
 
-void InsetBoxParams::read(LyXLex & lex)
+void InsetBoxParams::read(Lexer & lex)
 {
        if (!lex.isOK())
                return;
@@ -614,7 +613,7 @@ void InsetBoxParams::read(LyXLex & lex)
                return;
        if (token == "width") {
                lex.next();
-               width = LyXLength(lex.getString());
+               width = Length(lex.getString());
        } else {
                lyxerr << "InsetBox::Read: Missing 'width'-tag!" << endl;
                lex.pushToken(token);
@@ -638,7 +637,7 @@ void InsetBoxParams::read(LyXLex & lex)
                return;
        if (token == "height") {
                lex.next();
-               height = LyXLength(lex.getString());
+               height = Length(lex.getString());
        } else {
                lyxerr << "InsetBox::Read: Missing 'height'-tag!" << endl;
                lex.pushToken(token);