xenocara/app/xterm/xtermcap.h

117 lines
3.1 KiB
C
Raw Normal View History

/* $XTermId: xtermcap.h,v 1.16 2010/01/06 21:20:40 tom Exp $ */
2007-06-15 13:29:55 -06:00
/************************************************************
Copyright 2007-2009,2010 by Thomas E. Dickey
2007-06-15 13:29:55 -06:00
All Rights Reserved
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the
sale, use or other dealings in this Software without prior written
authorization.
********************************************************/
/*
* Common/useful definitions for XTERM termcap interface.
*/
#ifndef included_xtermcap_h
#define included_xtermcap_h
#include <xterm.h>
#include <ptyx.h>
#ifndef HAVE_TIGETSTR
#undef USE_TERMINFO
2007-06-15 13:29:55 -06:00
#endif
#ifndef USE_TERMINFO
#define USE_TERMINFO 0
#endif
#if !USE_TERMINFO
#undef HAVE_TIGETSTR
#ifndef USE_TERMCAP
#define USE_TERMCAP 1
#endif
#endif
2007-06-15 13:29:55 -06:00
#undef ERR /* workaround for glibc 2.1.3 */
2007-06-15 13:29:55 -06:00
#include <curses.h>
#ifndef NCURSES_VERSION
#ifdef HAVE_TERMCAP_H
#include <termcap.h>
#endif
#endif
2007-06-15 13:29:55 -06:00
#ifdef HAVE_NCURSES_TERM_H
#include <ncurses/term.h>
#elif defined(HAVE_TERM_H)
#include <term.h> /* tgetent() */
#endif
/*
* Get rid of conflicting symbols from term.h
*/
#undef bell
2007-06-15 13:29:55 -06:00
/***====================================================================***/
#ifdef __cplusplus
extern "C" {
#endif
Update to xterm 243. tested by naddy@. Patch #243 - 2009/3/28 * revert change to default for allowTcapOps (request by Bram Moolenaar). * reallocate result returned by xtermEnvLocale() to avoid reference to freed memory after handling menuLocale resource. * fix an old (X11R5) bug in tek4014 for switching fontsizes. * add resource defaultString to make configurable the use of "#" when pastes of UTF-8 text fail due to limitations in the current locale settings. * make the set of selection target Atom's configurable by two new resources eightBitSelectTypes and utf8SelectTypes, e.g., to use the TEXT Atom in preference to UTF8_STRING (discussion with Stanislav Sedov regarding koi8rxterm and the FreeBSD port). * modify handling of TARGETS Atom by making it return exactly the set of targets as those which xterm is currently providing. * set MANPAGER and PAGER explicitly to /bin/cat in minstall.sh to work around /etc/man.conf's with those variables already set (report by Mar'yasin Semion). * improve error-checking of tcap-query parser. * add check for keyboard tcap), which ensures that terminal descriptions containing the same string for shifted/unshifted keys will be seen by tcap-query as only the unshifted key. (This would only happen with an incorrect terminal description). * fix conversion for input event-state to modifier-parameter which made tcap-query feature not work with tcapFunctionKeys (keyboard type tcap). * add "DEF_ALLOW_XXX" definitions to main.h to allow overriding the default compiled-in values for "allowxxx" resources. * remove check on bell-percentage added in patch #242, which disallowed zero/negative values (Redhat Bugzilla #487829).
2009-04-04 09:10:44 -06:00
#define MOD_NONE 1
#define MOD_SHIFT 1
#define MOD_ALT 2
#define MOD_CTRL 4
#define MOD_META 8
Update to xterm 243. tested by naddy@. Patch #243 - 2009/3/28 * revert change to default for allowTcapOps (request by Bram Moolenaar). * reallocate result returned by xtermEnvLocale() to avoid reference to freed memory after handling menuLocale resource. * fix an old (X11R5) bug in tek4014 for switching fontsizes. * add resource defaultString to make configurable the use of "#" when pastes of UTF-8 text fail due to limitations in the current locale settings. * make the set of selection target Atom's configurable by two new resources eightBitSelectTypes and utf8SelectTypes, e.g., to use the TEXT Atom in preference to UTF8_STRING (discussion with Stanislav Sedov regarding koi8rxterm and the FreeBSD port). * modify handling of TARGETS Atom by making it return exactly the set of targets as those which xterm is currently providing. * set MANPAGER and PAGER explicitly to /bin/cat in minstall.sh to work around /etc/man.conf's with those variables already set (report by Mar'yasin Semion). * improve error-checking of tcap-query parser. * add check for keyboard tcap), which ensures that terminal descriptions containing the same string for shifted/unshifted keys will be seen by tcap-query as only the unshifted key. (This would only happen with an incorrect terminal description). * fix conversion for input event-state to modifier-parameter which made tcap-query feature not work with tcapFunctionKeys (keyboard type tcap). * add "DEF_ALLOW_XXX" definitions to main.h to allow overriding the default compiled-in values for "allowxxx" resources. * remove check on bell-percentage added in patch #242, which disallowed zero/negative values (Redhat Bugzilla #487829).
2009-04-04 09:10:44 -06:00
#define MODIFIER_NAME(parm, name) \
(((parm > MOD_NONE) && ((parm - MOD_NONE) & name)) ? " "#name : "")
2007-06-15 13:29:55 -06:00
/* xtermcap.c */
extern Bool get_termcap(XtermWidget /* xw */, char * /* name */);
extern void set_termcap(XtermWidget /* xw */, const char * /* name */);
extern void free_termcap(XtermWidget /* xw */);
extern char *get_tcap_buffer(XtermWidget /* xw */);
extern char *get_tcap_erase(XtermWidget /* xw */);
2007-06-15 13:29:55 -06:00
#if OPT_TCAP_FKEYS
extern int xtermcapString(XtermWidget /* xw */, int /* keycode */, unsigned /* mask */);
#endif
#if OPT_TCAP_QUERY
extern int xtermcapKeycode(XtermWidget /* xw */, const char ** /* params */, unsigned * /* state */, Bool * /* fkey */);
2007-06-15 13:29:55 -06:00
#endif
#ifdef __cplusplus
}
#endif
#endif /* included_xtermcap_h */