X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2Fcurses.tail;h=11514498ddbc2a41afa6d3b5f1df1a4450981950;hp=66388e395dee51ad46c4001d919213fd800610ef;hb=3d46d7e9d3e210417f34acf3b469378558398d07;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/include/curses.tail b/include/curses.tail index 66388e39..11514498 100644 --- a/include/curses.tail +++ b/include/curses.tail @@ -1,4 +1,9 @@ -/* $Id: curses.tail,v 1.12 2005/03/27 00:09:51 tom Exp $ */ +/* $Id: curses.tail,v 1.26 2021/03/20 15:49:25 tom Exp $ */ +/* + * vile:cmode: + * This file is part of ncurses, designed to be appended after curses.h.in + * (see that file for the relevant copyright). + */ /* mouse interface */ @@ -74,12 +79,12 @@ #define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1) /* macros to extract single event-bits from masks */ -#define BUTTON_RELEASE(e, x) ((e) & (001 << (6 * ((x) - 1)))) -#define BUTTON_PRESS(e, x) ((e) & (002 << (6 * ((x) - 1)))) -#define BUTTON_CLICK(e, x) ((e) & (004 << (6 * ((x) - 1)))) -#define BUTTON_DOUBLE_CLICK(e, x) ((e) & (010 << (6 * ((x) - 1)))) -#define BUTTON_TRIPLE_CLICK(e, x) ((e) & (020 << (6 * ((x) - 1)))) -#define BUTTON_RESERVED_EVENT(e, x) ((e) & (040 << (6 * ((x) - 1)))) +#define BUTTON_RELEASE(e, x) ((e) & NCURSES_MOUSE_MASK(x, 001)) +#define BUTTON_PRESS(e, x) ((e) & NCURSES_MOUSE_MASK(x, 002)) +#define BUTTON_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 004)) +#define BUTTON_DOUBLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 010)) +#define BUTTON_TRIPLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 020)) +#define BUTTON_RESERVED_EVENT(e, x) ((e) & NCURSES_MOUSE_MASK(x, 040)) typedef struct { @@ -89,32 +94,46 @@ typedef struct } MEVENT; -extern NCURSES_EXPORT(int) getmouse (MEVENT *); -extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); +extern NCURSES_EXPORT(bool) has_mouse(void); +extern NCURSES_EXPORT(int) getmouse (MEVENT *); +extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); -extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); -extern NCURSES_EXPORT(int) mouseinterval (int); -extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); -extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ +extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); +extern NCURSES_EXPORT(int) mouseinterval (int); +extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); +extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ + +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_mouse) (SCREEN*); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetmouse) (SCREEN*,MEVENT *); +extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mouseinterval) (SCREEN*, int); +#endif +#ifndef NCURSES_NOMACROS #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) +#endif /* other non-XSI functions */ extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int); /* do we have given key? */ +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int); /* direct data to printer */ +#endif + /* Debugging : use with libncurses_g.a */ extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); extern NCURSES_EXPORT(char *) _traceattr (attr_t); extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); -extern NCURSES_EXPORT(char *) _nc_tracebits (void); extern NCURSES_EXPORT(char *) _tracechar (int); extern NCURSES_EXPORT(char *) _tracechtype (chtype); extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); -#ifdef _XOPEN_SOURCE_EXTENDED +#if NCURSES_WIDECHAR #define _tracech_t _tracecchar_t extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); #define _tracech_t2 _tracecchar_t2 @@ -123,8 +142,8 @@ extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *); #define _tracech_t _tracechtype #define _tracech_t2 _tracechtype2 #endif -extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); -extern NCURSES_EXPORT(void) trace (const unsigned int); +extern NCURSES_EXPORT(void) trace (const unsigned) GCC_DEPRECATED("use curses_trace"); +extern NCURSES_EXPORT(unsigned) curses_trace (const unsigned); /* trace masks */ #define TRACE_DISABLE 0x0000 /* turn off tracing */ @@ -148,10 +167,6 @@ extern NCURSES_EXPORT(void) trace (const unsigned int); #if defined(TRACE) || defined(NCURSES_TEST) extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ -#ifdef _XOPEN_SOURCE_EXTENDED -extern NCURSES_EXPORT(const char *) _nc_viswbuf(const wchar_t *); -extern NCURSES_EXPORT(const char *) _nc_viswibuf(const wint_t *); -#endif extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); #define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ #define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ @@ -159,8 +174,14 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); #define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ #endif +extern GCC_NORETURN NCURSES_EXPORT(void) exit_curses (int); + +#include + #ifdef __cplusplus +#ifndef NCURSES_NOMACROS + /* these names conflict with STL */ #undef box #undef clear @@ -168,6 +189,8 @@ extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); #undef move #undef refresh +#endif /* NCURSES_NOMACROS */ + } #endif