The Interface Kit Table of Contents | The Interface Kit Index

# Global Variables, Constants, and Defined Types

This section lists the various global variables, constants, and types that the Interface Kit defines.

## Global Variables

### System Fonts

Declared in: be/interface/Font.h

const BFont *`be_plain_font` const BFont *`be_bold_font` const BFont *`be_fixed_font`

These global BFont objects are created when the BApplication object is constructed. They encapsulate the three system fonts—the plain font which is used for labels and small stretches of text in the user interface, the bold font which is used for window and group titles, and the fixed font which is used in Terminal windows and other places where a fixed-width font is required.

These objects cannot be modified directly, nor are they modified when the user redefines a system font. The user's changed preferences don't affect running applications.

See also: the BFont class

## Constants

### alert_type Constants see alert_type (BAlert)

### alignment Constants

Declared in: be/interface/InterfaceDefs.h

Constant
`B_ALIGN_LEFT`
`B_ALIGN_RIGHT`
`B_ALIGN_CENTE R`

These constants define the `alignment` data type. They determine how lines of text and labels are aligned by BTextView, BStringView, and BMenuField objects.

See also: `BTextView::SetAlignment()`

### button_width Constants

Declared in: be/interface/InterfaceDefs.h

Constant
`B_WIDTH_AS_USUAL`
`B_WIDTH_FROM_LABEL`
`B_WIDTH_FROM_WIDEST`

These constants define the `button_width` type. They determine how the width of a set of buttons will be set—whether they're set to a minimal width, a width just sufficient to accommodate the button's own label, or a width sufficient to accommodate the widest label of all the buttons.

The constants are used by the BAlert and BTabView classes.

### border_style Constants

Declared in: be/interface/InterfaceDefs.h

Constant
`B_PLAIN_BORDER`
`B_FANCY_BORDER`
`B_NO_BORDER`

These constants define how BBox objects and BScrollViews are bordered.

See also: the BScrollView and BBox classes

### Character Constants

Declared in: be/interface/InterfaceDefs.h

Constant | Character value
`B_BACKSPACE` | 0x08 (same as 'b')
`B_ENTER` | 0x0a (same as 'n')
`B_RETURN` | 0x0a (synonym for `B_ENTER`)
`B_SPACE` | 0x20 (same as ' ')
`B_TAB` | 0x09 (same as 't')
`B_ESCAPE` | 0x1b
`B_LEFT_ARROW` | 0x1c
`B_RIGHT_ARROW` | 0x1d
`B_UP_ARROW` | 0x1e
`B_DOWN_ARROW` | 0x1f
`B_INSERT` | 0x05
`B_DELETE` | 0x7f
`B_HOME` | 0x01
`B_END` | 0x04
`B_PAGE_UP` | 0x0b
`B_PAGE_DOWN` | 0x0c
`B_FUNCTION_KEY` | 0x10
`B_UTF8_ELLIPSIS` | "xE2x80xA6"
`B_UTF8_OPEN_QUOT E` | "xE2x80x9C"
`B_UTF8_CLOSE_QUO TE` | "xE2x80x9D"
`B_UTF8_COPYRIGHT` | "xC2xA9"
`B_UTF8_REGISTERED` | "xC2xAE"
`B_UTF8_TRADEMARK` | "xE2x84xA2"
`B_UTF8_SMILING_FA CE` | "xE2x98xBB"
`B_UTF8_HIROSHI` | "xE5xBCx98"

Constants in the first group stand for the ASCII characters they name. They're defined only for characters that normally don't have visible symbols.

Constants in the second group are Unicode UTF-8 encodings of common characters that have multibyte representations. These constants are strings that can be concatenated with other strings—for example, to set a button label that ends in an ellipsis:

       myButton->SetLablel("Options"B_UTF_ELLIPSIS);

See also: "Function Key Constants" below

### color_space Constants

Declared in: be/interface/GraphicDefs.h

