All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Enumerations | Functions | Variables
InterfaceDefs.h File Reference

Defines standard interface definitions for controls. More...

Enumerations

enum  border_style {
  B_PLAIN_BORDER ,
  B_FANCY_BORDER ,
  B_NO_BORDER
}
 
enum  button_width {
  B_WIDTH_AS_USUAL ,
  B_WIDTH_FROM_WIDEST ,
  B_WIDTH_FROM_LABEL
}
 
enum  cap_mode {
  B_ROUND_CAP = B_ROUND_JOIN ,
  B_BUTT_CAP = B_BUTT_JOIN ,
  B_SQUARE_CAP = B_SQUARE_JOIN
}
 
enum  color_which {
  B_NO_COLOR = 0 ,
  B_PANEL_BACKGROUND_COLOR = 1 ,
  B_PANEL_TEXT_COLOR = 10 ,
  B_DOCUMENT_BACKGROUND_COLOR = 11 ,
  B_DOCUMENT_TEXT_COLOR = 12 ,
  B_CONTROL_BACKGROUND_COLOR = 13 ,
  B_CONTROL_TEXT_COLOR = 14 ,
  B_CONTROL_BORDER_COLOR = 15 ,
  B_CONTROL_HIGHLIGHT_COLOR = 16 ,
  B_CONTROL_MARK_COLOR = 27 ,
  B_NAVIGATION_BASE_COLOR = 4 ,
  B_NAVIGATION_PULSE_COLOR = 17 ,
  B_SHINE_COLOR = 18 ,
  B_SHADOW_COLOR = 19 ,
  B_LINK_TEXT_COLOR = 33 ,
  B_LINK_HOVER_COLOR = 34 ,
  B_LINK_VISITED_COLOR = 35 ,
  B_LINK_ACTIVE_COLOR = 36 ,
  B_MENU_BACKGROUND_COLOR = 2 ,
  B_MENU_SELECTED_BACKGROUND_COLOR = 6 ,
  B_MENU_ITEM_TEXT_COLOR = 7 ,
  B_MENU_SELECTED_ITEM_TEXT_COLOR = 8 ,
  B_MENU_SELECTED_BORDER_COLOR = 9 ,
  B_LIST_BACKGROUND_COLOR = 28 ,
  B_LIST_SELECTED_BACKGROUND_COLOR = 29 ,
  B_LIST_ITEM_TEXT_COLOR = 30 ,
  B_LIST_SELECTED_ITEM_TEXT_COLOR = 31 ,
  B_SCROLL_BAR_THUMB_COLOR = 32 ,
  B_TOOL_TIP_BACKGROUND_COLOR = 20 ,
  B_TOOL_TIP_TEXT_COLOR = 21 ,
  B_STATUS_BAR_COLOR = 37 ,
  B_SUCCESS_COLOR = 100 ,
  B_FAILURE_COLOR = 101 ,
  B_WINDOW_TAB_COLOR = 3 ,
  B_WINDOW_TEXT_COLOR = 22 ,
  B_WINDOW_INACTIVE_TAB_COLOR = 23 ,
  B_WINDOW_INACTIVE_TEXT_COLOR = 24 ,
  B_WINDOW_BORDER_COLOR = 25 ,
  B_WINDOW_INACTIVE_BORDER_COLOR = 26 ,
  B_KEYBOARD_NAVIGATION_COLOR = B_NAVIGATION_BASE_COLOR ,
  B_MENU_SELECTION_BACKGROUND_COLOR = B_MENU_SELECTED_BACKGROUND_COLOR ,
  B_DESKTOP_COLOR = 5
}
 
enum  join_mode {
  B_ROUND_JOIN = 0 ,
  B_MITER_JOIN ,
  B_BEVEL_JOIN ,
  B_BUTT_JOIN ,
  B_SQUARE_JOIN
}
 
enum  orientation {
  B_HORIZONTAL ,
  B_VERTICAL
}
 

Functions

status_t get_click_speed (bigtime_t *speed)
 Get the double-click maximum delay.
 
status_t get_click_speed (const char *mouse_name, bigtime_t *speed)
 Get the double-click maximum delay for a specific mouse.
 
