source: NonGTP/FLTK/include/FL/Enumerations.H @ 773

Revision 773, 11.2 KB checked in by gumbau, 19 years ago (diff)

FLTK imported to SVN repository to be linked agains the GeoTool? application

Line 
1//
2// "$Id: Enumerations.H 3184 2003-12-13 11:06:54Z spitzak $"
3//
4// Enumerations for the Fast Light Tool Kit (FLTK).
5//
6// Copyright 1998-2003 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 <fltk/FL_API.h>
30# include <fltk/FL_VERSION.h>
31
32enum Fl_Event { // these should match fltk/events.h
33  FL_NO_EVENT           = 0,
34  FL_PUSH               = 1,
35  FL_RELEASE            = 2,
36  FL_ENTER              = 3,
37  FL_LEAVE              = 4,
38  FL_DRAG               = 5,
39  FL_FOCUS              = 6,
40  FL_UNFOCUS            = 7,
41  FL_KEYDOWN            = 8,
42  FL_KEYBOARD           = FL_KEYDOWN,
43  FL_KEYUP              = 9,
44  //FL_CLOSE            = 10, // not in fltk2.0
45  FL_MOVE               = 11,
46  FL_SHORTCUT           = 12,
47  FL_DEACTIVATE         = 13,
48  FL_ACTIVATE           = 14,
49  FL_HIDE               = 15,
50  FL_SHOW               = 16,
51  FL_PASTE              = 17,
52  //FL_SELECTIONCLEAR   = 18, // not in fltk2.0
53  FL_MOUSEWHEEL         = 19,
54  FL_DND_ENTER          = 20,
55  FL_DND_DRAG           = 21,
56  FL_DND_LEAVE          = 22,
57  FL_DND_RELEASE        = 23
58};
59
60enum Fl_When { // These should match values in fltk/Widget.h
61  FL_WHEN_NEVER         = 0,
62  FL_WHEN_CHANGED       = 1,
63  FL_WHEN_RELEASE       = 4,
64  FL_WHEN_RELEASE_ALWAYS= 6,
65  FL_WHEN_ENTER_KEY     = 8,
66  FL_WHEN_ENTER_KEY_ALWAYS=10,
67  FL_WHEN_ENTER_KEY_CHANGED=11,
68  FL_WHEN_NOT_CHANGED   = 2 // modifier bit to disable changed() test
69};
70
71// These should match symbols in fltk/events.h:
72#define FL_Button       0 // old value was 0xfee8
73#define FL_LEFT_MOUSE   1
74#define FL_MIDDLE_MOUSE 2
75#define FL_RIGHT_MOUSE  3
76#define FL_BackSpace    0xff08
77#define FL_Tab          0xff09
78#define FL_Enter        0xff0d
79#define FL_Pause        0xff13
80#define FL_Scroll_Lock  0xff14
81#define FL_Escape       0xff1b
82#define FL_Home         0xff50
83#define FL_Left         0xff51
84#define FL_Up           0xff52
85#define FL_Right        0xff53
86#define FL_Down         0xff54
87#define FL_Page_Up      0xff55
88#define FL_Page_Down    0xff56
89#define FL_End          0xff57
90#define FL_Print        0xff61
91#define FL_Insert       0xff63
92#define FL_Menu         0xff67 // the "menu/apps" key on XFree86
93#define FL_Help         0xff68 // the 'help' key on Mac keyboards
94#define FL_Num_Lock     0xff7f
95#define FL_KP           0xff80 // use FL_KP+'x' for 'x' on numeric keypad
96#define FL_KP_Enter     0xff8d // same as Fl_KP+'\r'
97#define FL_KP_Last      0xffbd // use to range-check keypad
98#define FL_F            0xffbd // use FL_F+n for function key n
99#define FL_F_Last       0xffe0 // use to range-check function keys
100#define FL_Shift_L      0xffe1
101#define FL_Shift_R      0xffe2
102#define FL_Control_L    0xffe3
103#define FL_Control_R    0xffe4
104#define FL_Caps_Lock    0xffe5
105#define FL_Meta_L       0xffe7
106#define FL_Meta_R       0xffe8
107#define FL_Alt_L        0xffe9
108#define FL_Alt_R        0xffea
109#define FL_Delete       0xffff
110
111#define FL_SHIFT        0x00010000
112#define FL_CAPS_LOCK    0x00020000
113#define FL_CTRL         0x00040000
114#define FL_ALT          0x00080000
115#define FL_NUM_LOCK     0x00100000 // most X servers do this?
116#define FL_META         0x00400000
117#define FL_SCROLL_LOCK  0x00800000
118#define FL_BUTTON1      0x01000000
119#define FL_BUTTON2      0x02000000
120#define FL_BUTTON3      0x04000000
121#define FL_BUTTONS      0x7f000000 // All possible buttons
122#define FL_BUTTON(n)    (0x00800000<<(n))
123
124#ifdef __APPLE__
125#  define FL_COMMAND    FL_META
126#else
127#  define FL_COMMAND    FL_CTRL
128#endif // __APPLE__
129
130#include <fltk/Style.h>
131
132typedef fltk::Box* Fl_Boxtype;
133
134// Box types. Many of the FRAME types are deleted in fltk2.0, these have
135// been replaced with the equivalent BOX which draws it's inner area:
136#define FL_NO_BOX               fltk::NO_BOX
137#define FL_FLAT_BOX             fltk::FLAT_BOX
138#define FL_UP_BOX               fltk::UP_BOX
139#define FL_DOWN_BOX             fltk::DOWN_BOX
140#define FL_UP_FRAME             fltk::UP_BOX //
141#define FL_DOWN_FRAME           fltk::DOWN_BOX //
142#define FL_THIN_UP_BOX          fltk::THIN_UP_BOX
143#define FL_THIN_DOWN_BOX        fltk::THIN_DOWN_BOX
144#define FL_THIN_UP_FRAME        fltk::THIN_UP_BOX //
145#define FL_THIN_DOWN_FRAME      fltk::THIN_DOWN_BOX //
146#define FL_ENGRAVED_BOX         fltk::ENGRAVED_BOX
147#define FL_EMBOSSED_BOX         fltk::EMBOSSED_BOX
148#define FL_ENGRAVED_FRAME       fltk::ENGRAVED_BOX //
149#define FL_EMBOSSED_FRAME       fltk::EMBOSSED_BOX //
150#define FL_BORDER_BOX           fltk::BORDER_BOX
151#define FL_SHADOW_BOX           fltk::SHADOW_BOX
152#define FL_BORDER_FRAME         fltk::BORDER_FRAME
153#define FL_SHADOW_FRAME         fltk::SHADOW_BOX //
154#define FL_ROUNDED_BOX          fltk::ROUNDED_BOX
155#define FL_RSHADOW_BOX          fltk::RSHADOW_BOX
156#define FL_ROUNDED_FRAME        fltk::ROUNDED_BOX //
157#define FL_RFLAT_BOX            fltk::RFLAT_BOX
158#define FL_ROUND_UP_BOX         fltk::ROUND_UP_BOX
159#define FL_ROUND_DOWN_BOX       fltk::ROUND_DOWN_BOX
160#define FL_DIAMOND_UP_BOX       fltk::DIAMOND_UP_BOX
161#define FL_DIAMOND_DOWN_BOX     fltk::DIAMOND_DOWN_BOX
162#define FL_OVAL_BOX             fltk::OVAL_BOX
163#define FL_OSHADOW_BOX          fltk::OSHADOW_BOX
164#define FL_OVAL_FRAME           fltk::OVAL_BOX //
165#define FL_OFLAT_BOX            fltk::OFLAT_BOX
166#define FL_PLASTIC_UP_BOX       fltk::PLASTIC_UP_BOX
167#define FL_PLASTIC_DOWN_BOX     fltk::PLASTIC_DOWN_BOX
168#define FL_PLASTIC_UP_FRAME     fltk::PLASTIC_UP_BOX //
169#define FL_PLASTIC_DOWN_FRAME   fltk::PLASTIC_DOWN_BOX //
170//#define FL_FREE_BOXTYPE not used in fltk 2.0
171
172// conversions of box types to other boxtypes:
173//inline Fl_Boxtype fl_down(Fl_Boxtype b) // not implemented
174//inline Fl_Boxtype fl_frame(Fl_Boxtype b)
175
176// back-compatability box types:
177#define FL_FRAME                FL_ENGRAVED_FRAME
178#define FL_FRAME_BOX            FL_ENGRAVED_BOX
179#define FL_CIRCLE_BOX           FL_ROUND_DOWN_BOX
180#define FL_DIAMOND_BOX          FL_DIAMOND_DOWN_BOX
181
182// labeltypes:
183#define FL_NO_LABEL             fltk::NO_LABEL
184#define FL_NORMAL_LABEL         fltk::NORMAL_LABEL
185#define FL_SHADOW_LABEL         fltk::SHADOW_LABEL
186#define FL_ENGRAVED_LABEL       fltk::ENGRAVED_LABEL
187#define FL_EMBOSSED_LABEL       fltk::EMBOSSED_LABEL
188//#define FL_FREE_LABELTYPE not used in fltk2.0
189#define FL_SYMBOL_LABEL         FL_NORMAL_LABEL
190
191#define Fl_Align                fltk::Flags
192enum {
193  FL_ALIGN_CENTER               = 0,
194  FL_ALIGN_TOP                  = fltk::ALIGN_TOP,
195  FL_ALIGN_BOTTOM               = fltk::ALIGN_BOTTOM,
196  FL_ALIGN_LEFT                 = fltk::ALIGN_LEFT,
197  FL_ALIGN_RIGHT                = fltk::ALIGN_RIGHT,
198  FL_ALIGN_INSIDE               = fltk::ALIGN_INSIDE,
199  FL_ALIGN_TEXT_OVER_IMAGE      = fltk::ALIGN_BOTTOM|fltk::ALIGN_INSIDE, //
200  FL_ALIGN_IMAGE_OVER_TEXT      = 0,
201  FL_ALIGN_CLIP                 = fltk::ALIGN_CLIP,
202  FL_ALIGN_WRAP                 = fltk::ALIGN_WRAP,
203  FL_ALIGN_MASK                 = fltk::ALIGN_MASK,
204  FL_ALIGN_TOP_LEFT             = FL_ALIGN_TOP | FL_ALIGN_LEFT,
205  FL_ALIGN_TOP_RIGHT            = FL_ALIGN_TOP | FL_ALIGN_RIGHT,
206  FL_ALIGN_BOTTOM_LEFT          = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT,
207  FL_ALIGN_BOTTOM_RIGHT         = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT,
208  FL_ALIGN_LEFT_TOP             = FL_ALIGN_TOP_LEFT,
209  FL_ALIGN_RIGHT_TOP            = FL_ALIGN_TOP_RIGHT,
210  FL_ALIGN_LEFT_BOTTOM          = FL_ALIGN_BOTTOM_LEFT,
211  FL_ALIGN_RIGHT_BOTTOM         = FL_ALIGN_BOTTOM_RIGHT,
212  FL_ALIGN_NOWRAP               = 0
213};
214
215#define FL_HELVETICA            fltk::HELVETICA
216#define FL_HELVETICA_BOLD       fltk::HELVETICA_BOLD
217#define FL_HELVETICA_ITALIC     fltk::HELVETICA_ITALIC
218#define FL_HELVETICA_BOLD_ITALIC fltk::HELVETICA_BOLD_ITALIC
219#define FL_COURIER              fltk::COURIER
220#define FL_COURIER_BOLD         fltk::COURIER_BOLD
221#define FL_COURIER_ITALIC       fltk::COURIER_ITALIC
222#define FL_COURIER_BOLD_ITALIC  fltk::COURIER_BOLD_ITALIC
223#define FL_TIMES                fltk::TIMES
224#define FL_TIMES_BOLD           fltk::TIMES_BOLD
225#define FL_TIMES_ITALIC         fltk::TIMES_ITALIC
226#define FL_TIMES_BOLD_ITALIC    fltk::TIMES_BOLD_ITALIC
227#define FL_SYMBOL               fltk::SYMBOL_FONT
228#define FL_SCREEN               fltk::SCREEN_FONT
229#define FL_SCREEN_BOLD          fltk::SCREEN_BOLD_FONT
230#define FL_ZAPF_DINGBATS        fltk::ZAPF_DINGBATS
231//#define FL_FREE_FONT
232// These used to be added to the above fonts but were sometimes used alone
233// because FL_HELVETICA was zero. Only using these by themselves works now:
234#define FL_BOLD                 fltk::HELVETICA_BOLD
235#define FL_ITALIC               fltk::HELVETICA_ITALIC
236
237#define FL_NORMAL_SIZE (fltk::Widget::default_style->label_size_)
238#define FL_FOREGROUND_COLOR (fltk::Widget::default_style->label_color_)
239#define FL_BACKGROUND2_COLOR (fltk::Widget::default_style->color_)
240#define FL_SELECTION_COLOR (fltk::Widget::default_style->selection_color_)
241
242#define Fl_Color        fltk::Color
243enum {
244  FL_GRAY0              = fltk::GRAY00,
245  FL_DARK3              = fltk::GRAY33,
246  FL_DARK2              = fltk::GRAY60,
247  FL_DARK1              = fltk::GRAY66,
248  FL_GRAY               = fltk::GRAY75,
249  FL_BACKGROUND_COLOR   = fltk::GRAY75,
250  FL_LIGHT1             = fltk::GRAY85,
251  FL_LIGHT2             = fltk::GRAY90,
252  FL_LIGHT3             = fltk::GRAY99,
253
254  FL_BLACK              = fltk::BLACK,
255  FL_RED                = fltk::RED,
256  FL_GREEN              = fltk::GREEN,
257  FL_YELLOW             = fltk::YELLOW,
258  FL_BLUE               = fltk::BLUE,
259  FL_MAGENTA            = fltk::MAGENTA,
260  FL_CYAN               = fltk::CYAN,
261  FL_DARK_RED           = 72,
262
263  FL_DARK_GREEN         = 60,
264  FL_DARK_YELLOW        = 76,
265  FL_DARK_BLUE          = 136,
266  FL_DARK_MAGENTA       = 152,
267  FL_DARK_CYAN          = 140,
268
269  FL_WHITE              = fltk::WHITE,
270
271  FL_FREE_COLOR         = 16,
272  FL_NUM_FREE_COLOR     = 16,
273  FL_GRAY_RAMP          = fltk::GRAY00,
274  FL_NUM_GRAY           = 24,
275  FL_COLOR_CUBE         = fltk::BLACK,
276  FL_NUM_RED            = 5,
277  FL_NUM_GREEN          = 8,
278  FL_NUM_BLUE           = 5
279};
280
281#define fl_inactive(c)          fltk::inactive(c)
282#define fl_contrast(a,b)        fltk::contrast(a,b)
283#define fl_color_average(a,b,c) fltk::lerp(b,a,c)
284#define fl_lighter(c)           fltk::lerp(fltk::WHITE,c,.67f)
285#define fl_darker(c)            fltk::lerp(fltk::BLACK,c,.67f)
286#define fl_rgb_color            fltk::color
287#define fl_gray_ramp(i)         (fltk::GRAY00+(i))
288#define fl_color_cube(r,g,b)    (((b)*5+(r))*8+(g)+fltk::BLACK)
289
290#include <fltk/Cursor.h>
291#define Fl_Cursor               fltk::Cursor*
292#define FL_CURSOR_DEFAULT       fltk::CURSOR_DEFAULT
293#define FL_CURSOR_ARROW         fltk::CURSOR_ARROW
294#define FL_CURSOR_CROSS         fltk::CURSOR_CROSS
295#define FL_CURSOR_WAIT          fltk::CURSOR_WAIT
296#define FL_CURSOR_INSERT        fltk::CURSOR_INSERT
297#define FL_CURSOR_HAND          fltk::CURSOR_HAND
298#define FL_CURSOR_HELP          fltk::CURSOR_HELP
299#define FL_CURSOR_MOVE          fltk::CURSOR_MOVE
300#define FL_CURSOR_NS            fltk::CURSOR_NS
301#define FL_CURSOR_WE            fltk::CURSOR_WE
302#define FL_CURSOR_NWSE          fltk::CURSOR_NWSE
303#define FL_CURSOR_NESW          fltk::CURSOR_NESW
304#define FL_CURSOR_NO            fltk::CURSOR_NO
305#define FL_CURSOR_NONE          fltk::CURSOR_NONE
306#define FL_CURSOR_N             fltk::CURSOR_NS
307#define FL_CURSOR_NE            fltk::CURSOR_NESW
308#define FL_CURSOR_E             fltk::CURSOR_WE
309#define FL_CURSOR_SE            fltk::CURSOR_NWSE
310#define FL_CURSOR_S             fltk::CURSOR_NS
311#define FL_CURSOR_SW            fltk::CURSOR_NESW
312#define FL_CURSOR_W             fltk::CURSOR_WE
313#define FL_CURSOR_NW            fltk::CURSOR_NWSE
314
315enum { // must match values in fltk/run.h
316  FL_READ = 1,
317  FL_WRITE = 4,
318  FL_EXCEPT = 8
319};
320
321enum Fl_Mode { // must match values in fltk/visual.h
322  FL_RGB        = 0,
323  FL_INDEX      = 1,
324  FL_SINGLE     = 0,
325  FL_DOUBLE     = 2,
326  FL_ACCUM      = 4,
327  FL_ALPHA      = 8,
328  FL_DEPTH      = 16,
329  FL_STENCIL    = 32,
330  FL_RGB8       = 64,
331  FL_MULTISAMPLE= 128,
332  FL_STEREO     = 256,
333  FL_FAKE_SINGLE = 512  // Fake single buffered windows using double-buffer
334};
335
336#include <fltk/damage.h>
337enum Fl_Damage {
338  FL_DAMAGE_CHILD    = fltk::DAMAGE_CHILD,
339  FL_DAMAGE_EXPOSE   = fltk::DAMAGE_EXPOSE,
340  FL_DAMAGE_SCROLL   = fltk::DAMAGE_SCROLL,
341  FL_DAMAGE_OVERLAY  = fltk::DAMAGE_OVERLAY,
342  FL_DAMAGE_ALL      = fltk::DAMAGE_ALL
343};
344
345// FLTK 1.0.x compatibility definitions...
346#  ifdef FLTK_1_0_COMPAT
347#    define contrast    fl_contrast
348#    define down        fl_down
349#    define frame       fl_frame
350#    define inactive    fl_inactive
351#  endif // FLTK_1_0_COMPAT
352
353#endif
354
355//
356// End of "$Id: Enumerations.H 3184 2003-12-13 11:06:54Z spitzak $".
357//
Note: See TracBrowser for help on using the repository browser.