2011-08-10 01:46:13 +04:00
|
|
|
/*
|
2013-06-04 04:12:40 +04:00
|
|
|
* Copyright 2011-2013 Haiku, Inc. All rights reserved.
|
2011-08-10 01:46:13 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
2013-02-07 06:05:00 +04:00
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* John Scipione, jscipione@gmail.com
|
|
|
|
*
|
|
|
|
* Corresponds to:
|
2013-06-04 04:12:40 +04:00
|
|
|
* headers/os/interface/InterfaceDefs.h hrev45737
|
|
|
|
* src/kits/interface/InterfaceDefs.cpp hrev45737
|
2011-08-10 01:46:13 +04:00
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
/*!
|
|
|
|
\file InterfaceDefs.h
|
2013-02-07 06:05:00 +04:00
|
|
|
\ingroup interface
|
|
|
|
\ingroup libbe
|
2011-08-10 01:46:13 +04:00
|
|
|
\brief Defines standard interface definitions for controls.
|
|
|
|
*/
|
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\enum border_style
|
2013-02-07 06:05:00 +04:00
|
|
|
\ingroup interface
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Collection of flags that determine the border style drawn around a BBox.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\var border_style B_PLAIN_BORDER
|
2011-08-10 01:46:13 +04:00
|
|
|
|
|
|
|
\image html B_PLAIN_BORDER.png
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\var border_style B_FANCY_BORDER
|
2011-08-10 01:46:13 +04:00
|
|
|
|
|
|
|
\image html B_FANCY_BORDER.png
|
|
|
|
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\var border_style B_NO_BORDER
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
No border.
|
|
|
|
*/
|
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\enum orientation
|
2013-02-07 06:05:00 +04:00
|
|
|
|
|
|
|
Orientation flag sets the layout to either horizontal or vertical
|
2011-08-10 01:46:13 +04:00
|
|
|
alignment.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
/*!
|
|
|
|
\var orientation B_HORIZONTAL
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Horizontal alignment
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\var orientation B_VERTICAL
|
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Vertical alignment
|
|
|
|
*/
|
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
|
|
|
|
/*!
|
|
|
|
\enum button_width
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Collection of flags that determine how wide to draw the buttons in a
|
|
|
|
BAlert dialog.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
/*!
|
|
|
|
\var button_width B_WIDTH_AS_USUAL
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Set the width of each button based on the standard width.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
/*!
|
|
|
|
\var button_width B_WIDTH_FROM_WIDEST
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Set the width of each button based on the width of the widest button.
|
|
|
|
*/
|
|
|
|
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
/*!
|
|
|
|
\var button_width B_WIDTH_FROM_LABEL
|
2013-02-07 06:05:00 +04:00
|
|
|
|
2011-08-10 01:46:13 +04:00
|
|
|
Set the width of each button to accomidate the width of the button's
|
|
|
|
label.
|
|
|
|
*/
|
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
|
2013-06-04 04:12:40 +04:00
|
|
|
// Line join and cap modes
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\enum join_mode
|
|
|
|
|
|
|
|
PostScript-style line join modes used by BView::SetLineMode()
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var join_mode B_ROUND_JOIN
|
|
|
|
|
|
|
|
Round join mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var join_mode B_MITER_JOIN
|
|
|
|
|
|
|
|
Miter join mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var join_mode B_BEVEL_JOIN
|
|
|
|
|
|
|
|
Bevel join mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var join_mode B_BUTT_JOIN
|
|
|
|
|
|
|
|
Butt join mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var join_mode B_SQUARE_JOIN
|
|
|
|
|
|
|
|
Square join mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\enum cap_mode
|
|
|
|
|
|
|
|
PostScript-style line cap modes used by BView::SetLineMode()
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var cap_mode B_ROUND_CAP
|
|
|
|
|
|
|
|
Round cap mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var cap_mode B_BUTT_CAP
|
|
|
|
|
|
|
|
Butt cap mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var cap_mode B_SQUARE_CAP
|
|
|
|
|
|
|
|
Square cap mode.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\var B_DEFAULT_MITER_LIMIT
|
|
|
|
|
|
|
|
Default miter limit used to calculate the angle cut off for miter joins.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-11-10 12:35:38 +04:00
|
|
|
///// Keyboard related functions
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn uint32 modifiers()
|
|
|
|
\brief 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:
|
|
|
|
- \c B_CAPS_LOCK
|
|
|
|
- \c B_COMMAND_KEY
|
|
|
|
- \c B_CONTROL_KEY
|
|
|
|
- \c B_MENU_KEY
|
|
|
|
- \c B_NUM_LOCK
|
|
|
|
- \c B_OPTION_KEY
|
|
|
|
- \c B_SCROLL_LOCK
|
|
|
|
- \c 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:
|
|
|
|
- \c B_LEFT_SHIFT_KEY
|
|
|
|
- \c B_RIGHT_SHIFT_KEY
|
|
|
|
- \c B_LEFT_CONTROL_KEY
|
|
|
|
- \c B_RIGHT_CONTROL_KEY
|
|
|
|
- \c B_LEFT_OPTION_KEY
|
|
|
|
- \c B_RIGHT_OPTION_KEY
|
|
|
|
- \c B_LEFT_COMMAND_KEY
|
|
|
|
- \c B_RIGHT_COMMAND_KEY
|
|
|
|
|
|
|
|
\returns A bitmap containing each active modifier keys and locks.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn status_t get_key_info(key_info* info)
|
|
|
|
\brief Fills out the key_info struct with the current state of the
|
|
|
|
keyboard.
|
|
|
|
|
|
|
|
\param info The key_info struct to fill out.
|
|
|
|
|
|
|
|
\retval B_OK Everything went fine.
|
|
|
|
\retval B_ERROR There was an error retrieving the key_info struct.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void get_key_map(key_map** _map, char** _keyBuffer)
|
|
|
|
\brief Provides a copy of the system keymap.
|
|
|
|
|
|
|
|
\attention You must free \a _map and \a _keyBuffer when you are done
|
|
|
|
with them.
|
|
|
|
|
|
|
|
\param _map A pointer to the system keymap structure.
|
|
|
|
\param _keyBuffer A pointer containing the UTF-8 character encodings.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn status_t get_keyboard_id(uint16* _id)
|
|
|
|
\brief Fills out \a _id with the id of the currently attached keyboard.
|
|
|
|
|
|
|
|
\retval B_OK Everything went fine.
|
|
|
|
\retval B_ERROR There was an error retrieving the keyboard id.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn status_t get_modifier_key(uint32 modifier, uint32 *key)
|
|
|
|
\brief Gets the code of the requested \a modifier key from the
|
|
|
|
system keymap.
|
|
|
|
|
|
|
|
\param modifier The modifier key to get from the system keymap.
|
|
|
|
\param key A pointer to an int32 to store the key code.
|
|
|
|
|
|
|
|
\retval B_OK Everything went fine.
|
|
|
|
\retval B_ERROR There was an error retrieving the modifier key.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void set_modifier_key(uint32 modifier, uint32 key)
|
|
|
|
\brief Set the \a modifier \a key to the specified code in the
|
|
|
|
system keymap.
|
|
|
|
|
|
|
|
\param modifier The modifier key to set in the system keymap.
|
|
|
|
\param key The key code to set the modifier key to.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
\fn void set_keyboard_locks(uint32 modifiers)
|
|
|
|
\brief Set the keyboard locks.
|
|
|
|
|
|
|
|
Pass in a bit mask containing the following constants:
|
|
|
|
- \c B_CAPS_LOCK
|
|
|
|
- \c B_NUM_LOCK
|
|
|
|
- \c 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.
|
|
|
|
|
|
|
|
\param modifiers A bitmap of lock keys to set.
|
|
|
|
*/
|