3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
8 * \author Lars Gullik Bjønnes
9 * \author Matthias Ettrich
11 * Full author contact details are available in file CREDITS.
17 #include "updatableinset.h"
19 #include "BufferView.h"
31 xo_(0), yo_(0), scx(0), owner_(0),
32 //background_color_(LColor::inherit)
33 background_color_(LColor::background)
37 InsetOld::InsetOld(InsetOld const & in)
39 xo_(0), yo_(0), scx(0), owner_(0), name_(in.name_),
40 background_color_(in.background_color_)
44 bool InsetOld::directWrite() const
50 InsetOld::EDITABLE InsetOld::editable() const
56 bool InsetOld::autoDelete() const
62 string const InsetOld::editMessage() const
64 return _("Opened inset");
68 void InsetOld::setBackgroundColor(LColor_color color)
70 background_color_ = color;
74 LColor_color InsetOld::backgroundColor() const
76 return LColor::color(background_color_);
80 bool InsetOld::forceDefaultParagraphs(InsetOld const * inset) const
83 return owner()->forceDefaultParagraphs(inset);
88 int InsetOld::ascent() const
94 int InsetOld::descent() const
100 int InsetOld::width() const
106 bool InsetOld::insetAllowed(InsetOld * in) const
108 return insetAllowed(in->lyxCode());
112 int InsetOld::scroll(bool recursive) const
114 if (!recursive || !owner_)
120 int InsetOld::getCell(int x, int y) const
122 for (int i = 0, n = numParagraphs(); i < n; ++i) {
123 LyXText * text = getText(i);
124 //lyxerr << "### text: " << text << " i: " << i
125 // << " xo: " << text->xo_ << "..." << text->xo_ + text->width
126 // << " yo: " << text->yo_
127 // << " yo: " << text->yo_ - text->ascent() << "..."
128 // << text->yo_ + text->descent()
131 && x <= text->xo_ + text->width
133 && y <= text->yo_ + text->height)
135 lyxerr << "### found text # " << i << std::endl;
143 bool isEditableInset(InsetOld const * i)
145 return i && i->editable();
149 bool isHighlyEditableInset(InsetOld const * i)
151 return i && i->editable() == InsetOld::HIGHLY_EDITABLE;