]> git.lyx.org Git - lyx.git/blob - src/mathed/math_panel.h
get rid of several friends small cleanup
[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 ///
70 /// Class to manage bitmap menu bars
71 class BitmapMenu {
72         ///
73         static BitmapMenu * active;
74         ///
75         friend int peek_event(FL_FORM *, void *);
76         ///
77         typedef std::vector<FL_OBJECT *>   bitmaps_type;
78         ///
79         typedef bitmaps_type::size_type    size_type;
80         ///
81         BitmapMenu * next, * prev;
82         /// Current bitmap
83         size_type current_;
84         /// Border width
85         int ww;
86         ///
87         int x;
88         ///
89         int y;
90         ///
91         int w;
92         ///
93         int h;
94         ///
95         FL_FORM * form;
96         ///
97         bitmaps_type bitmaps_;
98         ///
99         FL_OBJECT * button;
100 public:
101         ///
102         BitmapMenu(int n, FL_OBJECT * bt, BitmapMenu * prevx= 0);
103         ///
104         ~BitmapMenu();
105         ///
106         FL_OBJECT * AddBitmap(int id,
107                               int nx, int ny, int bw, int bh,
108                               unsigned char const * data,
109                               Bool vert = True); // Why Bool?
110         ///
111         void Create();
112         ///
113         void Hide();
114         ///
115         void Show();
116         ///
117         void Prev();
118         ///
119         void Next();
120         ///
121         int GetIndex(FL_OBJECT * ob);
122 };
123
124
125 /// This is just a wrapper around peek_event()
126 extern "C" int C_peek_event(FL_FORM * form, void * ptr);
127
128
129 inline
130 void BitmapMenu::Prev()
131 {
132         Hide();
133         if (prev)
134                 prev->Show();
135 }
136
137
138 inline
139 void BitmapMenu::Next()
140 {
141         Hide();
142         if (next)
143                 next->Show();
144 }
145
146
147 #include "math_forms.h"
148
149 ///
150 extern FD_panel * create_math_panel(void);
151
152 #endif /* FD_math_panel_h_ */