FLTK 1.3.2
Enumerations.H
Go to the documentation of this file.
1 //
2 // "$Id: Enumerations.H 9856 2013-04-02 16:47:57Z greg.ercolano $"
3 //
4 // Enumerations for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2012 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
23 #ifndef Fl_Enumerations_H
24 #define Fl_Enumerations_H
25 
26 /* Uncomment the following FLTK_ABI_VERSION line to enable ABI breaking fixes
27  * in the current patch release of FLTK. ** Use for static builds only! **
28  * For more info on this macro, see: http://fltk.org/cmp.php#FLTK_ABI_VERSION
29  */
30 //#define FLTK_ABI_VERSION 10303
31 
32 # include "Fl_Export.H"
33 # include "fl_types.h"
34 
43 
48 #define FL_MAJOR_VERSION 1
49 
55 #define FL_MINOR_VERSION 3
56 
62 #define FL_PATCH_VERSION 2
63 
75 #define FL_VERSION ((double)FL_MAJOR_VERSION + \
76  (double)FL_MINOR_VERSION * 0.01 + \
77  (double)FL_PATCH_VERSION * 0.0001)
78  // group: Version Numbers
80 
96 enum Fl_Event { // events
99 
111  FL_PUSH = 1,
112 
120 
128  FL_ENTER = 3,
129 
134  FL_LEAVE = 4,
135 
143  FL_DRAG = 5,
144 
158  FL_FOCUS = 6,
159 
164 
186 
191 
195  FL_KEYUP = 9,
196 
202  FL_CLOSE = 10,
203 
210  FL_MOVE = 11,
211 
225 
232 
237 
244  FL_HIDE = 15,
245 
252  FL_SHOW = 16,
253 
258  FL_PASTE = 17,
259 
266 
271 
277 
283 
287 
300 };
301 
309 enum Fl_When { // Fl_Widget::when():
318 };
319  // group: When Conditions
321 
334 
335 // FIXME: These codes collide with valid Unicode keys
336 
337 #define FL_Button 0xfee8
338 #define FL_BackSpace 0xff08
339 #define FL_Tab 0xff09
340 #define FL_Iso_Key 0xff0c
341 #define FL_Enter 0xff0d
342 #define FL_Pause 0xff13
343 #define FL_Scroll_Lock 0xff14
344 #define FL_Escape 0xff1b
345 #define FL_Kana 0xff2e
346 #define FL_Eisu 0xff2f
347 #define FL_Yen 0xff30
348 #define FL_JIS_Underscore 0xff31
349 #define FL_Home 0xff50
350 #define FL_Left 0xff51
351 #define FL_Up 0xff52
352 #define FL_Right 0xff53
353 #define FL_Down 0xff54
354 #define FL_Page_Up 0xff55
355 #define FL_Page_Down 0xff56
356 #define FL_End 0xff57
357 #define FL_Print 0xff61
358 #define FL_Insert 0xff63
359 #define FL_Menu 0xff67
360 #define FL_Help 0xff68
361 #define FL_Num_Lock 0xff7f
362 #define FL_KP 0xff80
363 #define FL_KP_Enter 0xff8d
364 #define FL_KP_Last 0xffbd
365 #define FL_F 0xffbd
366 #define FL_F_Last 0xffe0
367 #define FL_Shift_L 0xffe1
368 #define FL_Shift_R 0xffe2
369 #define FL_Control_L 0xffe3
370 #define FL_Control_R 0xffe4
371 #define FL_Caps_Lock 0xffe5
372 #define FL_Meta_L 0xffe7
373 #define FL_Meta_R 0xffe8
374 #define FL_Alt_L 0xffe9
375 #define FL_Alt_R 0xffea
376 #define FL_Delete 0xffff
377 
378 // These use the Private Use Area (PUA) of the Basic Multilingual Plane
379 // of Unicode. Guaranteed not to conflict with a proper Unicode character.
380 
381 // These primarily map to the XFree86 keysym range
382 #define FL_Volume_Down 0xEF11 /* Volume control down */
383 #define FL_Volume_Mute 0xEF12 /* Mute sound from the system */
384 #define FL_Volume_Up 0xEF13 /* Volume control up */
385 #define FL_Media_Play 0xEF14 /* Start playing of audio */
386 #define FL_Media_Stop 0xEF15 /* Stop playing audio */
387 #define FL_Media_Prev 0xEF16 /* Previous track */
388 #define FL_Media_Next 0xEF17 /* Next track */
389 #define FL_Home_Page 0xEF18 /* Display user's home page */
390 #define FL_Mail 0xEF19 /* Invoke user's mail program */
391 #define FL_Search 0xEF1B /* Search */
392 #define FL_Back 0xEF26 /* Like back on a browser */
393 #define FL_Forward 0xEF27 /* Like forward on a browser */
394 #define FL_Stop 0xEF28 /* Stop current operation */
395 #define FL_Refresh 0xEF29 /* Refresh the page */
396 #define FL_Sleep 0xEF2F /* Put system to sleep */
397 #define FL_Favorites 0xEF30 /* Show favorite locations */
398  // group: Mouse and Keyboard Events
400 
409 
410 #define FL_LEFT_MOUSE 1
411 #define FL_MIDDLE_MOUSE 2
412 #define FL_RIGHT_MOUSE 3
413 
414  // group: Mouse Buttons
415 
416 
422  // group: Event States
423 
424 // FIXME: it would be nice to have the modifiers in the upper 8 bit so that
425 // a unicode ke (24bit) can be sent as an unsigned with the modifiers.
426 
427 #define FL_SHIFT 0x00010000
428 #define FL_CAPS_LOCK 0x00020000
429 #define FL_CTRL 0x00040000
430 #define FL_ALT 0x00080000
431 #define FL_NUM_LOCK 0x00100000
432  // most X servers do this?
433 #define FL_META 0x00400000
434  // correct for XFree86
435 #define FL_SCROLL_LOCK 0x00800000
436  // correct for XFree86
437 #define FL_BUTTON1 0x01000000
438 #define FL_BUTTON2 0x02000000
439 #define FL_BUTTON3 0x04000000
440 #define FL_BUTTONS 0x7f000000
441 #define FL_BUTTON(n) (0x00800000<<(n))
442 
443 #define FL_KEY_MASK 0x0000ffff
444  // FIXME: Unicode needs 24 bits!
445 
446 #ifdef __APPLE__
447 # define FL_COMMAND FL_META
448 # define FL_CONTROL FL_CTRL
449 #else
450 # define FL_COMMAND FL_CTRL
451 # define FL_CONTROL FL_META
452 #endif // __APPLE__
453  // group: Event States
455 
473 enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C):
474 
475  FL_NO_BOX = 0,
524 };
525 extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX();
526 #define FL_ROUND_UP_BOX fl_define_FL_ROUND_UP_BOX()
527 #define FL_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_ROUND_UP_BOX()+1)
528 extern FL_EXPORT Fl_Boxtype fl_define_FL_SHADOW_BOX();
529 #define FL_SHADOW_BOX fl_define_FL_SHADOW_BOX()
530 #define FL_SHADOW_FRAME (Fl_Boxtype)(fl_define_FL_SHADOW_BOX()+2)
531 extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUNDED_BOX();
532 #define FL_ROUNDED_BOX fl_define_FL_ROUNDED_BOX()
533 #define FL_ROUNDED_FRAME (Fl_Boxtype)(fl_define_FL_ROUNDED_BOX()+2)
534 extern FL_EXPORT Fl_Boxtype fl_define_FL_RFLAT_BOX();
535 #define FL_RFLAT_BOX fl_define_FL_RFLAT_BOX()
536 extern FL_EXPORT Fl_Boxtype fl_define_FL_RSHADOW_BOX();
537 #define FL_RSHADOW_BOX fl_define_FL_RSHADOW_BOX()
538 extern FL_EXPORT Fl_Boxtype fl_define_FL_DIAMOND_BOX();
539 #define FL_DIAMOND_UP_BOX fl_define_FL_DIAMOND_BOX()
540 #define FL_DIAMOND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_DIAMOND_BOX()+1)
541 extern FL_EXPORT Fl_Boxtype fl_define_FL_OVAL_BOX();
542 #define FL_OVAL_BOX fl_define_FL_OVAL_BOX()
543 #define FL_OSHADOW_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+1)
544 #define FL_OVAL_FRAME (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+2)
545 #define FL_OFLAT_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+3)
546 
547 extern FL_EXPORT Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX();
548 #define FL_PLASTIC_UP_BOX fl_define_FL_PLASTIC_UP_BOX()
549 #define FL_PLASTIC_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+1)
550 #define FL_PLASTIC_UP_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+2)
551 #define FL_PLASTIC_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+3)
552 #define FL_PLASTIC_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+4)
553 #define FL_PLASTIC_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+5)
554 #define FL_PLASTIC_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+6)
555 #define FL_PLASTIC_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+7)
556 
557 extern FL_EXPORT Fl_Boxtype fl_define_FL_GTK_UP_BOX();
558 #define FL_GTK_UP_BOX fl_define_FL_GTK_UP_BOX()
559 #define FL_GTK_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+1)
560 #define FL_GTK_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+2)
561 #define FL_GTK_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+3)
562 #define FL_GTK_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+4)
563 #define FL_GTK_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+5)
564 #define FL_GTK_THIN_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+6)
565 #define FL_GTK_THIN_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+7)
566 #define FL_GTK_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+8)
567 #define FL_GTK_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+9)
568 
569 // conversions of box types to other boxtypes:
576  return (Fl_Boxtype)((b<FL_UP_BOX||b%4>1)?b:(b-2));
577 }
584  return (Fl_Boxtype)((b<FL_UP_BOX)?b:(b|1));
585 }
592  return (Fl_Boxtype)((b%4<2)?b:(b+2));
593 }
594 
595 // back-compatibility box types:
596 #define FL_FRAME FL_ENGRAVED_FRAME
597 #define FL_FRAME_BOX FL_ENGRAVED_BOX
598 #define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX
599 #define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX
600  // group: Box Types
602 
615 enum Fl_Labeltype { // labeltypes:
624 
626 };
627 
632 #define FL_SYMBOL_LABEL FL_NORMAL_LABEL
633 extern Fl_Labeltype FL_EXPORT fl_define_FL_SHADOW_LABEL();
634 #define FL_SHADOW_LABEL fl_define_FL_SHADOW_LABEL()
635 extern Fl_Labeltype FL_EXPORT fl_define_FL_ENGRAVED_LABEL();
636 #define FL_ENGRAVED_LABEL fl_define_FL_ENGRAVED_LABEL()
637 extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL();
638 #define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL()
639 
672 typedef unsigned Fl_Align;
702 const Fl_Align FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT;
703 const Fl_Align FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT;
704 const Fl_Align FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT;
705 const Fl_Align FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT;
706 const Fl_Align FL_ALIGN_LEFT_TOP = 0x0007; // magic value
707 const Fl_Align FL_ALIGN_RIGHT_TOP = 0x000b; // magic value
708 const Fl_Align FL_ALIGN_LEFT_BOTTOM = 0x000d; // magic value
709 const Fl_Align FL_ALIGN_RIGHT_BOTTOM = 0x000e; // magic value
710 const Fl_Align FL_ALIGN_NOWRAP = (Fl_Align)0; // for back compatibility
711 const Fl_Align FL_ALIGN_POSITION_MASK = 0x000f; // left, right, top, bottom
712 const Fl_Align FL_ALIGN_IMAGE_MASK = 0x0320; // l/r, t/b, backdrop
721 typedef int Fl_Font;
722 
727 const Fl_Font FL_COURIER = 4;
731 const Fl_Font FL_TIMES = 8;
735 const Fl_Font FL_SYMBOL = 12;
736 const Fl_Font FL_SCREEN = 13;
739 
740 const Fl_Font FL_FREE_FONT = 16;
741 const Fl_Font FL_BOLD = 1;
742 const Fl_Font FL_ITALIC = 2;
744 
750 typedef int Fl_Fontsize;
751 
752 extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE;
753 
778 typedef unsigned int Fl_Color;
779 
780 // Standard colors. These are used as default colors in widgets and altered as necessary
785 
786  // boxtypes generally limit themselves to these colors so
787  // the whole ramp is not allocated:
788 
789 const Fl_Color FL_GRAY0 = 32; // 'A'
790 const Fl_Color FL_DARK3 = 39; // 'H'
791 const Fl_Color FL_DARK2 = 45; // 'N'
792 const Fl_Color FL_DARK1 = 47; // 'P'
793 const Fl_Color FL_BACKGROUND_COLOR = 49; // 'R' default background color
794 const Fl_Color FL_LIGHT1 = 50; // 'S'
795 const Fl_Color FL_LIGHT2 = 52; // 'U'
796 const Fl_Color FL_LIGHT3 = 54; // 'W'
797 
798  // FLTK provides a 5x8x5 color cube that is used with colormap visuals
799 
800 const Fl_Color FL_BLACK = 56;
801 const Fl_Color FL_RED = 88;
802 const Fl_Color FL_GREEN = 63;
803 const Fl_Color FL_YELLOW = 95;
804 const Fl_Color FL_BLUE = 216;
805 const Fl_Color FL_MAGENTA = 248;
806 const Fl_Color FL_CYAN = 223;
807 const Fl_Color FL_DARK_RED = 72;
808 
809 const Fl_Color FL_DARK_GREEN = 60;
810 const Fl_Color FL_DARK_YELLOW = 76;
811 const Fl_Color FL_DARK_BLUE = 136;
812 const Fl_Color FL_DARK_MAGENTA = 152;
813 const Fl_Color FL_DARK_CYAN = 140;
814 
815 const Fl_Color FL_WHITE = 255;
816 
817 
818 #define FL_FREE_COLOR (Fl_Color)16
819 #define FL_NUM_FREE_COLOR 16
820 #define FL_GRAY_RAMP (Fl_Color)32
821 #define FL_NUM_GRAY 24
822 #define FL_GRAY FL_BACKGROUND_COLOR
823 #define FL_COLOR_CUBE (Fl_Color)56
824 #define FL_NUM_RED 5
825 #define FL_NUM_GREEN 8
826 #define FL_NUM_BLUE 5
827 
828 FL_EXPORT Fl_Color fl_inactive(Fl_Color c);
829 
830 FL_EXPORT Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg);
831 
832 FL_EXPORT Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight);
833 
835 inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); }
836 
838 inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); }
839 
842  if (!r && !g && !b) return FL_BLACK;
843  else return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8);
844 }
845 
848  if (!g) return FL_BLACK;
849  else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8);
850 }
851 
860 inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);}
861 
876 inline Fl_Color fl_color_cube(int r, int g, int b) {
877  return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);}
878  // group: Colors
880 
883 
891 enum Fl_Cursor {
900  // fltk provides bitmaps for these:
906  // for back compatibility (non MSWindows ones):
907  FL_CURSOR_N = 70,
909  FL_CURSOR_E = 49,
913  FL_CURSOR_W = 36,
915 }; // group: Cursors
917 
919 enum { // values for "when" passed to Fl::add_fd()
920  FL_READ = 1,
921  FL_WRITE = 4,
923 };
924 
926 enum Fl_Mode {
927  FL_RGB = 0,
928  FL_INDEX = 1,
929  FL_SINGLE = 0,
930  FL_DOUBLE = 2,
931  FL_ACCUM = 4,
932  FL_ALPHA = 8,
933  FL_DEPTH = 16,
934  FL_STENCIL = 32,
935  FL_RGB8 = 64,
936  FL_MULTISAMPLE= 128,
937  FL_STEREO = 256,
938  FL_FAKE_SINGLE = 512 // Fake single buffered windows using double-buffer
939 };
940 
941 // image alpha blending
942 
943 #define FL_IMAGE_WITH_ALPHA 0x40000000
944 
946 enum Fl_Damage {
954 };
955 
956 // FLTK 1.0.x compatibility definitions...
957 # ifdef FLTK_1_0_COMPAT
958 # define contrast fl_contrast
959 # define down fl_down
960 # define frame fl_frame
961 # define inactive fl_inactive
962 # endif // FLTK_1_0_COMPAT
963 
964 #endif
965 
966 //
967 // End of "$Id: Enumerations.H 9856 2013-04-02 16:47:57Z greg.ercolano $".
968 //