]> git.lyx.org Git - lyx.git/blob - src/mathed/math_panel.h
mathed34.diff
[lyx.git] / src / mathed / math_panel.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_panel.h
4  *  Purpose:     Mathed GUI for lyx
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6  *  Created:     March 28, 1996
7  * 
8  *  Dependencies: Xlib, Xpm, XForms, Lyx
9  *
10  *  Copyright: 1996, Alejandro Aguilar Sierra 
11  *
12  *   You are free to use and modify it under the terms of
13  *   the GNU General Public Licence version 2 or later.
14  */
15
16 #ifndef FD_math_panel_h_
17 #define FD_math_panel_h_
18
19 #ifdef __GNUG__
20 #pragma interface
21 #endif
22
23 #include <vector>
24 #include "bmtable.h"                 
25
26 ///
27 enum SomeMathValues {
28         ///
29         MM_GREEK,
30         ///
31         MM_ARROW,
32         ///
33         MM_BOP,
34         ///
35         MM_BRELATS,
36         ///
37         MM_VARSIZE,
38         ///
39         MM_MISC,
40         ///
41         MM_FRAC,
42         ///
43         MM_SQRT,
44         ///
45         MM_DELIM,
46         ///
47         MM_MATRIX,
48         ///
49         MM_EQU,
50         ///
51         MM_DECO,
52         ///
53         MM_SPACE,
54         ///
55         MM_DOTS,
56         ///
57         MM_FUNC,
58         ///
59         MM_MAX,
60         ///
61         MM_CLOSE = 1024,
62         ///
63         MM_APPLY,
64         ///
65         MM_OK
66 };
67
68
69 /// Class to manage bitmap menu bars
70 class BitmapMenu {
71         ///
72         static BitmapMenu * active;
73         ///
74         friend int peek_event(FL_FORM *, void *);
75         ///
76         typedef std::vector<FL_OBJECT *>   bitmaps_type;
77         ///
78         typedef bitmaps_type::size_type    size_type;
79         ///
80         BitmapMenu * next;
81         ///
82         BitmapMenu * prev;
83         /// Current bitmap
84         size_type current_;
85         /// Border width
86         int ww;
87         ///
88         int x;
89         ///
90         int y;
91         ///
92         int w;
93         ///
94         int h;
95         ///
96         FL_FORM * form;
97         ///
98         bitmaps_type bitmaps_;
99         ///
100         FL_OBJECT * button;
101 public:
102         ///
103         BitmapMenu(int n, FL_OBJECT * bt, BitmapMenu * prevx= 0);
104         ///
105         ~BitmapMenu();
106         ///
107         FL_OBJECT * AddBitmap(int id,
108                               int nx, int ny, int bw, int bh,
109                               unsigned char const * data,
110                               Bool vert = True); // Why Bool?
111         ///
112         void Create();
113         ///
114         void Hide();
115         ///
116         void Show();
117         ///
118         void Prev();
119         ///
120         void Next();
121         ///
122         int GetIndex(FL_OBJECT * ob);
123 };
124
125
126 /// This is just a wrapper around peek_event()
127 extern "C" int C_peek_event(FL_FORM * form, void * ptr);
128
129
130 inline
131 void BitmapMenu::Prev()
132 {
133         Hide();
134         if (prev)
135                 prev->Show();
136 }
137
138
139 inline
140 void BitmapMenu::Next()
141 {
142         Hide();
143         if (next)
144                 next->Show();
145 }
146
147
148 #include "math_forms.h"
149
150 ///
151 extern FD_panel * create_math_panel(void);
152
153 #endif /* FD_math_panel_h_ */