FL_ALIGN_TOP_LEFT == (FL_ALIGN_TOP|FL_ALIGN_LEFT) != FL_ALIGN_LEFT_TOP.
\code
Outside alignments (FL_ALIGN_INSIDE is not set):
TOP_LEFT TOP TOP_RIGHT
+---------------------------------+
LEFT_TOP| |RIGHT_TOP
| |
LEFT| CENTER |RIGHT
| |
LEFT_BOTTOM| |RIGHT_BOTTOM
+---------------------------------+
BOTTOM_LEFT BOTTOM BOTTOM_RIGHT
Inside alignments (FL_ALIGN_INSIDE is set):
+---------------------------------+
|TOP_LEFT TOP TOP_RIGHT|
| |
|LEFT CENTER RIGHT|
| |
|BOTTOM_LEFT BOTTOM BOTTOM_RIGHT|
+---------------------------------+
\endcode
\see #FL_ALIGN_CENTER, etc.
*/
/*@{*/
/** FLTK type for alignment control */
typedef unsigned Fl_Align;
/** Align the label horizontally in the middle. */
const Fl_Align FL_ALIGN_CENTER = (Fl_Align)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. */
const Fl_Align FL_ALIGN_TOP = (Fl_Align)1;
/** Align the label at the bottom of the widget. */
const Fl_Align FL_ALIGN_BOTTOM = (Fl_Align)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. */
const Fl_Align FL_ALIGN_LEFT = (Fl_Align)4;
/** Align the label to the right of the widget. */
const Fl_Align FL_ALIGN_RIGHT = (Fl_Align)8;
/** Draw the label inside of the widget. */
const Fl_Align FL_ALIGN_INSIDE = (Fl_Align)16;
/** If the label contains an image, draw the text on top of the image. */
const Fl_Align FL_ALIGN_TEXT_OVER_IMAGE = (Fl_Align)0x0020;
/** If the label contains an image, draw the text below the image. */
const Fl_Align FL_ALIGN_IMAGE_OVER_TEXT = (Fl_Align)0x0000;
/** All parts of the label that are lager than the widget will not be drawn . */
const Fl_Align FL_ALIGN_CLIP = (Fl_Align)64;
/** Wrap text that does not fit the width of the widget. */
const Fl_Align FL_ALIGN_WRAP = (Fl_Align)128;
/** If the label contains an image, draw the text to the right of the image. */
const Fl_Align FL_ALIGN_IMAGE_NEXT_TO_TEXT = (Fl_Align)0x0100;
/** If the label contains an image, draw the text to the left of the image. */
const Fl_Align FL_ALIGN_TEXT_NEXT_TO_IMAGE = (Fl_Align)0x0120;
/** If the label contains an image, draw the image or deimage in the background. */
const Fl_Align FL_ALIGN_IMAGE_BACKDROP = (Fl_Align)0x0200;
const Fl_Align FL_ALIGN_TOP_LEFT = FL_ALIGN_TOP | FL_ALIGN_LEFT;
const Fl_Align FL_ALIGN_TOP_RIGHT = FL_ALIGN_TOP | FL_ALIGN_RIGHT;
const Fl_Align FL_ALIGN_BOTTOM_LEFT = FL_ALIGN_BOTTOM | FL_ALIGN_LEFT;
const Fl_Align FL_ALIGN_BOTTOM_RIGHT = FL_ALIGN_BOTTOM | FL_ALIGN_RIGHT;
const Fl_Align FL_ALIGN_LEFT_TOP = 0x0007; // magic value
const Fl_Align FL_ALIGN_RIGHT_TOP = 0x000b; // magic value
const Fl_Align FL_ALIGN_LEFT_BOTTOM = 0x000d; // magic value
const Fl_Align FL_ALIGN_RIGHT_BOTTOM = 0x000e; // magic value
const Fl_Align FL_ALIGN_NOWRAP = (Fl_Align)0; // for back compatibility
const Fl_Align FL_ALIGN_POSITION_MASK = 0x000f; // left, right, top, bottom
const Fl_Align FL_ALIGN_IMAGE_MASK = 0x0320; // l/r, t/b, backdrop
/*@}*/
/** \name Font Numbers
The following constants define the standard FLTK fonts:
*/
/*@{*/
/** A font number is an index into the internal font table. */
typedef int Fl_Font;
const Fl_Font FL_HELVETICA = 0; ///< Helvetica (or Arial) normal (0)
const Fl_Font FL_HELVETICA_BOLD = 1; ///< Helvetica (or Arial) bold
const Fl_Font FL_HELVETICA_ITALIC = 2; ///< Helvetica (or Arial) oblique
const Fl_Font FL_HELVETICA_BOLD_ITALIC = 3; ///< Helvetica (or Arial) bold-oblique
const Fl_Font FL_COURIER = 4; ///< Courier normal
const Fl_Font FL_COURIER_BOLD = 5; ///< Courier bold
const Fl_Font FL_COURIER_ITALIC = 6; ///< Courier italic
const Fl_Font FL_COURIER_BOLD_ITALIC = 7; ///< Courier bold-italic
const Fl_Font FL_TIMES = 8; ///< Times roman
const Fl_Font FL_TIMES_BOLD = 9; ///< Times roman bold
const Fl_Font FL_TIMES_ITALIC = 10; ///< Times roman italic
const Fl_Font FL_TIMES_BOLD_ITALIC = 11; ///< Times roman bold-italic
const Fl_Font FL_SYMBOL = 12; ///< Standard symbol font
const Fl_Font FL_SCREEN = 13; ///< Default monospaced screen font
const Fl_Font FL_SCREEN_BOLD = 14; ///< Default monospaced bold screen font
const Fl_Font FL_ZAPF_DINGBATS = 15; ///< Zapf-dingbats font
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
const Fl_Font FL_BOLD_ITALIC = 3; ///< add this to helvetica, courier, or times
/*@}*/
/** Size of a font in pixels.
This is the approximate height of a font in pixels.
*/
typedef int Fl_Fontsize;
extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
/** \name Colors
The Fl_Color type holds an FLTK color value.
Colors are either 8-bit indexes into a virtual colormap
or 24-bit RGB color values. (See \ref drawing_colors for the default FLTK colormap)
Color indices occupy the lower 8 bits of the value, while
RGB colors occupy the upper 24 bits, for a byte organization of RGBI.
Fl_Color => 0xrrggbbii
| | | |
| | | +--- \ref drawing_colors "index" between 0 and 255
| | +----- blue color component (8 bit)
| +------- green component (8 bit)
+--------- red component (8 bit)
A color can have either an index or an rgb value. Colors with rgb set
and an index >0 are reserved for special use.
*/
/*@{*/
/** An FLTK color value; see also \ref drawing_colors */
typedef unsigned int Fl_Color;
// Standard colors. These are used as default colors in widgets and altered as necessary
const Fl_Color FL_FOREGROUND_COLOR = 0; ///< the default foreground color (0) used for labels and text
const Fl_Color FL_BACKGROUND2_COLOR = 7; ///< the default background color for text, list, and valuator widgets
const Fl_Color FL_INACTIVE_COLOR = 8; ///< the inactive foreground color
const Fl_Color FL_SELECTION_COLOR = 15; ///< the default selection/highlight color
// boxtypes generally limit themselves to these colors so
// the whole ramp is not allocated:
const Fl_Color FL_GRAY0 = 32; // 'A'
const Fl_Color FL_DARK3 = 39; // 'H'
const Fl_Color FL_DARK2 = 45; // 'N'
const Fl_Color FL_DARK1 = 47; // 'P'
const Fl_Color FL_BACKGROUND_COLOR = 49; // 'R' default background color
const Fl_Color FL_LIGHT1 = 50; // 'S'
const Fl_Color FL_LIGHT2 = 52; // 'U'
const Fl_Color FL_LIGHT3 = 54; // 'W'
// FLTK provides a 5x8x5 color cube that is used with colormap visuals
const Fl_Color FL_BLACK = 56;
const Fl_Color FL_RED = 88;
const Fl_Color FL_GREEN = 63;
const Fl_Color FL_YELLOW = 95;
const Fl_Color FL_BLUE = 216;
const Fl_Color FL_MAGENTA = 248;
const Fl_Color FL_CYAN = 223;
const Fl_Color FL_DARK_RED = 72;
const Fl_Color FL_DARK_GREEN = 60;
const Fl_Color FL_DARK_YELLOW = 76;
const Fl_Color FL_DARK_BLUE = 136;
const Fl_Color FL_DARK_MAGENTA = 152;
const Fl_Color FL_DARK_CYAN = 140;
const Fl_Color 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);
/** Returns a lighter version of the specified color. */
inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); }
/** Returns a darker version of the specified color. */
inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); }
/** Returns the 24-bit color value closest to \p r, \p g, \p b. */
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);
}
/** Returns the 24-bit color value closest to \p g (grayscale). */
inline Fl_Color fl_rgb_color(uchar g) {
if (!g) return FL_BLACK;
else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8);
}
/** Returns a gray color value from black (i == 0) to white (i == FL_NUM_GRAY - 1).
FL_NUM_GRAY is defined to be 24 in the current FLTK release.
To get the closest FLTK gray value to an 8-bit grayscale color 'I' use:
\code
fl_gray_ramp(I * (FL_NUM_GRAY - 1) / 255)
\endcode
*/
inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);}
/** Returns a color out of the color cube.
\p r must be in the range 0 to FL_NUM_RED (5) minus 1,
\p g must be in the range 0 to FL_NUM_GREEN (8) minus 1,
\p b must be in the range 0 to FL_NUM_BLUE (5) minus 1.
To get the closest color to a 8-bit set of R,G,B values use:
\code
fl_color_cube(R * (FL_NUM_RED - 1) / 255,
G * (FL_NUM_GREEN - 1) / 255,
B * (FL_NUM_BLUE - 1) / 255);
\endcode
*/
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);}
/*@}*/ // group: Colors
/** \name Cursors */
/*@{*/
/** The following constants define the mouse cursors that are available in FLTK.
Cursors are provided by the system when available, or bitmaps built into
FLTK as a fallback.
\todo enum Fl_Cursor needs maybe an image.
*/
/* FIXME: We should renumber these, but that will break the ABI */
enum Fl_Cursor {
FL_CURSOR_DEFAULT = 0, /**< the default cursor, usually an arrow. */
FL_CURSOR_ARROW = 35, /**< an arrow pointer. */
FL_CURSOR_CROSS = 66, /**< crosshair. */
FL_CURSOR_WAIT = 76, /**< busy indicator (e.g. hourglass). */
FL_CURSOR_INSERT = 77, /**< I-beam. */
FL_CURSOR_HAND = 31, /**< pointing hand. */
FL_CURSOR_HELP = 47, /**< question mark pointer. */
FL_CURSOR_MOVE = 27, /**< 4-pointed arrow or hand. */
/* Resize indicators */
FL_CURSOR_NS = 78, /**< up/down resize. */
FL_CURSOR_WE = 79, /**< left/right resize. */
FL_CURSOR_NWSE = 80, /**< diagonal resize. */
FL_CURSOR_NESW = 81, /**< diagonal resize. */
FL_CURSOR_N = 70, /**< upwards resize. */
FL_CURSOR_NE = 69, /**< upwards, right resize. */
FL_CURSOR_E = 49, /**< rightwards resize. */
FL_CURSOR_SE = 8, /**< downwards, right resize. */
FL_CURSOR_S = 9, /**< downwards resize. */
FL_CURSOR_SW = 7, /**< downwards, left resize. */
FL_CURSOR_W = 36, /**< leftwards resize. */
FL_CURSOR_NW = 68, /**< upwards, left resize. */
FL_CURSOR_NONE =255 /**< invisible. */
};
/*@}*/ // group: Cursors
/** FD "when" conditions */
enum { // values for "when" passed to Fl::add_fd()
FL_READ = 1, /**< Call the callback when there is data to be read. */
FL_WRITE = 4, /**< Call the callback when data can be written without blocking. */
FL_EXCEPT = 8 /**< Call the callback if an exception occurs on the file. */
};
/** visual types and Fl_Gl_Window::mode() (values match Glut) */
enum Fl_Mode {
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, /**< A child needs to be redrawn. */
FL_DAMAGE_EXPOSE = 0x02, /**< The window was exposed. */
FL_DAMAGE_SCROLL = 0x04, /**< The Fl_Scroll widget was scrolled. */
FL_DAMAGE_OVERLAY = 0x08, /**< The overlay planes need to be redrawn. */
FL_DAMAGE_USER1 = 0x10, /**< First user-defined damage bit. */
FL_DAMAGE_USER2 = 0x20, /**< Second user-defined damage bit. */
FL_DAMAGE_ALL = 0x80 /**< Everything needs to be redrawn. */
};
// 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$".
//