Constant | Description
`B_NO_COLOR_SPACE` | Undefined color space
`B_RGB32` | xRGB 8:8:8:8, stored as little endian uint32
`B_RGBA32` | ARGB 8:8:8:8, stored as little endian uint32
`B_RGB24` | Currently unused
`B_RGB16` | RGB 5:6:5, stored as little endian uint16
`B_RGB15` | xRGB 1:5:5:5, stored as little endian uint16
`B_RGBA15` | ARGB 1:5:5:5, stored as little endian uint16
`B_CMAP8` | 256-color index into the color table.
`B_GRAY8` | 256-color greyscale value.
`B_GRAY1` | Each bit represents a single pixel, where 0 is the view's low color and 1 is the high color.
`B_RGB32_BIG` | xRGB 8:8:8:8, stored as big endian uint32
`B_RGBA32_BIG` | ARGB 8:8:8:8, stored as big endian uint32
`B_RGB24_BIG` | Currently unused
`B_RGB16_BIG` | RGB 5:6:5, stored as big endian uint16
`B_RGB15_BIG` | xRGB 1:5:5:5, stored as big endian uint16
`B_RGBA15_BIG` | ARGB 1:5:5:5, stored as big endian uint16
`B_YUV422` | Currently unused.
`B_YUV411` | Currently unused.
`B_YUV420` | Currently unused.
`B_YUV444` | Currently unused.
`B_YUV9` | Currently unused.
`B_YUV12` | Currently unused.
`B_MONOCHROME_1_BIT` | For compatibility only: use B_GRAY1
`B_GRAYSCALE_8_BIT` | For compatibility only; use B_GRAY8
`B_COLOR_8_BIT` | For compatibility only; use B_CMAP8
`B_RGB_32_BIT` | For compatibility only; use B_RGB32
`B_RGB_16_BIT` | For compatibility only; use B_RGB15
`B_BIG_RGB_32_BIT` | For compatibility only; use B_RGB32_BIG
`B_BIG_RGB_16_BIT` | For compatibility only; use B_RGB15_BIG

These constants define the `color_space` data type. A color space describes three properties of screens and bitmap images:

- How many bits of information there are per pixel (the depth of the image)

- How those bits are to be interpreted (whether as colors or on a grayscale, what the color components are, and so on).

- How are components are arranged

See the "Color Spaces" section in the "Drawing" section of this chapter for a fuller explanation of these color spaces.

See also: "Colors" in the "Drawing" section of this chapter, the BBitmap and BScreen classes

### Control Values

Declared in: be/interface/Control.h

Constant | Value
`B_CONTROL_O N` | 1
`B_CONTROL_OF F` | 0

These constants define the bipolar states of a typical control device.

See also: `BControl::SetValue()`

### Cursor Transit Constants

Declared in: be/interface/View.h

Constant | Meaning
`B_ENTERED_VIE W` | The cursor has just entered a view.
`B_INSIDE_VIEW` | The cursor has moved within the view.
`B_EXITED_VIEW` | The cursor has left the view

These constants describe the cursor's transit through a view. Each `MouseMoved()` notification includes one of these constants as an argument, to inform the BView whether the cursor has entered the view, moved while inside the view, or exited the view.

See also: `BView::MouseMoved()`

### Dead-Key Mapping

Declared in: be/interface/InterfaceDefs.h

Constant
`B_CONTROL_TABLE`
`B_OPTION_CAPS_SHIFT_TA BLE`
`B_OPTION_CAPS_TABLE`
`B_OPTION_SHIFT_TABLE`
`B_OPTION_TABLE`
`B_CAPS_SHIFT_TABLE`
`B_CAPS_TABLE`
`B_SHIFT_TABLE`
`B_NORMAL_TABLE`

These constants determine which combinations of modifiers can cause a key to be the "dead" member of a two-key combination.

See also: `get_key_map()`

### drawing_mode Constants

Declared in: be/interface/GraphicsDefs.h

Constant | Constant
`B_OP_COPY` | `B_OP_ADD`
`B_OP_OVER` | `B_OP_SUBTRA CT`
`B_OP_ERAS E` | `B_OP_BLEND`
`B_OP_INVE RT` | `B_OP_MIN`
`B_OP_SELE CT` | `B_OP_MAX`

These constants define the `drawing_mode` data type. The drawing mode is a BView graphics parameter that determines how the image being drawn interacts with the image already in place in the area where it's drawn. The various modes are explained under "Drawing Modes" in the "Drawing" section of this chapter.

See also: "Drawing Modes" in the "Drawing" section of this chapter, `BView::SetDrawingMode()`

### font_direction Constants

Declared in: be/interface/Font.h

