mirror of https://github.com/fltk/fltk.git
FLTK - Fast Light Tool Kit - https://github.com/fltk/fltk - cross platform GUI development
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
686 lines
24 KiB
686 lines
24 KiB
// |
|
// "$Id$" |
|
// |
|
// Enumerations for the Fast Light Tool Kit (FLTK). |
|
// |
|
// Copyright 1998-2008 by Bill Spitzak and others. |
|
// |
|
// This library is free software; you can redistribute it and/or |
|
// modify it under the terms of the GNU Library General Public |
|
// License as published by the Free Software Foundation; either |
|
// version 2 of the License, or (at your option) any later version. |
|
// |
|
// This library is distributed in the hope that it will be useful, |
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
// Library General Public License for more details. |
|
// |
|
// You should have received a copy of the GNU Library General Public |
|
// License along with this library; if not, write to the Free Software |
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 |
|
// USA. |
|
// |
|
// Please report all bugs and problems on the following page: |
|
// |
|
// http://www.fltk.org/str.php |
|
// |
|
|
|
/** \file |
|
* This file contains type definitions and general enumerations. |
|
*/ |
|
|
|
#ifndef Fl_Enumerations_H |
|
#define Fl_Enumerations_H |
|
|
|
# include "Fl_Export.H" |
|
|
|
/** |
|
* The major release version of this FLTK library. |
|
*/ |
|
#define FL_MAJOR_VERSION 1 |
|
|
|
/** |
|
* The minor release version for this library. |
|
* |
|
* FLTK remains mostly source-code compatible between minor version changes. |
|
*/ |
|
#define FL_MINOR_VERSION 3 |
|
|
|
/** |
|
* The patch version for this library. |
|
* |
|
* FLTK remains binary compatible between patches. |
|
*/ |
|
#define FL_PATCH_VERSION 0 |
|
|
|
/** |
|
* The FLTK version number as a \em double. |
|
* |
|
* This is changed slightly from the beta versions |
|
* because the old "const double" definition would not allow for conditional |
|
* compilation... |
|
* |
|
* FL_VERSION is a double that describes the major and minor version numbers. |
|
* Version 1.1 is actually stored as 1.01 to allow for more than 9 minor |
|
* releases. |
|
* |
|
* The FL_MAJOR_VERSION, FL_MINOR_VERSION, and FL_PATCH_VERSION constants |
|
* give the integral values for the major, minor, and patch releases |
|
* respectively. |
|
*/ |
|
#define FL_VERSION ((double)FL_MAJOR_VERSION + \ |
|
(double)FL_MINOR_VERSION * 0.01 + \ |
|
(double)FL_PATCH_VERSION * 0.0001) |
|
|
|
typedef unsigned char uchar; |
|
typedef unsigned long ulong; |
|
|
|
// FIXME: temporarary (?) typedef to mark UTF8 and Unicode conversions |
|
typedef char *Fl_String; // flexible length utf8 Unicode text |
|
typedef const char *Fl_CString; // flexible length utf8 Unicode read-only string |
|
typedef unsigned int Fl_Char; // 24-bit Unicode character + 8-bit indicatur for keyboard flags |
|
|
|
|
|
/** |
|
* Every time a user moves the mouse pointer, clicks a button, |
|
* or presses a key, an event is generated and sent to your |
|
* application. Events can also come from other programs like the |
|
* window manager. |
|
* |
|
* Events are identified by the integer argument passed to the |
|
* Fl_Widget::handle() virtual method. Other information about the |
|
* most recent event is stored in static locations and acquired by |
|
* calling the Fl::event_*() methods. This static information remains |
|
* valid until the next event is read from the window system, so it |
|
* is ok to look at it outside of the handle() method. |
|
*/ |
|
enum Fl_Event { // events |
|
FL_NO_EVENT = 0, |
|
|
|
/** A mouse button has gone down with the mouse pointing at this |
|
* widget. You can find out what button by calling Fl::event_button(). |
|
* You find out the mouse position by calling Fl::event_x() and |
|
* Fl::event_y(). |
|
* |
|
* A widget indicates that it "wants" the mouse click by returning non-zero |
|
* from its Fl_Widget::handle() method. It will then become the |
|
* Fl::pushed() widget and will get FL_DRAG and the matching FL_RELEASE events. |
|
* If Fl_Widget::handle() returns zero then FLTK will try sending the FL_PUSH |
|
* to another widget. |
|
*/ |
|
FL_PUSH = 1, |
|
|
|
/** A mouse button has been released. You can find out what button by |
|
* calling Fl::event_button(). |
|
* |
|
* In order to receive the FL_RELEASE event, the widget must return |
|
* non-zero when handling FL_PUSH. |
|
*/ |
|
FL_RELEASE = 2, |
|
|
|
/** The mouse has been moved to point at this widget. This can |
|
* be used for highlighting feedback. If a widget wants to |
|
* highlight or otherwise track the mouse, it indicates this by |
|
* returning non-zero from its handle() method. It then |
|
* becomes the Fl::belowmouse() widget and will receive |
|
* FL_MOVE and FL_LEAVE events. |
|
*/ |
|
FL_ENTER = 3, |
|
|
|
/** The mouse has moved out of the widget. |
|
* In order to receive the FL_LEAVE event, the widget must |
|
* return non-zero when handling FL_ENTER. |
|
*/ |
|
FL_LEAVE = 4, |
|
|
|
/** The mouse has moved with a button held down. The current button state |
|
* is in Fl::event_state(). The mouse position is in Fl::event_x() and |
|
* Fl::event_y(). |
|
* |
|
* In order to receive FL_DRAG events, the widget must return non-zero |
|
* when handling FL_PUSH. |
|
*/ |
|
FL_DRAG = 5, |
|
|
|
/** This indicates an <I>attempt</I> to give a widget the keyboard focus. |
|
* |
|
* If a widget wants the focus, it should change itself to display the |
|
* fact that it has the focus, and return non-zero from its handle() method. |
|
* It then becomes the Fl::focus() widget and gets FL_KEYDOWN, FL_KEYUP, |
|
* and FL_UNFOCUS events. |
|
* |
|
* The focus will change either because the window manager changed which |
|
* window gets the focus, or because the user tried to navigate using tab, |
|
* arrows, or other keys. You can check Fl::event_key() to figure out why |
|
* it moved. For navigation it will be the key pressed and interaction |
|
* with the window manager it will be zero. |
|
*/ |
|
FL_FOCUS = 6, |
|
|
|
/** This event is sent to the previous Fl::focus() widget when another |
|
* widget gets the focus or the window loses focus. |
|
*/ |
|
FL_UNFOCUS = 7, |
|
|
|
/** A key was pressed or released. The key can be found in Fl::event_key(). |
|
* The text that the key should insert can be found with Fl::event_text() |
|
* and its length is in Fl::event_length(). If you use the key handle() |
|
* should return 1. If you return zero then FLTK assumes you ignored the |
|
* key and will then attempt to send it to a parent widget. If none of |
|
* them want it, it will change the event into a FL_SHORTCUT event. |
|
* |
|
* To receive FL_KEYBOARD events you must also respond to the FL_FOCUS |
|
* and FL_UNFOCUS events. |
|
* |
|
* If you are writing a text-editing widget you may also want to call |
|
* the Fl::compose() function to translate individual keystrokes into |
|
* foreign characters. |
|
* |
|
* FL_KEYUP events are sent to the widget that currently has focus. This |
|
* is not necessarily the same widget that received the corresponding |
|
* FL_KEYDOWN event because focus may have changed between events. |
|
*/ |
|
FL_KEYDOWN = 8, |
|
|
|
/** Equvalent to FL_KEYDOWN. |
|
* \see FL_KEYDOWN |
|
*/ |
|
FL_KEYBOARD = 8, |
|
|
|
/** Key release event. |
|
* \see FL_KEYDOWN |
|
*/ |
|
FL_KEYUP = 9, |
|
|
|
/** The user clicked the close button of a window. |
|
* This event is used internally only to trigger the callback of |
|
* Fl_Window derived classed. The default callback closes the |
|
* window calling Fl_Window::hide(). |
|
*/ |
|
FL_CLOSE = 10, |
|
|
|
/** The mouse has moved without any mouse buttons held down. |
|
* This event is sent to the Fl::belowmouse() widget. |
|
* |
|
* In order to receive FL_MOVE events, the widget must return |
|
* non-zero when handling FL_ENTER. |
|
*/ |
|
FL_MOVE = 11, |
|
|
|
/** If the Fl::focus() widget is zero or ignores an FL_KEYBOARD |
|
* event then FLTK tries sending this event to every widget it |
|
* can, until one of them returns non-zero. FL_SHORTCUT is first |
|
* sent to the Fl::belowmouse() widget, then its parents and siblings, |
|
* and eventually to every widget in the window, trying to find an |
|
* object that returns non-zero. FLTK tries really hard to not to ignore |
|
* any keystrokes! |
|
* |
|
* You can also make "global" shortcuts by using Fl::add_handler(). A |
|
* global shortcut will work no matter what windows are displayed or |
|
* which one has the focus. |
|
*/ |
|
FL_SHORTCUT = 12, |
|
|
|
/** This widget is no longer active, due to Fl_Widget::deactivate() |
|
* being called on it or one of its parents. Fl_Widget::active() may |
|
* still be true after this, the widget is only active if Fl_Widget::active() |
|
* is true on it and all its parents (use Fl_Widget::active_r() to check this). |
|
*/ |
|
FL_DEACTIVATE = 13, |
|
|
|
/** This widget is now active, due to Fl_Widget::activate() being |
|
* called on it or one of its parents. |
|
*/ |
|
FL_ACTIVATE = 14, |
|
|
|
/** This widget is no longer visible, due to Fl_Widget::hide() being |
|
* called on it or one of its parents, or due to a parent window being |
|
* minimized. Fl_Widget::visible() may still be true after this, but the |
|
* widget is visible only if visible() is true for it and all its |
|
* parents (use Fl_Widget::visible_r() to check this). |
|
*/ |
|
FL_HIDE = 15, |
|
|
|
/** This widget is visible again, due to Fl_Widget::show() being called on |
|
* it or one of its parents, or due to a parent window being restored. |
|
* Child Fl_Windows respond to this by actually creating the window if not |
|
* done already, so if you subclass a window, be sure to pass FL_SHOW |
|
* to the base class Fl_Widget::handle() method! |
|
*/ |
|
FL_SHOW = 16, |
|
|
|
/** You should get this event some time after you call Fl::paste(). |
|
* The contents of Fl::event_text() is the text to insert and the number |
|
* of characters is in Fl::event_length(). |
|
*/ |
|
FL_PASTE = 17, |
|
|
|
/** The Fl::selection_owner() will get this event before the selection is |
|
* moved to another widget. This indicates that some other widget or program |
|
* has claimed the selection. Motif programs used this to clear the selection |
|
* indication. Most modern programs ignore this. |
|
*/ |
|
FL_SELECTIONCLEAR = 18, |
|
|
|
/** The user has moved the mouse wheel. The Fl::event_dx() and Fl::event_dy() |
|
* methods can be used to find the amount to scroll horizontally and vertically. |
|
*/ |
|
FL_MOUSEWHEEL = 19, |
|
|
|
/** The mouse has been moved to point at this widget. A widget that is |
|
* interested in receiving drag'n'drop data must return 1 to receive |
|
* FL_DND_DRAG, FL_DND_LEAVE and FL_DND_RELEASE events. |
|
*/ |
|
FL_DND_ENTER = 20, |
|
|
|
/** The mouse has been moved inside a widget while dragging data. A |
|
* widget that is interested in receiving drag'n'drop data should |
|
* indicate the possible drop position. |
|
*/ |
|
FL_DND_DRAG = 21, |
|
|
|
/** The mouse has moved out of the widget. |
|
*/ |
|
FL_DND_LEAVE = 22, |
|
|
|
/** The user has released the mouse button dropping data into the widget. |
|
* If the widget returns 1, it will receive the data in the immediatly |
|
* following FL_PASTE event. |
|
*/ |
|
FL_DND_RELEASE = 23 |
|
}; |
|
|
|
enum Fl_When { // Fl_Widget::when(): |
|
FL_WHEN_NEVER = 0, |
|
FL_WHEN_CHANGED = 1, |
|
FL_WHEN_RELEASE = 4, |
|
FL_WHEN_RELEASE_ALWAYS= 6, |
|
FL_WHEN_ENTER_KEY = 8, |
|
FL_WHEN_ENTER_KEY_ALWAYS=10, |
|
FL_WHEN_ENTER_KEY_CHANGED=11, |
|
FL_WHEN_NOT_CHANGED = 2 // modifier bit to disable changed() test |
|
}; |
|
|
|
// Fl::event_key() and Fl::get_key(n) (use ascii letters for all other keys): |
|
#define FL_Button 0xfee8 // use Fl_Button+FL_*_MOUSE |
|
#define FL_BackSpace 0xff08 |
|
#define FL_Tab 0xff09 |
|
#define FL_Enter 0xff0d |
|
#define FL_Pause 0xff13 |
|
#define FL_Scroll_Lock 0xff14 |
|
#define FL_Escape 0xff1b |
|
#define FL_Home 0xff50 |
|
#define FL_Left 0xff51 |
|
#define FL_Up 0xff52 |
|
#define FL_Right 0xff53 |
|
#define FL_Down 0xff54 |
|
#define FL_Page_Up 0xff55 |
|
#define FL_Page_Down 0xff56 |
|
#define FL_End 0xff57 |
|
#define FL_Print 0xff61 |
|
#define FL_Insert 0xff63 |
|
#define FL_Menu 0xff67 // the "menu/apps" key on XFree86 |
|
#define FL_Help 0xff68 // the 'help' key on Mac keyboards |
|
#define FL_Num_Lock 0xff7f |
|
#define FL_KP 0xff80 // use FL_KP+'x' for 'x' on numeric keypad |
|
#define FL_KP_Enter 0xff8d // same as Fl_KP+'\r' |
|
#define FL_KP_Last 0xffbd // use to range-check keypad |
|
#define FL_F 0xffbd // use FL_F+n for function key n |
|
#define FL_F_Last 0xffe0 // use to range-check function keys |
|
#define FL_Shift_L 0xffe1 |
|
#define FL_Shift_R 0xffe2 |
|
#define FL_Control_L 0xffe3 |
|
#define FL_Control_R 0xffe4 |
|
#define FL_Caps_Lock 0xffe5 |
|
#define FL_Meta_L 0xffe7 // the left MSWindows key on XFree86 |
|
#define FL_Meta_R 0xffe8 // the right MSWindows key on XFree86 |
|
#define FL_Alt_L 0xffe9 |
|
#define FL_Alt_R 0xffea |
|
#define FL_Delete 0xffff |
|
|
|
// Fl::event_button(): |
|
#define FL_LEFT_MOUSE 1 |
|
#define FL_MIDDLE_MOUSE 2 |
|
#define FL_RIGHT_MOUSE 3 |
|
|
|
// Fl::event_state(): |
|
#define FL_SHIFT 0x00010000 |
|
#define FL_CAPS_LOCK 0x00020000 |
|
#define FL_CTRL 0x00040000 |
|
#define FL_ALT 0x00080000 |
|
#define FL_NUM_LOCK 0x00100000 // most X servers do this? |
|
#define FL_META 0x00400000 // correct for XFree86 |
|
#define FL_SCROLL_LOCK 0x00800000 // correct for XFree86 |
|
#define FL_BUTTON1 0x01000000 |
|
#define FL_BUTTON2 0x02000000 |
|
#define FL_BUTTON3 0x04000000 |
|
#define FL_BUTTONS 0x7f000000 // All possible buttons |
|
#define FL_BUTTON(n) (0x00800000<<(n)) |
|
|
|
#ifdef __APPLE__ |
|
# define FL_COMMAND FL_META |
|
#else |
|
# define FL_COMMAND FL_CTRL |
|
#endif // __APPLE__ |
|
|
|
enum Fl_Boxtype { // boxtypes (if you change these you must fix fl_boxtype.C): |
|
FL_NO_BOX = 0, FL_FLAT_BOX, |
|
|
|
FL_UP_BOX, FL_DOWN_BOX, |
|
FL_UP_FRAME, FL_DOWN_FRAME, |
|
FL_THIN_UP_BOX, FL_THIN_DOWN_BOX, |
|
FL_THIN_UP_FRAME, FL_THIN_DOWN_FRAME, |
|
FL_ENGRAVED_BOX, FL_EMBOSSED_BOX, |
|
FL_ENGRAVED_FRAME, FL_EMBOSSED_FRAME, |
|
FL_BORDER_BOX, _FL_SHADOW_BOX, |
|
FL_BORDER_FRAME, _FL_SHADOW_FRAME, |
|
_FL_ROUNDED_BOX, _FL_RSHADOW_BOX, |
|
_FL_ROUNDED_FRAME, _FL_RFLAT_BOX, |
|
_FL_ROUND_UP_BOX, _FL_ROUND_DOWN_BOX, |
|
_FL_DIAMOND_UP_BOX, _FL_DIAMOND_DOWN_BOX, |
|
_FL_OVAL_BOX, _FL_OSHADOW_BOX, |
|
_FL_OVAL_FRAME, _FL_OFLAT_BOX, |
|
_FL_PLASTIC_UP_BOX, _FL_PLASTIC_DOWN_BOX, |
|
_FL_PLASTIC_UP_FRAME, _FL_PLASTIC_DOWN_FRAME, |
|
_FL_PLASTIC_THIN_UP_BOX, _FL_PLASTIC_THIN_DOWN_BOX, |
|
_FL_PLASTIC_ROUND_UP_BOX, _FL_PLASTIC_ROUND_DOWN_BOX, |
|
_FL_GTK_UP_BOX, _FL_GTK_DOWN_BOX, |
|
_FL_GTK_UP_FRAME, _FL_GTK_DOWN_FRAME, |
|
_FL_GTK_THIN_UP_BOX, _FL_GTK_THIN_DOWN_BOX, |
|
_FL_GTK_THIN_UP_FRAME, _FL_GTK_THIN_DOWN_FRAME, |
|
_FL_GTK_ROUND_UP_BOX, _FL_GTK_ROUND_DOWN_BOX, |
|
FL_FREE_BOXTYPE |
|
}; |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUND_UP_BOX(); |
|
#define FL_ROUND_UP_BOX fl_define_FL_ROUND_UP_BOX() |
|
#define FL_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_ROUND_UP_BOX()+1) |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_SHADOW_BOX(); |
|
#define FL_SHADOW_BOX fl_define_FL_SHADOW_BOX() |
|
#define FL_SHADOW_FRAME (Fl_Boxtype)(fl_define_FL_SHADOW_BOX()+2) |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_ROUNDED_BOX(); |
|
#define FL_ROUNDED_BOX fl_define_FL_ROUNDED_BOX() |
|
#define FL_ROUNDED_FRAME (Fl_Boxtype)(fl_define_FL_ROUNDED_BOX()+2) |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_RFLAT_BOX(); |
|
#define FL_RFLAT_BOX fl_define_FL_RFLAT_BOX() |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_RSHADOW_BOX(); |
|
#define FL_RSHADOW_BOX fl_define_FL_RSHADOW_BOX() |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_DIAMOND_BOX(); |
|
#define FL_DIAMOND_UP_BOX fl_define_FL_DIAMOND_BOX() |
|
#define FL_DIAMOND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_DIAMOND_BOX()+1) |
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_OVAL_BOX(); |
|
#define FL_OVAL_BOX fl_define_FL_OVAL_BOX() |
|
#define FL_OSHADOW_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+1) |
|
#define FL_OVAL_FRAME (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+2) |
|
#define FL_OFLAT_BOX (Fl_Boxtype)(fl_define_FL_OVAL_BOX()+3) |
|
|
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_PLASTIC_UP_BOX(); |
|
#define FL_PLASTIC_UP_BOX fl_define_FL_PLASTIC_UP_BOX() |
|
#define FL_PLASTIC_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+1) |
|
#define FL_PLASTIC_UP_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+2) |
|
#define FL_PLASTIC_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+3) |
|
#define FL_PLASTIC_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+4) |
|
#define FL_PLASTIC_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+5) |
|
#define FL_PLASTIC_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+6) |
|
#define FL_PLASTIC_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_PLASTIC_UP_BOX()+7) |
|
|
|
extern FL_EXPORT Fl_Boxtype fl_define_FL_GTK_UP_BOX(); |
|
#define FL_GTK_UP_BOX fl_define_FL_GTK_UP_BOX() |
|
#define FL_GTK_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+1) |
|
#define FL_GTK_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+2) |
|
#define FL_GTK_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+3) |
|
#define FL_GTK_THIN_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+4) |
|
#define FL_GTK_THIN_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+5) |
|
#define FL_GTK_THIN_UP_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+6) |
|
#define FL_GTK_THIN_DOWN_FRAME (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+7) |
|
#define FL_GTK_ROUND_UP_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+8) |
|
#define FL_GTK_ROUND_DOWN_BOX (Fl_Boxtype)(fl_define_FL_GTK_UP_BOX()+9) |
|
|
|
// conversions of box types to other boxtypes: |
|
inline Fl_Boxtype fl_box(Fl_Boxtype b) { |
|
return (Fl_Boxtype)((b<FL_UP_BOX||b%4>1)?b:(b-2)); |
|
} |
|
inline Fl_Boxtype fl_down(Fl_Boxtype b) { |
|
return (Fl_Boxtype)((b<FL_UP_BOX)?b:(b|1)); |
|
} |
|
inline Fl_Boxtype fl_frame(Fl_Boxtype b) { |
|
return (Fl_Boxtype)((b%4<2)?b:(b+2)); |
|
} |
|
|
|
// back-compatability box types: |
|
#define FL_FRAME FL_ENGRAVED_FRAME |
|
#define FL_FRAME_BOX FL_ENGRAVED_BOX |
|
#define FL_CIRCLE_BOX FL_ROUND_DOWN_BOX |
|
#define FL_DIAMOND_BOX FL_DIAMOND_DOWN_BOX |
|
|
|
enum Fl_Labeltype { // labeltypes: |
|
FL_NORMAL_LABEL = 0, |
|
FL_NO_LABEL, |
|
_FL_SHADOW_LABEL, |
|
_FL_ENGRAVED_LABEL, |
|
_FL_EMBOSSED_LABEL, |
|
_FL_MULTI_LABEL, |
|
_FL_ICON_LABEL, |
|
_FL_IMAGE_LABEL, |
|
|
|
FL_FREE_LABELTYPE |
|
}; |
|
#define FL_SYMBOL_LABEL FL_NORMAL_LABEL |
|
extern Fl_Labeltype FL_EXPORT fl_define_FL_SHADOW_LABEL(); |
|
#define FL_SHADOW_LABEL fl_define_FL_SHADOW_LABEL() |
|
extern Fl_Labeltype FL_EXPORT fl_define_FL_ENGRAVED_LABEL(); |
|
#define FL_ENGRAVED_LABEL fl_define_FL_ENGRAVED_LABEL() |
|
extern Fl_Labeltype FL_EXPORT fl_define_FL_EMBOSSED_LABEL(); |
|
#define FL_EMBOSSED_LABEL fl_define_FL_EMBOSSED_LABEL() |
|
|
|
/** Flags to control the label alignment. |
|
* This controls how the label is displayed next to or inside the widget. |
|
* The default value is FL_ALIGN_CENTER for most widgets, which centers the label |
|
* inside the widget. |
|
* |
|
* Flags can be or'd to achieve a combination of alignments. |
|
*/ |
|
enum Fl_Align { // align() values |
|
/** Align the label horizontally in the middle. */ |
|
FL_ALIGN_CENTER = 0, |
|
/** Align the label at the top of the widget. Inside labels appear below the top, |
|
* outside labels are drawn on top of the widget. */ |
|
FL_ALIGN_TOP = 1, |
|
/** Align the label at the bottom of the widget. */ |
|
FL_ALIGN_BOTTOM = 2, |
|
/** Align the label at the left of the widget. Inside labels appear left-justified |
|
* starting at the left side of the widget, outside labels are right-justified and |
|
* drawn to the left of the widget. */ |
|
FL_ALIGN_LEFT = 4, |
|
/** Align the label to the right of the widget. */ |
|
FL_ALIGN_RIGHT = 8, |
|
/** Draw the label inside of the widget. */ |
|
FL_ALIGN_INSIDE = 16, |
|
/** If the label contains an image, draw the text on top of the image. */ |
|
FL_ALIGN_TEXT_OVER_IMAGE = 32, |
|
/** If the label contains an image, draw the text below the image. */ |
|
FL_ALIGN_IMAGE_OVER_TEXT = 0, |
|
/** All parts of the label that are lager than the widget will not be drawn . */ |
|
FL_ALIGN_CLIP = 64, |
|
/** Wrap text that does not fit the width of the widget. */ |
|
FL_ALIGN_WRAP = 128, |
|
FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT, |
|
FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT, |
|
FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT, |
|
FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT, |
|
FL_ALIGN_LEFT_TOP = FL_ALIGN_TOP_LEFT, |
|
FL_ALIGN_RIGHT_TOP = FL_ALIGN_TOP_RIGHT, |
|
FL_ALIGN_LEFT_BOTTOM = FL_ALIGN_BOTTOM_LEFT, |
|
FL_ALIGN_RIGHT_BOTTOM = FL_ALIGN_BOTTOM_RIGHT, |
|
FL_ALIGN_NOWRAP = 0 // for back compatability |
|
}; |
|
|
|
typedef int Fl_Font; |
|
typedef int Fl_Font_Size; |
|
|
|
// standard fonts |
|
const Fl_Font FL_HELVETICA = 0; |
|
const Fl_Font FL_HELVETICA_BOLD = 1; |
|
const Fl_Font FL_HELVETICA_ITALIC = 2; |
|
const Fl_Font FL_HELVETICA_BOLD_ITALIC = 3; |
|
const Fl_Font FL_COURIER = 4; |
|
const Fl_Font FL_COURIER_BOLD = 5; |
|
const Fl_Font FL_COURIER_ITALIC = 6; |
|
const Fl_Font FL_COURIER_BOLD_ITALIC = 7; |
|
const Fl_Font FL_TIMES = 8; |
|
const Fl_Font FL_TIMES_BOLD = 9; |
|
const Fl_Font FL_TIMES_ITALIC = 10; |
|
const Fl_Font FL_TIMES_BOLD_ITALIC = 11; |
|
const Fl_Font FL_SYMBOL = 12; |
|
const Fl_Font FL_SCREEN = 13; |
|
const Fl_Font FL_SCREEN_BOLD = 14; |
|
const Fl_Font FL_ZAPF_DINGBATS = 15; |
|
|
|
const Fl_Font FL_FREE_FONT = 16; // first one to allocate |
|
const Fl_Font FL_BOLD = 1; // add this to helvetica, courier, or times |
|
const Fl_Font FL_ITALIC = 2; // add this to helvetica, courier, or times |
|
|
|
extern FL_EXPORT Fl_Font_Size FL_NORMAL_SIZE; |
|
|
|
|
|
enum Fl_Color { // standard colors |
|
// These are used as default colors in widgets and altered as necessary |
|
FL_FOREGROUND_COLOR = 0, |
|
FL_BACKGROUND2_COLOR = 7, |
|
FL_INACTIVE_COLOR = 8, |
|
FL_SELECTION_COLOR = 15, |
|
|
|
// boxtypes generally limit themselves to these colors so |
|
// the whole ramp is not allocated: |
|
FL_GRAY0 = 32, // 'A' |
|
FL_DARK3 = 39, // 'H' |
|
FL_DARK2 = 45, // 'N' |
|
FL_DARK1 = 47, // 'P' |
|
FL_BACKGROUND_COLOR = 49, // 'R' default background color |
|
FL_LIGHT1 = 50, // 'S' |
|
FL_LIGHT2 = 52, // 'U' |
|
FL_LIGHT3 = 54, // 'W' |
|
|
|
// FLTK provides a 5x8x5 color cube that is used with colormap visuals |
|
FL_BLACK = 56, |
|
FL_RED = 88, |
|
FL_GREEN = 63, |
|
FL_YELLOW = 95, |
|
FL_BLUE = 216, |
|
FL_MAGENTA = 248, |
|
FL_CYAN = 223, |
|
FL_DARK_RED = 72, |
|
|
|
FL_DARK_GREEN = 60, |
|
FL_DARK_YELLOW = 76, |
|
FL_DARK_BLUE = 136, |
|
FL_DARK_MAGENTA = 152, |
|
FL_DARK_CYAN = 140, |
|
|
|
FL_WHITE = 255 |
|
}; |
|
|
|
#define FL_FREE_COLOR (Fl_Color)16 |
|
#define FL_NUM_FREE_COLOR 16 |
|
#define FL_GRAY_RAMP (Fl_Color)32 |
|
#define FL_NUM_GRAY 24 |
|
#define FL_GRAY FL_BACKGROUND_COLOR |
|
#define FL_COLOR_CUBE (Fl_Color)56 |
|
#define FL_NUM_RED 5 |
|
#define FL_NUM_GREEN 8 |
|
#define FL_NUM_BLUE 5 |
|
|
|
FL_EXPORT Fl_Color fl_inactive(Fl_Color c); |
|
FL_EXPORT Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg); |
|
FL_EXPORT Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight); |
|
inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); } |
|
inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); } |
|
inline Fl_Color fl_rgb_color(uchar r, uchar g, uchar b) { |
|
if (!r && !g && !b) return FL_BLACK; |
|
else return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8); |
|
} |
|
inline Fl_Color fl_rgb_color(uchar g) { |
|
if (!g) return FL_BLACK; |
|
else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8); |
|
} |
|
inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);} |
|
inline Fl_Color fl_color_cube(int r, int g, int b) { |
|
return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);} |
|
|
|
enum Fl_Cursor { // standard cursors |
|
FL_CURSOR_DEFAULT = 0, |
|
FL_CURSOR_ARROW = 35, |
|
FL_CURSOR_CROSS = 66, |
|
FL_CURSOR_WAIT = 76, |
|
FL_CURSOR_INSERT = 77, |
|
FL_CURSOR_HAND = 31, |
|
FL_CURSOR_HELP = 47, |
|
FL_CURSOR_MOVE = 27, |
|
// fltk provides bitmaps for these: |
|
FL_CURSOR_NS = 78, |
|
FL_CURSOR_WE = 79, |
|
FL_CURSOR_NWSE = 80, |
|
FL_CURSOR_NESW = 81, |
|
FL_CURSOR_NONE = 255, |
|
// for back compatability (non MSWindows ones): |
|
FL_CURSOR_N = 70, |
|
FL_CURSOR_NE = 69, |
|
FL_CURSOR_E = 49, |
|
FL_CURSOR_SE = 8, |
|
FL_CURSOR_S = 9, |
|
FL_CURSOR_SW = 7, |
|
FL_CURSOR_W = 36, |
|
FL_CURSOR_NW = 68 |
|
//FL_CURSOR_NS = 22, |
|
//FL_CURSOR_WE = 55, |
|
}; |
|
|
|
enum { // values for "when" passed to Fl::add_fd() |
|
FL_READ = 1, |
|
FL_WRITE = 4, |
|
FL_EXCEPT = 8 |
|
}; |
|
|
|
enum Fl_Mode { // visual types and Fl_Gl_Window::mode() (values match Glut) |
|
FL_RGB = 0, |
|
FL_INDEX = 1, |
|
FL_SINGLE = 0, |
|
FL_DOUBLE = 2, |
|
FL_ACCUM = 4, |
|
FL_ALPHA = 8, |
|
FL_DEPTH = 16, |
|
FL_STENCIL = 32, |
|
FL_RGB8 = 64, |
|
FL_MULTISAMPLE= 128, |
|
FL_STEREO = 256, |
|
FL_FAKE_SINGLE = 512 // Fake single buffered windows using double-buffer |
|
}; |
|
|
|
// image alpha blending |
|
|
|
#define FL_IMAGE_WITH_ALPHA 0x40000000 |
|
|
|
// damage masks |
|
|
|
enum Fl_Damage { |
|
FL_DAMAGE_CHILD = 0x01, |
|
FL_DAMAGE_EXPOSE = 0x02, |
|
FL_DAMAGE_SCROLL = 0x04, |
|
FL_DAMAGE_OVERLAY = 0x08, |
|
FL_DAMAGE_USER1 = 0x10, |
|
FL_DAMAGE_USER2 = 0x20, |
|
FL_DAMAGE_ALL = 0x80 |
|
}; |
|
|
|
// FLTK 1.0.x compatibility definitions... |
|
# ifdef FLTK_1_0_COMPAT |
|
# define contrast fl_contrast |
|
# define down fl_down |
|
# define frame fl_frame |
|
# define inactive fl_inactive |
|
# endif // FLTK_1_0_COMPAT |
|
|
|
#endif |
|
|
|
// |
|
// End of "$Id$". |
|
//
|
|
|