status_t get_key_info (key_info *info)
 Fills out the key_info struct with the current state of the keyboard.
 
void get_key_map (key_map **_map, char **_keyBuffer)
 Provides a copy of the system keymap.
 
status_t get_keyboard_id (uint16 *_id)
 Fills out _id with the id of the currently attached keyboard.
 
status_t get_modifier_key (uint32 modifier, uint32 *key)
 Gets the code of the requested modifier key from the system keymap.
 
status_t get_mouse_acceleration (const char *mouse_name, int32 *speed)
 Get the mouse acceleration setting for a specific mouse.
 
status_t get_mouse_acceleration (int32 *speed)
 Get the mouse acceleration.
 
status_t get_mouse_map (const char *mouse_name, mouse_map *map)
 Get the button map for a specific mouse.
 
status_t get_mouse_map (mouse_map *map)
 Get the button map of the mouse.
 
status_t get_mouse_speed (const char *mouse_name, int32 *speed)
 Get the mouse speed setting for a specific mouse.
 
status_t get_mouse_speed (int32 *speed)
 Get the mouse speed.
 
status_t get_mouse_type (const char *mouse_name, int32 *type)
 Get the number of buttons for a specific mouse.
 
status_t get_mouse_type (int32 *type)
 Get the number of buttons of the mouse.
 
uint32 modifiers ()
 Gets a bitmap of each modifier key pressed down and each active keyboard lock.
 
status_t set_click_speed (bigtime_t speed)
 Set the double-click maximum delay.
 
status_t set_click_speed (const char *mouse_name, bigtime_t speed)
 Set the double-click maximum delay for a specific mouse.
 
void set_keyboard_locks (uint32 modifiers)
 Set the keyboard locks.
 
void set_modifier_key (uint32 modifier, uint32 key)
 Set the modifier key to the specified code in the system keymap.
 
status_t set_mouse_acceleration (const char *mouse_name, int32 speed)
 Set the mouse acceleration for a specific mouse.
 
status_t set_mouse_map (const char *mouse_name, mouse_map *map)
 Set the button map for a specific mouse.
 
status_t set_mouse_map (mouse_map *map)
 Set the button map of the mouse.
 
status_t set_mouse_speed (const char *mouse_name, int32 speed)
 Set the mouse speed for a specific mouse.
 
status_t set_mouse_type (const char *mouse_name, int32 type)
 Configure the number of buttons for a specific mouse.
 

Variables

const float B_DEFAULT_MITER_LIMIT = 10.0F
 

Detailed Description

Defines standard interface definitions for controls.

Since
BeOS R3

Enumeration Type Documentation

◆ border_style

Enumerator
B_PLAIN_BORDER 

The right and bottom sides of the box are darker than the top and left sides to produce a shadow effect and make the box look like it is raised slightly above the surrounding surface.

Since
BeOS R3
B_FANCY_BORDER 

The border is a bevelled to give it a 3D effect. The border is uniform in appearance on all four sides. This is the default appearance.

Since
BeOS R3
B_NO_BORDER 

No border.

Since
BeOS R3

◆ button_width

Enumerator
B_WIDTH_AS_USUAL 

Set the width of each button based on the standard width.

Since
BeOS R3
B_WIDTH_FROM_WIDEST 

Set the width of each button based on the width of the widest button.

Since
BeOS R3
B_WIDTH_FROM_LABEL 

Set the width of each button to accommodate the label.

Since
BeOS R5

◆ cap_mode

enum cap_mode
Enumerator
B_ROUND_CAP 

Round cap mode.

Since
BeOS R3
B_BUTT_CAP 

Butt cap mode.

Since
BeOS R3
B_SQUARE_CAP 

Square cap mode.

Since
BeOS R3

◆ color_which

Enumerator
B_NO_COLOR 

This indicates that no color has been configured for the View.

Since
Haiku R1
B_PANEL_BACKGROUND_COLOR 

The background color of a panel, a panel in this context is a window area on which controls are added. For example the background of preferences/appearence

use with B_PANEL_TEXT_COLOR