Constant
`B_FONT_LEFT_TO_RIG HT`
`B_FONT_RIGHT_TO_LE FT`

These constants tell whether a font is used for text that's read left-to-right or right-to-left. Thus is an inherent property of the font.

See also: `BFont::Direction()`

### Font Encodings

Declared in: be/interface/Font.h

Constant
`B_UNICODE_UTF8`
`B_ISO_8859_1`
`B_ISO_8859_2`
`B_ISO_8859_3`
`B_ISO_8859_4`
`B_ISO_8859_5`
`B_ISO_8859_6`
`B_ISO_8859_7`
`B_ISO_8859_8`
`B_ISO_8859_9`
`B_ISO_8859_10`
`B_MACINTOSH_ROMA N`

The constants name the various character encodings that the BeOS supports. `B_UNICODE_UTF8` is the default encoding. It matches ASCII values for 7-bit character codes but uses multiple bytes to encode other values in the Unicode standard.

See also: `BFont::SetEncoding()`, "Character Encoding" in the "Responding to the User" section of this chapter

### Font Flags

Declared in: be/interface/Font.h

Constant
`B_DISABLE_ANTIALIASI NG`
`B_IS_FIXED`
`B_HAS_TUNED_FONT`

The first flag, `B_DISABLE_ANTIALIASING`, is passed to a BFont object to turn antialiasing off. Antialiasing should be turned off when printing, but should generally be left on when drawing to the screen.

The other two flags enable `get_font_family()` and `get_font_style()` to give information about a font. `B_IS_FIXED` indicates that the font is nonproportional. `B_HAS_TUNED_FONT` indicates that the family or style has one or more tuned fonts—bitmap fonts that have been adjusted to look good on the screen—for some set of font properties (such as size and shear).

See also: `BFont::SetFlags()`, `get_font_family()`

### Font Name Lengths

Declared in: be/interface/Font.h

Constant | Value
`B_FONT_FAMILY_NAME_LENG TH` | 63
`B_FONT_STYLE_NAME_LENG TH` | 63

These constants define the maximum length of names for font families and styles, exclusive of a null terminator. They're used in the definition of the `font_family` and `font_style` types.

See also: `font_family` under "Defined Types" below

### Font Properties

Declared in: be/interface/View.h

Constant
`B_FONT_FAMILY_AND_STY LE`
`B_FONT_SIZE`
`B_FONT_SHEAR`
`B_FONT_ROTATION`
`B_FONT_SPACING`
`B_FONT_ENCODING`
`B_FONT_FACE`
`B_FONT_FLAGS`
`B_FONT_ALL`

These constants list the font properites that can be set for a BView individually or in combination. The constants form a mask that's passed, along with a BFont object, to BView's `SetFont()` and BTextView's `SetFontAndColor()` functions. For example:

       myView->SetFont(theFont, B_FONT_SIZE | B_FONT_ENCODING);

`B_FONT_ALL` stands for all properties of the BFont.

See also: `BView::SetFont()`

### Font Spacing Modes

Declared in: be/interface/Font.h

Constant
`B_CHAR_SPACING`
`B_STRING_SPACIN G`
`B_BITMAP_SPACIN G`
`B_FIXED_SPACING`

These constants enumerate the four modes for positioning characters in a line of text.

See also: `BFont::SetSpacing()`

### Function Key Constants

Declared in: be/interface/InterfaceDefs.h

Constant | Constant
`B_F1_KE Y` | `B_F9_KEY`
`B_F2_KE Y` | `B_F10_KEY`
`B_F3_KE Y` | `B_F11_KEY`
`B_F4_KE Y` | `B_F12_KEY`
`B_F5_KE Y` | `B_PRINT_KEY` (the "Print Screen" key)
`B_F6_KE Y` | `B_SCROLL_KEY` (the "Scroll Lock" key)
`B_F7_KE Y` | `B_PAUSE_KEY`
`B_F8_KE Y` |

These constants stand for the various keys that are mapped to the `B_FUNCTION_KEY` character. When the `B_FUNCTION_KEY` character is reported in a key-down event, the application can determine which key produced the character by testing the key code against these constants. (Control-p also produces the `B_FUNCTION_KEY` character.)

See also: "Character Mapping" in the Keyboard Information appendix

### Interface Messages

Declared in: be/app/AppDefs.h

