2001-06-25 00:06:33 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
#ifndef MATH_SCRIPTINSET_H
|
|
|
|
|
#define MATH_SCRIPTINSET_H
|
|
|
|
|
|
2001-07-26 06:46:50 +00:00
|
|
|
|
#include "math_inset.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma interface
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/** Inset for super- and subscripts
|
|
|
|
|
\author Andr<EFBFBD> P<EFBFBD>nitz
|
|
|
|
|
*/
|
|
|
|
|
|
2001-07-26 06:46:50 +00:00
|
|
|
|
|
|
|
|
|
class MathScriptInset : public MathInset {
|
2001-06-25 00:06:33 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
2001-07-26 06:46:50 +00:00
|
|
|
|
MathScriptInset();
|
|
|
|
|
///
|
|
|
|
|
MathScriptInset(bool up, bool down, MathInset * = 0);
|
|
|
|
|
///
|
|
|
|
|
MathScriptInset(MathScriptInset const &);
|
|
|
|
|
///
|
|
|
|
|
~MathScriptInset();
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-06-28 10:25:20 +00:00
|
|
|
|
MathInset * clone() const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
///
|
2001-07-26 06:46:50 +00:00
|
|
|
|
void Write(std::ostream &, bool fragile) const;
|
|
|
|
|
///
|
2001-06-25 00:06:33 +00:00
|
|
|
|
void WriteNormal(std::ostream &) const;
|
2001-07-26 06:46:50 +00:00
|
|
|
|
///
|
|
|
|
|
void Metrics(MathStyles st);
|
|
|
|
|
///
|
|
|
|
|
void draw(Painter &, int x, int baseline);
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
bool idxUp(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxDown(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxLeft(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxRight(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxFirst(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxFirstUp(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxFirstDown(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxLast(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxLastUp(int & idx, int & pos) const;
|
|
|
|
|
///
|
|
|
|
|
bool idxLastDown(int & idx, int & pos) const;
|
2001-06-27 14:10:35 +00:00
|
|
|
|
///
|
2001-07-09 16:59:57 +00:00
|
|
|
|
void idxDelete(int & idx, bool & popit, bool & deleteit);
|
2001-07-26 06:46:50 +00:00
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
bool up() const;
|
|
|
|
|
///
|
|
|
|
|
bool down() const;
|
|
|
|
|
///
|
|
|
|
|
void up(bool);
|
|
|
|
|
///
|
|
|
|
|
void down(bool);
|
|
|
|
|
///
|
|
|
|
|
void limits(int);
|
|
|
|
|
///
|
|
|
|
|
int limits() const;
|
|
|
|
|
///
|
|
|
|
|
bool isActive() const { return false; }
|
|
|
|
|
/// Identifies ScriptInsets
|
|
|
|
|
bool isScriptInset() const { return true; }
|
|
|
|
|
///
|
|
|
|
|
int xoffset() const { return dxx_; }
|
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
bool hasLimits() const;
|
|
|
|
|
///
|
|
|
|
|
bool up_;
|
|
|
|
|
///
|
|
|
|
|
bool down_;
|
|
|
|
|
///
|
|
|
|
|
string ssym_;
|
|
|
|
|
/// 1: \limits, -1: \nolimits, 0: use default
|
|
|
|
|
int limits_;
|
|
|
|
|
/// x offset for drawing the superscript
|
|
|
|
|
int dx0_;
|
|
|
|
|
/// x offset for drawing the subscript
|
|
|
|
|
int dx1_;
|
|
|
|
|
/// x offset for drawing the inner symbol
|
|
|
|
|
int dxx_;
|
|
|
|
|
///
|
|
|
|
|
int dy0_;
|
|
|
|
|
///
|
|
|
|
|
int dy1_;
|
|
|
|
|
///
|
|
|
|
|
MathInset * symbol_;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|