1/* 2 * Copyright 2012-2014, 2019 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/app/Cursor.h hrev54621 10 * src/kits/app/Cursor.cpp hrev54621 11 */ 12 13 14/*! 15 \file Cursor.h 16 \ingroup app 17 \ingroup libbe 18 \brief Provides the BCursor class. 19*/ 20 21 22/*! 23 \enum BCursorID 24 List of predefined cursor IDs 25 26 \since BeOS R5 27*/ 28 29 30/*! 31 \var BCursorID B_CURSOR_ID_SYSTEM_DEFAULT 32 System default cursor 33 34 \since BeOS R5 35*/ 36 37 38/*! 39 \var BCursorID B_CURSOR_ID_CONTEXT_MENU 40 Context menu cursor 41 42 \since BeOS R5 43*/ 44 45 46/*! 47 \var BCursorID B_CURSOR_ID_COPY 48 Copy cursor 49 50 \since BeOS R5 51*/ 52 53 54/*! 55 \var BCursorID B_CURSOR_ID_CREATE_LINK 56 Symlink cursor 57 58 \since BeOS R5 59*/ 60 61 62/*! 63 \var BCursorID B_CURSOR_ID_CROSS_HAIR 64 Cross hairs cursor 65 66 \since BeOS R5 67*/ 68 69 70/*! 71 \var BCursorID B_CURSOR_ID_FOLLOW_LINK 72 Follow html link cursor 73 74 \since BeOS R5 75*/ 76 77 78/*! 79 \var BCursorID B_CURSOR_ID_GRAB 80 Grab cursor 81 82 \since BeOS R5 83*/ 84 85 86/*! 87 \var BCursorID B_CURSOR_ID_GRABBING 88 Grabbing cursor (mouse down) 89 90 \since BeOS R5 91*/ 92 93 94/*! 95 \var BCursorID B_CURSOR_ID_HELP 96 Help cursor 97 98 \since BeOS R5 99*/ 100 101 102/*! 103 \var BCursorID B_CURSOR_ID_I_BEAM 104 I beam cursor 105 106 \since BeOS R5 107*/ 108 109 110/*! 111 \var BCursorID B_CURSOR_ID_I_BEAM_HORIZONTAL 112 Horizontal I beam cursor 113 114 \since BeOS R5 115*/ 116 117 118/*! 119 \var BCursorID B_CURSOR_ID_MOVE 120 Move cursor 121 122 \since BeOS R5 123*/ 124 125 126/*! 127 \var BCursorID B_CURSOR_ID_NO_CURSOR 128 No cursor 129 130 \since BeOS R5 131*/ 132 133 134/*! 135 \var BCursorID B_CURSOR_ID_NOT_ALLOWED 136 Not allowed cursor 137 138 \since BeOS R5 139*/ 140 141 142/*! 143 \var BCursorID B_CURSOR_ID_PROGRESS 144 Progress cursor 145 146 \since BeOS R5 147*/ 148 149 150/*! 151 \var BCursorID B_CURSOR_ID_RESIZE_NORTH 152 Resize north cursor 153 154 \since BeOS R5 155*/ 156 157 158/*! 159 \var BCursorID B_CURSOR_ID_RESIZE_EAST 160 Resize east cursor 161 162 \since BeOS R5 163*/ 164 165 166/*! 167 \var BCursorID B_CURSOR_ID_RESIZE_SOUTH 168 Resize south cursor 169 170 \since BeOS R5 171*/ 172 173 174/*! 175 \var BCursorID B_CURSOR_ID_RESIZE_WEST 176 Resize west cursor 177 178 \since BeOS R5 179*/ 180 181 182/*! 183 \var BCursorID B_CURSOR_ID_RESIZE_NORTH_EAST 184 Resize north east cursor 185 186 \since BeOS R5 187*/ 188 189 190/*! 191 \var BCursorID B_CURSOR_ID_RESIZE_NORTH_WEST 192 Resize north west cursor 193 194 \since BeOS R5 195*/ 196 197 198/*! 199 \var BCursorID B_CURSOR_ID_RESIZE_SOUTH_EAST 200 Resize south east cursor 201 202 \since BeOS R5 203*/ 204 205 206/*! 207 \var BCursorID B_CURSOR_ID_RESIZE_SOUTH_WEST 208 Resize south west cursor 209 210 \since BeOS R5 211*/ 212 213 214/*! 215 \var BCursorID B_CURSOR_ID_RESIZE_NORTH_SOUTH 216 Resize north south cursor 217 218 \since BeOS R5 219*/ 220 221 222/*! 223 \var BCursorID B_CURSOR_ID_RESIZE_EAST_WEST 224 Resize east west cursor 225 226 \since BeOS R5 227*/ 228 229 230/*! 231 \var BCursorID B_CURSOR_ID_RESIZE_NORTH_EAST_SOUTH_WEST 232 Resize north east south west cursor 233 234 \since BeOS R5 235*/ 236 237 238/*! 239 \var BCursorID B_CURSOR_ID_RESIZE_NORTH_WEST_SOUTH_EAST 240 Resize north west south east cursor 241 242 \since BeOS R5 243*/ 244 245 246/*! 247 \var BCursorID B_CURSOR_ID_ZOOM_IN 248 Zoom in cursor 249 250 \since BeOS R5 251*/ 252 253 254/*! 255 \var BCursorID B_CURSOR_ID_ZOOM_OUT 256 Zoom out cursor 257 258 \since BeOS R5 259*/ 260 261 262/*! 263 \class BCursor 264 \ingroup app 265 \ingroup libbe 266 \brief BCursor describes a view-wide or application-wide cursor. 267 268 \note As BeOS only supports 16x16 monochrome cursors, to see a nice 269 shadowed one we will need to extend this. 270 271 \since BeOS R5 272*/ 273 274 275/*! 276 \fn BCursor::BCursor(const void* cursorData) 277 \brief Initializes a new cursor object. 278 279 If the \a cursorData parameter is not \c NULL then the cursor is initialized 280 with the cursor data. 281 282 \param cursorData The cursor data. 283 284 \since BeOS R5 285*/ 286 287 288/*! 289 \fn BCursor::BCursor(BCursorID id) 290 \brief Initializes a new cursor object from a predefined cursor \a id. 291 292 \param id The predefined \a id to initialize to. 293 294 \since BeOS R5 295*/ 296 297 298/*! 299 \fn BCursor::BCursor(const BCursor& other) 300 \brief Initializes a new cursor object from another cursor object. 301 302 \param other The cursor object to initialize from. 303 304 \since BeOS R5 305*/ 306 307 308/*! 309 \fn BCursor::BCursor(BMessage* data) 310 \brief Initializes a new cursor object from a message archive. 311 312 \param data The message data to initialize from. 313 314 \since BeOS R5 315*/ 316 317 318/*! 319 \fn BCursor::BCursor(const BBitmap* bitmap, const BPoint& hotspot) 320 \brief Initializes a new cursor object from a bitmap object and a point 321 object. 322 323 \param bitmap The bitmap object to initialize from. 324 \param hotspot The cursor hotspot. 325 326 \since Haiku R1 327*/ 328 329 330/*! 331 \fn BCursor::~BCursor() 332 \brief Destroy the cursor and free its memory. 333 334 \since BeOS R5 335*/ 336 337 338/*! 339 \fn status_t BCursor::InitCheck() const 340 \brief Returns the initialization status. 341 342 \return \c B_OK if the object was properly initialized or an error code 343 otherwise. 344 345 \since Haiku R1 346*/ 347 348 349/*! 350 \fn status_t BCursor::Archive(BMessage *into, bool deep) const 351 \brief Archive the cursor. Not implemented. 352 353 \since BeOS R5 354*/ 355 356 357/*! 358 \fn BArchivable* BCursor::Instantiate(BMessage *archive) 359 \brief Instantiate the cursor from a message. Not implemented. 360 361 \since BeOS R5 362*/ 363 364 365/*! 366 \fn BCursor& BCursor::operator=(const BCursor &other) 367 \brief Set the cursor to another cursor object. 368 369 \param other The cursor object to copy from. 370 371 \returns the new cursor object. 372 373 \since BeOS R5 374*/ 375 376 377/*! 378 \fn bool BCursor::operator==(const BCursor &other) const 379 \brief Compare a cursor object to another and return if they are equal. 380 381 \param other The cursor object to compare to. 382 383 \returns \c true if the cursor objects are equal, \c false if the cursor 384 objects are not equal. 385 386 \since BeOS R5 387*/ 388 389 390/*! 391 \fn bool BCursor::operator!=(const BCursor &other) const 392 \brief Compare a cursor object to another and return if they are not equal. 393 394 \param other The cursor object to compare to. 395 396 \returns \c true if the cursor objects are not equal, \c false if the cursor 397 objects are equal. 398 399 \since BeOS R5 400*/ 401