Constant | Constant
`B_ZOOM` | `B_KEY_DOWN`
`B_MINIMIZE` | `B_KEY_UP`
`B_WINDOW_RESIZED` | `B_MOUSE_DOWN`
`B_WINDOW_MOVED` | `B_MOUSE_UP`
`B_WINDOW_ACTIVATED` | `B_MOUSE_MOVED`
`B_QUIT_REQUESTED` | `B_VIEW_RESIZED`
`B_SCREEN_CHANGED` | `B_VIEW_MOVED`
`B_WORKSPACE_ACTIVAT ED` | `B_VALUE_CHANGE D`
`B_WORKSPACES_CHANG ED` | `B_PULSE`

These constants identify interface messages—system messages that are delivered to BWindow objects. Each constant conveys an instruction to do something in particular (`B_ZOOM`) or names a type of event (`B_KEY_DOWN`).

See also: "Interface Messages" in the "Responding to the User" section of this chapter

### list_view_type Constants

Declared in: be/interface/ListView.h

Constant
`B_SINGLE_SELECTION_LIS T`
`B_MULTIPLE_SELECTION_ LIST`

These constants distinguish between lists that permit the user to select only one item at a time and those that allow multiple items to be selected.

See also: the BListView class

### Main Screen

Declared in: be/interface/Screen.h

const screen_id `B_MAIN_SCREEN_ID`

This constant stands for the main screen, the screen that has the origin of the screen coordinate system at its left top corner. (Currently only one screen can be attached to the computer and it is the main screen.)

See also: `screen_id`

### menu_bar_border Constants

Declared in: be/interface/MenuBar.h

Constant | Meaning
`B_BORDER_FRAME` | Put a border inside the entire frame rectangle.
`B_BORDER_CONTEN TS` | Put a border around the group of items only.
`B_BORDER_EACH_IT EM` | Put a border around each item.

These constants can be passed as an argument to BMenuBar's `SetBorder()` function.

See also: `BMenuBar::SetBorder()`

### menu_layout Constants

Declared in: be/interface/Menu.h

Constant | Meaning
`B_ITEMS_IN_ROW` | Menu items are arranged horizontally, in a row.
`B_ITEMS_IN_COLU MN` | Menu items are arranged vertically, in a column.
`B_ITEMS_IN_MATRI X` | Menu items are arranged in a custom fashion.

These constants define the `menu_layout` data type. They distinguish the ways that items can be arranged in a menu or menu bar—they can be laid out from end to end in a row like a typical menu bar, stacked from top to bottom in a column like a typical menu, or arranged in some custom fashion like a matrix.

See also: the BMenu and BMenuBar constructors

### Modifier States

Declared in: be/interface/InterfaceDef.h

Constant | Constant
`B_SHIFT_KEY` | `B_OPTION_KEY`
`B_LEFT_SHIFT_KEY` | `B_LEFT_OPTION_KEY`
`B_RIGHT_SHIFT_KEY` | `B_RIGHT_OPTION_KEY`
`B_CONTROL_KEY` | `B_COMMAND_KEY`
`B_LEFT_CONTROL_KE Y` | `B_LEFT_COMMAND_KEY`
`B_RIGHT_CONTROL_K EY` | `B_RIGHT_COMMAND_KE Y`
`B_CAPS_LOCK` | `B_MENU_KEY`
`B_SCROLL_LOCK` |
`B_NUM_LOCK` |

These constants designate the Shift, Option, Control, Command, and Menu modifier keys and the lock states set by the Caps Lock, Scroll Lock, and Num Lock keys. They're typically used to form a mask that describes the current, or required, modifier states.

For each variety of modifier key, there are constants that distinguish between the keys that appear at the left and right of the keyboard, as well as one that lumps both together. For example, if the user is holding the left Control key down, both `B_CONTROL_KEY` and `B_LEFT_CONTROL_KEY` will be set in the mask.

See also: `modifiers()`, `BWindow::AddShortcut()`, the BMenu constructor

### Mouse Buttons

Declared in: be/interface/View.h

Constant
`B_PRIMARY_MOUSE_BUTTON`
`B_SECONDARY_MOUSE_BUTT ON`
`B_TERTIARY_MOUSE_BUTTON`

These constants name the mouse buttons. Buttons are identified, not by their physical positions on the mouse, but by their roles in the user interface.

