]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormMathsBitmap.h
remove defaults stuff, let Qt handle no toolbar
[lyx.git] / src / frontends / xforms / FormMathsBitmap.h
1 // -*- C++ -*-
2 /**
3  * \file FormMathsBitmap.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author John Levon
9  * \author Angus Leeming
10  *
11  * Full author contact details are available in file CREDITS
12  */
13
14 #ifndef FORM_MATHSBITMAP_H
15 #define FORM_MATHSBITMAP_H
16
17
18 #include "FormBase.h"
19 #include <boost/shared_ptr.hpp>
20 #include <vector>
21
22 struct BitmapStore
23 {
24         BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
25                     unsigned char const * data_in, bool vert_in)
26                 : nt(nt_in), nx(nx_in), ny(ny_in), bw(bw_in), bh(bh_in),
27                   data(data_in), vert(vert_in)
28         {}
29
30         int nt;
31         int nx;
32         int ny;
33         int bw;
34         int bh;
35         unsigned char const * data;
36         bool vert;
37 };
38
39
40 struct FD_maths_bitmap
41 {
42         ~FD_maths_bitmap();
43         FL_FORM * form;
44         FL_OBJECT * button_close;
45 };
46
47
48 /**
49  * This class provides an XForms implementation of a maths bitmap form.
50  */
51
52 class ControlMathSub;
53
54 class FormMathsBitmap : public FormCB<ControlMathSub, FormDB<FD_maths_bitmap> >
55 {
56 public:
57         ///
58         FormMathsBitmap(string const &, std::vector<string> const &);
59         ///
60         void addBitmap(int, int, int, int, int, unsigned char const *,
61                        bool = true);
62
63 private:
64         ///
65         int GetIndex(FL_OBJECT *);
66
67         ///
68         virtual void apply();
69         ///
70         virtual void build();
71         ///
72         virtual ButtonPolicy::SMInput input(FL_OBJECT *, long);
73         /// Not needed.
74         virtual void update() {}
75
76         ///
77         FL_OBJECT * buildBitmap(BitmapStore const & bmstore);
78
79         /// The latex names associated with each symbol
80         std::vector<string> latex_;
81         /// The latex name chosen
82         string latex_chosen_;
83
84         /** Temporary store for bitmap data passed to addBitmap()
85          *  but before the FL_OBJECT is created in build().
86          */
87         std::vector<BitmapStore> bitmaps_;
88
89         /// Border width
90         int ww_;
91         ///
92         int x_;
93         ///
94         int y_;
95         ///
96         int w_;
97         ///
98         int h_;
99 };
100
101
102 #endif // FORM_MATHSBITMAP_H