2001-06-25 00:06:33 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
|
|
|
|
#ifndef MATHEDXARRAY_H
|
|
|
|
#define MATHEDXARRAY_H
|
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include "array.h"
|
2001-08-09 09:19:18 +00:00
|
|
|
#include "math_defs.h"
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class Painter;
|
|
|
|
|
|
|
|
class MathXArray
|
|
|
|
{
|
|
|
|
public:
|
2001-09-14 14:05:57 +00:00
|
|
|
///
|
|
|
|
typedef MathArray::size_type size_type;
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
|
|
|
MathXArray();
|
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
void metrics(MathStyles st) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
void draw(Painter & pain, int x, int y) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
int xo() const { return xo_; }
|
|
|
|
///
|
|
|
|
int yo() const { return yo_; }
|
|
|
|
///
|
2001-10-10 13:20:51 +00:00
|
|
|
int pos2x(size_type pos, bool inner) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-09-14 14:05:57 +00:00
|
|
|
size_type x2pos(int pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-09-14 14:05:57 +00:00
|
|
|
int width(size_type pos) const;
|
2001-10-10 13:20:51 +00:00
|
|
|
///
|
|
|
|
int innerwidth(size_type pos) const;
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
///
|
|
|
|
int ascent() const { return ascent_; }
|
|
|
|
///
|
|
|
|
int descent() const { return descent_; }
|
|
|
|
///
|
|
|
|
int height() const { return ascent_ + descent_; }
|
|
|
|
///
|
|
|
|
int width() const { return width_; }
|
|
|
|
///
|
|
|
|
MathStyles style() const { return style_; }
|
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
MathArray data_;
|
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
mutable int width_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
mutable int ascent_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
mutable int descent_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
mutable int xo_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
mutable int yo_;
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
2001-08-06 17:20:26 +00:00
|
|
|
mutable MathStyles style_;
|
2001-06-25 00:06:33 +00:00
|
|
|
};
|
|
|
|
|
2001-07-04 17:17:32 +00:00
|
|
|
std::ostream & operator<<(std::ostream & os, MathXArray const & ar);
|
2001-06-25 00:06:33 +00:00
|
|
|
|
|
|
|
#endif
|