1 /****************************************************************************
2 * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
4 * Permission is hereby granted, free of charge, to any person obtaining a *
5 * copy of this software and associated documentation files (the *
6 * "Software"), to deal in the Software without restriction, including *
7 * without limitation the rights to use, copy, modify, merge, publish, *
8 * distribute, distribute with modifications, sublicense, and/or sell *
9 * copies of the Software, and to permit persons to whom the Software is *
10 * furnished to do so, subject to the following conditions: *
12 * The above copyright notice and this permission notice shall be included *
13 * in all copies or substantial portions of the Software. *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
23 * Except as contained in this notice, the name(s) of the above copyright *
24 * holders shall not be used in advertising or otherwise to promote the *
25 * sale, use or other dealings in this Software without prior written *
27 ****************************************************************************/
29 /****************************************************************************
30 * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
31 * and: Eric S. Raymond <esr@snark.thyrsus.com> *
32 ****************************************************************************/
36 * $Id: curses.priv.h,v 1.168 2000/10/08 01:24:59 tom Exp $
40 * Header file for curses library objects which are private to
46 #define CURSES_PRIV_H 1
52 #include <ncurses_cfg.h>
55 #define MODULE_ID(id) static const char Ident[] = id;
57 #define MODULE_ID(id) /*nothing*/
62 #include <sys/types.h>
68 #if HAVE_SYS_BSDTYPES_H
69 #include <sys/bsdtypes.h> /* needed for ISC */
74 #elif HAVE_SYS_PARAM_H
75 # include <sys/param.h>
79 # if defined(_POSIX_PATH_MAX)
80 # define PATH_MAX _POSIX_PATH_MAX
81 # elif defined(MAXPATHLEN)
82 # define PATH_MAX MAXPATHLEN
84 # define PATH_MAX 255 /* the Posix minimum path-size */
99 /* Some systems have a broken 'select()', but workable 'poll()'. Use that */
100 #if HAVE_WORKING_POLL
101 #define USE_FUNC_POLL 1
105 #include <sys/poll.h>
108 #define USE_FUNC_POLL 0
111 /* Alessandro Rubini's GPM (general-purpose mouse) */
112 #if HAVE_LIBGPM && HAVE_GPM_H
113 #define USE_GPM_SUPPORT 1
115 #define USE_GPM_SUPPORT 0
118 /* QNX mouse support */
119 #if defined(__QNX__) && !defined(__QNXNTO__)
120 #define USE_QNX_MOUSE 1
122 #define USE_QNX_MOUSE 0
125 /* EMX mouse support */
127 #define USE_EMX_MOUSE
130 #define DEFAULT_MAXCLICK 166
131 #define EV_MAX 8 /* size of mouse circular event queue */
134 * If we don't have signals to support it, don't add a sigwinch handler.
135 * In any case, resizing is an extended feature. Use it if we've got it.
137 #if !NCURSES_EXT_FUNCS
138 #undef HAVE_SIZECHANGE
142 #define USE_SIZECHANGE 1
148 * If desired, one can configure this, disabling environment variables that
149 * point to custom terminfo/termcap locations.
151 #ifdef USE_ROOT_ENVIRON
152 #define use_terminfo_vars() 1
154 #define use_terminfo_vars() _nc_env_access()
155 extern int _nc_env_access(void);
159 * Not all platforms have memmove; some have an equivalent bcopy. (Some may
163 #define memmove(d,s,n) bcopy(s,d,n)
165 #define memmove(d,s,n) _nc_memmove(d,s,n)
166 extern void * _nc_memmove(void *, const void *, size_t);
170 * Scroll hints are useless when hashmap is used
172 #if !USE_SCROLL_HINTS
174 #define USE_SCROLL_HINTS 1
176 #define USE_SCROLL_HINTS 0
181 #define if_USE_SCROLL_HINTS(stmt) stmt
183 #define if_USE_SCROLL_HINTS(stmt) /*nothing*/
187 * Note: ht/cbt expansion flakes out randomly under Linux 1.1.47, but only
188 * when we're throwing control codes at the screen at high volume. To see
189 * this, re-enable USE_HARD_TABS and run worm for a while. Other systems
190 * probably don't want to define this either due to uncertainties about tab
191 * delays and expansion in raw mode.
195 struct tries *child; /* ptr to child. NULL if none */
196 struct tries *sibling; /* ptr to sibling. NULL if none */
197 unsigned char ch; /* character at this node */
198 unsigned short value; /* code of string so far. 0 if none. */
202 * Definitions for color pairs
204 #define C_SHIFT 8 /* we need more bits than there are colors */
205 #define C_MASK ((1 << C_SHIFT) - 1)
207 #define PAIR_OF(fg, bg) ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
210 * Common/troublesome character definitions
217 * Structure for palette tables
222 short red, green, blue;
226 #define MAXCOLUMNS 135
228 #define FIFO_SIZE MAXCOLUMNS+2 /* for nocbreak mode input */
232 #define WINDOWLIST struct _win_list
234 #include <curses.h> /* we'll use -Ipath directive to get the right one! */
237 * Structure for soft labels.
242 char *text; /* text for the label */
243 char *form_text; /* formatted text (left/center/...) */
244 int x; /* x coordinate of this field */
245 char dirty; /* this label has changed */
246 char visible; /* field is visible */
250 char dirty; /* all labels have changed */
251 char hidden; /* soft labels are hidden */
254 char* buffer; /* buffer for labels */
255 short maxlab; /* number of available labels */
256 short labcnt; /* number of allocated labels */
257 short maxlen; /* length of labels */
258 chtype attr; /* soft label attribute */
262 int _ifd; /* input file ptr for screen */
263 FILE *_ofp; /* output file ptr for screen */
264 char *_setbuf; /* buffered I/O for output */
265 int _buffered; /* setvbuf uses _setbuf data */
266 int _checkfd; /* filedesc for typeahead check */
267 struct term *_term; /* terminal type information */
268 short _lines; /* screen lines */
269 short _columns; /* screen columns */
270 short _lines_avail; /* lines available for stdscr */
271 short _topstolen; /* lines stolen from top */
273 WINDOW *_curscr; /* current screen */
274 WINDOW *_newscr; /* virtual screen to be updated to */
275 WINDOW *_stdscr; /* screen's full-window context */
277 struct tries *_keytry; /* "Try" for use with keypad mode */
278 struct tries *_key_ok; /* Disabled keys via keyok(,FALSE) */
279 int _tried; /* keypad mode was initialized */
281 unsigned int _fifo[FIFO_SIZE]; /* input push-back buffer */
282 short _fifohead, /* head of fifo queue */
283 _fifotail, /* tail of fifo queue */
284 _fifopeek, /* where to peek for next char */
285 _fifohold; /* set if breakout marked */
287 int _endwin; /* are we out of window mode? */
288 unsigned long _current_attr; /* terminal attribute current set */
289 int _coloron; /* is color enabled? */
290 int _cursor; /* visibility of the cursor */
291 int _cursrow; /* physical cursor row */
292 int _curscol; /* physical cursor column */
293 int _nl; /* True if NL -> CR/NL is on */
294 int _raw; /* True if in raw mode */
295 int _cbreak; /* 1 if in cbreak mode */
296 /* > 1 if in halfdelay mode */
297 int _echo; /* True if echo on */
298 int _use_meta; /* use the meta key? */
299 SLK *_slk; /* ptr to soft key struct / NULL */
300 int slk_format; /* selected format for this screen */
301 /* cursor movement costs; units are 10ths of milliseconds */
302 #if NCURSES_NO_PADDING
303 int _no_padding; /* flag to set if padding disabled */
305 int _char_padding; /* cost of character put */
306 int _cr_cost; /* cost of (carriage_return) */
307 int _cup_cost; /* cost of (cursor_address) */
308 int _home_cost; /* cost of (cursor_home) */
309 int _ll_cost; /* cost of (cursor_to_ll) */
311 int _ht_cost; /* cost of (tab) */
312 int _cbt_cost; /* cost of (backtab) */
313 #endif /* USE_HARD_TABS */
314 int _cub1_cost; /* cost of (cursor_left) */
315 int _cuf1_cost; /* cost of (cursor_right) */
316 int _cud1_cost; /* cost of (cursor_down) */
317 int _cuu1_cost; /* cost of (cursor_up) */
318 int _cub_cost; /* cost of (parm_cursor_left) */
319 int _cuf_cost; /* cost of (parm_cursor_right) */
320 int _cud_cost; /* cost of (parm_cursor_down) */
321 int _cuu_cost; /* cost of (parm_cursor_up) */
322 int _hpa_cost; /* cost of (column_address) */
323 int _vpa_cost; /* cost of (row_address) */
324 /* used in tty_update.c, must be chars */
325 int _ed_cost; /* cost of (clr_eos) */
326 int _el_cost; /* cost of (clr_eol) */
327 int _el1_cost; /* cost of (clr_bol) */
328 int _dch1_cost; /* cost of (delete_character) */
329 int _ich1_cost; /* cost of (insert_character) */
330 int _dch_cost; /* cost of (parm_dch) */
331 int _ich_cost; /* cost of (parm_ich) */
332 int _ech_cost; /* cost of (erase_chars) */
333 int _rep_cost; /* cost of (repeat_char) */
334 int _hpa_ch_cost; /* cost of (column_address) */
335 int _cup_ch_cost; /* cost of (cursor_address) */
336 int _cuf_ch_cost; /* cost of (parm_cursor_right) */
337 int _inline_cost; /* cost of inline-move */
338 int _smir_cost; /* cost of (enter_insert_mode) */
339 int _rmir_cost; /* cost of (exit_insert_mode) */
340 int _ip_cost; /* cost of (insert_padding) */
341 /* used in lib_mvcur.c */
342 char * _address_cursor;
343 /* used in tty_update.c */
344 int _scrolling; /* 1 if terminal's smart enough to */
346 /* used in lib_color.c */
347 color_t *_color_table; /* screen's color palette */
348 int _color_count; /* count of colors in palette */
349 unsigned short *_color_pairs; /* screen's color pair list */
350 int _pair_count; /* count of color pairs */
351 #if NCURSES_EXT_FUNCS
352 bool _default_color; /* use default colors */
353 bool _has_sgr_39_49; /* has ECMA default color support */
354 int _default_fg; /* assumed default foreground */
355 int _default_bg; /* assumed default background */
357 chtype _xmc_suppress; /* attributes to suppress if xmc */
358 chtype _xmc_triggers; /* attributes to process if xmc */
359 chtype _acs_map[ACS_LEN];
361 /* used in lib_vidattr.c */
362 bool _use_rmso; /* true if we may use 'rmso' */
363 bool _use_rmul; /* true if we may use 'rmul' */
366 * These data correspond to the state of the idcok() and idlok()
367 * functions. A caveat is in order here: the XSI and SVr4
368 * documentation specify that these functions apply to the window which
369 * is given as an argument. However, ncurses implements this logic
370 * only for the newscr/curscr update process, _not_ per-window.
374 #define _nc_idlok SP->_nc_sp_idlok
375 #define _nc_idcok SP->_nc_sp_idcok
378 * These are the data that support the mouse interface.
381 bool (*_mouse_event) (SCREEN *);
382 bool (*_mouse_inline)(SCREEN *);
383 bool (*_mouse_parse) (int);
384 void (*_mouse_resume)(SCREEN *);
385 void (*_mouse_wrap) (SCREEN *);
386 int _mouse_fd; /* file-descriptor, if any */
389 * This supports automatic resizing
392 int (*_resize)(int,int);
396 * These are data that support the proper handling of the panel stack on an
399 struct panelhook _panelHook;
401 * Linked-list of all windows, to support '_nc_resizeall()' and
404 WINDOWLIST *_nc_sp_windows;
405 #define _nc_windows SP->_nc_sp_windows
408 SCREEN *_next_screen;
410 /* hashes for old and new lines */
411 unsigned long *oldhash, *newhash;
413 bool _cleanup; /* cleanup after int/quit signal */
414 int (*_outch)(int); /* output handler if not putc */
417 extern SCREEN *_nc_screen_chain;
420 #include <nomacros.h>
429 int line; /* lines to take, < 0 => from bottom*/
430 int (*hook)(struct _win_st *, int); /* callback for user */
431 struct _win_st *w; /* maybe we need this for cleanup */
434 /* The terminfo source is assumed to be 7-bit ASCII */
435 #define is7bits(c) ((unsigned)(c) < 128)
438 #define min(a,b) ((a) > (b) ? (b) : (a))
442 #define max(a,b) ((a) < (b) ? (b) : (a))
445 /* usually in <unistd.h> */
447 #define STDIN_FILENO 0
450 #ifndef STDOUT_FILENO
451 #define STDOUT_FILENO 1
454 #ifndef STDERR_FILENO
455 #define STDERR_FILENO 2
459 #define EXIT_SUCCESS 0
463 #define EXIT_FAILURE 1
467 #define R_OK 4 /* Test for read permission. */
470 #define W_OK 2 /* Test for write permission. */
473 #define X_OK 1 /* Test for execute permission. */
476 #define F_OK 0 /* Test for existence. */
480 #include <fcntl.h> /* may define O_BINARY */
487 #define TextOf(c) ((c) & (chtype)A_CHARTEXT)
488 #define AttrOf(c) ((c) & (chtype)A_ATTRIBUTES)
490 #define BLANK (' '|A_NORMAL)
494 #define CHANGED_CELL(line,col) \
495 if (line->firstchar == _NOCHANGE) \
496 line->firstchar = line->lastchar = col; \
497 else if ((col) < line->firstchar) \
498 line->firstchar = col; \
499 else if ((col) > line->lastchar) \
502 #define CHANGED_RANGE(line,start,end) \
503 if (line->firstchar == _NOCHANGE \
504 || line->firstchar > (start)) \
505 line->firstchar = start; \
506 if (line->lastchar == _NOCHANGE \
507 || line->lastchar < (end)) \
510 #define CHANGED_TO_EOL(line,start,end) \
511 if (line->firstchar == _NOCHANGE \
512 || line->firstchar > (start)) \
513 line->firstchar = start; \
516 #define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
518 #define FreeIfNeeded(p) if ((p) != 0) free(p)
520 /* FreeAndNull() is not a comma-separated expression because some compilers
521 * do not accept a mixture of void with values.
523 #define FreeAndNull(p) free(p); p = 0
525 #include <nc_alloc.h>
528 * Prefixes for call/return points of library function traces. We use these to
529 * instrument the public functions so that the traces can be easily transformed
530 * into regression scripts.
532 #define T_CALLED(fmt) "called " fmt
533 #define T_CREATE(fmt) "create " fmt
534 #define T_RETURN(fmt) "return " fmt
537 #define TR(n, a) if (_nc_tracing & (n)) _tracef a
538 #define T(a) TR(TRACE_CALLS, a)
539 #define TPUTS_TRACE(s) _nc_tputs_trace = s;
540 #define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
541 #define returnAttr(code) TRACE_RETURN(code,attr_t)
542 #define returnChar(code) TRACE_RETURN(code,chtype)
543 #define returnCode(code) TRACE_RETURN(code,int)
544 #define returnPtr(code) TRACE_RETURN(code,ptr)
545 #define returnVoid T((T_RETURN(""))); return
546 #define returnWin(code) TRACE_RETURN(code,win)
547 extern WINDOW * _nc_retrace_win(WINDOW *);
548 extern attr_t _nc_retrace_attr_t(attr_t);
549 extern attr_t _nc_retrace_chtype(chtype);
550 extern char *_nc_retrace_ptr(char *);
551 extern const char *_nc_tputs_trace;
552 extern int _nc_retrace_int(int);
553 extern long _nc_outchars;
554 extern void _nc_fifo_dump(void);
558 #define TPUTS_TRACE(s)
559 #define returnAttr(code) return code
560 #define returnChar(code) return code
561 #define returnCode(code) return code
562 #define returnPtr(code) return code
563 #define returnVoid return
564 #define returnWin(code) return code
567 extern unsigned _nc_tracing;
568 extern const char *_nc_visbuf2(int, const char *);
570 #define _trace_key(ch) ((ch > KEY_MIN) ? keyname(ch) : _tracechar((unsigned char)ch))
572 #define ALL_BUT_COLOR ((chtype)~(A_COLOR))
573 #define IGNORE_COLOR_OFF FALSE
574 #define NONBLANK_ATTR (A_BOLD|A_DIM|A_BLINK)
575 #define XMC_CHANGES(c) ((c) & SP->_xmc_suppress)
578 #define toggle_attr_on(S,at) {\
579 if (PAIR_NUMBER(at) > 0)\
580 (S) = ((S) & ALL_BUT_COLOR) | (at);\
583 TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
586 #define toggle_attr_off(S,at) {\
587 if (IGNORE_COLOR_OFF == TRUE) {\
588 if (PAIR_NUMBER(at) == 0xff) /* turn off color */\
590 else /* leave color alone */\
591 (S) &= ~((at)&ALL_BUT_COLOR);\
593 if (PAIR_NUMBER(at) > 0x00) /* turn off color */\
594 (S) &= ~(at|A_COLOR);\
595 else /* leave color alone */\
598 TR(TRACE_ATTRS, ("new attribute is %s", _traceattr((S))));}
600 #define DelCharCost(count) \
603 : ((delete_character != 0) \
604 ? (SP->_dch1_cost * count) \
607 #define InsCharCost(count) \
610 : ((enter_insert_mode && exit_insert_mode) \
611 ? SP->_smir_cost + SP->_rmir_cost + (SP->_ip_cost * count) \
612 : ((insert_character != 0) \
613 ? (SP->_ich1_cost * count) \
617 #define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) { \
618 attr_t chg = SP->_current_attr; \
619 vidattr(AttrOf(c)); \
620 if (magic_cookie_glitch > 0 \
621 && XMC_CHANGES((chg ^ SP->_current_attr))) { \
623 ("%s @%d before glitch %d,%d", \
624 __FILE__, __LINE__, \
627 _nc_do_xmc_glitch(chg); \
631 #define UpdateAttrs(c) if (SP->_current_attr != AttrOf(c)) \
635 #if NCURSES_EXPANDED && NCURSES_EXT_FUNCS
637 #undef toggle_attr_on
638 #define toggle_attr_on(S,at) _nc_toggle_attr_on(&(S), at)
639 extern void _nc_toggle_attr_on(attr_t *, attr_t);
641 #undef toggle_attr_off
642 #define toggle_attr_off(S,at) _nc_toggle_attr_off(&(S), at)
643 extern void _nc_toggle_attr_off(attr_t *, attr_t);
646 #define DelCharCost(count) _nc_DelCharCost(count)
647 extern int _nc_DelCharCost(int);
650 #define InsCharCost(count) _nc_InsCharCost(count)
651 extern int _nc_InsCharCost(int);
654 #define UpdateAttrs(c) _nc_UpdateAttrs(c)
655 extern void _nc_UpdateAttrs(chtype);
659 extern void _nc_expanded(void);
664 #define getcwd(buf,len) getwd(buf)
669 extern void _nc_do_xmc_glitch(attr_t);
673 #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
674 extern void _nc_linedump(void);
678 extern void _nc_init_acs(void); /* corresponds to traditional 'init_acs()' */
679 extern int _nc_msec_cost(const char *const, int); /* used by 'tack' program */
682 #define INFINITY 1000000 /* cost: too high to use */
684 extern void _nc_mvcur_init(void);
685 extern void _nc_mvcur_resume(void);
686 extern void _nc_mvcur_wrap(void);
688 extern int _nc_scrolln(int, int, int, int);
690 extern void _nc_screen_init(void);
691 extern void _nc_screen_resume(void);
692 extern void _nc_screen_wrap(void);
695 extern int _nc_has_mouse(void);
698 #define INFINITY 1000000 /* cost: too high to use */
707 extern string_desc *_nc_str_init(string_desc * dst, char *src, size_t len);
708 extern string_desc *_nc_str_null(string_desc * dst, size_t len);
709 extern string_desc *_nc_str_copy(string_desc * dst, string_desc * src);
710 extern bool _nc_safe_strcat(string_desc * dst, const char *src);
711 extern bool _nc_safe_strcpy(string_desc * dst, const char *src);
713 extern void _nc_mvcur_init(void);
714 extern void _nc_mvcur_resume(void);
715 extern void _nc_mvcur_wrap(void);
717 extern int _nc_scrolln(int, int, int, int);
719 extern void _nc_screen_init(void);
720 extern void _nc_screen_resume(void);
721 extern void _nc_screen_wrap(void);
724 #define strstr _nc_strstr
725 extern char *_nc_strstr(const char *, const char *);
729 extern char * _nc_printf_string(const char *fmt, va_list ap);
732 extern void _nc_add_to_try(struct tries **tree, const char *str, unsigned short code);
733 extern char *_nc_expand_try(struct tries *tree, unsigned short code, int *count, size_t len);
734 extern int _nc_remove_key(struct tries **tree, unsigned short code);
735 extern int _nc_remove_string(struct tries **tree, char *string);
738 extern WINDOW *_nc_makenew(int, int, int, int, int);
739 extern char *_nc_home_terminfo(void);
740 extern char *_nc_trace_buf(int, size_t);
741 extern chtype _nc_background(WINDOW *);
742 extern chtype _nc_render(WINDOW *, chtype);
743 extern int _nc_access(const char *, int);
744 extern int _nc_baudrate(int);
745 extern int _nc_getenv_num(const char *);
746 extern int _nc_keypad(bool);
747 extern int _nc_ospeed(int);
748 extern int _nc_outch(int);
749 extern int _nc_setupscreen(short, short const, FILE *);
750 extern int _nc_timed_wait(int, int, int *);
751 extern int _nc_waddch_nosync(WINDOW *, const chtype);
752 extern void _nc_do_color(int, int, bool, int (*)(int));
753 extern void _nc_freeall(void);
754 extern void _nc_freewin(WINDOW *win);
755 extern void _nc_hash_map(void);
756 extern void _nc_init_keytry(void);
757 extern void _nc_keep_tic_dir(const char *);
758 extern void _nc_make_oldhash(int i);
759 extern void _nc_flush(void);
760 extern void _nc_outstr(const char *str);
761 extern void _nc_scroll_oldhash(int n, int top, int bot);
762 extern void _nc_scroll_optimize(void);
763 extern void _nc_scroll_window(WINDOW *, int const, short const, short const, chtype);
764 extern void _nc_set_buffer(FILE *, bool);
765 extern void _nc_signal_handler(bool);
766 extern void _nc_synchook(WINDOW *win);
767 extern void _nc_trace_tries(struct tries *tree);
770 extern void _nc_update_screensize(void);
773 #if USE_WIDEC_SUPPORT
774 extern int _nc_utf8_outch(int);
778 extern int *_nc_oldnums;
780 #define USE_SETBUF_0 0
782 #define NC_BUFFERED(flag) \
783 if ((SP->_buffered != 0) != flag) \
784 _nc_set_buffer(SP->_ofp, flag)
786 #define NC_OUTPUT ((SP != 0) ? SP->_ofp : stdout)
789 * On systems with a broken linker, define 'SP' as a function to force the
790 * linker to pull in the data-only module with 'SP'.
793 #define SP _nc_screen()
794 extern SCREEN *_nc_screen(void);
795 extern int _nc_alloc_screen(void);
796 extern void _nc_set_screen(SCREEN *);
798 /* current screen is private data; avoid possible linking conflicts too */
800 #define _nc_alloc_screen() ((SP = typeCalloc(SCREEN, 1)) != 0)
801 #define _nc_set_screen(sp) SP = sp
805 * We don't want to use the lines or columns capabilities internally,
806 * because if the application is running multiple screens under
807 * X windows, it's quite possible they could all have type xterm
808 * but have different sizes! So...
810 #define screen_lines SP->_lines
811 #define screen_columns SP->_columns
813 extern int _nc_slk_format; /* != 0 if slk_init() called */
814 extern int _nc_slk_initialize(WINDOW *, int);
817 * Some constants related to SLK's
819 #define MAX_SKEY_OLD 8 /* count of soft keys */
820 #define MAX_SKEY_LEN_OLD 8 /* max length of soft key text */
821 #define MAX_SKEY_PC 12 /* This is what most PC's have */
822 #define MAX_SKEY_LEN_PC 5
824 /* Macro to check whether or not we use a standard format */
825 #define SLK_STDFMT(fmt) (fmt < 3)
826 /* Macro to determine height of label window */
827 #define SLK_LINES(fmt) (SLK_STDFMT(fmt) ? 1 : ((fmt) - 2))
829 #define MAX_SKEY(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_OLD : MAX_SKEY_PC)
830 #define MAX_SKEY_LEN(fmt) (SLK_STDFMT(fmt)? MAX_SKEY_LEN_OLD : MAX_SKEY_LEN_PC)
832 extern int _nc_ripoffline(int line, int (*init)(WINDOW *,int));
838 #endif /* CURSES_PRIV_H */