See also: `BView::GetMouse()`, `set_mouse_map()`

### orientation Constants

Declared in: be/interface/InterfaceDef.h

Constant
`B_HORIZONTA L`
`B_VERTICAL`

These constants define the `orientation` data type that distinguishes between the vertical and horizontal orientation of graphic objects. It's currently used only to differentiate scroll bars.

See also: the BScrollBar and BScrollView classes

### Pattern Constants

Declared in: be/interface/GraphicsDef.h

const pattern `B_SOLID_HIGH` = { 0xff, 0xff, 0xff, 0xff, 0xff,0xff, 0xff, 0xff }
const pattern `B_SOLID_LOW` = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
const pattern `B_MIXED_COLORS` = { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }

These constants name the three standard patterns defined in the Interface Kit.

`B_SOLID_HIGH` is a pattern that consists of the high color only. It's the default pattern for all BView drawing functions that stroke lines and fill shapes.

`B_SOLID_LOW` is a pattern with only the low color. It's used mainly to erase images
(to replace them with the background color).

`B_MIXED_COLORS` alternates pixels between the high and low colors in a checkerboard pattern. The result is a halftone midway between the two colors. This pattern can produce fine gradations of color, especially when the high and low colors are set to two colors that are already quite similar.

See also: "Patterns" in the "Drawing" section of this chapter

### Resizing Modes

Declared in: be/interface/View.h

Constants
`B_FOLLOW_LEFT`
`B_FOLLOW_RIGHT`
`B_FOLLOW_LEFT_RIGHT`
`B_FOLLOW_H_CENTER`
`B_FOLLOW_TOP`
`B_FOLLOW_BOTTOM`
`B_FOLLOW_TOP_BOTTO M`
`B_FOLLOW_V_CENTER`
`B_FOLLOW_ALL`
`B_FOLLOW_NONE`

These constants are used to set the behavior of a view when its parent is resized. They're explained under the BView constructor.

See also: the BView constructor, `BView::SetResizingMode()`

### Screen Spaces

Declared in: be/interface/GraphicsDef.h

`B_8_BIT_640x400` |  |  | ``
`B_8_BIT_640x480` | `B_15_BIT_640x480` | `B_16_BIT_640x480` | `B_32_BIT_640x480`
`B_8_BIT_800x600` | `B_15_BIT_800x600` | `B_16_BIT_800x600` | `B_32_BIT_800x600`
`B_8_BIT_1024x768` | `B_15_BIT_1024x768` | `B_16_BIT_1024x768` | `B_32_BIT_1024x768`
`B_8_BIT_1152x900` | `B_15_BIT_1152x900` | `B_16_BIT_1152x900` | `B_32_BIT_1152x900`
`B_8_BIT_1280x1024` | `B_15_BIT_1280x1024` | `B_16_BIT_1280x1024` | `B_32_BIT_1280x1024`
`B_8_BIT_1600x1200` | `B_15_BIT_1600x1200` | `B_16_BIT_1600x1200` | `B_32_BIT_1600x1200`

These constants are currently used to configure the screen—to set its depth and the size of the pixel grid it displays—as well as to report which configurations are possible. However, they may not be supported in the future. 15-bit depths are not currently supported

See also: `set_screen_space()`, `get_screen_info()`

### Scroll Bar Constants

Declared in: be/interface/ScrollBar.h

Constant
`B_H_SCROLL_BAR_HEIG HT`
`B_V_SCROLL_BAR_WIDT H`

These constants record the recommended thickness of scroll bars. They should be used to help define the frame rectangles passed to the BScrollBar constructor.

See also: the BScrollBar class

### String Truncation Constants

Declared in: be/interface/Font.h

Constant
`B_TRUNCATE_END`
`B_TRUNCATE_BEGINNIN G`
`B_TRUNCATE_MIDDLE`
`B_TRUNCATE_SMART`

These constants instruct a BFont where it should remove characters from a set of strings to shorten them.

See also: `BFont::GetTruncatedStrings()`

### Transparency Constants

Declared in: be/interface/GraphicsDefs.h

const uint8 `B_TRANSPARENT_8_BIT`
const rgb_color `B_TRANSPARENT_32_BIT`

