]> git.lyx.org Git - lyx.git/blob - src/mathed/math_panel.h
first go at mathed file 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 /// 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, * prev;
81    /// Current bitmap
82    size_type current_;
83    /// Border width
84    int ww;
85    ///
86    int x, y, w, h;
87    ///
88    FL_FORM * form;
89    ///
90    bitmaps_type bitmaps_;
91    ///
92    FL_OBJECT * button;
93  public:
94    ///
95    BitmapMenu(int n, FL_OBJECT * bt, BitmapMenu * prevx= 0);
96    ///
97    ~BitmapMenu();
98    ///
99    FL_OBJECT * AddBitmap(int id,
100                          int nx, int ny, int bw, int bh,
101                          unsigned char const * data,
102                          Bool vert= True); // Why Bool?
103    ///
104    void Create();
105    ///
106    void Hide();
107    ///
108    void Show();
109    ///
110    void Prev();
111    ///
112    void Next();
113    ///
114    int  GetIndex(FL_OBJECT * ob);
115 };
116
117 /// This is just a wrapper around peek_event()
118 extern "C" int C_peek_event(FL_FORM * form, void * ptr);
119
120
121 inline
122 void BitmapMenu::Prev()  {
123    Hide();
124    if (prev)
125      prev->Show();
126 }
127
128 inline
129 void BitmapMenu::Next()  {
130    Hide();
131    if (next)
132      next->Show();
133 }
134
135 #include "math_forms.h"
136
137 ///
138 extern FD_panel * create_math_panel(void);
139
140 #endif /* FD_math_panel_h_ */