Since
BeOS
B_PANEL_TEXT_COLOR 

The text color matching B_PANEL_BACKGROUND_COLOR.

Since
Haiku R1
B_DOCUMENT_BACKGROUND_COLOR 

The background color of a text view. For example the background of a BTextView.

use with B_DOCUMENT_TEXT_COLOR

Since
Haiku R1
B_DOCUMENT_TEXT_COLOR 

The text color matching B_DOCUMENT_BACKGROUND_COLOR.

Since
Haiku R1
B_CONTROL_BACKGROUND_COLOR 

The background of a control. For example a Button.

use with B_CONTROL_TEXT_COLOR

Since
Haiku R1
B_CONTROL_TEXT_COLOR 

The text color matching B_CONTROL_BACKGROUND_COLOR.

Since
Haiku R1
B_CONTROL_BORDER_COLOR 

The border of a control. For example a Button.

use with B_CONTROL_BACKGROUND_COLOR

Since
Haiku R1
B_CONTROL_HIGHLIGHT_COLOR 
Since
Haiku R1
B_CONTROL_MARK_COLOR 
Since
Haiku R1
B_NAVIGATION_BASE_COLOR 

This is used to the keyboard focus.

Since
Haiku R1
B_NAVIGATION_PULSE_COLOR 
Since
Haiku R1
B_SHINE_COLOR 
Since
Haiku R1
B_SHADOW_COLOR 
Since
Haiku R1
B_LINK_TEXT_COLOR 

The color of links (URLs).

Since
Haiku R1
B_LINK_HOVER_COLOR 

The color of a link (URL) that is currently hovered by the mouse.

Since
Haiku R1
B_LINK_VISITED_COLOR 

The color of a link (URL) that was visited in the past.

Since
Haiku R1
B_LINK_ACTIVE_COLOR 

The color of a link (URL) that is active. This is a link that is currently beeing clicked, but the user has not yet let go of the mouse.

Since
Haiku R1
B_MENU_BACKGROUND_COLOR 

The background color of a menu.

Since
BeOS
B_MENU_SELECTED_BACKGROUND_COLOR 

The background color of selected menu item.

Relates to B_MENU_BACKGROUND_COLOR

Since
Haiku R1
B_MENU_ITEM_TEXT_COLOR 

The text color of a menu item.

Use with B_MENU_BACKGROUND_COLOR.

Since
BeOS
B_MENU_SELECTED_ITEM_TEXT_COLOR 

The text color of a selected menu item.

Use with B_MENU_SELECTED_BACKGROUND_COLOR.

Since
BeOS
B_MENU_SELECTED_BORDER_COLOR 
Since
Haiku R1
B_LIST_BACKGROUND_COLOR 

The background color of a list. This is used by BListView.

Since
Haiku R1
B_LIST_SELECTED_BACKGROUND_COLOR 

The background color of a selected list item.

Since
Haiku R1
B_LIST_ITEM_TEXT_COLOR 

The text color of a list item.

Use with B_LIST_BACKGROUND_COLOR.

Since
Haiku R1
B_LIST_SELECTED_ITEM_TEXT_COLOR 

The text color of a selected list item.

Use with B_LIST_SELECTED_BACKGROUND_COLOR.

Since
Haiku R1
B_SCROLL_BAR_THUMB_COLOR 

The color of the thumb of a scrollbar. This is the part you can drag.

Since
Haiku R1
B_TOOL_TIP_BACKGROUND_COLOR 

The background color of a tooltip.

Since
Haiku R1
B_TOOL_TIP_TEXT_COLOR 

The text color of a tooltip.

Use with B_TOOL_TIP_BACKGROUND_COLOR.

Since
Haiku R1
B_STATUS_BAR_COLOR 

This is used by progress bars. For example by BStatusBar.

Since
Haiku R1
B_SUCCESS_COLOR 

This marks operations that suceeded. For example downloads in WebPositive that completed.

Since
Haiku R1
B_FAILURE_COLOR 

This marks operations that failed. For example downloads in WebPositive that failed or wrong user input. Used by BTextControl::MarkAsInvalid

