#pragma interface
#endif
+#define USE_PAINTER 1
+
#include "support/LIstream.h"
#include "LString.h"
#include "array.h"
+class Painter;
+
///
enum math_align {
MathedInset(MathedInset *);
///
virtual ~MathedInset() {}
-
+
+#ifdef USE_PAINTER
+ /// Draw the object
+ virtual void draw(Painter &, int x, int baseline) = 0;
+#else
/// Draw the object
virtual void Draw(int x, int baseline) = 0;
+#endif
/// Write LaTeX and Lyx code
virtual void Write(ostream &) = 0;
virtual void SetStyle(short st) { size = st; } // Metrics();
///
virtual void SetName(char const * n) { name = n; }
+#ifndef USE_PAINTER
///
void setDrawable(long unsigned int d) { pm = d; }
+#endif
protected:
///
int descent;
///
short size;
+#ifndef USE_PAINTER
/// This works while only one process can draw unless
/// the process have their own data
- static long unsigned int pm;
+ static unsigned long pm;
+#endif
/// Default metrics
static int df_asc, df_des, df_width;
/// In a near future maybe we use a better fonts renderer than X
+#ifdef USE_PAINTER
+ void drawStr(Painter &, short, int, int, int, byte *, int);
+#else
void drawStr(short, int, int, int, byte *, int);
+#endif
///
friend class MathedCursor;
///
virtual MathedInset * Clone();
/// Draw the object on a drawable
+#ifdef USE_PAINTER
+ virtual void draw(Painter &, int x, int baseline);
+#else
virtual void Draw(int x, int baseline);
+#endif
/// Write LaTeX code
virtual void Write(ostream &);
}
///
~MathedRowSt() {
- delete[] w;
- if (label) // DEL LINE
- delete[] label;
+ delete[] w;
+ delete[] label;
}
/// Should be const but...
MathedRowSt * getNext() const { return next; }
MathedInset * Clone();
///
virtual ~MathMatrixInset();
+#ifdef USE_PAINTER
+ ///
+ void draw(Painter &, int, int);
+#else
///
void Draw(int, int);
+#endif
///
void Write(ostream &);
///