1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
/*
* Linux mouse driver for Twin
*
* Copyright 2006 Benjamin Herrenschmidt <benh@kernel.crashing.org>
*
* This Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This Library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with the Twin Library; see the file COPYING. If not,
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef _TWIN_LINUX_MOUSE_H_
#define _TWIN_LINUX_MOUSE_H_
#include "twin.h"
typedef struct _twin_linux_mouse {
twin_screen_t *screen;
/* acceleration settings */
int acc_num;
int acc_den;
int acc_threshold;
/* internals */
int fd;
char residual[2];
int res_cnt;
int btns;
int x,y;
} twin_linux_mouse_t;
/**
* twin_linux_mouse_create - create the linux mouse driver
* @file: device file to open, pass NULL for default
*/
twin_linux_mouse_t *twin_linux_mouse_create(const char *file,
twin_screen_t *screen);
/**
* twin_linux_mouse_destroy - destroy the linux mouse driver
*/
void twin_linux_mouse_destroy(twin_linux_mouse_t *tm);
/**
* twin_linux_mouse_set_bounds - set mouse boundaries
*/
void twin_linux_mouse_screen_changed(twin_linux_mouse_t *tm);
/**
* twin_linux_mouse_set_accel - set mouse acceleration data
*/
void twin_linux_mouse_set_accel(twin_linux_mouse_t *tm,
int num, int den, int threshold);
#endif /* _TWIN_LINUX_MOUSE_H_ */
|