These constants set transparent pixel values in a bitmap image. `B_TRANSPARENT_8_BIT` designates a transparent pixel in the `B_CMAP8` color space, and `B_TRANSPARENT_32_BIT` designates a transparent pixel in the `B_RGB32` color space.

Transparency is explained in the "Drawing Modes" part of the "Drawing" section of this chapter. Drawing modes other than `B_OP_COPY` preserve the destination image where a source bitmap is transparent.

See also: "Drawing Modes" in the "Drawing" section of this chapter, the BBitmap class, `BView::SetViewColor()`

### View Flags

Declared in: be/interface/View.h

Constant | Meaning
`B_FULL_UPDATE_ON_RE SIZE` | Include the entire view in the clipping region.
`B_WILL_DRAW` | Allow the BView to draw.
`B_PULSE_NEEDED` | Report pulse events to the BView.
`B_FRAME_EVENTS` | Report view-resized and view-moved events.
`B_NAVIGABLE` | Let users navigate to the view with the Tab key.
`B_NAVIGABLE_JUMP` | Mark the view for Control-Tab navigation.

These constants can be combined to form a mask that sets the behavior of a BView object. They're explained in more detail under the class constructor. The mask is passed to the constructor, or to the `SetFlags()` function.

See also: the BView constructor, `BView::SetFlags()`

### Window Flags

Declared in: be/interface/Window.h

Constant | Constant
`B_NOT_MOVABLE` | `B_NOT_CLOSABLE`
`B_NOT_H_RESIZABLE` | `B_NOT_ZOOMABLE`
`B_NOT_V_RESIZABLE` | `B_NOT_MINIMIZABL E`
`B_NOT_RESIZABLE` | `B_WILL_FLOAT`
`B_WILL_ACCEPT_FIRST_CLI CK` |

These constants set the behavior of a window. They can be combined to form a mask that's passed to the BWindow constructor.

See also: the BWindow constructor

### window_type Constants

Declared in: be/interface/Window.h

Constant | Meaning
`B_MODAL_WINDOW` | The window is a modal window.
`B_BORDERED_WINDO W` | The window has a border but no title tab.
`B_TITLED_WINDOW` | The window has a border and a title tab.
`B_DOCUMENT_WINDO W` | The window has a border, tab and resize knob.

These constants describe the various kinds of windows that can be requested from the Application Server.

See also: the BWindow constructor

### Workspace Constants

Declared in: be/interface/Window.h

Constant
`B_CURRENT_WORKSPA CE`
`B_ALL_WORKSPACES`

These constants are used—along with designations of specific workspaces—to associate a set of one or more workspaces with a BWindow.

See also: the BWindow constructor, `BWindow::SetWorkspaces()`

## Defined Types

### alert_type

Declared in: be/interface/Alert.h

typedef enum {. . .} `alert_type`

These constants name the various types of alert panel.

See also: "`alert_type` Constants", the BAlert constructor

### alignment

Declared in: be/interface/InterfaceDefs.h

typedef enum {. . .} `alignment`

Alignment constants determine where lines of text are placed in a view.

See also: "`alignment` Constants", `BTextView::SetAlignment()`

### button_width

Declared in: be/interface/Alert.h

typedef enum {. . .} `button_width`

These constants name the methods that can be used to determine how wide to make the buttons in an alert panel.

See also: "`button_width` Constants", the BAlert constructor

### color_map

Declared in: be/interface/GraphicsDefs.h

typedef struct { int32 `id`; rgb_color `color_list`[256]; uint8 `inversion_map`[256]; uint8 `index_map`[32768]; } `color_map`

This structure contains information about the 8-bit color context for a particular screen. All applications that display on the screen share the same color map.

See also: `BScreen::ColorMap()`

### color_space

Declared in: be/interface/GraphicsDefs.h

typedef enum {. . .} `color_space`

Color space constants determine the depth and interpretation of bitmap images. They're described under "Colors" in the "Drawing" section of this chapter.

See also: "`color_space` Constants"

### drawing_mode

Declared in: be/interface/GraphicsDefs.h

typedef enum {. . .} `drawing_mode`

The drawing mode determines how source and destination images interact.

See also: "Drawing Modes" in the "Drawing" section of this chapter, "`drawing_mode` Constants"

### edge_info

Declared in: be/interface/Font.h

typedef struct { float `left`; float `right`; } `edge_info`

