2001-06-13 14:33:31 +00:00
|
|
|
// -*- C++ -*-
|
2001-03-19 15:38:22 +00:00
|
|
|
/**
|
|
|
|
* \file FormMathsBitmap.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-19 15:38:22 +00:00
|
|
|
*
|
|
|
|
* \author Alejandro Aguilar Sierra
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author John Levon
|
2002-12-01 22:59:25 +00:00
|
|
|
* \author Angus Leeming
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-03-19 15:38:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FORM_MATHSBITMAP_H
|
|
|
|
#define FORM_MATHSBITMAP_H
|
|
|
|
|
2002-05-24 10:39:34 +00:00
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
#include "FormBase.h"
|
2002-08-20 20:43:10 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2001-03-19 15:38:22 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2002-12-01 22:59:25 +00:00
|
|
|
struct BitmapStore
|
2002-11-25 18:58:15 +00:00
|
|
|
{
|
|
|
|
BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
|
|
|
|
unsigned char const * data_in, bool vert_in)
|
|
|
|
: nt(nt_in), nx(nx_in), ny(ny_in), bw(bw_in), bh(bh_in),
|
|
|
|
data(data_in), vert(vert_in)
|
|
|
|
{}
|
|
|
|
|
|
|
|
int nt;
|
|
|
|
int nx;
|
|
|
|
int ny;
|
|
|
|
int bw;
|
|
|
|
int bh;
|
|
|
|
unsigned char const * data;
|
|
|
|
bool vert;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-12-01 22:59:25 +00:00
|
|
|
struct FD_maths_bitmap
|
2002-11-25 18:58:15 +00:00
|
|
|
{
|
|
|
|
~FD_maths_bitmap();
|
|
|
|
FL_FORM * form;
|
|
|
|
FL_OBJECT * button_close;
|
|
|
|
};
|
|
|
|
|
2001-03-19 15:38:22 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
/**
|
2001-03-19 15:38:22 +00:00
|
|
|
* This class provides an XForms implementation of a maths bitmap form.
|
|
|
|
*/
|
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
class ControlMathSub;
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
class FormMathsBitmap : public FormCB<ControlMathSub, FormDB<FD_maths_bitmap> >
|
|
|
|
{
|
|
|
|
public:
|
2001-03-19 15:38:22 +00:00
|
|
|
///
|
2002-11-25 18:58:15 +00:00
|
|
|
FormMathsBitmap(string const &, std::vector<string> const &);
|
2001-09-13 11:44:07 +00:00
|
|
|
///
|
2001-03-19 15:38:22 +00:00
|
|
|
void addBitmap(int, int, int, int, int, unsigned char const *,
|
|
|
|
bool = true);
|
|
|
|
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
int GetIndex(FL_OBJECT *);
|
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
///
|
2001-03-19 15:38:22 +00:00
|
|
|
virtual void apply();
|
2002-11-25 18:58:15 +00:00
|
|
|
///
|
|
|
|
virtual void build();
|
|
|
|
///
|
|
|
|
virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
|
|
|
|
/// Not needed.
|
|
|
|
virtual void update() {}
|
2001-03-19 15:38:22 +00:00
|
|
|
|
2002-11-25 18:58:15 +00:00
|
|
|
///
|
|
|
|
FL_OBJECT * buildBitmap(BitmapStore const & bmstore);
|
2001-03-19 15:38:22 +00:00
|
|
|
|
|
|
|
/// The latex names associated with each symbol
|
|
|
|
std::vector<string> latex_;
|
|
|
|
/// The latex name chosen
|
|
|
|
string latex_chosen_;
|
2002-11-25 18:58:15 +00:00
|
|
|
|
|
|
|
/** Temporary store for bitmap data passed to addBitmap()
|
|
|
|
* but before the FL_OBJECT is created in build().
|
|
|
|
*/
|
|
|
|
std::vector<BitmapStore> bitmaps_;
|
2001-03-19 15:38:22 +00:00
|
|
|
|
|
|
|
/// Border width
|
|
|
|
int ww_;
|
|
|
|
///
|
|
|
|
int x_;
|
|
|
|
///
|
|
|
|
int y_;
|
|
|
|
///
|
|
|
|
int w_;
|
|
|
|
///
|
|
|
|
int h_;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // FORM_MATHSBITMAP_H
|