2001-12-10 10:09:00 +00:00
|
|
|
#ifndef MATH_POS_H
|
|
|
|
#define MATH_POS_H
|
|
|
|
|
2002-09-11 09:14:57 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-12-10 10:09:00 +00:00
|
|
|
#include <iosfwd>
|
2002-08-02 14:29:42 +00:00
|
|
|
#include "math_data.h"
|
2001-12-10 10:09:00 +00:00
|
|
|
|
|
|
|
|
2002-03-21 17:42:56 +00:00
|
|
|
/// Description of a position
|
2001-12-10 10:09:00 +00:00
|
|
|
class MathCursorPos {
|
|
|
|
public:
|
2002-03-21 17:42:56 +00:00
|
|
|
///
|
2001-12-10 10:09:00 +00:00
|
|
|
MathCursorPos();
|
2002-03-21 17:42:56 +00:00
|
|
|
///
|
2001-12-11 15:35:18 +00:00
|
|
|
explicit MathCursorPos(MathInset *);
|
2001-12-10 10:09:00 +00:00
|
|
|
|
|
|
|
/// returns cell corresponding to this position
|
|
|
|
MathArray & cell() const;
|
|
|
|
/// returns cell corresponding to this position
|
|
|
|
MathArray & cell(MathArray::idx_type idx) const;
|
2002-07-26 13:13:20 +00:00
|
|
|
/// gets screen position of the thing
|
|
|
|
void getPos(int & x, int & y) const;
|
2001-12-10 10:09:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
/// pointer to an inset
|
2001-12-11 15:35:18 +00:00
|
|
|
MathInset * par_;
|
2001-12-10 10:09:00 +00:00
|
|
|
/// cell index of a position in this inset
|
|
|
|
MathArray::idx_type idx_;
|
|
|
|
/// position in this cell
|
|
|
|
MathArray::pos_type pos_;
|
|
|
|
};
|
|
|
|
|
|
|
|
/// test for equality
|
|
|
|
bool operator==(MathCursorPos const &, MathCursorPos const &);
|
|
|
|
/// test for inequality
|
|
|
|
bool operator!=(MathCursorPos const &, MathCursorPos const &);
|
|
|
|
/// test for order
|
|
|
|
bool operator<(MathCursorPos const &, MathCursorPos const &);
|
|
|
|
/// output
|
|
|
|
std::ostream & operator<<(std::ostream &, MathCursorPos const &);
|
|
|
|
|
|
|
|
#endif
|