ooops reverting mischanged option menu order...
[midnight-commander.git] / src / mouse.h
blobd2f9384ac2b1d1b95a9a7c2ebb312e99ea187549
1 #ifndef MC_MOUSE_H
2 #define MC_MOUSE_H
4 #ifdef HAVE_LIBGPM
6 /* GPM mouse support include file */
7 #include <gpm.h>
9 #else
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 */
15 #define GPM_B_LEFT 4
16 #define GPM_B_MIDDLE 2
17 #define GPM_B_RIGHT 1
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,
27 #define GPM_BARE_EVENTS(ev) ((ev)&0xF)
29 GPM_SINGLE=16, /* at most one in three is set */
30 GPM_DOUBLE=32,
31 GPM_TRIPLE=64,
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 */
38 typedef struct Gpm_Event {
39 int buttons, x, y;
40 enum Gpm_Etype type;
41 } Gpm_Event;
43 #endif /* !HAVE_LIBGPM */
45 /* General mouse support definitions */
47 typedef int (*mouse_h)(Gpm_Event *, void *);
49 typedef enum {
50 MOUSE_NONE, /* Not detected yet */
51 MOUSE_DISABLED, /* Explicitly disabled by -d */
52 MOUSE_GPM, /* Support using GPM on Linux */
53 MOUSE_XTERM /* Support using xterm-style mouse reporting */
54 } Mouse_Type;
56 /* Type of the currently used mouse */
57 extern Mouse_Type use_mouse_p;
59 /* The mouse is currently: 1 - enabled, 0 - disabled */
60 extern int mouse_enabled;
62 /* String indicating that a mouse event has occured, usually "\E[M" */
63 extern char *xmouse_seq;
65 void init_mouse (void);
66 void enable_mouse (void);
67 void disable_mouse (void);
69 /* Constants returned from mouse handlers */
71 #define MOU_NORMAL 0x00
72 #define MOU_REPEAT 0x01
73 #define MOU_ENDLOOP 0x02
74 #define MOU_LOCK 0x04
76 #ifdef HAVE_LIBGPM
78 /* GPM specific mouse support definitions */
79 void show_mouse_pointer (int x, int y);
81 #else
83 /* Mouse support definitions for non-GPM mouse */
84 #define show_mouse_pointer(a,b)
86 #endif
88 #endif /* MC_MOUSE_H */