#include "debug.h"
#include "FloatList.h"
#include "FuncRequest.h"
-#include "LColor.h"
+#include "Color.h"
#include "Lexer.h"
#include "LyX.h"
#include "Paragraph.h"
#include "insets/InsetCaption.h"
#include "insets/InsetCitation.h"
#include "insets/InsetCharStyle.h"
-#include "insets/InsetEnv.h"
+#include "insets/InsetEnvironment.h"
#include "insets/InsetERT.h"
+#include "insets/InsetListings.h"
#include "insets/InsetExternal.h"
#include "insets/InsetFloat.h"
#include "insets/InsetFloatList.h"
#include "mathed/MathMacroTemplate.h"
#include "mathed/InsetMathHull.h"
-#include "frontends/Alert.h"
+#include "frontends/alert.h"
#include "support/lstrings.h"
#include "support/ExceptionMessage.h"
using std::string;
-InsetBase * createInset(BufferView * bv, FuncRequest const & cmd)
+Inset * createInset(BufferView * bv, FuncRequest const & cmd)
{
BufferParams const & params = bv->buffer()->params();
case LFUN_CHARSTYLE_INSERT: {
string s = cmd.getArg(0);
- LyXTextClass tclass = params.getLyXTextClass();
+ TextClass tclass = params.getTextClass();
CharStyles::iterator found_cs = tclass.charstyle(s);
if (found_cs != tclass.charstyles().end())
return new InsetCharStyle(params, found_cs);
case LFUN_ERT_INSERT:
return new InsetERT(params);
+ case LFUN_LISTING_INSERT:
+ return new InsetListings(params);
+
case LFUN_FOOTNOTE_INSERT:
return new InsetFoot(params);
case LFUN_FLOAT_INSERT: {
// check if the float type exists
string const argument = to_utf8(cmd.argument());
- if (params.getLyXTextClass().floats().typeExist(argument))
+ if (params.getTextClass().floats().typeExist(argument))
return new InsetFloat(params, argument);
lyxerr << "Non-existent float type: " << argument << endl;
return 0;
case LFUN_FLOAT_WIDE_INSERT: {
// check if the float type exists
string const argument = to_utf8(cmd.argument());
- if (params.getLyXTextClass().floats().typeExist(argument)) {
+ if (params.getTextClass().floats().typeExist(argument)) {
auto_ptr<InsetFloat> p(new InsetFloat(params, argument));
p->wide(true, params);
return p.release();
auto_ptr<InsetCaption> inset(new InsetCaption(params));
inset->setAutoBreakRows(true);
inset->setDrawFrame(true);
- inset->setFrameColor(LColor::captionframe);
+ inset->setFrameColor(Color::captionframe);
return inset.release();
}
InsetERTMailer::string2params(to_utf8(cmd.argument()), st);
return new InsetERT(params, st);
+ } else if (name == "listings") {
+ InsetListingsParams par;
+ InsetListingsMailer::string2params(to_utf8(cmd.argument()), par);
+ return new InsetListings(params, par);
+
} else if (name == "external") {
Buffer const & buffer = *bv->buffer();
InsetExternalParams iep;
}
-InsetBase * readInset(Lexer & lex, Buffer const & buf)
+Inset * readInset(Lexer & lex, Buffer const & buf)
{
// consistency check
if (lex.getString() != "\\begin_inset") {
<< endl;
}
- auto_ptr<InsetBase> inset;
+ auto_ptr<Inset> inset;
- LyXTextClass tclass = buf.params().getLyXTextClass();
+ TextClass tclass = buf.params().getTextClass();
lex.next();
string tmptok = lex.getString();
inset.reset(new InsetEnvironment(buf.params(), lex.getString()));
} else if (tmptok == "ERT") {
inset.reset(new InsetERT(buf.params()));
+ } else if (tmptok == "listings") {
+ inset.reset(new InsetListings(buf.params()));
} else if (tmptok == "InsetSpace") {
inset.reset(new InsetSpace);
} else if (tmptok == "Tabular") {
#ifdef WITH_WARNINGS
#warning hack..
#endif
- if (inset->lyxCode() == InsetBase::MATHMACRO_CODE) {
+ if (inset->lyxCode() == Inset::MATHMACRO_CODE) {
MathMacroTemplate const * tmpl =
static_cast<MathMacroTemplate*>(inset.get());
MacroTable::globalMacros().insert