Since
Haiku R1
B_WINDOW_TAB_COLOR 

The background color of the active window tab.

Since
BeOS
B_WINDOW_TEXT_COLOR 

The text color of the active window tab.

Use with B_WINDOW_TAB_COLOR.

Since
Haiku R1
B_WINDOW_INACTIVE_TAB_COLOR 

The background color of inactive window tabs.

Since
Haiku R1
B_WINDOW_INACTIVE_TEXT_COLOR 

The text color of inactive window tabs.

Use with B_WINDOW_INACTIVE_TAB_COLOR.

Since
Haiku R1
B_WINDOW_BORDER_COLOR 

The border color of the active window.

Relates to B_WINDOW_TAB_COLOR.

Since
Haiku R1
B_WINDOW_INACTIVE_BORDER_COLOR 

The border color of the inactive windows.

Relates to B_WINDOW_INACTIVE_TAB_COLOR.

Since
Haiku R1

◆ join_mode

enum join_mode
Enumerator
B_ROUND_JOIN 

Round join mode.

Since
BeOS R3
B_MITER_JOIN 

Miter join mode.

Since
BeOS R3
B_BEVEL_JOIN 

Bevel join mode.

Since
BeOS R3
B_BUTT_JOIN 

Butt join mode.

Since
BeOS R3
B_SQUARE_JOIN 

Square join mode.

Since
BeOS R3

◆ orientation

Enumerator
B_HORIZONTAL 

Horizontal alignment

Since
BeOS R3
B_VERTICAL 

Vertical alignment

Since
BeOS R3

Function Documentation

◆ get_click_speed() [1/2]

status_t get_click_speed ( bigtime_t speed)

Get the double-click maximum delay.

◆ get_click_speed() [2/2]

status_t get_click_speed ( const char *  mouse_name,
bigtime_t speed 
)

Get the double-click maximum delay for a specific mouse.

Since
Haiku R1

◆ get_key_info()

status_t get_key_info ( key_info *  info)

Fills out the key_info struct with the current state of the keyboard.

Parameters
infoThe key_info struct to fill out.
Return values
B_OKEverything went fine.
B_ERRORThere was an error retrieving the key_info struct.
Since
BeOS R3

◆ get_key_map()

void get_key_map ( key_map **  _map,
char **  _keyBuffer 
)

Provides a copy of the system keymap.

Attention
You must free _map and _keyBuffer when you are done with them.
Parameters
_mapA pointer to the system keymap structure.
_keyBufferA pointer containing the UTF-8 character encodings.
Since
BeOS R3

◆ get_keyboard_id()

status_t get_keyboard_id ( uint16 _id)

Fills out _id with the id of the currently attached keyboard.

Return values
B_OKEverything went fine.
B_ERRORThere was an error retrieving the keyboard id.
Since
BeOS R3

◆ get_modifier_key()

status_t get_modifier_key ( uint32  modifier,
uint32 key 
)

Gets the code of the requested modifier key from the system keymap.

Parameters
modifierThe modifier key to get from the system keymap.
keyA pointer to an int32 to store the key code.
Return values
B_OKEverything went fine.
B_ERRORThere was an error retrieving the modifier key.
Since
BeOS R3

◆ get_mouse_acceleration() [1/2]

status_t get_mouse_acceleration ( const char *  mouse_name,
int32 speed 
)

Get the mouse acceleration setting for a specific mouse.

Since
Haiku R1

◆ get_mouse_acceleration() [2/2]

status_t get_mouse_acceleration ( int32 speed)

Get the mouse acceleration.

If there are multiple mouses connected, this function returns the speed from a random one.

◆ get_mouse_map() [1/2]

status_t get_mouse_map ( const char *  mouse_name,
mouse_map *  map 
)

Get the button map for a specific mouse.

Since
Haiku R1

◆ get_mouse_map() [2/2]

status_t get_mouse_map ( mouse_map *  map)

Get the button map of the mouse.

◆ get_mouse_speed() [1/2]

status_t get_mouse_speed ( const char *  mouse_name,
int32 speed 
)

