2001-02-16 09:25:43 +00:00
|
|
|
// -*- C++ -*-
|
2001-02-13 13:28:32 +00:00
|
|
|
#ifndef MATH_FRACINSET_H
|
|
|
|
#define MATH_FRACINSET_H
|
|
|
|
|
|
|
|
#include "math_parinset.h"
|
|
|
|
|
2001-02-26 12:53:35 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-02-16 09:25:43 +00:00
|
|
|
/** Fraction like objects (frac, stackrel, binom)
|
|
|
|
\author Alejandro Aguilar Sierra
|
|
|
|
*/
|
2001-02-28 11:56:36 +00:00
|
|
|
class MathFracInset : public MathParInset {
|
2001-02-13 13:28:32 +00:00
|
|
|
public:
|
|
|
|
///
|
|
|
|
MathFracInset(short ot = LM_OT_FRAC);
|
|
|
|
///
|
|
|
|
MathedInset * Clone();
|
|
|
|
///
|
|
|
|
void draw(Painter &, int x, int baseline);
|
|
|
|
///
|
|
|
|
void Write(std::ostream &, bool fragile);
|
|
|
|
///
|
2001-04-25 15:43:57 +00:00
|
|
|
void WriteNormal(std::ostream &);
|
|
|
|
///
|
2001-02-13 13:28:32 +00:00
|
|
|
void Metrics();
|
|
|
|
|
2001-02-20 16:00:22 +00:00
|
|
|
/** This does the same that SetData(MathedArray const &) but for both
|
2001-02-13 13:28:32 +00:00
|
|
|
numerator and denominator at once.
|
|
|
|
*/
|
2001-02-20 16:00:22 +00:00
|
|
|
void SetData(MathedArray const &, MathedArray const &);
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-02-20 16:00:22 +00:00
|
|
|
void setData(MathedArray const &);
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
|
|
|
void GetXY(int & x, int & y) const;
|
|
|
|
///
|
|
|
|
void SetFocus(int, int);
|
|
|
|
///
|
|
|
|
bool Inside(int, int);
|
|
|
|
///
|
2001-02-20 16:00:22 +00:00
|
|
|
MathedArray & GetData();
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-02-28 17:21:16 +00:00
|
|
|
MathedArray const & GetData() const;
|
|
|
|
///
|
2001-02-13 13:28:32 +00:00
|
|
|
bool setArgumentIdx(int i); // was bool Up/down(void);
|
|
|
|
///
|
2001-02-16 09:25:43 +00:00
|
|
|
int getArgumentIdx() const;
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-02-16 09:25:43 +00:00
|
|
|
int getMaxArgumentIdx() const;
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
|
|
|
void SetStyle(short);
|
2001-02-16 09:25:43 +00:00
|
|
|
private:
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-02-16 09:25:43 +00:00
|
|
|
int idx_;
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-02-28 11:56:36 +00:00
|
|
|
MathParInset den_;
|
2001-02-13 13:28:32 +00:00
|
|
|
///
|
2001-02-16 09:25:43 +00:00
|
|
|
int w0_;
|
|
|
|
///
|
|
|
|
int w1_;
|
|
|
|
///
|
|
|
|
int des0_;
|
|
|
|
///
|
|
|
|
int dh_;
|
2001-02-13 13:28:32 +00:00
|
|
|
};
|
2001-02-16 09:25:43 +00:00
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
#endif
|