2001-09-11 10:58:17 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
|
|
|
|
#ifndef MATH_ATOM_H
|
|
|
|
#define MATH_ATOM_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2002-03-21 17:42:56 +00:00
|
|
|
/**
|
2001-09-11 10:58:17 +00:00
|
|
|
The 'atom' is the major blob in math typesetting. And 'atom' consists
|
|
|
|
of a nucleus, an optional superscript, and an optional subscript.
|
|
|
|
|
|
|
|
Exactly where the subscript and superscript are drawn depends on the
|
2002-03-21 17:42:56 +00:00
|
|
|
size, and type, of the nucleus they are attached to.
|
2001-09-11 10:58:17 +00:00
|
|
|
|
|
|
|
Jules
|
2001-10-23 09:03:07 +00:00
|
|
|
|
|
|
|
--
|
|
|
|
|
|
|
|
Ok: Implementing it thusly is not feasible since cursor movement gets
|
|
|
|
hackish. We use MathAtom only as a wrapper around MathInset * with value
|
|
|
|
semantics.
|
|
|
|
|
2001-12-11 07:38:02 +00:00
|
|
|
The MathAtom owns the MathInset * and is responsible for proper cloning and
|
|
|
|
destruction. Every MathInset * should be put into a MathAtom after its
|
|
|
|
creation as soon as possible.
|
|
|
|
|
2001-10-23 09:03:07 +00:00
|
|
|
Andre'
|
|
|
|
|
2001-09-11 10:58:17 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
class MathInset;
|
|
|
|
|
|
|
|
class MathAtom {
|
2002-03-21 17:42:56 +00:00
|
|
|
public:
|
2001-12-11 07:38:02 +00:00
|
|
|
/// default constructor, object is useless, but we need it to put it into
|
|
|
|
// std::containers
|
2001-09-11 10:58:17 +00:00
|
|
|
MathAtom();
|
2001-12-11 07:38:02 +00:00
|
|
|
/// the "real constructor"
|
2001-09-11 10:58:17 +00:00
|
|
|
explicit MathAtom(MathInset * p);
|
2001-12-11 07:38:02 +00:00
|
|
|
/// copy constructor, invokes nucleus_->clone()
|
|
|
|
MathAtom(MathAtom const &);
|
|
|
|
/// we really need to clean up
|
2002-03-21 17:42:56 +00:00
|
|
|
~MathAtom();
|
2001-12-11 07:38:02 +00:00
|
|
|
/// assignment invokes nucleus_->clone()
|
2001-09-11 10:58:17 +00:00
|
|
|
void operator=(MathAtom const &);
|
2001-12-11 07:38:02 +00:00
|
|
|
/// change inset under the hood
|
2001-11-09 08:35:57 +00:00
|
|
|
void reset(MathInset * p);
|
2002-03-12 14:59:08 +00:00
|
|
|
/// access to the inset (checked with gprof)
|
|
|
|
MathInset * nucleus() const { return nucleus_; }
|
2001-12-11 07:38:02 +00:00
|
|
|
/// access to the inset
|
2002-03-12 14:59:08 +00:00
|
|
|
MathInset * operator->() const { return nucleus_; }
|
2001-09-11 10:58:17 +00:00
|
|
|
|
2001-10-12 12:02:49 +00:00
|
|
|
private:
|
2001-09-11 10:58:17 +00:00
|
|
|
///
|
|
|
|
MathInset * nucleus_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|