2001-06-25 00:06:33 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
|
|
|
|
#ifndef MATHEDXARRAY_H
|
|
|
|
#define MATHEDXARRAY_H
|
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include "array.h"
|
2001-10-19 17:46:13 +00:00
|
|
|
#include "math_metricsinfo.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
|
|
|
///
|
2001-10-12 12:02:49 +00:00
|
|
|
typedef MathArray::size_type size_type;
|
|
|
|
///
|
|
|
|
typedef MathArray::const_iterator const_iterator;
|
2001-09-14 14:05:57 +00:00
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
|
|
|
MathXArray();
|
|
|
|
///
|
2001-10-19 11:25:48 +00:00
|
|
|
void metrics(MathMetricsInfo const & 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-12 12:02:49 +00:00
|
|
|
int pos2x(size_type pos) 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
|
|
|
|
|
|
|
///
|
|
|
|
int ascent() const { return ascent_; }
|
|
|
|
///
|
|
|
|
int descent() const { return descent_; }
|
|
|
|
///
|
|
|
|
int height() const { return ascent_ + descent_; }
|
|
|
|
///
|
|
|
|
int width() const { return width_; }
|
|
|
|
|
2001-10-12 12:02:49 +00:00
|
|
|
///
|
|
|
|
const_iterator begin() const { return data_.begin(); }
|
|
|
|
///
|
|
|
|
const_iterator end() const { return data_.end(); }
|
|
|
|
|
|
|
|
public:
|
2001-06-25 00:06:33 +00:00
|
|
|
///
|
|
|
|
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-10-19 17:46:13 +00:00
|
|
|
mutable MathMetricsInfo size_;
|
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
|