Rev 105 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
105 | pj | 1 | /* |
2 | * Project: S.Ha.R.K. |
||
3 | * |
||
4 | * Coordinators: |
||
5 | * Giorgio Buttazzo <giorgio@sssup.it> |
||
6 | * Paolo Gai <pj@gandalf.sssup.it> |
||
7 | * |
||
8 | * Authors : |
||
9 | * Paolo Gai <pj@gandalf.sssup.it> |
||
10 | * Massimiliano Giorgi <massy@gandalf.sssup.it> |
||
11 | * Luca Abeni <luca@gandalf.sssup.it> |
||
12 | * (see the web pages for full authors list) |
||
13 | * |
||
14 | * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy) |
||
15 | * |
||
16 | * http://www.sssup.it |
||
17 | * http://retis.sssup.it |
||
18 | * http://shark.sssup.it |
||
19 | */ |
||
20 | |||
21 | /** |
||
22 | ------------ |
||
23 | CVS : $Id: _mouse.h,v 1.1 2003-03-24 10:54:16 pj Exp $ |
||
24 | |||
25 | File: $File$ |
||
26 | Revision: $Revision: 1.1 $ |
||
27 | Last update: $Date: 2003-03-24 10:54:16 $ |
||
28 | ------------ |
||
29 | |||
30 | _mouse.h |
||
31 | |||
32 | **/ |
||
33 | |||
34 | /* |
||
35 | * Copyright (C) 2000 Paolo Gai |
||
36 | * |
||
37 | * This program is free software; you can redistribute it and/or modify |
||
38 | * it under the terms of the GNU General Public License as published by |
||
39 | * the Free Software Foundation; either version 2 of the License, or |
||
40 | * (at your option) any later version. |
||
41 | * |
||
42 | * This program is distributed in the hope that it will be useful, |
||
43 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
44 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
45 | * GNU General Public License for more details. |
||
46 | * |
||
47 | * You should have received a copy of the GNU General Public License |
||
48 | * along with this program; if not, write to the Free Software |
||
49 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
50 | * |
||
51 | */ |
||
52 | |||
53 | #ifndef ___MOUSE_H__ |
||
54 | #define ___MOUSE_H__ |
||
1689 | fabio | 55 | #include <arch/sys/cdefs.h> |
105 | pj | 56 | |
57 | __BEGIN_DECLS |
||
58 | |||
59 | /* "virtual operations" on a mouse */ |
||
60 | struct mouse_operations { |
||
61 | char *name; /* name! */ |
||
62 | char *desc; /* a descriptive line */ |
||
63 | |||
64 | BYTE proto[4]; |
||
65 | int packetlen; /* lenght of a packet */ |
||
66 | int howmany; /* howmany bytes to read at a time (unused) */ |
||
67 | int getextra; /* there is a extra byte (unused) */ |
||
68 | int absolute; /* absolute pointing devide (unused) */ |
||
69 | int dummy; /* (unused) */ |
||
70 | |||
71 | int (*open)(void*); /* open comunication device */ |
||
72 | void (*close)(void); /* close comunication device */ |
||
73 | void (*wait)(void); /* wait to have a BYTE (blocking operation)*/ |
||
74 | int (*get)(BYTE *ptr); /* get last BYTE */ |
||
75 | void (*enable)(void); /* enable interface */ |
||
76 | void (*disable)(void); /* disable interface */ |
||
77 | |||
78 | /* this function decode the mouse packet into a MOUSE_EVT structure */ |
||
79 | int (*decode)(MOUSE_EVT *evt,unsigned char *data); |
||
80 | }; |
||
81 | |||
82 | /* to virtualize interface beetwen a mouse device and a mouse protocol */ |
||
83 | extern int mousetype; |
||
84 | extern struct mouse_operations vmouse[]; |
||
85 | |||
86 | /* functions and variables (to use virtual operation)*/ |
||
87 | extern int (*open_mouse)(void*); /* open comunication device */ |
||
88 | extern void (*close_mouse)(void); /* close comunication device */ |
||
89 | extern void (*wait_mouse)(void); /* wait to have a BYTE (blocking operation)*/ |
||
90 | extern int (*get_mouse)(BYTE *data); /* get last BYTE */ |
||
91 | extern void (*enable_mouse)(void); /* enable interface */ |
||
92 | extern void (*disable_mouse)(void); /* disable interface */ |
||
93 | |||
94 | extern char *name_mouse; |
||
95 | extern char *desc_mouse; |
||
96 | extern BYTE *proto_mouse; |
||
97 | extern int packetlen_mouse; |
||
98 | |||
99 | /* used by mouse protocol task */ |
||
100 | extern short int mouse_lim_x1; |
||
101 | extern short int mouse_lim_y1; |
||
102 | extern short int mouse_lim_x2; |
||
103 | extern short int mouse_lim_y2; |
||
104 | extern short int mouse_x; |
||
105 | extern short int mouse_x_mick; |
||
106 | extern short int mouse_y; |
||
107 | extern short int mouse_y_mick; |
||
108 | extern short int mouse_buttons; |
||
109 | extern short int mouse_thresholdlim; |
||
110 | extern MOUSE_HANDLER mouse_handler; |
||
111 | |||
112 | /* a generic mouse server */ |
||
113 | extern TASK generalmouse_server(void); |
||
114 | |||
115 | /* |
||
116 | * mouse autocursor variables |
||
117 | */ |
||
118 | |||
119 | /* mask to extrac the status from autocursormode */ |
||
120 | #define STATUSMASK 0x0f |
||
121 | |||
122 | /* flags for autocursormode (there are some other flags into mouse.h) */ |
||
123 | #define GRXCURSOR 0x100 |
||
124 | #define TXTCURSOR 0x200 |
||
125 | |||
126 | /* cursor status and flags */ |
||
127 | extern int autocursormode; |
||
128 | |||
129 | /* this functions is used to enable/disable the cursor */ |
||
130 | /* (it is here to be used by the mcurgrx.c module) */ |
||
131 | int _mouse_cursor_init(int cmd, |
||
132 | void(*my_show_cursor)(int,int), |
||
133 | void(*my_restore_cursor)(int,int) |
||
134 | ); |
||
135 | |||
136 | /* this is used by mcurgrx.c to know the last mouse position */ |
||
137 | /* (to not declare saved_x & saved_y public) */ |
||
138 | void _mouse_getsavedposition(int *xptr, int *yptr); |
||
139 | |||
140 | __END_DECLS |
||
141 | #endif |
||
142 | |||
143 | |||
144 | |||
145 |