xtermcap.h revision 20d2c4d2
120d2c4d2Smrg/* $XTermId: xtermcap.h,v 1.16 2010/01/06 21:20:40 tom Exp $ */ 2d522f475Smrg 3d522f475Smrg/************************************************************ 4d522f475Smrg 520d2c4d2SmrgCopyright 2007-2009,2010 by Thomas E. Dickey 6d522f475Smrg 7d522f475Smrg All Rights Reserved 8d522f475Smrg 9d522f475SmrgPermission is hereby granted, free of charge, to any person obtaining a 10d522f475Smrgcopy of this software and associated documentation files (the 11d522f475Smrg"Software"), to deal in the Software without restriction, including 12d522f475Smrgwithout limitation the rights to use, copy, modify, merge, publish, 13d522f475Smrgdistribute, sublicense, and/or sell copies of the Software, and to 14d522f475Smrgpermit persons to whom the Software is furnished to do so, subject to 15d522f475Smrgthe following conditions: 16d522f475Smrg 17d522f475SmrgThe above copyright notice and this permission notice shall be included 18d522f475Smrgin all copies or substantial portions of the Software. 19d522f475Smrg 20d522f475SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21d522f475SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22d522f475SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23d522f475SmrgIN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 24d522f475SmrgCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25d522f475SmrgTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26d522f475SmrgSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27d522f475Smrg 28d522f475SmrgExcept as contained in this notice, the name(s) of the above copyright 29d522f475Smrgholders shall not be used in advertising or otherwise to promote the 30d522f475Smrgsale, use or other dealings in this Software without prior written 31d522f475Smrgauthorization. 32d522f475Smrg 33d522f475Smrg********************************************************/ 34d522f475Smrg 35d522f475Smrg/* 36d522f475Smrg * Common/useful definitions for XTERM termcap interface. 37d522f475Smrg */ 38d522f475Smrg#ifndef included_xtermcap_h 39d522f475Smrg#define included_xtermcap_h 40d522f475Smrg 41d522f475Smrg#include <xterm.h> 42d522f475Smrg 43d522f475Smrg#include <ptyx.h> 44d522f475Smrg 4520d2c4d2Smrg#ifndef HAVE_TIGETSTR 4620d2c4d2Smrg#undef USE_TERMINFO 47d522f475Smrg#endif 4820d2c4d2Smrg 4920d2c4d2Smrg#ifndef USE_TERMINFO 5020d2c4d2Smrg#define USE_TERMINFO 0 5120d2c4d2Smrg#endif 5220d2c4d2Smrg 5320d2c4d2Smrg#if !USE_TERMINFO 5420d2c4d2Smrg#undef HAVE_TIGETSTR 5520d2c4d2Smrg#ifndef USE_TERMCAP 5620d2c4d2Smrg#define USE_TERMCAP 1 5720d2c4d2Smrg#endif 5820d2c4d2Smrg#endif 5920d2c4d2Smrg 60d522f475Smrg#undef ERR /* workaround for glibc 2.1.3 */ 6120d2c4d2Smrg 62d522f475Smrg#include <curses.h> 6320d2c4d2Smrg 6420d2c4d2Smrg#ifndef NCURSES_VERSION 6520d2c4d2Smrg#ifdef HAVE_TERMCAP_H 6620d2c4d2Smrg#include <termcap.h> 6720d2c4d2Smrg#endif 6820d2c4d2Smrg#endif 6920d2c4d2Smrg 70d522f475Smrg#ifdef HAVE_NCURSES_TERM_H 71d522f475Smrg#include <ncurses/term.h> 72d522f475Smrg#elif defined(HAVE_TERM_H) 73d522f475Smrg#include <term.h> /* tgetent() */ 7420d2c4d2Smrg#endif 7520d2c4d2Smrg 7620d2c4d2Smrg/* 7720d2c4d2Smrg * Get rid of conflicting symbols from term.h 7820d2c4d2Smrg */ 7920d2c4d2Smrg#undef bell 80d522f475Smrg 81d522f475Smrg/***====================================================================***/ 82d522f475Smrg 83d522f475Smrg#ifdef __cplusplus 84d522f475Smrgextern "C" { 85d522f475Smrg#endif 86d522f475Smrg 87956cc18dSsnj#define MOD_NONE 1 88956cc18dSsnj#define MOD_SHIFT 1 89956cc18dSsnj#define MOD_ALT 2 90956cc18dSsnj#define MOD_CTRL 4 91956cc18dSsnj#define MOD_META 8 92d522f475Smrg 93956cc18dSsnj#define MODIFIER_NAME(parm, name) \ 94956cc18dSsnj (((parm > MOD_NONE) && ((parm - MOD_NONE) & name)) ? " "#name : "") 95d522f475Smrg 96d522f475Smrg/* xtermcap.c */ 9720d2c4d2Smrgextern Bool get_termcap(XtermWidget /* xw */, char * /* name */); 9820d2c4d2Smrgextern void set_termcap(XtermWidget /* xw */, const char * /* name */); 9920d2c4d2Smrgextern void free_termcap(XtermWidget /* xw */); 10020d2c4d2Smrg 10120d2c4d2Smrgextern char *get_tcap_buffer(XtermWidget /* xw */); 10220d2c4d2Smrgextern char *get_tcap_erase(XtermWidget /* xw */); 103d522f475Smrg 104d522f475Smrg#if OPT_TCAP_FKEYS 105d522f475Smrgextern int xtermcapString(XtermWidget /* xw */, int /* keycode */, unsigned /* mask */); 106d522f475Smrg#endif 107d522f475Smrg 108d522f475Smrg#if OPT_TCAP_QUERY 10920d2c4d2Smrgextern int xtermcapKeycode(XtermWidget /* xw */, const char ** /* params */, unsigned * /* state */, Bool * /* fkey */); 110d522f475Smrg#endif 111d522f475Smrg 112d522f475Smrg#ifdef __cplusplus 113d522f475Smrg } 114d522f475Smrg#endif 115d522f475Smrg 116d522f475Smrg#endif /* included_xtermcap_h */ 117