Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 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.1.1 2002-03-29 14:12:49 pj Exp $
24
 
25
 File:        $File$
26
 Revision:    $Revision: 1.1.1.1 $
27
 Last update: $Date: 2002-03-29 14:12:49 $
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__
55
 
56
/* "virtual operations" on a mouse */
57
struct mouse_operations {
58
  char *name;             /* name! */
59
  char *desc;             /* a descriptive line */  
60
 
61
  BYTE proto[4];          
62
  int  packetlen;         /* lenght of a packet */
63
  int  howmany;           /* howmany bytes to read at a time (unused) */
64
  int  getextra;          /* there is a extra byte (unused) */
65
  int  absolute;          /* absolute pointing devide (unused) */
66
  int  dummy;             /* (unused) */
67
 
68
  int  (*open)(void*);    /* open comunication device */
69
  void (*close)(void);    /* close comunication device */
70
  void (*wait)(void);     /* wait to have a BYTE (blocking operation)*/
71
  int  (*get)(BYTE *ptr); /* get last BYTE */
72
  void (*enable)(void);   /* enable interface */
73
  void (*disable)(void);  /* disable interface */
74
 
75
  /* this function decode the mouse packet into a MOUSE_EVT structure */
76
  int  (*decode)(MOUSE_EVT *evt,unsigned char *data);
77
};
78
 
79
/* to virtualize interface beetwen a mouse device and a mouse protocol */
80
extern int    mousetype;
81
extern struct mouse_operations vmouse[];
82
 
83
/* functions and variables (to use virtual operation)*/
84
extern int  (*open_mouse)(void*);     /* open comunication device */
85
extern void (*close_mouse)(void);     /* close comunication device */
86
extern void (*wait_mouse)(void);      /* wait to have a BYTE (blocking operation)*/
87
extern int  (*get_mouse)(BYTE *data); /* get last BYTE */
88
extern void (*enable_mouse)(void);    /* enable interface */
89
extern void (*disable_mouse)(void);   /* disable interface */
90
 
91
extern char *name_mouse;
92
extern char *desc_mouse;
93
extern BYTE *proto_mouse;
94
extern int  packetlen_mouse;
95
 
96
/* used by mouse protocol task */
97
extern short int mouse_lim_x1;
98
extern short int mouse_lim_y1;
99
extern short int mouse_lim_x2;
100
extern short int mouse_lim_y2;
101
extern short int mouse_x;
102
extern short int mouse_x_mick;
103
extern short int mouse_y;
104
extern short int mouse_y_mick;
105
extern short int mouse_buttons;
106
extern short int mouse_thresholdlim;
107
extern MOUSE_HANDLER mouse_handler;
108
 
109
/* a generic mouse server */
110
extern TASK generalmouse_server(void);
111
 
112
/*
113
 * mouse autocursor variables
114
 */
115
 
116
/* mask to extrac the status from autocursormode */
117
#define STATUSMASK 0x0f
118
 
119
/* flags for autocursormode (there are some other flags into mouse.h) */
120
#define GRXCURSOR 0x100
121
#define TXTCURSOR 0x200
122
 
123
/* cursor status and flags */
124
extern int autocursormode;
125
 
126
/* this functions is used to enable/disable the cursor */
127
/* (it is here to be used by the mcurgrx.c  module) */
128
int _mouse_cursor_init(int cmd,
129
                       void(*my_show_cursor)(int,int),
130
                       void(*my_restore_cursor)(int,int)
131
                       );
132
 
133
/* this is used by mcurgrx.c to know the last mouse position */
134
/* (to not declare saved_x & saved_y public) */
135
void _mouse_getsavedposition(int *xptr, int *yptr);
136
 
137
#endif
138
 
139
 
140
 
141