1 /* $Id: curses.tail,v 1.7 2002/10/12 15:46:02 tom Exp $ */
4 #define NCURSES_MOUSE_VERSION 1
7 #define BUTTON1_RELEASED 000000000001L
8 #define BUTTON1_PRESSED 000000000002L
9 #define BUTTON1_CLICKED 000000000004L
10 #define BUTTON1_DOUBLE_CLICKED 000000000010L
11 #define BUTTON1_TRIPLE_CLICKED 000000000020L
12 #define BUTTON1_RESERVED_EVENT 000000000040L
13 #define BUTTON2_RELEASED 000000000100L
14 #define BUTTON2_PRESSED 000000000200L
15 #define BUTTON2_CLICKED 000000000400L
16 #define BUTTON2_DOUBLE_CLICKED 000000001000L
17 #define BUTTON2_TRIPLE_CLICKED 000000002000L
18 #define BUTTON2_RESERVED_EVENT 000000004000L
19 #define BUTTON3_RELEASED 000000010000L
20 #define BUTTON3_PRESSED 000000020000L
21 #define BUTTON3_CLICKED 000000040000L
22 #define BUTTON3_DOUBLE_CLICKED 000000100000L
23 #define BUTTON3_TRIPLE_CLICKED 000000200000L
24 #define BUTTON3_RESERVED_EVENT 000000400000L
25 #define BUTTON4_RELEASED 000001000000L
26 #define BUTTON4_PRESSED 000002000000L
27 #define BUTTON4_CLICKED 000004000000L
28 #define BUTTON4_DOUBLE_CLICKED 000010000000L
29 #define BUTTON4_TRIPLE_CLICKED 000020000000L
30 #define BUTTON4_RESERVED_EVENT 000040000000L
31 #define BUTTON_CTRL 000100000000L
32 #define BUTTON_SHIFT 000200000000L
33 #define BUTTON_ALT 000400000000L
34 #define ALL_MOUSE_EVENTS 000777777777L
35 #define REPORT_MOUSE_POSITION 001000000000L
37 /* macros to extract single event-bits from masks */
38 #define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1))))
39 #define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1))))
40 #define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1))))
41 #define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1))))
42 #define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1))))
43 #define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1))))
45 typedef unsigned long mmask_t;
49 short id; /* ID to distinguish multiple devices */
50 int x, y, z; /* event coordinates (character-cell) */
51 mmask_t bstate; /* button state bits */
55 extern NCURSES_EXPORT(int) getmouse (MEVENT *);
56 extern NCURSES_EXPORT(int) ungetmouse (MEVENT *);
57 extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *);
58 extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int);
59 extern NCURSES_EXPORT(int) mouseinterval (int);
60 extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW* win,int* y, int* x, bool to_screen);
61 extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */
63 #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen)
65 /* other non-XSI functions */
67 extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */
68 extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */
70 /* Debugging : use with libncurses_g.a */
72 extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2);
73 extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *);
74 extern NCURSES_EXPORT(char *) _traceattr (attr_t);
75 extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype);
76 extern NCURSES_EXPORT(char *) _nc_tracebits (void);
77 extern NCURSES_EXPORT(char *) _tracechar (int);
78 extern NCURSES_EXPORT(char *) _tracechtype (chtype);
79 extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype);
80 #ifdef _XOPEN_SOURCE_EXTENDED
81 #define _tracech_t _tracecchar_t
82 extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *);
83 #define _tracech_t2 _tracecchar_t2
84 extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *);
86 #define _tracech_t _tracechtype
87 #define _tracech_t2 _tracechtype2
89 extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *);
90 extern NCURSES_EXPORT(void) trace (const unsigned int);
93 #define TRACE_DISABLE 0x0000 /* turn off tracing */
94 #define TRACE_TIMES 0x0001 /* trace user and system times of updates */
95 #define TRACE_TPUTS 0x0002 /* trace tputs calls */
96 #define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */
97 #define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */
98 #define TRACE_CHARPUT 0x0010 /* trace all character outputs */
99 #define TRACE_ORDINARY 0x001F /* trace all update actions */
100 #define TRACE_CALLS 0x0020 /* trace all curses calls */
101 #define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */
102 #define TRACE_IEVENT 0x0080 /* trace low-level input processing */
103 #define TRACE_BITS 0x0100 /* trace state of TTY control bits */
104 #define TRACE_ICALLS 0x0200 /* trace internal/nested calls */
105 #define TRACE_CCALLS 0x0400 /* trace per-character calls */
106 #define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */
107 #define TRACE_ATTRS 0x1000 /* trace attribute updates */
109 #define TRACE_SHIFT 13 /* number of bits in the trace masks */
110 #define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */
112 #if defined(TRACE) || defined(NCURSES_TEST)
113 extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */
114 #ifdef _XOPEN_SOURCE_EXTENDED
115 extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *);
117 extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *);
118 #define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */
119 #define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */
120 #define OPTIMIZE_SCROLL 0x04 /* scroll optimization */
121 #define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */
124 #ifndef NCURSES_WGETCH_EVENTS
130 /* these names conflict with STL */
140 #endif /* __NCURSES_H */