]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.cpp
This should be the last of the commits refactoring the InsetLayout code.
[lyx.git] / src / insets / Inset.cpp
index 58e9aa1ce2b25016bf147371c068f01982e72369..fe5b1a7f26bbca89a724415f5765b22efca11391 100644 (file)
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
+#include "LyX.h" // quitting
+#include "MetricsInfo.h"
 #include "Text.h"
 #include "TextClass.h"
-#include "MetricsInfo.h"
-#include "MetricsInfo.h"
 
 #include "frontends/Painter.h"
 #include "frontends/Application.h"
 
 #include <map>
 
+using namespace std;
 
 namespace lyx {
 
-extern bool quitting;
-
 class InsetName {
 public:
-       InsetName(std::string const & n, InsetCode c) : name(n), code(c) {}
-       std::string name;
+       InsetName(string const & n, InsetCode c) : name(n), code(c) {}
+       string name;
        InsetCode code;
 };
 
 
-typedef std::map<std::string, InsetCode> TranslatorMap;
+typedef map<string, InsetCode> TranslatorMap;
 
 
 static TranslatorMap const build_translator()
@@ -108,7 +107,7 @@ static TranslatorMap const build_translator()
        size_t const insetnames_size =
                sizeof(insetnames) / sizeof(insetnames[0]);
 
-       std::map<std::string, InsetCode> data;
+       map<string, InsetCode> data;
        for (size_t i = 0; i != insetnames_size; ++i) {
                InsetName const & var = insetnames[i];
                data[var.name] = var.code;
@@ -124,13 +123,25 @@ docstring Inset::name() const
 }
 
 
+docstring Inset::toolTip(BufferView const &, int, int) const
+{
+       return docstring();
+}
+
+
+docstring Inset::contextMenu(BufferView const &, int, int) const
+{
+       return docstring();
+}
+
+
 Dimension const Inset::dimension(BufferView const & bv) const
 {
        return bv.coordCache().getInsets().dim(this);
 }
 
 
-InsetCode insetCode(std::string const & name)
+InsetCode insetCode(string const & name)
 {
        static TranslatorMap const translator = build_translator();
 
@@ -139,7 +150,7 @@ InsetCode insetCode(std::string const & name)
 }
 
 
-std::string insetName(InsetCode c) 
+string insetName(InsetCode c) 
 {
        static TranslatorMap const translator = build_translator();
 
@@ -149,7 +160,7 @@ std::string insetName(InsetCode c)
                if (it->second == c)
                        return it->first;
        }
-       return std::string();
+       return string();
 }
 
 
@@ -200,7 +211,7 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd,
 }
 
 
-void Inset::edit(Cursor &, bool)
+void Inset::edit(Cursor &, bool, EntryDirection)
 {
        LYXERR(Debug::INSETS, "edit left/right");
 }
@@ -324,7 +335,7 @@ void Inset::drawMarkers2(PainterInfo & pi, int x, int y) const
 }
 
 
-bool Inset::editing(BufferView * bv) const
+bool Inset::editing(BufferView const * bv) const
 {
        return bv->cursor().isInside(this);
 }