Update the changelog
[opencv] / otherlibs / _fltk / include / FL / Enumerations.H
1 //
2 // "$Id: Enumerations.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $"
3 //
4 // Enumerations for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2002 by Bill Spitzak and others.
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 // USA.
22 //
23 // Please report all bugs and problems to "fltk-bugs@fltk.org".
24 //
25
26 #ifndef Fl_Enumerations_H
27 #define Fl_Enumerations_H
28
29 #  include "Fl_Export.H"
30
31
32 //
33 // The FLTK version number; this is changed slightly from the beta versions
34 // because the old "const double" definition would not allow for conditional
35 // compilation...
36 //
37 // FL_VERSION is a double that describes the major and minor version numbers.
38 // Version 1.1 is actually stored as 1.01 to allow for more than 9 minor
39 // releases.
40 //
41 // The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants
42 // give the integral values for the major, minor, and patch releases
43 // respectively.
44 //
45
46 #define FL_MAJOR_VERSION        1
47 #define FL_MINOR_VERSION        1
48 #define FL_PATCH_VERSION        2
49 #define FL_VERSION              ((double)FL_MAJOR_VERSION + \
50                                  (double)FL_MINOR_VERSION * 0.01 + \
51                                  (double)FL_PATCH_VERSION * 0.0001)
52
53 typedef unsigned char uchar;
54 typedef unsigned long ulong;
55
56 enum Fl_Event { // events
57   FL_NO_EVENT           = 0,
58   FL_PUSH               = 1,
59   FL_RELEASE            = 2,
60   FL_ENTER              = 3,
61   FL_LEAVE              = 4,
62   FL_DRAG               = 5,
63   FL_FOCUS              = 6,
64   FL_UNFOCUS            = 7,
65   FL_KEYDOWN            = 8,
66   FL_KEYUP              = 9,
67   FL_CLOSE              = 10,
68   FL_MOVE               = 11,
69   FL_SHORTCUT           = 12,
70   FL_DEACTIVATE         = 13,
71   FL_ACTIVATE           = 14,
72   FL_HIDE               = 15,
73   FL_SHOW               = 16,
74   FL_PASTE              = 17,
75   FL_SELECTIONCLEAR     = 18,
76   FL_MOUSEWHEEL         = 19,
77   FL_DND_ENTER          = 20,
78   FL_DND_DRAG           = 21,
79   FL_DND_LEAVE          = 22,
80   FL_DND_RELEASE        = 23
81 };
82 #define FL_KEYBOARD FL_KEYDOWN
83
84 enum Fl_When { // Fl_Widget::when():
85   FL_WHEN_NEVER         = 0,
86   FL_WHEN_CHANGED       = 1,
87   FL_WHEN_RELEASE       = 4,
88   FL_WHEN_RELEASE_ALWAYS= 6,
89   FL_WHEN_ENTER_KEY     = 8,
90   FL_WHEN_ENTER_KEY_ALWAYS=10,
91   FL_WHEN_ENTER_KEY_CHANGED=11,
92   FL_WHEN_NOT_CHANGED   = 2 // modifier bit to disable changed() test
93 };
94
95 // Fl::event_key() and Fl::get_key(n) (use ascii letters for all other keys):
96 #define FL_Button       0xfee8 // use Fl_Button+FL_*_MOUSE
97 #define FL_BackSpace    0xff08
98 #define FL_Tab          0xff09
99 #define FL_Enter        0xff0d
100 #define FL_Pause        0xff13
101 #define FL_Scroll_Lock  0xff14
102 #define FL_Escape       0xff1b
103 #define FL_Home         0xff50
104 #define FL_Left         0xff51
105 #define FL_Up           0xff52
106 #define FL_Right        0xff53
107 #define FL_Down         0xff54
108 #define FL_Page_Up      0xff55
109 #define FL_Page_Down    0xff56
110 #define FL_End          0xff57
111 #define FL_Print        0xff61
112 #define FL_Insert       0xff63
113 #define FL_Menu         0xff67 // the "menu/apps" key on XFree86
114 #define FL_Help         0xff68 // the 'help' key on Mac keyboards
115 #define FL_Num_Lock     0xff7f
116 #define FL_KP           0xff80 // use FL_KP+'x' for 'x' on numeric keypad
117 #define FL_KP_Enter     0xff8d // same as Fl_KP+'\r'
118 #define FL_KP_Last      0xffbd // use to range-check keypad
119 #define FL_F            0xffbd // use FL_F+n for function key n
120 #define FL_F_Last       0xffe0 // use to range-check function keys
121 #define FL_Shift_L      0xffe1
122 #define FL_Shift_R      0xffe2
123 #define FL_Control_L    0xffe3
124 #define FL_Control_R    0xffe4
125 #define FL_Caps_Lock    0xffe5
126 #define FL_Meta_L       0xffe7 // the left MSWindows key on XFree86
127 #define FL_Meta_R       0xffe8 // the right MSWindows key on XFree86
128 #define FL_Alt_L        0xffe9
129 #define FL_Alt_R        0xffea
130 #define FL_Delete       0xffff
131
132 // Fl::event_button():
133 #define FL_LEFT_MOUSE   1
134 #define FL_MIDDLE_MOUSE 2
135 #define FL_RIGHT_MOUSE  3
136
137 // Fl::event_state():
138 #define FL_SHIFT        0x00010000
139 #define FL_CAPS_LOCK    0x00020000
140 #define FL_CTRL         0x00040000
141 #define FL_ALT          0x00080000
142 #define FL_NUM_LOCK     0x00100000 // most X servers do this?
143 #define FL_META         0x00400000 // correct for XFree86
144 #define FL_SCROLL_LOCK  0x00800000 // correct for XFree86
145 #define FL_BUTTON1      0x01000000
146 #define FL_BUTTON2      0x02000000
147 #define FL_BUTTON3      0x04000000
148 #define FL_BUTTONS      0x7f000000 // All possible buttons
149 #define FL_BUTTON(n)    (0x00800000<<(n))
150
151 #ifdef __APPLE__
152 #  define FL_COMMAND    FL_META
153 #else
154 #  define FL_COMMAND    FL_CTRL
155 #endif // __APPLE__
156
157 enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C):
158   FL_NO_BOX = 0,        FL_FLAT_BOX,
159
160   FL_UP_BOX,            FL_DOWN_BOX,
161   FL_UP_FRAME,          FL_DOWN_FRAME,
162   FL_THIN_UP_BOX,       FL_THIN_DOWN_BOX,
163   FL_THIN_UP_FRAME,     FL_THIN_DOWN_FRAME,
164   FL_ENGRAVED_BOX,      FL_EMBOSSED_BOX,
165   FL_ENGRAVED_FRAME,    FL_EMBOSSED_FRAME,
166   FL_BORDER_BOX,        _FL_SHADOW_BOX,
167   FL_BORDER_FRAME,      _FL_SHADOW_FRAME,
168   _FL_ROUNDED_BOX,      _FL_RSHADOW_BOX,
169   _FL_ROUNDED_FRAME,    _FL_RFLAT_BOX,
170   _FL_ROUND_UP_BOX,     _FL_ROUND_DOWN_BOX,
171   _FL_DIAMOND_UP_BOX,   _FL_DIAMOND_DOWN_BOX,
172   _FL_OVAL_BOX,         _FL_OSHADOW_BOX,
173   _FL_OVAL_FRAME,       _FL_OFLAT_BOX,
174   _FL_PLASTIC_UP_BOX,   _FL_PLASTIC_DOWN_BOX,
175   _FL_PLASTIC_UP_FRAME, _FL_PLASTIC_DOWN_FRAME,
176   FL_FREE_BOXTYPE
177 };
178 extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX();
179 #define FL_ROUND_UP_BOX fl_define_FL_ROUND_UP_BOX()
180 #define FL_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_ROUND_UP_BOX()+1)
181 extern FL_EXPORT Fl_Boxtype fl_define_FL_SHADOW_BOX();
182 #define FL_SHADOW_BOX fl_define_FL_SHADOW_BOX()
183 #define FL_SHADOW_FRAME (Fl_Boxtype)(fl_define_FL_SHADOW_BOX()+2)
184 extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUNDED_BOX();
185 #define FL_ROUNDED_BOX fl_define_FL_ROUNDED_BOX()
186 #define FL_ROUNDED_FRAME (Fl_Boxtype)(fl_define_FL_ROUNDED_BOX()+2)
187 extern FL_EXPORT Fl_Boxtype fl_define_FL_RFLAT_BOX();
188 #define FL_RFLAT_BOX fl_define_FL_RFLAT_BOX()
189 extern FL_EXPORT Fl_Boxtype fl_define_FL_RSHADOW_BOX();
190 #define FL_RSHADOW_BOX fl_define_FL_RSHADOW_BOX()
191 extern FL_EXPORT Fl_Boxtype fl_define_FL_DIAMOND_BOX();
192 #define FL_DIAMOND_UP_BOX fl_define_FL_DIAMOND_BOX()
193 #define FL_DIAMOND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_DIAMOND_BOX()+1)
194 extern FL_EXPORT Fl_Boxtype fl_define_FL_OVAL_BOX();
195 #define FL_OVAL_BOX fl_define_FL_OVAL_BOX()
196 #define FL_OSHADOW_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+1)
197 #define FL_OVAL_FRAME (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+2)
198 #define FL_OFLAT_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+3)
199
200 extern FL_EXPORT Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX();
201 #define FL_PLASTIC_UP_BOX fl_define_FL_PLASTIC_UP_BOX()
202 #define FL_PLASTIC_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+1)
203 #define FL_PLASTIC_UP_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+2)
204 #define FL_PLASTIC_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+3)
205
206 // conversions of box types to other boxtypes:
207 inline Fl_Boxtype fl_down(Fl_Boxtype b) {return (Fl_Boxtype)(b|1);}
208 inline Fl_Boxtype fl_frame(Fl_Boxtype b) {return (Fl_Boxtype)(b|2);}
209
210 // back-compatability box types:
211 #define FL_FRAME FL_ENGRAVED_FRAME
212 #define FL_FRAME_BOX FL_ENGRAVED_BOX
213 #define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX
214 #define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX
215
216 enum Fl_Labeltype {     // labeltypes:
217   FL_NORMAL_LABEL       = 0,
218   FL_NO_LABEL,
219   _FL_SHADOW_LABEL,
220   _FL_ENGRAVED_LABEL,
221   _FL_EMBOSSED_LABEL,
222   _FL_MULTI_LABEL,
223   _FL_ICON_LABEL,
224   _FL_IMAGE_LABEL,
225
226   FL_FREE_LABELTYPE
227 };
228 #define FL_SYMBOL_LABEL FL_NORMAL_LABEL
229 extern Fl_Labeltype FL_EXPORT fl_define_FL_SHADOW_LABEL();
230 #define FL_SHADOW_LABEL fl_define_FL_SHADOW_LABEL()
231 extern Fl_Labeltype FL_EXPORT fl_define_FL_ENGRAVED_LABEL();
232 #define FL_ENGRAVED_LABEL fl_define_FL_ENGRAVED_LABEL()
233 extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL();
234 #define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL()
235
236 enum Fl_Align { // align() values
237   FL_ALIGN_CENTER               = 0,
238   FL_ALIGN_TOP                  = 1,
239   FL_ALIGN_BOTTOM               = 2,
240   FL_ALIGN_LEFT                 = 4,
241   FL_ALIGN_RIGHT                = 8,
242   FL_ALIGN_INSIDE               = 16,
243   FL_ALIGN_TEXT_OVER_IMAGE      = 32,
244   FL_ALIGN_IMAGE_OVER_TEXT      = 0,
245   FL_ALIGN_CLIP                 = 64,
246   FL_ALIGN_WRAP                 = 128,
247   FL_ALIGN_TOP_LEFT             = FL_ALIGN_TOP | FL_ALIGN_LEFT,
248   FL_ALIGN_TOP_RIGHT            = FL_ALIGN_TOP | FL_ALIGN_RIGHT,
249   FL_ALIGN_BOTTOM_LEFT          = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT,
250   FL_ALIGN_BOTTOM_RIGHT         = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT,
251   FL_ALIGN_LEFT_TOP             = FL_ALIGN_TOP_LEFT,
252   FL_ALIGN_RIGHT_TOP            = FL_ALIGN_TOP_RIGHT,
253   FL_ALIGN_LEFT_BOTTOM          = FL_ALIGN_BOTTOM_LEFT,
254   FL_ALIGN_RIGHT_BOTTOM         = FL_ALIGN_BOTTOM_RIGHT,
255   FL_ALIGN_NOWRAP               = 0 // for back compatability
256 };
257
258 enum Fl_Font {  // standard fonts
259   FL_HELVETICA          = 0,
260   FL_HELVETICA_BOLD,
261   FL_HELVETICA_ITALIC,
262   FL_HELVETICA_BOLD_ITALIC,
263   FL_COURIER,
264   FL_COURIER_BOLD,
265   FL_COURIER_ITALIC,
266   FL_COURIER_BOLD_ITALIC,
267   FL_TIMES,
268   FL_TIMES_BOLD,
269   FL_TIMES_ITALIC,
270   FL_TIMES_BOLD_ITALIC,
271   FL_SYMBOL,
272   FL_SCREEN,
273   FL_SCREEN_BOLD,
274   FL_ZAPF_DINGBATS,
275
276   FL_FREE_FONT          = 16,   // first one to allocate
277   FL_BOLD               = 1,    // add this to helvetica, courier, or times
278   FL_ITALIC             = 2     // add this to helvetica, courier, or times
279 };
280
281 extern FL_EXPORT int FL_NORMAL_SIZE;
282
283 enum Fl_Color { // standard colors
284   // These are used as default colors in widgets and altered as necessary
285   FL_FOREGROUND_COLOR   = 0,
286   FL_BACKGROUND2_COLOR  = 7,
287   FL_INACTIVE_COLOR     = 8,
288   FL_SELECTION_COLOR    = 15,
289
290   // boxtypes generally limit themselves to these colors so
291   // the whole ramp is not allocated:
292   FL_GRAY0              = 32,   // 'A'
293   FL_DARK3              = 39,   // 'H'
294   FL_DARK2              = 45,   // 'N'
295   FL_DARK1              = 47,   // 'P'
296   FL_BACKGROUND_COLOR   = 49,   // 'R' default background color
297   FL_LIGHT1             = 50,   // 'S'
298   FL_LIGHT2             = 52,   // 'U'
299   FL_LIGHT3             = 54,   // 'W'
300
301   // FLTK provides a 5x8x5 color cube that is used with colormap visuals
302   FL_BLACK              = 56,
303   FL_RED                = 88,
304   FL_GREEN              = 63,
305   FL_YELLOW             = 95,
306   FL_BLUE               = 216,
307   FL_MAGENTA            = 248,
308   FL_CYAN               = 223,
309   FL_DARK_RED           = 72,
310
311   FL_DARK_GREEN         = 60,
312   FL_DARK_YELLOW        = 76,
313   FL_DARK_BLUE          = 136,
314   FL_DARK_MAGENTA       = 152,
315   FL_DARK_CYAN          = 140,
316
317   FL_WHITE              = 255
318 };
319
320 #define FL_FREE_COLOR           (Fl_Color)16
321 #define FL_NUM_FREE_COLOR       16
322 #define FL_GRAY_RAMP            (Fl_Color)32
323 #define FL_NUM_GRAY             24
324 #define FL_GRAY                 FL_BACKGROUND_COLOR
325 #define FL_COLOR_CUBE           (Fl_Color)56
326 #define FL_NUM_RED              5
327 #define FL_NUM_GREEN            8
328 #define FL_NUM_BLUE             5
329
330 FL_EXPORT Fl_Color fl_inactive(Fl_Color c);
331 FL_EXPORT Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg);
332 FL_EXPORT Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight);
333 inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); }
334 inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); }
335 inline Fl_Color fl_rgb_color(uchar r, uchar g, uchar b) {
336   if (!r && !g && !b) return FL_BLACK;
337   else return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8);
338 }
339 inline Fl_Color fl_rgb_color(uchar g) {
340   if (!g) return FL_BLACK;
341   else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8);
342 }
343 inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);}
344 inline Fl_Color fl_color_cube(int r, int g, int b) {
345   return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);}
346
347 enum Fl_Cursor {        // standard cursors
348   FL_CURSOR_DEFAULT     = 0,
349   FL_CURSOR_ARROW       = 35,
350   FL_CURSOR_CROSS       = 66,
351   FL_CURSOR_WAIT        = 76,
352   FL_CURSOR_INSERT      = 77,
353   FL_CURSOR_HAND        = 31,
354   FL_CURSOR_HELP        = 47,
355   FL_CURSOR_MOVE        = 27,
356   // fltk provides bitmaps for these:
357   FL_CURSOR_NS          = 78,
358   FL_CURSOR_WE          = 79,
359   FL_CURSOR_NWSE        = 80,
360   FL_CURSOR_NESW        = 81,
361   FL_CURSOR_NONE        = 255,
362   // for back compatability (non MSWindows ones):
363   FL_CURSOR_N           = 70,
364   FL_CURSOR_NE          = 69,
365   FL_CURSOR_E           = 49,
366   FL_CURSOR_SE          = 8,
367   FL_CURSOR_S           = 9,
368   FL_CURSOR_SW          = 7,
369   FL_CURSOR_W           = 36,
370   FL_CURSOR_NW          = 68
371   //FL_CURSOR_NS        = 22,
372   //FL_CURSOR_WE        = 55,
373 };
374
375 enum { // values for "when" passed to Fl::add_fd()
376   FL_READ = 1,
377   FL_WRITE = 4,
378   FL_EXCEPT = 8
379 };
380
381 enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut)
382   FL_RGB        = 0,
383   FL_INDEX      = 1,
384   FL_SINGLE     = 0,
385   FL_DOUBLE     = 2,
386   FL_ACCUM      = 4,
387   FL_ALPHA      = 8,
388   FL_DEPTH      = 16,
389   FL_STENCIL    = 32,
390   FL_RGB8       = 64,
391   FL_MULTISAMPLE= 128,
392   FL_STEREO     = 256,
393   FL_FAKE_SINGLE = 512  // Fake single buffered windows using double-buffer
394 };
395
396 // damage masks
397
398 enum Fl_Damage {
399   FL_DAMAGE_CHILD    = 0x01,
400   FL_DAMAGE_EXPOSE   = 0x02,
401   FL_DAMAGE_SCROLL   = 0x04,
402   FL_DAMAGE_OVERLAY  = 0x08,
403   FL_DAMAGE_ALL      = 0x80
404 };
405
406 // FLTK 1.0.x compatibility definitions...
407 #  ifdef FLTK_1_0_COMPAT
408 #    define contrast    fl_contrast
409 #    define down        fl_down
410 #    define frame       fl_frame
411 #    define inactive    fl_inactive
412 #  endif // FLTK_1_0_COMPAT
413
414 #endif
415
416 //
417 // End of "$Id: Enumerations.H,v 1.2 2002/12/01 15:38:37 neurosurg Exp $".
418 //