]> git.lyx.org Git - lyx.git/blobdiff - src/factory.C
remove mention of lyxrc from the splash
[lyx.git] / src / factory.C
index 490bd0dabb73f49ec74d7d56fdcfb6f74a28abe3..44eb7c70f17d51a852ec60a7d5351cd4d28c04f3 100644 (file)
@@ -38,8 +38,8 @@
 #include "insets/insetminipage.h"
 #include "insets/insetnote.h"
 #include "insets/insetoptarg.h"
-#include "insets/insetparent.h"
 #include "insets/insetref.h"
+#include "insets/insetspace.h"
 #include "insets/insettabular.h"
 #include "insets/insettext.h"
 #include "insets/insettoc.h"
@@ -157,10 +157,6 @@ Inset * createInset(FuncRequest const & cmd)
        case LFUN_TOC_INSERT:
                return new InsetTOC(InsetCommandParams("tableofcontents"));
 
-       case LFUN_PARENTINSERT:
-               return new InsetParent(
-                       InsetCommandParams("lyxparent", cmd.argument), *bv->buffer());
-
        case LFUN_ENVIRONMENT_INSERT:
                return new InsetEnvironment(params, cmd.argument);
 
@@ -203,15 +199,15 @@ Inset * createInset(FuncRequest const & cmd)
                        InsetExternal::Params iep;
                        InsetExternalMailer::string2params(cmd.argument, iep);
                        InsetExternal * inset = new InsetExternal;
-                       inset->setFromParams(iep);
+                       string const fpath = cmd.view()->buffer()->filePath();
+                       inset->setParams(iep, fpath);
                        return inset;
 
                } else if (name == "graphics") {
                        InsetGraphicsParams igp;
                        InsetGraphicsMailer::string2params(cmd.argument, igp);
                        InsetGraphics * inset = new InsetGraphics;
-                       string const fpath = cmd.view()->buffer()->filePath();
-                       inset->setParams(igp, fpath);
+                       inset->setParams(igp);
                        return inset;
 
                } else if (name == "include") {
@@ -245,6 +241,31 @@ Inset * createInset(FuncRequest const & cmd)
                        return new InsetUrl(icp);
                }
        }
+
+       case LFUN_SPACE_INSERT: {
+               string const name = cmd.argument;
+               if (name == "normal")
+                       return new InsetSpace(InsetSpace::NORMAL);
+               else if (name == "protected")
+                       return new InsetSpace(InsetSpace::PROTECTED);
+               else if (name == "thin")
+                       return new InsetSpace(InsetSpace::THIN);
+               else if (name == "quad")
+                       return new InsetSpace(InsetSpace::QUAD);
+               else if (name == "qquad")
+                       return new InsetSpace(InsetSpace::QQUAD);
+               else if (name == "enspace")
+                       return new InsetSpace(InsetSpace::ENSPACE);
+               else if (name == "enskip")
+                       return new InsetSpace(InsetSpace::ENSKIP);
+               else if (name == "negthinspace")
+                       return new InsetSpace(InsetSpace::NEGTHIN);
+               else if (name.empty())
+                       lyxerr << "LyX function 'space' needs an argument." << endl;
+               else
+                       lyxerr << "Wrong argument for LyX function 'space'." << endl;
+       }
+
        break;
 
        default:
@@ -282,7 +303,7 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
                } else if (cmdName == "bibitem") {
                        lex.printError("Wrong place for bibitem");
                        inset = new InsetBibitem(inscmd);
-               } else if (cmdName == "BibTeX") {
+               } else if (cmdName == "bibtex") {
                        inset = new InsetBibtex(inscmd);
                } else if (cmdName == "index") {
                        inset = new InsetIndex(inscmd);
@@ -294,6 +315,7 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
                           || cmdName == "htmlurl") {
                        inset = new InsetUrl(inscmd);
                } else if (cmdName == "ref"
+                          || cmdName == "eqref"
                           || cmdName == "pageref"
                           || cmdName == "vref"
                           || cmdName == "vpageref"
@@ -312,8 +334,6 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
                        inset = new InsetFloatList("table");
                } else if (cmdName == "printindex") {
                        inset = new InsetPrintIndex(inscmd);
-               } else if (cmdName == "lyxparent") {
-                       inset = new InsetParent(inscmd, buf);
                }
        } else {
                if (tmptok == "Quotes") {
@@ -336,6 +356,8 @@ Inset * readInset(LyXLex & lex, Buffer const & buf)
                        inset = new InsetEnvironment(buf.params, lex.getString());
                } else if (tmptok == "ERT") {
                        inset = new InsetERT(buf.params);
+               } else if (tmptok == "InsetSpace") {
+                       inset = new InsetSpace;
                } else if (tmptok == "Tabular") {
                        inset = new InsetTabular(buf);
                } else if (tmptok == "Text") {