]> 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 4e09297a81c10b6e3d47b9a5d565499d69a18d09..5f0b633794979a5e7b0c6f9fb2c615067bc68579 100644 (file)
-/* This file is part of
- * ======================================================
- * 
- *           LyX, The Document Processor
- *      
- *         Copyright (C) 1995 Matthias Ettrich
- *          Copyright (C) 1995-1998 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 "error.h"
+#include "BufferView.h"
+#include "debug.h"
+#include "gettext.h"
+#include "lyxtext.h"
+#include "LColor.h"
+#include "metricsinfo.h"
+#include "coordcache.h"
 
-//     $Id: inset.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $     
 
-#if !defined(lint) && !defined(WITH_WARNINGS)
-static char vcid[] = "$Id: inset.C,v 1.1 1999/09/27 18:44:38 larsbj Exp $";
-#endif /* lint */
+namespace lyx {
 
-/* Insets default methods */
+using std::string;
 
-bool Inset::Deletable() const
-{
-  return true;
-}
 
+InsetOld::InsetOld()
+       : //background_color_(LColor::inherit)
+         background_color_(LColor::background)
+{}
 
-bool Inset::DirectWrite() const
-{
-  return false;
-}
 
+InsetOld::InsetOld(InsetOld const & in)
+       : InsetBase(in), name_(in.name_),
+         background_color_(in.background_color_)
+{}
 
-unsigned char Inset::Editable() const
-{
-  return 0;
-}
 
-void Inset::Validate(LaTeXFeatures &) const
+void InsetOld::setBackgroundColor(LColor_color color)
 {
-       // nothing by default
+       background_color_ = color;
 }
 
 
-
-bool Inset::AutoDelete() const
+LColor_color InsetOld::backgroundColor() const
 {
-  return false;
+       return LColor::color(background_color_);
 }
 
 
-void Inset::Edit(int, int)
+int InsetOld::ascent() const
 {
+       return dim_.asc;
 }
 
 
-LyXFont Inset::ConvertFont(LyXFont font)
-{
-  return font;
-}
-
-
-// Inset::Code Inset::LyxCode() const
-// {
-//   return Inset::NO_CODE;
-// }
-
- /* some stuff for inset locking */
-
-
-void UpdatableInset::InsetButtonPress(int x, int y, int button)
+int InsetOld::descent() const
 {
-       lyxerr.debug(LString("Inset Button Press x=")+ x +
-                     ", y=" + y + ", button=" + button);
+       return dim_.des;
 }
 
 
-void UpdatableInset::InsetButtonRelease(int x, int y, int button)
+int InsetOld::width() const
 {
-       lyxerr.debug(LString("Inset Button Release x=")+ x +
-                     ", y=" + y + ", button=" + button);
+       return dim_.wid;
 }
 
 
-void UpdatableInset::InsetKeyPress(XKeyEvent *)
+void InsetOld::setPosCache(PainterInfo const & pi, int x, int y) const
 {
-       lyxerr.debug("Inset Keypress");
+       //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(LString("Inset Motion Notify x=")+ x +
-                     ", y=" + y + ", state=" + state);
-}
-
-
-void UpdatableInset::InsetUnlock()
-{
-       lyxerr.debug("Inset Unlock", Error::ANY);
-}
-
-
-// An updatable inset is highly editable by definition
-unsigned char UpdatableInset::Editable() const
-{
-       return 2; // and what does "2" siginify? (Lgb)
-}
-
-
-void UpdatableInset::ToggleInsetCursor()
-{
-  // nothing
-}
+} // namespace lyx