X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fcurses.priv.h;h=caf71161f2dc395d26e6bea145a97e3499077562;hp=007ed445006f25780238104a36645c22b6ca9b55;hb=8485ec820b6d0ad70950b63834f31b3ca235c84b;hpb=404cc3f5b0751dd219565139f825c5a4d445f651 diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 007ed445..caf71161 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -35,7 +35,7 @@ /* - * $Id: curses.priv.h,v 1.416 2009/05/10 01:01:51 tom Exp $ + * $Id: curses.priv.h,v 1.430 2009/07/04 20:40:42 tom Exp $ * * curses.priv.h * @@ -194,9 +194,14 @@ extern NCURSES_EXPORT(void *) _nc_memmove (void *, const void *, size_t); #endif /* - * Terminal drivers... + * Options for terminal drivers, etc... */ -#define USE_TERM_DRIVER 0 +#if 0 +#define USE_SP_RIPOFF 1 +#define USE_SP_TERMTYPE 1 +#define USE_SP_WINDOWLIST 1 +#define USE_TERM_DRIVER 1 +#endif /* * Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only @@ -335,6 +340,7 @@ color_t; #endif #else /* !(NCURSES_EXT_COLORS && USE_WIDEC_SUPPORT) */ + #define if_EXT_COLORS(stmt) /* nothing */ #define SetPair(value,p) RemAttr(value, A_COLOR), \ SetAttr(value, AttrOf(value) | (A_COLOR & COLOR_PAIR(p))) @@ -369,17 +375,34 @@ extern NCURSES_EXPORT(void) _nc_set_no_padding(SCREEN *); #define SET_SCREEN_PAIR(s,p) SetPair(SCREEN_ATTRS(s), p) #if USE_REENTRANT -NCURSES_EXPORT(int *) _nc_ptr_Lines (void); -NCURSES_EXPORT(int *) _nc_ptr_Cols (void); + +NCURSES_EXPORT(int *) _nc_ptr_Lines (SCREEN *); +NCURSES_EXPORT(int *) _nc_ptr_Cols (SCREEN *); +NCURSES_EXPORT(int *) _nc_ptr_Tabsize (SCREEN *); +NCURSES_EXPORT(int *) _nc_ptr_Escdelay (SCREEN *); + #define ptrLines(sp) (sp ? &(sp->_LINES) : &(_nc_prescreen._LINES)) #define ptrCols(sp) (sp ? &(sp->_COLS) : &(_nc_prescreen._COLS)) -#define SET_LINES(value) *_nc_ptr_Lines() = value -#define SET_COLS(value) *_nc_ptr_Cols() = value +#define ptrTabsize(sp) (sp ? &(sp->_TABSIZE) : &(_nc_prescreen._TABSIZE)) +#define ptrEscdelay(sp) (sp ? &(sp->_ESCDELAY) : &(_nc_prescreen._ESCDELAY)) + +#define SET_LINES(value) *_nc_ptr_Lines(SP_PARM) = value +#define SET_COLS(value) *_nc_ptr_Cols(SP_PARM) = value +#define SET_TABSIZE(value) *_nc_ptr_Tabsize(SP_PARM) = value +#define SET_ESCDELAY(value) *_nc_ptr_Escdelay(SP_PARM) = value + #else + #define ptrLines(sp) &LINES #define ptrCols(sp) &COLS +#define ptrTabsize(sp) &TABSIZE +#define ptrEscdelay(sp) &ESCDELAY + #define SET_LINES(value) LINES = value #define SET_COLS(value) COLS = value +#define SET_TABSIZE(value) TABSIZE = value +#define SET_ESCDELAY(value) ESCDELAY = value + #endif #define TR_MUTEX(data) _tracef("%s@%d: me:%08lX COUNT:%2u/%2d/%6d/%2d/%s%9u: " #data, \ @@ -678,8 +701,10 @@ typedef struct { int tgetent_index; long tgetent_sequence; +#ifndef USE_SP_WINDOWLIST WINDOWLIST *_nc_windowlist; #define WindowList(sp) _nc_globals._nc_windowlist +#endif #if USE_HOME_TERMINFO char *home_terminfo; @@ -740,8 +765,10 @@ typedef struct { bool use_env; bool filter_mode; attr_t previous_attr; +#ifndef USE_SP_RIPOFF ripoff_t rippedoff[N_RIPS]; ripoff_t *rsp; +#endif TPARM_STATE tparm_state; TTY *saved_tty; /* savetty/resetty information */ #if NCURSES_NO_PADDING @@ -751,6 +778,8 @@ typedef struct { chtype *real_acs_map; int _LINES; int _COLS; + int _TABSIZE; + int _ESCDELAY; TERMINAL *_cur_term; #ifdef TRACE long _outchars; @@ -907,8 +936,9 @@ struct screen { */ bool _nc_sp_idlok; bool _nc_sp_idcok; -#define _nc_idlok SP->_nc_sp_idlok -#define _nc_idcok SP->_nc_sp_idcok + +#define _nc_idlok SP_PARM->_nc_sp_idlok +#define _nc_idcok SP_PARM->_nc_sp_idcok /* * These are the data that support the mouse interface. @@ -962,7 +992,7 @@ struct screen { * This supports automatic resizing */ #if USE_SIZECHANGE - int (*_resize)(int,int); + int (*_resize)(NCURSES_SP_DCLx int y, int x); #endif /* @@ -1002,7 +1032,7 @@ struct screen { char tracechr_buf[40]; char tracemse_buf[TRACEMSE_MAX]; #endif -#if 0 +#ifdef USE_SP_WINDOWLIST WINDOWLIST* _windowlist; #define WindowList(sp) (sp)->_windowlist #endif @@ -1535,16 +1565,28 @@ extern NCURSES_EXPORT(void) _nc_toggle_attr_on (attr_t *, attr_t); extern NCURSES_EXPORT(void) _nc_toggle_attr_off (attr_t *, attr_t); #undef DelCharCost -#define DelCharCost(count) _nc_DelCharCost(count) -extern NCURSES_EXPORT(int) _nc_DelCharCost (int); +#define DelCharCost(sp, count) NCURSES_SP_NAME(_nc_DelCharCost)(NCURSES_SP_ARGx count) #undef InsCharCost -#define InsCharCost(count) _nc_InsCharCost(count) -extern NCURSES_EXPORT(int) _nc_InsCharCost (int); +#define InsCharCost(sp, count) NCURSES_SP_NAME(_nc_InsCharCost)(NCURSES_SP_ARGx count) + +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_DelCharCost) (NCURSES_SP_DCLx int _c); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_InsCharCost) (NCURSES_SP_DCLx int _c); #undef UpdateAttrs -#define UpdateAttrs(c) _nc_UpdateAttrs(c) -extern NCURSES_EXPORT(void) _nc_UpdateAttrs (NCURSES_CH_T); +#define UpdateAttrs(sp,c) NCURSES_SP_NAME(_nc_UpdateAttrs)(NCURSES_SP_ARGx CHREF(c)) + +#if defined(NEED_NCURSES_CH_T) +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx CARG_CH_T _c); +#else +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_UpdateAttrs) (NCURSES_SP_DCLx chtype c); +#endif + +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(int) _nc_DelCharCost (int); +extern NCURSES_EXPORT(int) _nc_InsCharCost (int); +extern NCURSES_EXPORT(void) _nc_UpdateAttrs (CARG_CH_T); +#endif /* NCURSES_SP_FUNCS */ #else @@ -1613,7 +1655,7 @@ extern NCURSES_EXPORT(bool) _nc_reset_colors(void); extern NCURSES_EXPORT(int) _nc_wgetch(WINDOW *, unsigned long *, int EVENTLIST_2nd(_nc_eventlist *)); /* lib_insch.c */ -extern NCURSES_EXPORT(int) _nc_insert_ch(WINDOW *, chtype); +extern NCURSES_EXPORT(int) _nc_insert_ch(SCREEN *, WINDOW *, chtype); /* lib_mvcur.c */ #define INFINITY 1000000 /* cost: too high to use */ @@ -1642,6 +1684,9 @@ extern NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL *); extern NCURSES_EXPORT(int) _nc_setupterm(NCURSES_CONST char *, int, int *, bool); extern NCURSES_EXPORT(void) _nc_get_screensize(SCREEN *, int *, int *); +/* lib_set_term.c */ +extern NCURSES_EXPORT(int) _nc_ripoffline(int, int(*)(WINDOW*, int)); + /* lib_tstp.c */ #if USE_SIGWINCH extern NCURSES_EXPORT(int) _nc_handle_sigwinch(SCREEN *); @@ -1776,8 +1821,9 @@ extern NCURSES_EXPORT_VAR(int *) _nc_oldnums; * On systems with a broken linker, define 'SP' as a function to force the * linker to pull in the data-only module with 'SP'. */ +#define _nc_alloc_screen_sp() typeCalloc(SCREEN, 1) + #if BROKEN_LINKER -#define SP _nc_screen() extern NCURSES_EXPORT(SCREEN *) _nc_screen (void); extern NCURSES_EXPORT(int) _nc_alloc_screen (void); extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *); @@ -1786,7 +1832,7 @@ extern NCURSES_EXPORT(void) _nc_set_screen (SCREEN *); /* current screen is private data; avoid possible linking conflicts too */ extern NCURSES_EXPORT_VAR(SCREEN *) SP; #define CURRENT_SCREEN SP -#define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0) +#define _nc_alloc_screen() ((SP = _nc_alloc_screen_sp()) != 0) #define _nc_set_screen(sp) SP = sp #endif @@ -1805,6 +1851,7 @@ extern NCURSES_EXPORT_VAR(SCREEN *) SP; #define screen_columns(sp) (sp)->_columns extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int); +extern NCURSES_EXPORT(int) _nc_format_slks (NCURSES_SP_DCLx int _c); /* * Some constants related to SLK's @@ -1822,14 +1869,15 @@ extern NCURSES_EXPORT(int) _nc_slk_initialize (WINDOW *, int); #define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC) #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC) -extern NCURSES_EXPORT(int) _nc_ripoffline (int line, int (*init)(WINDOW *,int)); - /* * Common error messages */ #define MSG_NO_MEMORY "Out of memory" #define MSG_NO_INPUTS "Premature EOF" +extern NCURSES_EXPORT(int) _nc_set_tty_mode(TTY *); +extern NCURSES_EXPORT(int) _nc_get_tty_mode(TTY *); + /* timed_wait flag definitions */ #define TW_NONE 0 #define TW_INPUT 1 @@ -1937,13 +1985,20 @@ typedef struct DriverTCB extern NCURSES_EXPORT_VAR(const color_t*) _nc_cga_palette; extern NCURSES_EXPORT_VAR(const color_t*) _nc_hls_palette; +#ifdef USE_TERM_DRIVER +extern NCURSES_EXPORT(int) _nc_tinfo_has_key(SCREEN*, int); +extern NCURSES_EXPORT(int) _nc_tinfo_doupdate(SCREEN *sp); +extern NCURSES_EXPORT(int) _nc_tinfo_mvcur(SCREEN*,int,int,int,int); +extern NCURSES_EXPORT(int) _nc_get_driver(TERMINAL_CONTROL_BLOCK*, const char*, int*); +#endif + #ifdef __MINGW32__ #include extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_WIN_DRIVER; #endif extern NCURSES_EXPORT_VAR(TERM_DRIVER) _nc_TINFO_DRIVER; -#if USE_TERM_DRIVER +#ifdef USE_TERM_DRIVER #define IsTermInfo(sp) (TCBOf(sp) && ((TCBOf(sp)->drv->isTerminfo))) #else #define IsTermInfo(sp) TRUE @@ -1975,9 +2030,6 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_set_tabsize)(SCREEN*, int); * We put the safe versions of various calls here as they are not published * part of the API up to now */ -extern NCURSES_EXPORT(SCREEN*) _nc_SP(void); - -extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(_nc_set_curterm)(SCREEN*,TERMINAL*); extern NCURSES_EXPORT(TERMINAL*) NCURSES_SP_NAME(cur_term)(SCREEN *sp); extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(_nc_makenew) (SCREEN*, int, int, int, int, int); extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(_nc_reset_colors)(SCREEN*); @@ -1988,7 +2040,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_get_tty_mode)(SCREEN*,TTY*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_mcprint)(SCREEN*,char*, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_msec_cost)(SCREEN*, const char *, int); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_outch)(SCREEN*, int); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp)(SCREEN*, const char *, const char *); +extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp)(SCREEN*, const char *, const char*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_putp_flush)(SCREEN*, const char *, const char *); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_resetty)(SCREEN*); extern NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_resize_term)(SCREEN*,int,int); @@ -2022,8 +2074,6 @@ extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_scroll_optimize)(SCREEN*); extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_set_buffer)(SCREEN*, FILE *, bool); extern NCURSES_EXPORT(void) _nc_cookie_init(SCREEN *sp); -extern NCURSES_EXPORT(int) _nc_tinfo_doupdate(SCREEN *sp); -extern NCURSES_EXPORT(int) _nc_tinfo_mcprint(SCREEN*,char*,int); #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_linedump)(SCREEN*);