]> git.lyx.org Git - lyx.git/blob - src/mathed/math_panel.h
Baruch's graphic-inset patch.
[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 "bmtable.h"                 
24
25 ///
26 enum SomeMathValues {
27     ///
28     MM_GREEK,
29     ///
30     MM_ARROW,
31     ///
32     MM_BOP,
33     ///
34     MM_BRELATS,
35     ///
36     MM_VARSIZE,
37     ///
38     MM_MISC,
39     ///
40     MM_FRAC,
41     ///
42     MM_SQRT,
43     ///
44     MM_DELIM,
45     ///
46     MM_MATRIX,
47     ///
48     MM_EQU,
49     ///
50     MM_DECO,
51     ///
52     MM_SPACE,
53     ///
54     MM_DOTS,
55     ///
56     MM_FUNC,
57     ///
58     MM_MAX,
59     ///
60     MM_CLOSE = 1024,
61     ///
62     MM_APPLY,
63     ///
64     MM_OK
65 };
66
67 ///
68 typedef FL_OBJECT * FL_OBJECTP;
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 protected:
77    ///
78    BitmapMenu * next, * prev;
79    /// Number of bitmaps
80    int nb;
81    /// Current bitmap
82    int i;
83    /// Border width
84    int ww;
85    ///
86    int x, y, w, h;
87    ///
88    FL_FORM * form;
89    ///
90    FL_OBJECTP * bitmap;
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_ */