Documentation | ApplicationKit | Cursor
SYNOPSIS
Perl
use HaikuR1::Cursor qw(B_CURSOR_SYSTEM_DEFAULT B_CURSOR_I_BEAM B_CURSOR_ID_HELP); my $cursor1 = HaikuR1::Cursor->new($raw_data); my $cursor2 = HaikuR1::Cursor->new($copy_from); my $cursor1 = HaikuR1::Cursor->new(B_CURSOR_ID_HELP);
Python
from HaikuR1.Cursor import B_CURSOR_SYSTEM_DEFAULT B_CURSOR_I_BEAM B_CURSOR_ID_HELP cursor1 = Cursor(raw_data) cursor2 = Cursor(copy_from) cursor1 = Cursor(B_CURSOR_ID_HELP)
DESCRIPTION
Exposes the BCursor
object.
For more information on Cursor, see the Be Book class description, the Be Book overview, and the Haiku Book class description.
METHODS
Constructor
Creates a Cursor.
Perl
HaikuR1::Cursor->new($cursor);
Python
Cursor(cursor)
cursor
Can be a byte string containing raw cursor data, a Cursor to copy, an integer cursor id (see Cursor IDs below), or a Message containing an archive.
Note
The archiving of Cursors is not implemented in the C
The raw data format is:
header
1 byte width/height (currently must be 16)
1 byte bit depth (currently must be 1)
1 byte hotspot x-coordinate
1 byte hotspot y-coordinate
Total 4 bytes
color data
Currently, the width/height must be 16 and the bit depth must be 1 (1 = black, 0 = white); this makes 16x16 = 256 pixels at 1 bit per pixel, for 256 bits or 32 bytes.
transparency data
Currently, only on/off transparency (1 = opaque, 0 = transparent) is supported, so this is also 32 bytes.
copy
Copies the contents of another object into this object.
Perl
$cursor->copy($copy_from);
Python
cursor.copy(copy_from)
copy_from
A Cursor to copy.
ARCHIVABLE INTERFACE
Cursor
inherits the methods and hooks of Archivable.
OPERATORS
==
Returns true if the cursor objects refer to the same underlying cursor data.
!=
Returns true if the cursor objects do not refer to the same underlying cursor data.
CONSTANTS
Pre-defined Cursors
Perl
use HaikuR1::Cursor qw(:cursors)
Python
Python does not support export tags.
B_CURSOR_SYSTEM_DEFAULT
A hand cursor
B_CURSOR_I_BEAM
A text insertion cursor
Python
Since these two items are not instantiated on the C++ side until the Application is created, they are initially set to None. If you wish to use them, you must wait to import them until after you have created your Application object.
Cursor IDs
Perl
use HaikuR1::Cursor qw(:ids)
Python
Python does not support export tags.
- B_CURSOR_ID_SYSTEM_DEFAULT
- B_CURSOR_ID_CONTEXT_MENU
- B_CURSOR_ID_COPY
- B_CURSOR_ID_CREATE_LINK
- B_CURSOR_ID_CROSS_HAIR
- B_CURSOR_ID_FOLLOW_LINK
- B_CURSOR_ID_GRAB
- B_CURSOR_ID_GRABBING
- B_CURSOR_ID_HELP
- B_CURSOR_ID_I_BEAM
- B_CURSOR_ID_I_BEAM_HORIZONTAL
- B_CURSOR_ID_MOVE
- B_CURSOR_ID_NO_CURSOR
- B_CURSOR_ID_NOT_ALLOWED
- B_CURSOR_ID_PROGRESS
- B_CURSOR_ID_RESIZE_NORTH
- B_CURSOR_ID_RESIZE_EAST
- B_CURSOR_ID_RESIZE_SOUTH
- B_CURSOR_ID_RESIZE_WEST
- B_CURSOR_ID_RESIZE_NORTH_EAST
- B_CURSOR_ID_RESIZE_NORTH_WEST
- B_CURSOR_ID_RESIZE_SOUTH_EAST
- B_CURSOR_ID_RESIZE_SOUTH_WEST
- B_CURSOR_ID_RESIZE_NORTH_SOUTH
- B_CURSOR_ID_RESIZE_EAST_WEST
- B_CURSOR_ID_RESIZE_NORTH_EAST_SOUTH_WEST
- B_CURSOR_ID_RESIZE_NORTH_WEST_SOUTH_EAST
- B_CURSOR_ID_ZOOM_IN
- B_CURSOR_ID_ZOOM_OUT