2001-02-13 13:28:32 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-19 13:00:56 +00:00
|
|
|
/**
|
2006-09-17 09:14:18 +00:00
|
|
|
* \file MathSupport.h
|
2003-08-19 13:00:56 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2003-08-19 13:00:56 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
2001-02-13 13:28:32 +00:00
|
|
|
|
|
|
|
#ifndef MATH_SUPPORT_H
|
|
|
|
#define MATH_SUPPORT_H
|
|
|
|
|
2008-10-18 12:25:03 +00:00
|
|
|
#include "MathParser_flags.h"
|
2007-11-27 20:51:20 +00:00
|
|
|
#include "support/strfwd.h"
|
2006-10-21 11:15:37 +00:00
|
|
|
#include <vector>
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
class PainterInfo;
|
2007-10-28 18:51:54 +00:00
|
|
|
class FontInfo;
|
2002-07-11 11:27:24 +00:00
|
|
|
class Dimension;
|
2007-04-26 16:05:57 +00:00
|
|
|
class MathData;
|
2004-01-07 18:28:50 +00:00
|
|
|
class MathAtom;
|
2006-09-16 18:11:38 +00:00
|
|
|
class InsetMath;
|
2004-01-07 18:28:50 +00:00
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
int mathed_char_width(FontInfo const &, char_type c);
|
2001-02-13 13:28:32 +00:00
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
int mathed_char_kerning(FontInfo const &, char_type c);
|
2007-03-21 17:21:59 +00:00
|
|
|
|
2003-03-21 14:20:48 +00:00
|
|
|
void mathed_draw_deco(PainterInfo & pi, int x, int y, int w, int h,
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring const & name);
|
2001-02-13 19:10:18 +00:00
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
void mathed_string_dim(FontInfo const & font,
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring const & s,
|
2006-10-21 11:15:37 +00:00
|
|
|
Dimension & dim);
|
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
int mathed_string_width(FontInfo const &, docstring const & s);
|
2001-02-13 19:10:18 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
void drawStrRed(PainterInfo & pi, int x, int y, docstring const & s);
|
|
|
|
void drawStrBlack(PainterInfo & pi, int x, int y, docstring const & s);
|
2001-07-13 09:10:59 +00:00
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
void math_font_max_dim(FontInfo const &, int & asc, int & desc);
|
2001-07-20 14:54:13 +00:00
|
|
|
|
2007-10-28 18:51:54 +00:00
|
|
|
void augmentFont(FontInfo & f, docstring const & cmd);
|
2002-05-30 07:09:54 +00:00
|
|
|
|
2006-10-22 10:15:23 +00:00
|
|
|
bool isFontName(docstring const & name);
|
2002-03-19 16:55:58 +00:00
|
|
|
|
2003-06-02 10:03:27 +00:00
|
|
|
// converts single cell to string
|
2007-04-26 16:05:57 +00:00
|
|
|
docstring asString(MathData const & ar);
|
2004-01-07 18:28:50 +00:00
|
|
|
// converts single inset to string
|
2006-10-22 10:15:23 +00:00
|
|
|
docstring asString(InsetMath const &);
|
|
|
|
docstring asString(MathAtom const &);
|
2003-06-02 10:03:27 +00:00
|
|
|
// converts string to single cell
|
2008-10-17 21:40:11 +00:00
|
|
|
void asArray(docstring const &, MathData &, Parse::flags f = Parse::NORMAL);
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
} // namespace lyx
|
2003-06-02 10:03:27 +00:00
|
|
|
|
2001-02-13 13:28:32 +00:00
|
|
|
#endif
|