|
| 1 | +#ifndef Fl_Enumerations_H |
| 2 | +#define Fl_Enumerations_H |
| 3 | + |
| 4 | +const double FL_VERSION = 0.99; |
| 5 | + |
| 6 | +typedef unsigned char uchar; |
| 7 | +typedef unsigned long ulong; |
| 8 | +typedef unsigned int u32; // you must fix if not 32 bits on your machine! |
| 9 | + |
| 10 | +enum Fl_Event { // events |
| 11 | + FL_NO_EVENT = 0, |
| 12 | + FL_PUSH = 1, |
| 13 | + FL_RELEASE = 2, |
| 14 | + FL_ENTER = 3, |
| 15 | + FL_LEAVE = 4, |
| 16 | + FL_DRAG = 5, |
| 17 | + FL_FOCUS = 6, |
| 18 | + FL_UNFOCUS = 7, |
| 19 | + FL_KEYBOARD = 8, |
| 20 | + FL_CLOSE = 9, |
| 21 | + FL_MOVE = 10, |
| 22 | + FL_SHORTCUT = 11, |
| 23 | + FL_DEACTIVATE = 13, |
| 24 | + FL_ACTIVATE = 14, |
| 25 | + FL_HIDE = 15, |
| 26 | + FL_SHOW = 16, |
| 27 | + FL_PASTE = 17, |
| 28 | + FL_SELECTIONCLEAR = 18 |
| 29 | +}; |
| 30 | + |
| 31 | +enum Fl_When { // Fl_Widget::when(): |
| 32 | + FL_WHEN_NEVER = 0, |
| 33 | + FL_WHEN_CHANGED = 1, |
| 34 | + FL_WHEN_RELEASE = 4, |
| 35 | + FL_WHEN_RELEASE_ALWAYS= 6, |
| 36 | + FL_WHEN_ENTER_KEY = 8, |
| 37 | + FL_WHEN_ENTER_KEY_ALWAYS=10, |
| 38 | + FL_WHEN_NOT_CHANGED = 2 // modifier bit to disable changed() test |
| 39 | +}; |
| 40 | + |
| 41 | +// Fl::event_key() and Fl::get_key(n) (use ascii letters for all other keys): |
| 42 | +#define FL_Button 0xfee8 // use Fl_Button+n for mouse button n |
| 43 | +#define FL_BackSpace 0xff08 |
| 44 | +#define FL_Tab 0xff09 |
| 45 | +#define FL_Enter 0xff0d |
| 46 | +#define FL_Pause 0xff13 |
| 47 | +#define FL_Scroll_Lock 0xff14 |
| 48 | +#define FL_Escape 0xff1b |
| 49 | +#define FL_Home 0xff50 |
| 50 | +#define FL_Left 0xff51 |
| 51 | +#define FL_Up 0xff52 |
| 52 | +#define FL_Right 0xff53 |
| 53 | +#define FL_Down 0xff54 |
| 54 | +#define FL_Page_Up 0xff55 |
| 55 | +#define FL_Page_Down 0xff56 |
| 56 | +#define FL_End 0xff57 |
| 57 | +#define FL_Print 0xff61 |
| 58 | +#define FL_Insert 0xff63 |
| 59 | +#define FL_Menu 0xff67 // the "menu/apps" key on XFree86 |
| 60 | +#define FL_Num_Lock 0xff7f |
| 61 | +#define FL_KP 0xff80 // use FL_KP+'x' for 'x' on numeric keypad |
| 62 | +#define FL_KP_Enter 0xff8d // same as Fl_KP+'\r' |
| 63 | +#define FL_KP_Last 0xffbd // use to range-check keypad |
| 64 | +#define FL_F 0xffbd // use FL_F+n for function key n |
| 65 | +#define FL_F_Last 0xffe0 // use to range-check function keys |
| 66 | +#define FL_Shift_L 0xffe1 |
| 67 | +#define FL_Shift_R 0xffe2 |
| 68 | +#define FL_Control_L 0xffe3 |
| 69 | +#define FL_Control_R 0xffe4 |
| 70 | +#define FL_Caps_Lock 0xffe5 |
| 71 | +#define FL_Meta_L 0xffe7 // the left MSWindows key on XFree86 |
| 72 | +#define FL_Meta_R 0xffe8 // the right MSWindows key on XFree86 |
| 73 | +#define FL_Alt_L 0xffe9 |
| 74 | +#define FL_Alt_R 0xffea |
| 75 | +#define FL_Delete 0xffff |
| 76 | + |
| 77 | +// Fl::event_state(): |
| 78 | +#define FL_SHIFT 0x00010000 |
| 79 | +#define FL_CAPS_LOCK 0x00020000 |
| 80 | +#define FL_CTRL 0x00040000 |
| 81 | +#define FL_ALT 0x00080000 |
| 82 | +#define FL_NUM_LOCK 0x00100000 // most X servers do this? |
| 83 | +#define FL_META 0x00400000 // correct for XFree86 |
| 84 | +#define FL_SCROLL_LOCK 0x00800000 // correct for XFree86 |
| 85 | +#define FL_BUTTON1 0x01000000 |
| 86 | +#define FL_BUTTON2 0x02000000 |
| 87 | +#define FL_BUTTON3 0x04000000 |
| 88 | + |
| 89 | +enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C): |
| 90 | + FL_NO_BOX = 0, FL_FLAT_BOX, |
| 91 | + |
| 92 | + FL_UP_BOX, FL_DOWN_BOX, |
| 93 | + FL_UP_FRAME, FL_DOWN_FRAME, |
| 94 | + FL_THIN_UP_BOX, FL_THIN_DOWN_BOX, |
| 95 | + FL_THIN_UP_FRAME, FL_THIN_DOWN_FRAME, |
| 96 | + FL_ENGRAVED_BOX, FL_EMBOSSED_BOX, |
| 97 | + FL_ENGRAVED_FRAME, FL_EMBOSSED_FRAME, |
| 98 | + FL_BORDER_BOX, _FL_SHADOW_BOX, |
| 99 | + FL_BORDER_FRAME, _FL_SHADOW_FRAME, |
| 100 | + _FL_ROUNDED_BOX, _FL_RSHADOW_BOX, |
| 101 | + _FL_ROUNDED_FRAME, _FL_RFLAT_BOX, |
| 102 | + _FL_ROUND_UP_BOX, _FL_ROUND_DOWN_BOX, |
| 103 | + _FL_DIAMOND_UP_BOX, _FL_DIAMOND_DOWN_BOX, |
| 104 | + _FL_OVAL_BOX, _FL_OSHADOW_BOX, |
| 105 | + _FL_OVAL_FRAME, _FL_OFLAT_BOX |
| 106 | +}; |
| 107 | +extern Fl_Boxtype define_FL_ROUND_UP_BOX(); |
| 108 | +#define FL_ROUND_UP_BOX define_FL_ROUND_UP_BOX() |
| 109 | +#define FL_ROUND_DOWN_BOX (Fl_Boxtype)(define_FL_ROUND_UP_BOX()+1) |
| 110 | +extern Fl_Boxtype define_FL_SHADOW_BOX(); |
| 111 | +#define FL_SHADOW_BOX define_FL_SHADOW_BOX() |
| 112 | +#define FL_SHADOW_FRAME (Fl_Boxtype)(define_FL_SHADOW_BOX()+2) |
| 113 | +extern Fl_Boxtype define_FL_ROUNDED_BOX(); |
| 114 | +#define FL_ROUNDED_BOX define_FL_ROUNDED_BOX() |
| 115 | +#define FL_ROUNDED_FRAME (Fl_Boxtype)(define_FL_ROUNDED_BOX()+2) |
| 116 | +extern Fl_Boxtype define_FL_RFLAT_BOX(); |
| 117 | +#define FL_RFLAT_BOX define_FL_RFLAT_BOX() |
| 118 | +extern Fl_Boxtype define_FL_RSHADOW_BOX(); |
| 119 | +#define FL_RSHADOW_BOX define_FL_RSHADOW_BOX() |
| 120 | +extern Fl_Boxtype define_FL_DIAMOND_BOX(); |
| 121 | +#define FL_DIAMOND_UP_BOX define_FL_DIAMOND_BOX() |
| 122 | +#define FL_DIAMOND_DOWN_BOX (Fl_Boxtype)(define_FL_DIAMOND_BOX()+1) |
| 123 | +extern Fl_Boxtype define_FL_OVAL_BOX(); |
| 124 | +#define FL_OVAL_BOX define_FL_OVAL_BOX() |
| 125 | +#define FL_OSHADOW_BOX (Fl_Boxtype)(define_FL_OVAL_BOX()+1) |
| 126 | +#define FL_OVAL_FRAME (Fl_Boxtype)(define_FL_OVAL_BOX()+2) |
| 127 | +#define FL_OFLAT_BOX (Fl_Boxtype)(define_FL_OVAL_BOX()+3) |
| 128 | + |
| 129 | +// conversions of box types to other boxtypes: |
| 130 | +inline Fl_Boxtype down(Fl_Boxtype b) {return (Fl_Boxtype)(b|1);} |
| 131 | +inline Fl_Boxtype frame(Fl_Boxtype b) {return (Fl_Boxtype)(b|2);} |
| 132 | + |
| 133 | +// back-compatability box types: |
| 134 | +#define FL_FRAME FL_ENGRAVED_FRAME |
| 135 | +#define FL_FRAME_BOX FL_ENGRAVED_BOX |
| 136 | +#define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX |
| 137 | +#define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX |
| 138 | + |
| 139 | +enum Fl_Labeltype { // labeltypes: |
| 140 | + FL_NORMAL_LABEL = 0, |
| 141 | + FL_NO_LABEL, |
| 142 | + _FL_SYMBOL_LABEL, |
| 143 | + _FL_SHADOW_LABEL, |
| 144 | + _FL_ENGRAVED_LABEL, |
| 145 | + _FL_EMBOSSED_LABEL, |
| 146 | + _FL_BITMAP_LABEL, |
| 147 | + _FL_PIXMAP_LABEL, |
| 148 | + _FL_IMAGE_LABEL, |
| 149 | + _FL_MULTI_LABEL, |
| 150 | + FL_FREE_LABELTYPE |
| 151 | +}; |
| 152 | +extern Fl_Labeltype define_FL_SYMBOL_LABEL(); |
| 153 | +#define FL_SYMBOL_LABEL define_FL_SYMBOL_LABEL() |
| 154 | +extern Fl_Labeltype define_FL_SHADOW_LABEL(); |
| 155 | +#define FL_SHADOW_LABEL define_FL_SHADOW_LABEL() |
| 156 | +extern Fl_Labeltype define_FL_ENGRAVED_LABEL(); |
| 157 | +#define FL_ENGRAVED_LABEL define_FL_ENGRAVED_LABEL() |
| 158 | +extern Fl_Labeltype define_FL_EMBOSSED_LABEL(); |
| 159 | +#define FL_EMBOSSED_LABEL define_FL_EMBOSSED_LABEL() |
| 160 | + |
| 161 | +enum Fl_Align { // align() values |
| 162 | + FL_ALIGN_CENTER = 0, |
| 163 | + FL_ALIGN_TOP = 1, |
| 164 | + FL_ALIGN_BOTTOM = 2, |
| 165 | + FL_ALIGN_LEFT = 4, |
| 166 | + FL_ALIGN_RIGHT = 8, |
| 167 | + FL_ALIGN_INSIDE = 16, |
| 168 | + FL_ALIGN_CLIP = 64, |
| 169 | + FL_ALIGN_WRAP = 128, |
| 170 | + FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT, |
| 171 | + FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT, |
| 172 | + FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT, |
| 173 | + FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT, |
| 174 | + FL_ALIGN_LEFT_TOP = FL_ALIGN_TOP_LEFT, |
| 175 | + FL_ALIGN_RIGHT_TOP = FL_ALIGN_TOP_RIGHT, |
| 176 | + FL_ALIGN_LEFT_BOTTOM = FL_ALIGN_BOTTOM_LEFT, |
| 177 | + FL_ALIGN_RIGHT_BOTTOM = FL_ALIGN_BOTTOM_RIGHT, |
| 178 | + FL_ALIGN_NOWRAP = 0 // for back compatability |
| 179 | +}; |
| 180 | + |
| 181 | +enum Fl_Font { // standard fonts |
| 182 | + FL_HELVETICA = 0, |
| 183 | + FL_HELVETICA_BOLD, |
| 184 | + FL_HELVETICA_ITALIC, |
| 185 | + FL_HELVETICA_BOLD_ITALIC, |
| 186 | + FL_COURIER, |
| 187 | + FL_COURIER_BOLD, |
| 188 | + FL_COURIER_ITALIC, |
| 189 | + FL_COURIER_BOLD_ITALIC, |
| 190 | + FL_TIMES, |
| 191 | + FL_TIMES_BOLD, |
| 192 | + FL_TIMES_ITALIC, |
| 193 | + FL_TIMES_BOLD_ITALIC, |
| 194 | + FL_SYMBOL, |
| 195 | + FL_SCREEN, |
| 196 | + FL_SCREEN_BOLD, |
| 197 | + FL_ZAPF_DINGBATS, |
| 198 | + |
| 199 | + FL_FREE_FONT = 16, // first one to allocate |
| 200 | + FL_BOLD = 1, // add this to helvetica, courier, or times |
| 201 | + FL_ITALIC = 2 // add this to helvetica, courier, or times |
| 202 | +}; |
| 203 | + |
| 204 | +#define FL_NORMAL_SIZE 14 // default size of all labels & text |
| 205 | + |
| 206 | +enum Fl_Color { // standard colors |
| 207 | + FL_BLACK = 0, |
| 208 | + FL_RED = 1, |
| 209 | + FL_GREEN = 2, |
| 210 | + FL_YELLOW = 3, |
| 211 | + FL_BLUE = 4, |
| 212 | + FL_MAGENTA = 5, |
| 213 | + FL_CYAN = 6, |
| 214 | + FL_WHITE = 7, |
| 215 | + FL_INACTIVE_COLOR = 8, |
| 216 | + FL_SELECTION_COLOR = 15, |
| 217 | + |
| 218 | + FL_FREE_COLOR = 16, |
| 219 | + FL_NUM_FREE_COLOR = 16, |
| 220 | + |
| 221 | + FL_GRAY_RAMP = 32, |
| 222 | + |
| 223 | + // boxtypes limit themselves to these colors so whole ramp is not allocated: |
| 224 | + FL_GRAY0 = 32, // 'A' |
| 225 | + FL_DARK3 = 39, // 'H' |
| 226 | + FL_DARK2 = 45, // 'N' |
| 227 | + FL_DARK1 = 47, // 'P' |
| 228 | + FL_GRAY = 49, // 'R' default color |
| 229 | + FL_LIGHT1 = 50, // 'S' |
| 230 | + FL_LIGHT2 = 52, // 'U' |
| 231 | + FL_LIGHT3 = 54, // 'W' |
| 232 | + |
| 233 | + FL_COLOR_CUBE = 56 |
| 234 | +}; |
| 235 | + |
| 236 | +inline Fl_Color inactive(Fl_Color c) {return (Fl_Color)(c|8);} |
| 237 | +Fl_Color contrast(Fl_Color fg, Fl_Color bg); |
| 238 | +#define FL_NUM_GRAY 24 |
| 239 | +inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);} |
| 240 | +#define FL_NUM_RED 5 |
| 241 | +#define FL_NUM_GREEN 8 |
| 242 | +#define FL_NUM_BLUE 5 |
| 243 | +inline Fl_Color fl_color_cube(int r, int g, int b) { |
| 244 | + return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);} |
| 245 | + |
| 246 | +enum Fl_Cursor { // standard cursors |
| 247 | + FL_CURSOR_DEFAULT = 0, |
| 248 | + FL_CURSOR_ARROW = 35, |
| 249 | + FL_CURSOR_CROSS = 66, |
| 250 | + FL_CURSOR_WAIT = 76, |
| 251 | + FL_CURSOR_INSERT = 77, |
| 252 | + FL_CURSOR_HAND = 31, |
| 253 | + FL_CURSOR_HELP = 47, |
| 254 | + FL_CURSOR_MOVE = 27, |
| 255 | + // fltk provides bitmaps for these: |
| 256 | + FL_CURSOR_NS = 78, |
| 257 | + FL_CURSOR_WE = 79, |
| 258 | + FL_CURSOR_NWSE = 80, |
| 259 | + FL_CURSOR_NESW = 81, |
| 260 | + FL_CURSOR_NONE = 255, |
| 261 | + // for back compatability (non MSWindows ones): |
| 262 | + FL_CURSOR_N = 70, |
| 263 | + FL_CURSOR_NE = 69, |
| 264 | + FL_CURSOR_E = 49, |
| 265 | + FL_CURSOR_SE = 8, |
| 266 | + FL_CURSOR_S = 9, |
| 267 | + FL_CURSOR_SW = 7, |
| 268 | + FL_CURSOR_W = 36, |
| 269 | + FL_CURSOR_NW = 68 |
| 270 | + //FL_CURSOR_NS = 22, |
| 271 | + //FL_CURSOR_WE = 55, |
| 272 | +}; |
| 273 | + |
| 274 | +enum { // values for "when" passed to Fl::add_fd() |
| 275 | + FL_READ = 1, |
| 276 | + FL_WRITE = 4, |
| 277 | + FL_EXCEPT = 8 |
| 278 | +}; |
| 279 | + |
| 280 | +enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut) |
| 281 | + FL_RGB = 0, |
| 282 | + FL_INDEX = 1, |
| 283 | + FL_SINGLE = 0, |
| 284 | + FL_DOUBLE = 2, |
| 285 | + FL_ACCUM = 4, |
| 286 | + FL_ALPHA = 8, |
| 287 | + FL_DEPTH = 16, |
| 288 | + FL_STENCIL = 32, |
| 289 | + FL_RGB8 = 64, |
| 290 | + FL_MULTISAMPLE= 128 |
| 291 | +}; |
| 292 | + |
| 293 | +#endif |
0 commit comments