// Note: These math insets are internal to Mathed and are not derived
// from lyx inset.
-#ifndef __MATH_INSET__
-#define __MATH_INSET__
+#ifndef MATH_INSET
+#define MATH_INSET
#ifdef __GNUG__
#pragma interface
class MathFuncInset: public MathedInset {
public:
///
- MathFuncInset(char const *nm, short ot=LM_OT_FUNC, short st=LM_ST_TEXT);
+ MathFuncInset(char const * nm,
+ short ot = LM_OT_FUNC, short st = LM_ST_TEXT);
///
~MathFuncInset();
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
///
///
bool lims;
///
- char *fname;
+ char * fname;
};
class MathAccentInset: public MathedInset {
public:
///
- MathAccentInset(byte, MathedTextCodes, int, short st=LM_ST_TEXT);
+ MathAccentInset(byte, MathedTextCodes, int, short st = LM_ST_TEXT);
///
- MathAccentInset(MathedInset *, int, short st=LM_ST_TEXT);
+ MathAccentInset(MathedInset *, int, short st = LM_ST_TEXT);
///
~MathAccentInset();
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
///
///
int code;
///
- MathedInset *inset;
+ MathedInset * inset;
///
int dh, dy;
};
class MathDotsInset: public MathedInset {
public:
///
- MathDotsInset(char const*,int,short st=LM_ST_TEXT);
+ MathDotsInset(char const *, int, short st = LM_ST_TEXT);
///
- ~MathDotsInset() { };
+ ~MathDotsInset() {}
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
protected:
class MathSpaceInset: public MathedInset {
public:
///
- MathSpaceInset(int sp, short ot=LM_OT_SPACE, short st=LM_ST_TEXT);
+ MathSpaceInset(int sp, short ot = LM_OT_SPACE, short st = LM_ST_TEXT);
///
- ~MathSpaceInset() { };
+ ~MathSpaceInset() {}
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
inline void Metrics();
///
class MathBigopInset: public MathedInset {
public:
///
- MathBigopInset(char const*, int, short st=LM_ST_TEXT);
+ MathBigopInset(char const *, int, short st = LM_ST_TEXT);
///
- ~MathBigopInset() { };
+ ~MathBigopInset() {}
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
///
class MathSqrtInset: public MathParInset {
public:
///
- MathSqrtInset(short st=LM_ST_TEXT);
+ MathSqrtInset(short st = LM_ST_TEXT);
///
- ~MathSqrtInset() { };
+ ~MathSqrtInset() {}
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int x, int baseline);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
///
class MathFracInset: public MathParInset {
public:
///
- MathFracInset(short ot=LM_OT_FRAC);
+ MathFracInset(short ot = LM_OT_FRAC);
///
~MathFracInset();
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int x, int baseline);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
/** This does the same that SetData(LyxArrayBase*) but for both
numerator and denominator at once.
*/
- void SetData(LyxArrayBase*, LyxArrayBase*);
+ void SetData(LyxArrayBase *, LyxArrayBase *);
///
- void SetData(LyxArrayBase*);
+ void SetData(LyxArrayBase *);
///
- void GetXY(int& x, int& y) const;
+ void GetXY(int & x, int & y) const;
///
- void SetFocus(int,int);
+ void SetFocus(int, int);
///
bool Inside(int, int);
///
///
bool setArgumentIdx(int i); // was bool Up/down(void);
///
- int getArgumentIdx() { return (int)idx; }
+ int getArgumentIdx() { return int(idx); }
///
int getMaxArgumentIdx() { return 1; }
///
///
short idx;
///
- MathParInset *den;
+ MathParInset * den;
///
int w0, w1, des0, dh;
};
class MathDelimInset: public MathParInset {
public:
///
- MathDelimInset(int, int, short st=LM_ST_TEXT);
+ MathDelimInset(int, int, short st = LM_ST_TEXT);
///
- ~MathDelimInset() { };
+ ~MathDelimInset() {}
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
protected:
class MathDecorationInset: public MathParInset {
public:
///
- MathDecorationInset(int, short st=LM_ST_TEXT);
+ MathDecorationInset(int, short st = LM_ST_TEXT);
///
- ~MathDecorationInset() { };
+ ~MathDecorationInset() {}
///
- MathedInset *Clone();
+ MathedInset * Clone();
///
void Draw(int, int);
///
- void Write(FILE *file);
+ void Write(FILE * file);
///
- void Write(string &file);
+ void Write(string & file);
///
void Metrics();
///
inline
MathFuncInset::~MathFuncInset()
{
- if (fname && GetType()==LM_OT_UNDEF) delete[] fname;
+ if (fname && GetType() == LM_OT_UNDEF) delete[] fname;
}
+
inline
bool MathFuncInset::GetLimits() const
{
- return (bool)(lims && (GetStyle()==LM_ST_DISPLAY));
+ return bool(lims && (GetStyle() == LM_ST_DISPLAY));
}
+
inline
-void MathFuncInset::Write(FILE *file)
+void MathFuncInset::Write(FILE * file)
{
fprintf(file, "\\%s ", name);
}
+
inline
-void MathFuncInset::Write(string &file)
+void MathFuncInset::Write(string & file)
{
file += '\\';
file += name;
file += ' ';
}
+
inline
void MathSpaceInset::Metrics()
{
- width = (space) ? space*2: 2;
+ width = (space) ? space * 2 : 2;
if (space>3) width *= 2;
- if (space==5) width *= 2;
+ if (space == 5) width *= 2;
width += 4;
ascent = 4; descent = 0;
}
+
inline
void MathSpaceInset::SetSpace(int sp)
{
Metrics();
}
+
inline
bool MathBigopInset::GetLimits() const
{
// Default case
- if (lims<0) {
- return (bool)(sym!=LM_int && sym!=LM_oint && (GetStyle()==LM_ST_DISPLAY));
+ if (lims < 0) {
+ return sym != LM_int && sym != LM_oint && GetStyle() == LM_ST_DISPLAY;
}
// Custom
- return (bool)(lims>0);
+ return lims > 0;
}
+
inline
void MathBigopInset::SetLimits(bool ls)
{
- lims = (ls) ? 1: 0;
+ lims = ls ? 1 : 0;
}
+
inline
bool MathDecorationInset::GetLimits() const
{
- return (bool)(deco==LM_underbrace||deco==LM_overbrace);
+ return deco == LM_underbrace || deco == LM_overbrace;
}
-
#endif
-