#include "Color.h"
#include "Lexer.h"
#include "LyX.h"
-#include "Paragraph.h"
#include "insets/InsetBibitem.h"
#include "insets/InsetBibtex.h"
#include "insets/InsetCharStyle.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 <sstream>
+using std::auto_ptr;
+using std::endl;
+using std::string;
+
namespace lyx {
using support::compare_ascii_no_case;
-using std::auto_ptr;
-using std::endl;
-using std::string;
-
Inset * createInset(BufferView * bv, FuncRequest const & cmd)
{
case LFUN_ERT_INSERT:
return new InsetERT(params);
+ case LFUN_LISTING_INSERT:
+ return new InsetListings(params);
+
case LFUN_FOOTNOTE_INSERT:
return new InsetFoot(params);
return new InsetTOC(InsetCommandParams("tableofcontents"));
case LFUN_ENVIRONMENT_INSERT:
- return new InsetEnvironment(params, to_utf8(cmd.argument()));
+ return new InsetEnvironment(params, cmd.argument());
#if 0
case LFUN_LIST_INSERT:
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;
inset.reset(new InsetInclude(p));
} else if (tmptok == "Environment") {
lex.next();
- inset.reset(new InsetEnvironment(buf.params(), lex.getString()));
+ inset.reset(new InsetEnvironment(buf.params(), lex.getDocString()));
} 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") {
inset->read(buf, lex);
-#ifdef WITH_WARNINGS
-#warning hack..
-#endif
+// FIXME: hack..
if (inset->lyxCode() == Inset::MATHMACRO_CODE) {
MathMacroTemplate const * tmpl =
static_cast<MathMacroTemplate*>(inset.get());