Fix umpnpmgr build
[reactos.git] / rosapps / mc / src / mouse.h
1 #ifndef MC_MOUSE_H
2 #define MC_MOUSE_H
3
4 #ifdef HAVE_LIBGPM
5
6 /* GPM mouse support include file */
7 #include <gpm.h>
8
9 #else
10
11 /* Equivalent definitions for non-GPM mouse support */
12 /* These lines are modified version from the lines appearing in the */
13 /* gpm.h include file of the Linux General Purpose Mouse server */
14
15 #define GPM_B_LEFT 4
16 #define GPM_B_MIDDLE 2
17 #define GPM_B_RIGHT 1
18
19 /* Xterm mouse support supports only GPM_DOWN and GPM_UP */
20 /* If you use others make sure your code also works without them */
21 enum Gpm_Etype {
22 GPM_MOVE=1,
23 GPM_DRAG=2, /* exactly one in four is active at a time */
24 GPM_DOWN=4,
25 GPM_UP= 8,
26
27 #define GPM_BARE_EVENTS(ev) ((ev)&0xF)
28
29 GPM_SINGLE=16, /* at most one in three is set */
30 GPM_DOUBLE=32,
31 GPM_TRIPLE=64,
32
33 GPM_MFLAG=128, /* motion during click? */
34 GPM_HARD=256 /* if set in the defaultMask, force an already
35 used event to pass over to another handler */
36 };
37
38 typedef struct Gpm_Event {
39 int buttons, x, y;
40 enum Gpm_Etype type;
41 } Gpm_Event;
42
43 extern int gpm_fd;
44
45 #endif
46
47 /* General mouse support definitions */
48
49 typedef int (*mouse_h)(Gpm_Event *, void *);
50
51 #define NO_MOUSE 0
52 #define GPM_MOUSE 1
53 #define XTERM_MOUSE 2
54
55 void init_mouse (void);
56 void shut_mouse (void);
57
58 /* Type of mouse: NO_MOUSE, GPM_MOUSE or XTERM_MOUSE */
59 extern int use_mouse_p;
60 /* If use_mouse_p is XTERM_MOUSE: is mouse currently active? */
61 extern int xmouse_flag;
62
63 int mouse_handler (Gpm_Event *gpm_event);
64 int redo_mouse (Gpm_Event *event);
65
66 /* Constants returned from mouse handlers */
67
68 #define MOU_NORMAL 0x00
69 #define MOU_REPEAT 0x01
70 #define MOU_ENDLOOP 0x02
71 #define MOU_LOCK 0x04
72
73 #ifdef DEBUGMOUSE
74 #define DEBUGM(data) fprintf data
75 #else
76 #define DEBUGM(data)
77 #endif
78
79 #ifdef HAVE_LIBGPM
80
81 /* GPM specific mouse support definitions */
82 void show_mouse_pointer (int x, int y);
83
84 #else
85
86 /* Mouse support definitions for non-GPM mouse */
87 #define show_mouse_pointer(a,b)
88
89 #endif
90
91 #endif /* MC_MOUSE_H */