/
manymouse.h
63 lines (50 loc) · 1.19 KB
1
/*
2
* ManyMouse main header. Include this from your app.
3
*
4
* Please see the file LICENSE.txt in the source's root directory.
5
6
7
*
* This file written by Ryan C. Gordon.
*/
8
9
10
#ifndef _INCLUDE_MANYMOUSE_H_
#define _INCLUDE_MANYMOUSE_H_
11
12
13
14
15
#ifdef __cplusplus
extern "C" {
#endif
16
#define MANYMOUSE_VERSION "0.0.3"
17
18
19
typedef enum
{
20
21
22
23
24
25
26
MANYMOUSE_EVENT_ABSMOTION = 0,
MANYMOUSE_EVENT_RELMOTION,
MANYMOUSE_EVENT_BUTTON,
MANYMOUSE_EVENT_SCROLL,
MANYMOUSE_EVENT_DISCONNECT,
MANYMOUSE_EVENT_MAX
} ManyMouseEventType;
27
28
typedef struct
29
{
30
ManyMouseEventType type;
31
32
33
34
35
unsigned int device;
unsigned int item;
int value;
int minval;
int maxval;
36
} ManyMouseEvent;
37
38
39
/* internal use only. */
40
41
typedef struct
{
42
const char *driver_name;
43
44
int (*init)(void);
void (*quit)(void);
45
const char *(*name)(unsigned int index);
46
47
int (*poll)(ManyMouseEvent *event);
} ManyMouseDriver;
48
49
50
int ManyMouse_Init(void);
51
const char *ManyMouse_DriverName(void);
52
53
54
void ManyMouse_Quit(void);
const char *ManyMouse_DeviceName(unsigned int index);
int ManyMouse_PollEvent(ManyMouseEvent *event);
55
56
57
58
59
#ifdef __cplusplus
}
#endif
60
#endif /* !defined _INCLUDE_MANYMOUSE_H_ */
61
62
/* end of manymouse.h ... */