]> git.lyx.org Git - lyx.git/blobdiff - src/insets/inset.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / inset.C
index 7a2293118edb77234a05c505e82c0b30b03ac274..5f0b633794979a5e7b0c6f9fb2c615067bc68579 100644 (file)
-/* This file is part of
- * ====================================================== 
- * 
- *           LyX, The Document Processor
- *      
- *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-1999 The LyX Team.
+/**
+ * \file inset.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ====================================================== */
+ * \author Alejandro Aguilar Sierra
+ * \author Jürgen Vigna
+ * \author Lars Gullik Bjønnes
+ * \author Matthias Ettrich
+ *
+ * Full author contact details are available in file CREDITS.
+ */
 
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation "lyxinset.h"
-#endif
+#include "inset.h"
 
-#include "lyxinset.h"
+#include "BufferView.h"
 #include "debug.h"
-#include "support/lstrings.h"
+#include "gettext.h"
+#include "lyxtext.h"
+#include "LColor.h"
+#include "metricsinfo.h"
+#include "coordcache.h"
 
-/* Insets default methods */
 
-bool Inset::Deletable() const
-{
-  return true;
-}
+namespace lyx {
 
+using std::string;
 
-bool Inset::DirectWrite() const
-{
-  return false;
-}
 
+InsetOld::InsetOld()
+       : //background_color_(LColor::inherit)
+         background_color_(LColor::background)
+{}
 
-unsigned char Inset::Editable() const
-{
-  return 0;
-}
 
-
-void Inset::Validate(LaTeXFeatures &) const
-{
-}
+InsetOld::InsetOld(InsetOld const & in)
+       : InsetBase(in), name_(in.name_),
+         background_color_(in.background_color_)
+{}
 
 
-bool Inset::AutoDelete() const
+void InsetOld::setBackgroundColor(LColor_color color)
 {
-  return false;
+       background_color_ = color;
 }
 
 
-void Inset::Edit(int, int)
+LColor_color InsetOld::backgroundColor() const
 {
+       return LColor::color(background_color_);
 }
 
 
-LyXFont Inset::ConvertFont(LyXFont font)
+int InsetOld::ascent() const
 {
-  return font;
+       return dim_.asc;
 }
 
 
- /* some stuff for inset locking */
-
-void UpdatableInset::InsetButtonPress(int x, int y, int button)
+int InsetOld::descent() const
 {
-       lyxerr.debug() << "Inset Button Press x=" << x
-                      << ", y=" << y << ", button=" << button << endl;
+       return dim_.des;
 }
 
 
-void UpdatableInset::InsetButtonRelease(int x, int y, int button)
+int InsetOld::width() const
 {
-       lyxerr.debug() << "Inset Button Release x=" << x
-                      << ", y=" << y << ", button=" << button << endl;
+       return dim_.wid;
 }
 
 
-void UpdatableInset::InsetKeyPress(XKeyEvent *)
+void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const
 {
-       lyxerr.debug() << "Inset Keypress" << endl;
+       //lyxerr << "InsetOld:: position cache to " << x << " " << y << std::endl;
+       pi.base.bv->coordCache().insets().add(this, x, y);
 }
 
 
-void UpdatableInset::InsetMotionNotify(int x, int y, int state)
-{
-       lyxerr.debug() << "Inset Motion Notify x=" << x
-                      << ", y=" << y << ", state=" << state << endl;
-}
-
-
-void UpdatableInset::InsetUnlock()
-{
-       lyxerr.debug() << "Inset Unlock" << endl;
-}
-
-
-// An updatable inset is highly editable by definition
-unsigned char UpdatableInset::Editable() const
-{
-       return 2; // and what does "2" siginify? (Lgb)
-}
-
-
-void UpdatableInset::ToggleInsetCursor()
-{
-}
+} // namespace lyx