curshdr.h revision e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#ifndef _CURSHDR_H
#define _CURSHDR_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define _KEY (01)
#define _MACRO (02)
/*
* IC and IL overheads and costs should be set to this
* value if the corresponding feature is missing
*/
#define LARGECOST 500
typedef struct
{
short icfixed; /* Insert char fixed overhead */
short dcfixed; /* Delete char fixed overhead */
short Insert_character;
short Delete_character;
short Cursor_home;
short Cursor_to_ll;
short Cursor_left;
short Cursor_right;
short Cursor_down;
short Cursor_up;
short Carriage_return;
short Tab;
short Back_tab;
short Clr_eol;
short Clr_bol;
short Parm_ich;
short Parm_dch;
short Parm_left_cursor;
short Parm_up_cursor;
short Parm_down_cursor;
short Parm_right_cursor;
short Cursor_address;
short Row_address;
} COSTS;
/* Soft label keys */
typedef struct
{
short _num; /* actual number of labels */
short _len; /* real length of labels */
bool _changed; /* TRUE if some labels changed */
} SLK_MAP;
struct screen
{
long baud; /* baud rate of this tty */
short kp_state; /* 1 iff keypad is on, else 0 */
short Yabove; /* How many lines are above stdscr */
short lsize; /* How many lines decided by newscreen */
short csize; /* How many columns decided by newscreen */
short tsize; /* How big is a tab decided by newscreen */
int *cur_hash; /* hash table of curscr */
int *virt_hash; /* hash table of virtscr */
char **_mks; /* marks, only used with xhp terminals */
#ifdef SYSV
#endif
char **_color_mks; /* marks, only used with color xhp terminals */
unsigned long _trap_mbe; /* trap these mouse button events */
unsigned long _map_mbe_to_key; /* map selected buttons on top of */
/* slk's to function keys */
};
#ifdef DEBUG
#ifndef outf
#endif /* outf */
#endif /* DEBUG */
extern short cswidth[], /* byte size of multi-byte chars */
_curs_scrwidth[]; /* display size */
extern short _csmax,
extern bool _mbtrue;
#define RBYTE(x) ((x) & 0377)
/* terminfo magic number */
#define MAGNUM 0432
/* curses screen dump magic number */
#define SVR2_DUMP_MAGIC_NUMBER 0433
#define SVR3_DUMP_MAGIC_NUMBER 0434
/* Getting the baud rate is different on the two systems. */
#ifdef SYSV
#define _BRS(x) (cfgetospeed(&x))
#include <values.h>
#else /* SYSV */
#define BITSPERBYTE 8
#define MAXINT 32767
#endif /* SYSV */
#define _BLNKCHAR ' '
#define _CTRL(c) (c | 0100)
#define _ATTR(c) ((c) & A_ATTRIBUTES)
#define _CHAR(c) ((c) & A_CHARTEXT)
/*
* combine CHAR par of the character with the attributes of the window.
* Two points: 1) If character is blank, usebackground instead
* 2) If character contains color, delete color from
* window attribute.
*/
((w)->_attrs)))
#define _UNCTRL(c) ((c) ^ 0100)
/* blank lines info of curscr */
/* hash tables */
/* video marks */
#define _NUMELEMENTS(x) (sizeof (x)/sizeof (x[0]))
#ifdef _VR3_COMPAT_CODE
/*
* #define _TO_OCHTYPE(x) ((_ochtype)(((x&A_ATTRIBUTES)>>9)| \
* (x&0x0000007FUL)))
*/
extern void (*_y16update)(WINDOW *, int, int, int, int);
#endif /* _VR3_COMPAT_CODE */
/* functions for screen updates */
extern int (*_setidln)(void);
extern int (*_useidln)(void);
#define _MIN(a, b) ((a) < (b) ? (a) : (b))
#define _MAX(a, b) ((a) > (b) ? (a) : (b))
extern int (*_do_slk_ref)(void);
extern int (*_do_slk_tch)(void);
extern int (*_do_slk_noref)(void);
extern int _outch(char);
extern int _chkinput(void);
extern int _curs_wctomb(char *, wchar_t);
extern int _delay(int, int (*)(char));
int, int, int);
extern int _scr_all(char *, int);
extern int _slk_update(void);
extern int _tcsearch(char *, short [], char *[], int, int);
extern int force_doupdate(void);
extern int init_acs(void);
extern int mbscrw(int);
extern int mbeucw(int);
extern int scr_ll_dump(FILE *);
extern int setkeymap(void);
extern int ttimeout(int);
extern int wadjcurspos(WINDOW *);
extern void (*_slk_init)(void);
extern void (*_rip_init)(void);
extern void mbgetwidth(void);
extern void _blast_keys(TERMINAL *);
extern void _init_costs(void);
extern void _init_HP_pair(short, short, short);
extern void _update_old_y_area(WINDOW *, int, int, int, int);
extern char *tparm_p0(char *);
extern char *tparm_p1(char *, long);
extern char *tparm_p2(char *, long, long);
extern char *tparm_p3(char *, long, long, long);
extern char *tparm_p4(char *, long, long, long, long);
extern char *tparm_p7(char *, long, long, long, long, long, long, long);
extern char *infotocap(char *, int *);
extern char *_strcode2byte(wchar_t *, char *, int);
#ifdef __cplusplus
}
#endif
#endif /* _CURSHDR_H */