This structure records information about the location of a character outline within the horizontal space allotted to the character. Edges separate one character from adjacent characters on the left and right. They're explained under the `GetEdges()` function in the BFont class.

See also: `BFont::GetEscapements()`

### escapement_delta

Declared in: be/interface/Font.h

typedef struct { float `nonspace`; float `space`; } `escapement_delta`

This structure contains values that should be added to the width of each character in a string when the string is drawn.

See also: `BView::DrawString()`, `BFont::GetEscapements()`

### font_direction

Declared in: be/interface/Font.h

typedef enum {...} `font_direction`

This type distinguishes between fonts that are read left-to-right (`B_FONT_LEFT_TO_RIGHT`) and those that are read right-to-left (`B_FONT_RIGHT_TO_LEFT`).

See also: `BFont::Direction()`

### font_family

Declared in: be/interface/InterfaceDefs.h

typedef char `font_family`[B_FONT_FAMILY_LENGTH + 1]

This type defines a string long enough to hold the name of a font family—64 characters including the null terminator.

See also: `get_font_family()`

### font_height

Declared in: be/interface/Font.h

typedef struct { float `ascent`; float `descent`; float `leading`; } `font_height`

This type combines the three vertical measurements that determine the height of a line of text.

See also: `BFont::GetHeight()`

### font_style

Declared in: be/interface/InterfaceDefs.h

typedef char `font_style`[B_FONT_STYLE_LENGTH + 1]

This type defines a string long enough to hold the name of a font style—64 characters including the null terminator.

See also: `get_font_style()`

### key_info

Declared in: be/interface/View.h

typedef struct { uint32 `modifiers`; uint8 `key_states`[16]; } `key_info`

This structure is used to get information about the current state of the keyboard in the absence of `B_KEY_DOWN` messages.

See also: `get_key_info()`

### key_map

Declared in: be/interface/InterfaceDefs.h

typedef struct { uint32 `version`; uint32 `caps_key`; uint32 `scroll_key`; uint32 `num_key`; uint32 `left_shift_key`; uint32 `right_shift_key`; uint32 `left_command_key`; uint32 `right_command_key`; uint32 `left_control_key`; uint32 `right_control_key`; uint32 `left_option_key`; uint32 `right_option_key`; uint32 `menu_key`; uint32 `lock_settings`; int32 `control_map`[128]; int32 `option_caps_shift_map`[128]; int32 `option_caps_map`[128]; int32 `option_shift_map`[128]; int32 `option_map`[128]; int32 `caps_shift_map`[128]; int32 `caps_map`[128]; int32 `shift_map`[128]; int32 `normal_map`[128]; int32 `acute_dead_key`[32]; int32 `grave_dead_key`[32]; int32 `circumflex_dead_key`[32]; int32 `dieresis_dead_key`[32]; int32 `tilde_dead_key`[32]; uint32 `acute_tables`; uint32 `grave_tables`; uint32 `circumflex_tables`; uint32 `dieresis_tables`; uint32 `tilde_tables`; } `key_map`

This structure maps the physical keys on the keyboard to their functions in the user interface. It holds the tables that assign characters to key codes, set up dead keys, and determine which keys function as modifiers. There's just one key map shared by all applications running on the same machine.

See also: `get_key_map()`

### menu_bar_border

Declared in: be/interface/MenuBar.h

typedef enum {. . .} `menu_bar_border`

This type enumerates the ways that a menu bar can be bordered.

See also: `BMenuBar::SetBorder()`, "`menu_bar_border` Constants" above

### menu_info

Declared in: be/interface/Menu.h

typedef struct { float `font_size`; font_name `font`; rgb_color `background_color`; int32 `separator`; bool `click_to_open`; bool `triggers_always_shown`; } `menu_info`

This structure records the user's menu preferences.

See also: `set_menu_info()` , the BMenu class

### menu_layout

Declared in: be/interface/Menu.h

typedef enum {. . .} `menu_layout`

This type distinguishes the various ways that items can arranged in a menu or menu bar.

See also: the BMenu class, "`menu_layout` Constants" above

### mouse_map

Declared in: be/interface/InterfaceDefs.h

typedef struct { uint32 `left`; uint32 `right`; uint32 `middle`; } `mouse_map`

