1/* 2 * Copyright 2011-2013 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * John Scipione, jscipione@gmail.com 7 * 8 * Corresponds to: 9 * headers/os/interface/InterfaceDefs.h hrev45737 10 * src/kits/interface/InterfaceDefs.cpp hrev45737 11 */ 12 13 14/*! 15 \file InterfaceDefs.h 16 \ingroup interface 17 \ingroup libbe 18 \brief Defines standard interface definitions for controls. 19*/ 20 21 22/*! 23 \enum border_style 24 \ingroup interface 25 26 Collection of flags that determine the border style drawn around a BBox. 27*/ 28 29 30/*! 31 \var border_style B_PLAIN_BORDER 32 33 \image html B_PLAIN_BORDER.png 34 35 The right and bottom sides of the box are darker than the top and 36 left sides to produce a shadow effect and make the box look like it 37 is raised slightly above the surrounding surface. 38*/ 39 40 41/*! 42 \var border_style B_FANCY_BORDER 43 44 \image html B_FANCY_BORDER.png 45 46 The border is a bevelled to give it a 3D effect. The border is uniform 47 in appearance on all four sides. This is the default appearance. 48*/ 49 50 51/*! 52 \var border_style B_NO_BORDER 53 54 No border. 55*/ 56 57 58/*! 59 \enum orientation 60 61 Orientation flag sets the layout to either horizontal or vertical 62 alignment. 63*/ 64 65 66/*! 67 \var orientation B_HORIZONTAL 68 69 Horizontal alignment 70*/ 71 72 73/*! 74 \var orientation B_VERTICAL 75 76 Vertical alignment 77*/ 78 79 80/*! 81 \enum button_width 82 83 Collection of flags that determine how wide to draw the buttons in a 84 BAlert dialog. 85*/ 86 87 88/*! 89 \var button_width B_WIDTH_AS_USUAL 90 91 Set the width of each button based on the standard width. 92*/ 93 94 95/*! 96 \var button_width B_WIDTH_FROM_WIDEST 97 98 Set the width of each button based on the width of the widest button. 99*/ 100 101 102/*! 103 \var button_width B_WIDTH_FROM_LABEL 104 105 Set the width of each button to accomidate the width of the button's 106 label. 107*/ 108 109 110// Line join and cap modes 111 112 113/*! 114 \enum join_mode 115 116 PostScript-style line join modes used by BView::SetLineMode() 117*/ 118 119 120/*! 121 \var join_mode B_ROUND_JOIN 122 123 Round join mode. 124*/ 125 126 127/*! 128 \var join_mode B_MITER_JOIN 129 130 Miter join mode. 131*/ 132 133 134/*! 135 \var join_mode B_BEVEL_JOIN 136 137 Bevel join mode. 138*/ 139 140 141/*! 142 \var join_mode B_BUTT_JOIN 143 144 Butt join mode. 145*/ 146 147/*! 148 \var join_mode B_SQUARE_JOIN 149 150 Square join mode. 151*/ 152 153 154/*! 155 \enum cap_mode 156 157 PostScript-style line cap modes used by BView::SetLineMode() 158*/ 159 160 161/*! 162 \var cap_mode B_ROUND_CAP 163 164 Round cap mode. 165*/ 166 167 168/*! 169 \var cap_mode B_BUTT_CAP 170 171 Butt cap mode. 172*/ 173 174 175/*! 176 \var cap_mode B_SQUARE_CAP 177 178 Square cap mode. 179*/ 180 181 182/*! 183 \var B_DEFAULT_MITER_LIMIT 184 185 Default miter limit used to calculate the angle cut off for miter joins. 186*/ 187 188 189///// Keyboard related functions 190 191 192/*! 193 \fn uint32 modifiers() 194 \brief Gets a bitmap of each modifier key pressed down and each active 195 keyboard lock. 196 197 Test the bitmap returned using a bit mask composed of the following 198 modifier key constants: 199 - \c B_CAPS_LOCK 200 - \c B_COMMAND_KEY 201 - \c B_CONTROL_KEY 202 - \c B_MENU_KEY 203 - \c B_NUM_LOCK 204 - \c B_OPTION_KEY 205 - \c B_SCROLL_LOCK 206 - \c B_SHIFT_KEY 207 208 You may use a bit mask of 0 to test that no modifier keys are pressed. 209 If it is important to know if the left or right modifier key is pressed 210 down you can use the following additional constants: 211 - \c B_LEFT_SHIFT_KEY 212 - \c B_RIGHT_SHIFT_KEY 213 - \c B_LEFT_CONTROL_KEY 214 - \c B_RIGHT_CONTROL_KEY 215 - \c B_LEFT_OPTION_KEY 216 - \c B_RIGHT_OPTION_KEY 217 - \c B_LEFT_COMMAND_KEY 218 - \c B_RIGHT_COMMAND_KEY 219 220 \returns A bitmap containing each active modifier keys and locks. 221*/ 222 223 224/*! 225 \fn status_t get_key_info(key_info* info) 226 \brief Fills out the key_info struct with the current state of the 227 keyboard. 228 229 \param info The key_info struct to fill out. 230 231 \retval B_OK Everything went fine. 232 \retval B_ERROR There was an error retrieving the key_info struct. 233*/ 234 235 236/*! 237 \fn void get_key_map(key_map** _map, char** _keyBuffer) 238 \brief Provides a copy of the system keymap. 239 240 \attention You must free \a _map and \a _keyBuffer when you are done 241 with them. 242 243 \param _map A pointer to the system keymap structure. 244 \param _keyBuffer A pointer containing the UTF-8 character encodings. 245*/ 246 247 248/*! 249 \fn status_t get_keyboard_id(uint16* _id) 250 \brief Fills out \a _id with the id of the currently attached keyboard. 251 252 \retval B_OK Everything went fine. 253 \retval B_ERROR There was an error retrieving the keyboard id. 254*/ 255 256 257/*! 258 \fn status_t get_modifier_key(uint32 modifier, uint32 *key) 259 \brief Gets the code of the requested \a modifier key from the 260 system keymap. 261 262 \param modifier The modifier key to get from the system keymap. 263 \param key A pointer to an int32 to store the key code. 264 265 \retval B_OK Everything went fine. 266 \retval B_ERROR There was an error retrieving the modifier key. 267*/ 268 269 270/*! 271 \fn void set_modifier_key(uint32 modifier, uint32 key) 272 \brief Set the \a modifier \a key to the specified code in the 273 system keymap. 274 275 \param modifier The modifier key to set in the system keymap. 276 \param key The key code to set the modifier key to. 277*/ 278 279 280/*! 281 \fn void set_keyboard_locks(uint32 modifiers) 282 \brief Set the keyboard locks. 283 284 Pass in a bit mask containing the following constants: 285 - \c B_CAPS_LOCK 286 - \c B_NUM_LOCK 287 - \c B_SCROLL_LOCK 288 289 The constants present in the bit mask will turn the lock on, those 290 absent will turn the lock off. Pass 0 in to turn off all locks. 291 292 \param modifiers A bitmap of lock keys to set. 293*/ 294