]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormMathsBitmap.h
Change glob() API to accept a dir parameter.
[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 #include "FormDialogView.h"
18 #include <vector>
19
20 namespace lyx {
21 namespace frontend {
22
23 struct BitmapStore
24 {
25         BitmapStore(int nt_in, int nx_in, int ny_in, int bw_in, int bh_in,
26                     unsigned char const * data_in, bool vert_in)
27                 : nt(nt_in), nx(nx_in), ny(ny_in), bw(bw_in), bh(bh_in),
28                   data(data_in), vert(vert_in)
29         {}
30
31         int nt;
32         int nx;
33         int ny;
34         int bw;
35         int bh;
36         unsigned char const * data;
37         bool vert;
38 };
39
40
41 struct FD_maths_bitmap
42 {
43         ~FD_maths_bitmap();
44         FL_FORM * form;
45         FL_OBJECT * button_close;
46 };
47
48
49 /**
50  * This class provides an XForms implementation of a maths bitmap form.
51  */
52
53 class ControlMath;
54
55 class FormMathsBitmap
56         : public FormController<ControlMath, FormView<FD_maths_bitmap> > {
57 public:
58         ///
59         FormMathsBitmap(Dialog &, std::string const &, std::vector<std::string> const &);
60         ///
61         void addBitmap(BitmapStore const &);
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<std::string> latex_;
81         /// The latex name chosen
82         std::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 } // namespace frontend
102 } // namespace lyx
103
104 #endif // FORM_MATHSBITMAP_H