]> git.lyx.org Git - lyx.git/blobdiff - src/insets/Inset.cpp
Change cursor shape for clickable math insets
[lyx.git] / src / insets / Inset.cpp
index a5077edda35ad269f714ec3e623a01f308de1618..7d05c8ef1fa3097e8ae9cc8af773232e894ad969 100644 (file)
@@ -27,6 +27,7 @@
 #include "DispatchResult.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
+#include "InsetLayout.h"
 #include "MetricsInfo.h"
 #include "output_xhtml.h"
 #include "xml.h"
@@ -236,6 +237,20 @@ docstring Inset::layoutName() const
 }
 
 
+InsetLayout const & Inset::getLayout() const
+{
+       if (!buffer_)
+               return DocumentClass::plainInsetLayout();
+       return buffer().params().documentClass().insetLayout(layoutName());
+}
+
+
+bool Inset::isPassThru() const
+{
+       return getLayout().isPassThru();
+}
+
+
 bool Inset::isFreeSpacing() const
 {
        return getLayout().isFreeSpacing();
@@ -260,6 +275,18 @@ bool Inset::isInToc() const
 }
 
 
+FontInfo Inset::getFont() const
+{
+       return getLayout().font();
+}
+
+
+FontInfo Inset::getLabelfont() const
+{
+       return getLayout().labelfont();
+}
+
+
 docstring Inset::toolTip(BufferView const &, int, int) const
 {
        return docstring();
@@ -316,7 +343,7 @@ docstring insetDisplayName(InsetCode c)
 
 void Inset::dispatch(Cursor & cur, FuncRequest & cmd)
 {
-       if (buffer_ == 0) {
+       if (buffer_ == nullptr) {
                lyxerr << "Unassigned buffer_ member in Inset::dispatch()" << std::endl;
                lyxerr << "LyX Code: " << lyxCode() << " name: "
                       << insetName(lyxCode()) << std::endl;
@@ -579,14 +606,6 @@ bool Inset::covers(BufferView const & bv, int x, int y) const
 }
 
 
-InsetLayout const & Inset::getLayout() const
-{
-       if (!buffer_)
-               return DocumentClass::plainInsetLayout();
-       return buffer().params().documentClass().insetLayout(layoutName());
-}
-
-
 bool Inset::undefined() const
 {
        docstring const & n = getLayout().name();
@@ -625,8 +644,8 @@ Buffer const * Inset::updateFrontend() const
        // are in the CutAndPaste stack. See InsetGraphics, RenderGraphics and
        // RenderPreview.
        if (!buffer_)
-               return 0;
-       return theApp() ? theApp()->updateInset(this) : 0;
+               return nullptr;
+       return theApp() ? theApp()->updateInset(this) : nullptr;
 }