root/foundation-apps/mxterm-maxx/xtermcap.h
| Revision 8, 2.9 KB (checked in by emasson, 3 years ago) |
|---|
| Line | |
|---|---|
| 1 | /* $XTermId: xtermcap.h,v 1.5 2007/12/06 00:09:44 tom Exp $ */ |
| 2 | |
| 3 | /************************************************************ |
| 4 | |
| 5 | Copyright 2007 by Thomas E. Dickey |
| 6 | |
| 7 | All Rights Reserved |
| 8 | |
| 9 | Permission is hereby granted, free of charge, to any person obtaining a |
| 10 | copy of this software and associated documentation files (the |
| 11 | "Software"), to deal in the Software without restriction, including |
| 12 | without limitation the rights to use, copy, modify, merge, publish, |
| 13 | distribute, sublicense, and/or sell copies of the Software, and to |
| 14 | permit persons to whom the Software is furnished to do so, subject to |
| 15 | the following conditions: |
| 16 | |
| 17 | The above copyright notice and this permission notice shall be included |
| 18 | in all copies or substantial portions of the Software. |
| 19 | |
| 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 21 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 22 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 23 | IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY |
| 24 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 25 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 26 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 27 | |
| 28 | Except as contained in this notice, the name(s) of the above copyright |
| 29 | holders shall not be used in advertising or otherwise to promote the |
| 30 | sale, use or other dealings in this Software without prior written |
| 31 | authorization. |
| 32 | |
| 33 | ********************************************************/ |
| 34 | |
| 35 | /* |
| 36 | * Common/useful definitions for XTERM termcap interface. |
| 37 | */ |
| 38 | #ifndef included_xtermcap_h |
| 39 | #define included_xtermcap_h |
| 40 | |
| 41 | #include <xterm.h> |
| 42 | |
| 43 | #include <ptyx.h> |
| 44 | |
| 45 | #ifdef HAVE_TERMCAP_H |
| 46 | #include <termcap.h> |
| 47 | #if defined(NCURSES_VERSION) |
| 48 | /* The tgetent emulation function in SVr4-style curses implementations |
| 49 | * (e.g., ncurses) ignores the buffer, so TERMCAP can't be set from it. |
| 50 | * Instead, just use terminfo. |
| 51 | */ |
| 52 | #undef USE_TERMCAP |
| 53 | #include <curses.h> |
| 54 | #endif |
| 55 | #else |
| 56 | #undef ERR /* workaround for glibc 2.1.3 */ |
| 57 | #include <curses.h> |
| 58 | #ifdef HAVE_NCURSES_TERM_H |
| 59 | #include <ncurses/term.h> |
| 60 | #elif defined(HAVE_TERM_H) |
| 61 | #include <term.h> /* tgetent() */ |
| 62 | #endif /*CYGWIN */ |
| 63 | #endif /* HAVE_TERMCAP_H */ |
| 64 | |
| 65 | /***====================================================================***/ |
| 66 | |
| 67 | #ifdef __cplusplus |
| 68 | extern "C" { |
| 69 | #endif |
| 70 | |
| 71 | #define MAX_FKEY 64 |
| 72 | #define MAX_FMOD 16 |
| 73 | |
| 74 | #define CodeToXkey(code) (XK_Fn(MAX_FKEY) - (int) code) |
| 75 | |
| 76 | /* |
| 77 | * Store Xkey-data internally as a negative value, past the last values used |
| 78 | * for function keys. |
| 79 | */ |
| 80 | #define XkeyData(code,mods) (-((mods-1) + (code*MAX_FMOD) + MAX_FKEY)) |
| 81 | |
| 82 | /* xtermcap.c */ |
| 83 | extern Bool get_termcap(char * /* name */, char * /* buffer */); |
| 84 | |
| 85 | #if OPT_TCAP_FKEYS |
| 86 | extern int xtermcapString(XtermWidget /* xw */, int /* keycode */, unsigned /* mask */); |
| 87 | #endif |
| 88 | |
| 89 | #if OPT_TCAP_QUERY |
| 90 | extern int xtermcapKeycode(XtermWidget /* xw */, char ** /* params */, unsigned * /* state */, Bool * /* fkey */); |
| 91 | #endif |
| 92 | |
| 93 | #ifdef __cplusplus |
| 94 | } |
| 95 | #endif |
| 96 | |
| 97 | #endif /* included_xtermcap_h */ |
Note: See TracBrowser
for help on using the browser.