This structure maps mouse buttons to their roles as the `B_PRIMARY_MOUSE_BUTTON`, `B_SECONDARY_MOUSE_BUTTON`, or `B_TERTIARY_MOUSE_BUTTON`.

See also: `set_mouse_map()`

### orientation

Declared in: be/interface/InterfaceDefs.h

typedef enum {. . .} `orientation`

This type distinguishes between the `B_VERTICAL` and `B_HORIZONTAL` orientation of scroll bars.

See also: the BScrollBar and BScrollView classes

### pattern

Declared in: be/interface/GraphicsDefs.h

typedef struct { uchar `data`[8]; } `pattern`

A pattern is a arrangement of two colors—the high color and the low color—in an 8-pixel by 8-pixel square. Pixels are specified in rows, with one byte per row and one bit per pixel. Bits marked 1 designate the high color; those marked 0 designate the low color. An example and an illustration are given under "Patterns" in the "Drawing section of this chapter.

See also: "Pattern Constants" above

### print_file_header

Declared in: be/interface/PrintJob.h

typedef struct { long `version`; long `page_count`; long `_reserved_1_`; long `_reserved_2_`; long `_reserved_3_`; long `_reserved_4_`; long `_reserved_5_`; } `print_file_header`

This structure defines the header information for a print job. Although declared publicly, it currently is used only internally by the BPrintJob class.

### rgb_color

Declared in: be/interface/GraphicsDefs.h

typedef struct { uint8 `red`; uint8 `green`; uint8 `blue`; uint8 `alpha`; } `rgb_color`

This type specifies a full 32-bit color. Each component can have a value ranging from a minimum of 0 to a maximum of 255.

The `alpha` component, which is designed to specify the coverage of the color (how transparent or opaque it is), is currently ignored. However, an `rgb_color` can be made completely transparent by assigning it the special value, `B_TRANSPARENT_32_BIT`.

See also: `BView::SetHighColor()`

### screen_id

Declared in: be/interface/Screen.h

typedef struct { int32 `id`; } `screen_id`

This type is a unique identifier for a screen. The constant `B_MAIN_SCREEN_ID` is a `screen_id` that identifies the main screen.

See also: the BScreen class

### screen_info

Declared in: be/interface/InterfaceDefs.h

typedef struct { color_space `mode`; BRect `frame`; uint32 `spaces`; float `min_refresh_rate`; float `max_refresh_rate`; float `refresh_rate`; uchar `h_position`; uchar `v_position`; uchar `h_size`; uchar `v_size`; } `screen_info`

This structure holds information about a screen. Its fields are explained under the `get_screen_info()` global function.

See also: `get_screen_info()`

### scroll_bar_info

Declared in: be/interface/InterfaceDefs.h

typedef struct { bool `proportional`; bool `double_arrows`; int32 `knob`; int32 `min_knob_size`; } `scroll_bar_info`

This structure captures the user's preferences for how scroll bars should behave and appear.

See also: `set_scroll_bar_info()`, the BScrollBar class

### text_run

Declared in: be/interface/TextView.h

typedef struct { int32 `offset`; BFont `font`; rgb_color `color`; } `text_run`

The BTextView class uses this structure to keep track of a sequence of characters that are displayed in the same font and color.

See also: `BTextView::SetRunArray()`

### text_run_array

Declared in: be/interface/TextView.h

typedef struct { int32 `count`; text_run `runs`[]; } `text_run_array`

The BTextView class uses this structure to associate character formats with the text it displays.

See also: `BTextView::SetRunArray()`

### tuned_font_info

Declared in: be/interface/Font.h

typedef struct { float `size`; float `shear`; float `rotation`; int32 `flags`; int16 `face`; } `tuned_font_info`

This structure lists the properties of a font that has a counterpart that's been tuned to improve its appearance on-screen. The tuned counterpart will be used whenever the font is the BView's current font and `DrawString()` draws to the screen.

See also: `BFont::GetTunedInfo()`, `get_font_family()`

### window_type

Declared in: be/interface/Window.h

typedef enum {. . .} `window_type`

This type describes the various kinds of windows that can be requested from the Application Server.

See also: the BWindow constructor, "`window_type` Constants"

The Interface Kit Table of Contents | The Interface Kit Index

The B e Book,
...in lovely HTML...
for BeOS Release 5.

Copyright © 2000 Be, Inc. All rights reserved..