]> git.lyx.org Git - lyx.git/blobdiff - src/CmdDef.h
Only create a new view for lyxfiles-open if no view is open (#12894)
[lyx.git] / src / CmdDef.h
index 2b15f5565b9f5f37ba1f4a9bdfb187a9b87d683f..946730e64e44ffee41b8325c9395fde303369469 100644 (file)
 #ifndef CMDDEF_H
 #define CMDDEF_H
 
-#include "FuncRequest.h"
-
-#include "support/docstream.h"
-
-#include <boost/shared_ptr.hpp>
-
-#include <vector>
-#include <deque>
+#include "support/strfwd.h"
 
+#include <map>
+#include <set>
 
 namespace lyx {
 
+class FuncRequest;
+
 /// Creates command definitions
 class CmdDef {
 private:
-       /// information for a definition
-       struct CmdDefInfo {
-               CmdDefInfo(FuncRequest const & f): func(f), locked(false) {}
-               /// the expanded FuncRequest
-               FuncRequest func;
-               /// to avoid recursive calls
-               bool locked;
-       };
-
-
        /// type for map between a macro name and its info
-       typedef std::map<std::string, boost::shared_ptr<CmdDefInfo> > CmdDefMap;
-
+       typedef std::map<std::string, FuncRequest> CmdDefMap;
+       /// type for a set containing all locked definitions
+       typedef std::set<std::string> LockSet;
 public:
 
        /// Parse a def file
@@ -71,11 +59,13 @@ private:
         * Add a new command definition.
         * @param name internal recursion level
         */
-       newCmdDefResult newCmdDef(std::string const & name, 
-               std::string const & def);
+       newCmdDefResult newCmdDef(std::string const & name,
+                                     std::string const & def);
 
        ///
        CmdDefMap cmdDefMap;
+       ///
+       LockSet lockSet;
 };
 
 /// Implementation is in LyX.cpp