4 * Ullrich von Bassewitz, 24.04.1999
14 /* Define __MOUSE__ for systems that support a proportional mouse */
24 void __fastcall__ mouse_init (unsigned char port, unsigned char sprite);
25 /* Setup the mouse interrupt handler. If the sprite value is != zero, the
26 * mouse routines will manage the sprite with this number. That means, it
27 * is moved if the mouse is moved (provided that the mouse cursor is visible),
28 * and switch on and off in the show and hide functions.
29 * The port parameter gives the joystick port used for the mouse and is only
30 * needed to read the mouse button state.
31 * After calling this function, the mouse is invisble, the cursor is placed
32 * at 0/0 (upper left corner), and the bounding box is reset to cover the
33 * whole screen. Call mouse_show once to make the mouse cursor visible.
36 void mouse_done (void);
37 /* Disable the mouse, remove the interrupt handler. This function MUST be
38 * called before terminating the program, otherwise odd things may happen.
39 * If in doubt, install an exit handler (using atexit) that calls this
43 void mouse_hide (void);
44 /* Hide the mouse. This function doesn't do anything visible if no sprite is
45 * used. The function manages a counter and may be called more than once.
46 * For each call to mouse_hide there must be a call to mouse_show to make
47 * the mouse visible again.
50 void mouse_show (void);
51 /* Show the mouse. This function doesn't do anything visible if no sprite is
52 * used. See mouse_hide for more information.
55 void __fastcall__ mouse_box (int minx, int miny, int maxx, int maxy);
56 /* Set the bounding box for the mouse pointer movement. The mouse X and Y
57 * coordinates will never go outside the given box.
58 * NOTE: The function does *not* check if the mouse is currently inside the
59 * given margins. The proper way to use this function therefore is:
62 * - Set the bounding box
63 * - Place the mouse at the desired position
64 * - Show the mouse again.
66 * NOTE2: When setting the box to something that is larger than the actual
67 * screen, the positioning of the mouse cursor will fail. If such margins
68 * are really what you want, you have to use your own cursor routines.
71 void __fastcall__ mouse_move (int x, int y);
72 /* Set the mouse cursor to the given position. If a mouse cursor is defined
73 * and currently visible, the mouse cursor is also moved.
74 * NOTE: This function does not check if the given position is valid and
75 * inside the bounding box.
78 void mouse_info (void);