]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inset.C
Final touch 'inset display()'; fix 'is a bit silly' bug
[lyx.git] / src / insets / inset.C
index 07fe683d1e731d0ec785d71378e9bed3191a12ef..f28c9d6b8d1645018a60af6a8b62f236d42803cd 100644 (file)
@@ -8,29 +8,21 @@
  * \author Lars Gullik Bjønnes
  * \author Matthias Ettrich
  *
- * Full author contact details are available in file CREDITS
+ * Full author contact details are available in file CREDITS.
  */
 
 #include <config.h>
 
 #include "inset.h"
+#include "updatableinset.h"
+
 #include "BufferView.h"
-#include "funcrequest.h"
 #include "gettext.h"
-#include "lyxfont.h"
-#include "lyxtext.h"
-#include "dimension.h"
-#include "metricsinfo.h"
-
-#include "insets/updatableinset.h"
-
-#include "frontends/Painter.h"
-#include "frontends/mouse_state.h"
+#include "LColor.h"
 
-#include "support/lstrings.h"
 
+using std::string;
 
-#include "debug.h"
 
 // Initialization of the counter for the inset id's,
 unsigned int InsetOld::inset_id = 0;
@@ -38,17 +30,17 @@ unsigned int InsetOld::inset_id = 0;
 InsetOld::InsetOld()
        : InsetBase(),
        top_x(0), top_baseline(0), scx(0),
-       id_(inset_id++), owner_(0), par_owner_(0),
+       id_(inset_id++), owner_(0),
        background_color_(LColor::inherit)
 {}
 
 
 InsetOld::InsetOld(InsetOld const & in)
        : InsetBase(),
-       top_x(0), top_baseline(0), scx(0), id_(in.id_), owner_(0),
+       top_x(0), top_baseline(0), scx(0),
+       id_(in.id_), owner_(0),
        name_(in.name_), background_color_(in.background_color_)
-{
-}
+{}
 
 
 bool InsetOld::directWrite() const
@@ -96,13 +88,13 @@ LyXText * InsetOld::getLyXText(BufferView const * bv, bool /*recursive*/) const
 }
 
 
-void InsetOld::setBackgroundColor(LColor::color color)
+void InsetOld::setBackgroundColor(LColor_color color)
 {
        background_color_ = color;
 }
 
 
-LColor::color InsetOld::backgroundColor() const
+LColor_color InsetOld::backgroundColor() const
 {
        if (background_color_ == LColor::inherit) {
                if (owner())
@@ -110,7 +102,7 @@ LColor::color InsetOld::backgroundColor() const
                else
                        return LColor::background;
        } else
-               return background_color_;
+               return LColor::color(background_color_);
 }
 
 
@@ -159,3 +151,27 @@ int InsetOld::width() const
 {
        return dim_.wid;
 }
+
+
+bool InsetOld::insetAllowed(InsetOld * in) const
+{
+       return insetAllowed(in->lyxCode());
+}
+
+
+bool InsetOld::checkInsertChar(LyXFont &)
+{
+       return false;
+}
+
+
+bool isEditableInset(InsetOld const * i)
+{
+       return i && i->editable();
+}
+
+
+bool isHighlyEditableInset(InsetOld const * i)
+{
+       return i && i->editable() == InsetOld::HIGHLY_EDITABLE;
+}