Get the mouse speed setting for a specific mouse.

Since
Haiku R1

◆ get_mouse_speed() [2/2]

status_t get_mouse_speed ( int32 speed)

Get the mouse speed.

If there are multiple mouses connected, this function returns the speed from a random one.

◆ get_mouse_type() [1/2]

status_t get_mouse_type ( const char *  mouse_name,
int32 type 
)

Get the number of buttons for a specific mouse.

Mouse names can be known from BInputDevice.

Since
Haiku R1

◆ get_mouse_type() [2/2]

status_t get_mouse_type ( int32 type)

Get the number of buttons of the mouse.

If there are multiple mouses connected, the number of buttons for one of them picked at random will be returned.

◆ modifiers()

uint32 modifiers ( )

Gets a bitmap of each modifier key pressed down and each active keyboard lock.

Test the bitmap returned using a bit mask composed of the following modifier key constants:

  • B_CAPS_LOCK
  • B_COMMAND_KEY
  • B_CONTROL_KEY
  • B_MENU_KEY
  • B_NUM_LOCK
  • B_OPTION_KEY
  • B_SCROLL_LOCK
  • B_SHIFT_KEY

You may use a bit mask of 0 to test that no modifier keys are pressed. If it is important to know if the left or right modifier key is pressed down you can use the following additional constants:

  • B_LEFT_SHIFT_KEY
  • B_RIGHT_SHIFT_KEY
  • B_LEFT_CONTROL_KEY
  • B_RIGHT_CONTROL_KEY
  • B_LEFT_OPTION_KEY
  • B_RIGHT_OPTION_KEY
  • B_LEFT_COMMAND_KEY
  • B_RIGHT_COMMAND_KEY
Returns
A bitmap containing each active modifier keys and locks.
Since
BeOS R3

◆ set_click_speed() [1/2]

status_t set_click_speed ( bigtime_t  speed)

Set the double-click maximum delay.

◆ set_click_speed() [2/2]

status_t set_click_speed ( const char *  mouse_name,
bigtime_t  speed 
)

Set the double-click maximum delay for a specific mouse.

Since
Haiku R1

◆ set_keyboard_locks()

void set_keyboard_locks ( uint32  modifiers)

Set the keyboard locks.

Pass in a bit mask containing the following constants:

  • B_CAPS_LOCK
  • B_NUM_LOCK
  • B_SCROLL_LOCK

The constants present in the bit mask will turn the lock on, those absent will turn the lock off. Pass 0 in to turn off all locks.

Parameters
modifiersA bitmap of lock keys to set.
Since
BeOS R3

◆ set_modifier_key()

void set_modifier_key ( uint32  modifier,
uint32  key 
)

Set the modifier key to the specified code in the system keymap.

Parameters
modifierThe modifier key to set in the system keymap.
keyThe key code to set the modifier key to.
Since
BeOS R3

◆ set_mouse_acceleration()

status_t set_mouse_acceleration ( const char *  mouse_name,
int32  speed 
)

Set the mouse acceleration for a specific mouse.

The setting is saved and persists accross reboots.

Since
Haiku R1

◆ set_mouse_map() [1/2]

status_t set_mouse_map ( const char *  mouse_name,
mouse_map *  map 
)

Set the button map for a specific mouse.

The setting is saved and persists accross reboots.

Since
Haiku R1

◆ set_mouse_map() [2/2]

status_t set_mouse_map ( mouse_map *  map)

Set the button map of the mouse.

◆ set_mouse_speed()

status_t set_mouse_speed ( const char *  mouse_name,
int32  speed 
)

Set the mouse speed for a specific mouse.

The setting is saved and persists accross reboots.

Since
Haiku R1

◆ set_mouse_type()

status_t set_mouse_type ( const char *  mouse_name,
int32  type 
)

Configure the number of buttons for a specific mouse.

The setting is saved and persists accross reboots.

Since
Haiku R1

Variable Documentation

◆ B_DEFAULT_MITER_LIMIT

B_DEFAULT_MITER_LIMIT = 10.0F

Default miter limit used to calculate the angle cut off for miter joins.

Since
BeOS R3