2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 1996-1999 by Sun Microsystems, Inc.
2N/A * All rights reserved.
2N/A */
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A/*
2N/A * private.h
2N/A *
2N/A * XCurses Library
2N/A *
2N/A * Copyright 1990, 1995 by Mortice Kern Systems Inc. All rights reserved.
2N/A *
2N/A */
2N/A
2N/A#include <sys/isa_defs.h>
2N/A#include <mks.h>
2N/A#include <curses.h>
2N/A#include <termios.h>
2N/A#include <unctrl.h>
2N/A
2N/A#define M_TERM_NAME "unknown"
2N/A
2N/A/*
2N/A * Interbyte timer value used for processing multibyte function keys.
2N/A */
2N/A#ifndef M_CURSES_INTERBYTE_TIME
2N/A#define M_CURSES_INTERBYTE_TIME 10
2N/A#endif
2N/A
2N/A/*
2N/A * Maximum number of lines that can be ripped off.
2N/A */
2N/A#ifndef M_CURSES_MAX_RIPOFFLINE
2N/A#define M_CURSES_MAX_RIPOFFLINE 5
2N/A#endif
2N/A
2N/A/*
2N/A * See copywin() and wrefresh() case 4. It is unclear whether XPG4 V2
2N/A * disallows supporting case 4 (expanding characters straddling a window
2N/A * boundary).
2N/A */
2N/A#define M_CURSES_SENSIBLE_WINDOWS
2N/A
2N/A/*
2N/A * Enable typeahead() support.
2N/A */
2N/A/* using unget buffer as typeahead buffer too */
2N/A#define M_TYPEAHEAD_SIZE 200
2N/A
2N/A/*
2N/A * END OF CONFIGURABLE SECTION
2N/A */
2N/A
2N/A/*
2N/A * Constant WINDOW definition attributes.
2N/A */
2N/A#define W_IS_PAD 0x0001 /* Window is a pad. */
2N/A#define W_END_LINE 0x0002 /* End of line is the margin. */
2N/A#define W_FULL_LINE 0x0004 /* Line spans screen width. */
2N/A#define W_FULL_WINDOW 0x0008 /* Window is full screen. */
2N/A#define W_SCROLL_WINDOW 0x0010 /* Touches bottom-right corner */
2N/A
2N/A/*
2N/A * WINDOW state.
2N/A */
2N/A#define W_CLEAR_WINDOW 0x0020 /* clearok() clear screen next update. */
2N/A#define W_REDRAW_WINDOW 0x0040 /* wredrawln() use simple() next update. */
2N/A
2N/A/*
2N/A * Configurable WINDOW options.
2N/A */
2N/A#define W_FLUSH 0x0080 /* immedok() update when window changes. */
2N/A#define W_CAN_SCROLL 0x0100 /* scrollok() window can software scroll. */
2N/A#define W_LEAVE_CURSOR 0x0200 /* leaveok() don't fuss with the cursor. */
2N/A#define W_SYNC_UP 0x0400 /* syncok() update ancestors when changed. */
2N/A#define W_USE_KEYPAD 0x0800 /* keypad() enbles KEY_ processing. */
2N/A#define W_USE_TIMEOUT 0x1000 /* notimeout() disables the interbyte timer. */
2N/A#define W_CONFIG_MASK 0x1f80 /* Mask of configurable flags. */
2N/A
2N/A/*
2N/A * Flags used in SCREEN.
2N/A */
2N/A#define S_ECHO 0x0001 /* Software echo enbled. */
2N/A#define S_ENDWIN 0x0002 /* Curses is in "shell" mode. */
2N/A#define S_INS_DEL_CHAR 0x0004 /* idcok() enabled for terminal (future). */
2N/A#define S_INS_DEL_LINE 0x0008 /* idlok() enabled for terminal. */
2N/A#define S_ISATTY 0x0010 /* _kfd is a terminal. */
2N/A#define S_USE_META 0x0020 /* meta() enabled. */
2N/A#define S_TYPEAHEAD_OK 0x0040 /* typeahead flag */
2N/A
2N/Atypedef struct t_decode {
2N/A struct t_decode *sibling;
2N/A struct t_decode *child;
2N/A short key; /* KEY_ value or 0. */
2N/A int ch; /* Character found by this node. */
2N/A} t_decode;
2N/A
2N/Atypedef struct {
2N/A int top; /* # of lines off the top. */
2N/A int bottom; /* # of lines off the bottom (-ve). */
2N/A struct {
2N/A int dy; /* Distance from screen top/bottom. */
2N/A int (*init)(WINDOW *, int); /* Init. function for window. */
2N/A int created;
2N/A } line[M_CURSES_MAX_RIPOFFLINE];
2N/A} t_rip;
2N/A
2N/Aextern SCREEN *__m_screen;
2N/Aextern int __m_slk_format;
2N/Aextern int __m_slk_labels_on;
2N/Aextern const short __m_keyindex[][2];
2N/A
2N/Aextern const char *boolnames[];
2N/Aextern const char *boolcodes[];
2N/Aextern const char *boolfnames[];
2N/Aextern const char *numnames[];
2N/Aextern const char *numcodes[];
2N/Aextern const char *numfnames[];
2N/Aextern const char *strnames[];
2N/Aextern const char *strcodes[];
2N/Aextern const char *strfnames[];
2N/A
2N/A#define ATTR_STATE cur_term->_at
2N/A
2N/A#define PTERMIOS(x) ((struct termios *)(cur_term->x))
2N/A
2N/A#define __m_cc_width(cc) wcwidth((cc)->_wc[0])
2N/A
2N/A#define TPUTS(a, b, c) tputs(a, b, c)
2N/A
2N/Aextern int __m_wc_cc(wint_t, cchar_t *);
2N/Aextern int __m_mbs_cc(const char *, attr_t, short, cchar_t *);
2N/Aextern int __m_wcs_cc(const wchar_t *, attr_t, short, cchar_t *);
2N/Aextern int __m_acs_cc(chtype, cchar_t *);
2N/Aextern int __m_wacs_cc(const cchar_t *, cchar_t *);
2N/Aextern int __m_cc_mbs(const cchar_t *, char *, int);
2N/A
2N/Aextern int __m_cc_sort(cchar_t *);
2N/Aextern int __m_cc_write(const cchar_t *);
2N/Aextern int __m_cc_first(WINDOW *, int, int);
2N/Aextern int __m_cc_next(WINDOW *, int, int);
2N/Aextern int __m_cc_islast(WINDOW *, int, int);
2N/Aextern int __m_cc_expand(WINDOW *, int, int, int);
2N/Aextern int __m_cc_erase(WINDOW *, int, int, int, int);
2N/Aextern int __m_cc_compare(const cchar_t *, const cchar_t *, int);
2N/Aextern int __m_cc_replace(WINDOW *, int, int, const cchar_t *, int);
2N/Aextern int __m_cc_add(WINDOW *, int, int, const cchar_t *, int,
2N/A int *, int *);
2N/A#if defined(_LP64)
2N/Aextern void __m_cc_hash(WINDOW *, unsigned int *, int);
2N/A#else
2N/Aextern void __m_cc_hash(WINDOW *, unsigned long *, int);
2N/A#endif
2N/A
2N/Aextern int __m_set_echo(int);
2N/Aextern int __m_tty_get(struct termios *);
2N/Aextern int __m_tty_set(struct termios *);
2N/Aextern int __m_decode_init(t_decode **);
2N/Aextern void __m_decode_free(t_decode **);
2N/Aextern int __m_do_scroll(WINDOW *, int, int, int *, int *);
2N/Aextern int __m_ptr_move(void **, unsigned, unsigned, unsigned, unsigned);
2N/A
2N/Aextern int __m_doupdate_init(void);
2N/Aextern int __m_wins_wch(WINDOW *, int, int, const cchar_t *, int *, int *);
2N/Aextern int __m_cc_ins(WINDOW *, int, int, const cchar_t *);
2N/Aextern void __m_mvcur_cost(void);
2N/A
2N/Aextern int __m_cc_modify(WINDOW *, int, int, const cchar_t *);
2N/Aextern int __m_tty_set_prog_mode(void);
2N/Aextern int __m_tputs(const char *, int, int (*)(int));
2N/Aextern int __m_slk_clear(int);
2N/Aextern int __m_cc_add_k(WINDOW *, int, int, const cchar_t *,
2N/A int, int *, int *);
2N/Aextern int __m_cc_equal(const cchar_t *, const cchar_t *);
2N/Aextern void __m_touch_locs(WINDOW *, int, int, int);
2N/Aextern int __m_wadd_wch(WINDOW *, const cchar_t *);
2N/Aextern void __m_slk_doupdate(void);
2N/Aextern int __m_outc(int);
2N/Aextern int __m_tty_wc(int, wchar_t *);
2N/Aextern int __m_chtype_cc(chtype, cchar_t *);
2N/Aextern chtype __m_cc_chtype(const cchar_t *);
2N/Aextern int __m_copywin(const WINDOW *, WINDOW *, int);
2N/Aextern WINDOW *__m_newwin(WINDOW *, int, int, int, int);
2N/Aextern int __m_putchar(int);
2N/Aextern int __m_mvcur(int, int, int, int, int (*)(int));
2N/Aextern int __m_read_terminfo(const char *, TERMINAL *);
2N/Aextern int __m_setupterm(char *, int, int, int *);
2N/A
2N/Aextern int pollTypeahead(void);
2N/Aextern int wistombs(char *, const wint_t *, int);
2N/Aextern int wistowcs(wchar_t *, const wint_t *, int);
2N/A
2N/Aextern void wtouchln_hard(WINDOW *, int, int);
2N/A
2N/A/*
2N/A * Unique callback functions to initialize a SCREEN's wide_io_t structure,
2N/A * which is used by __m_wio_get(). The __xc_ denotes XCurses and is used
2N/A * instead of __m_ to avoid possible name conflicts else-where in MKS
2N/A * libraries and applications. Note that wgetch() is used for the get
2N/A * function.
2N/A */
2N/Aextern int __xc_feof(void *);
2N/Aextern int __xc_ferror(void *);
2N/Aextern void __xc_clearerr(void *);
2N/Aextern int __xc_ungetc(int, void *);
2N/A
2N/A/*
2N/A * Input stack macros replaced by these functions.
2N/A */
2N/Aextern void iqAdd(unsigned int ch);
2N/Aextern void iqPush(unsigned int ch);
2N/Aextern int iqIsEmpty(void);
2N/Aextern void iqReset(void);
2N/Aextern int iqPull(void);
2N/A
2N/A#define WSYNC(w) \
2N/A if ((w)->_flags & W_SYNC_UP) {\
2N/A wsyncup(w);\
2N/A }
2N/A#define WFLUSH(w) (((w)->_flags & W_FLUSH) ? wrefresh(w) : OK)
2N/A
2N/A/* end */