]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetNote.cpp
InsetListings: change the interface of diaplay function and allow AlignLeft. Applied...
[lyx.git] / src / insets / InsetNote.cpp
index eec5f635f0ee7eb686e84fe4a2ebc91a26de4d3f..f99d51d02ad55413316cd3d0057e1d4c5baa5f0e 100644 (file)
@@ -14,8 +14,9 @@
 
 #include "InsetNote.h"
 
+#include "Buffer.h"
 #include "BufferView.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "debug.h"
 #include "DispatchResult.h"
 #include "Exporter.h"
@@ -23,7 +24,7 @@
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
 #include "Lexer.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
@@ -112,7 +113,6 @@ void InsetNoteParams::read(Lexer & lex)
 
 void InsetNote::init()
 {
-       setInsetName(from_ascii("Note"));
        setButtonLabel();
 }
 
@@ -138,9 +138,9 @@ InsetNote::~InsetNote()
 }
 
 
-auto_ptr<InsetBase> InsetNote::doClone() const
+auto_ptr<Inset> InsetNote::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetNote(*this));
+       return auto_ptr<Inset>(new InsetNote(*this));
 }
 
 
@@ -170,30 +170,30 @@ void InsetNote::setButtonLabel()
        docstring const label = notetranslator_loc().find(params_.type);
        setLabel(label);
 
-       LyXFont font(LyXFont::ALL_SANE);
+       Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
 
        switch (params_.type) {
        case InsetNoteParams::Note:
-               font.setColor(LColor::note);
-               setBackgroundColor(LColor::notebg);
+               font.setColor(Color::note);
+               setBackgroundColor(Color::notebg);
                break;
        case InsetNoteParams::Comment:
-               font.setColor(LColor::comment);
-               setBackgroundColor(LColor::commentbg);
+               font.setColor(Color::comment);
+               setBackgroundColor(Color::commentbg);
                break;
        case InsetNoteParams::Greyedout:
-               font.setColor(LColor::greyedout);
-               setBackgroundColor(LColor::greyedoutbg);
+               font.setColor(Color::greyedout);
+               setBackgroundColor(Color::greyedoutbg);
                break;
        case InsetNoteParams::Framed:
-               font.setColor(LColor::greyedout);
-               setBackgroundColor(LColor::greyedoutbg);
+               font.setColor(Color::greyedout);
+               setBackgroundColor(Color::greyedoutbg);
                break;
        case InsetNoteParams::Shaded:
-               font.setColor(LColor::greyedout);
-               setBackgroundColor(LColor::shadedbg);
+               font.setColor(Color::greyedout);
+               setBackgroundColor(Color::shadedbg);
                break;
        }
        setLabelFont(font);
@@ -207,7 +207,7 @@ bool InsetNote::showInsetDialog(BufferView * bv) const
 }
 
 
-void InsetNote::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
 
@@ -234,7 +234,7 @@ void InsetNote::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetNote::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action) {
@@ -308,7 +308,7 @@ int InsetNote::plaintext(Buffer const & buf, odocstream & os,
                // Ignore files that are exported inside a comment
                runparams.exportdata.reset(new ExportData);
        }
-       os << '[' << _("note") << ":\n";
+       os << '[' << buf.B_("note") << ":\n";
        InsetText::plaintext(buf, os, runparams);
        os << "\n]";
 
@@ -400,7 +400,7 @@ void InsetNoteMailer::string2params(string const & in,
                return print_mailer_error("InsetNoteMailer", 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 != "Note")