]> git.sur5r.net Git - cc65/blob - include/mouse.h
This commit was generated by cvs2svn to compensate for changes in r2,
[cc65] / include / mouse.h
1 /*
2  * mouse.h
3  *
4  * Ullrich von Bassewitz, 24.04.1999
5  */
6
7
8
9 #ifndef _MOUSE_H
10 #define _MOUSE_H
11
12
13
14 /* Define __MOUSE__ for systems that support a proportional mouse */
15 #ifdef __C64__
16 #  define __MOUSE__
17 #endif
18 #ifdef __C128__
19 #  define __MOUSE__
20 #endif
21
22
23
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.
34  */
35
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
40  * function.
41  */
42
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.
48  */
49
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.
53  */
54
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:
60  *
61  *      - Hide the mouse
62  *      - Set the bounding box
63  *      - Place the mouse at the desired position
64  *      - Show the mouse again.
65  *
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.
69  */
70
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.
76  */
77
78 void mouse_info (void);
79 /* Hmmm...
80  */
81
82
83
84 /* End of mouse.h */
85 #endif
86
87
88