X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInset.cpp;h=fe5b1a7f26bbca89a724415f5765b22efca11391;hb=2c357c1d23b7b83839a9beb8225d4f1ae4f793b4;hp=873245089e889f97e32b998d617285829f0f5e4b;hpb=150cf11651ad92090a452bb9e6cb72d7eea886d5;p=lyx.git diff --git a/src/insets/Inset.cpp b/src/insets/Inset.cpp index 873245089e..fe5b1a7f26 100644 --- a/src/insets/Inset.cpp +++ b/src/insets/Inset.cpp @@ -21,40 +21,37 @@ #include "BufferView.h" #include "CoordCache.h" #include "Cursor.h" -#include "debug.h" #include "Dimension.h" #include "DispatchResult.h" #include "FuncRequest.h" #include "FuncStatus.h" -#include "gettext.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 "support/convert.h" - -#include +#include "support/debug.h" +#include "support/gettext.h" #include +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 TranslatorMap; +typedef map TranslatorMap; static TranslatorMap const build_translator() @@ -110,7 +107,7 @@ static TranslatorMap const build_translator() size_t const insetnames_size = sizeof(insetnames) / sizeof(insetnames[0]); - std::map data; + map data; for (size_t i = 0; i != insetnames_size; ++i) { InsetName const & var = insetnames[i]; data[var.name] = var.code; @@ -126,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(); @@ -141,7 +150,7 @@ InsetCode insetCode(std::string const & name) } -std::string insetName(InsetCode c) +string insetName(InsetCode c) { static TranslatorMap const translator = build_translator(); @@ -151,7 +160,7 @@ std::string insetName(InsetCode c) if (it->second == c) return it->first; } - return std::string(); + return string(); } @@ -202,15 +211,15 @@ bool Inset::getStatus(Cursor &, FuncRequest const & cmd, } -void Inset::edit(Cursor &, bool) +void Inset::edit(Cursor &, bool, EntryDirection) { - LYXERR(Debug::INSETS, BOOST_CURRENT_FUNCTION << ": edit left/right"); + LYXERR(Debug::INSETS, "edit left/right"); } Inset * Inset::editXY(Cursor &, int x, int y) { - LYXERR(Debug::INSETS, BOOST_CURRENT_FUNCTION << ": x=" << x << " y= " << y); + LYXERR(Debug::INSETS, "x: " << x << " y: " << y); return this; } @@ -218,9 +227,9 @@ Inset * Inset::editXY(Cursor &, int x, int y) Inset::idx_type Inset::index(row_type row, col_type col) const { if (row != 0) - LYXERR0(BOOST_CURRENT_FUNCTION << ": illegal row: " << row); + LYXERR0("illegal row: " << row); if (col != 0) - LYXERR0(BOOST_CURRENT_FUNCTION << ": illegal col: " << col); + LYXERR0("illegal col: " << col); return 0; } @@ -326,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); }