eterm/src/feature.h

321 lines
8.9 KiB
C
Raw Normal View History

/*
* Copyright (C) 1997-2009, Michael Jennings
1999-08-17 18:24:23 -07:00
*
* 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:
1999-08-17 18:24:23 -07:00
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
1999-08-17 18:24:23 -07:00
*
* 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 AUTHORS 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.
1999-08-17 18:24:23 -07:00
*/
#ifndef _FEATURE_H_
# define _FEATURE_H_
/********************* Miscellaneous OS fixings *********************/
# if defined(hpux) && !defined(_HPUX_SOURCE)
# define _HPUX_SOURCE
# endif
/*
# if defined(_HPUX_SOURCE) && !defined(SVR4)
# define SVR4
# endif
*/
# if defined(SVR4) || defined(__SVR4)
# ifndef __svr4__
# define __svr4__
# endif
1999-08-17 18:24:23 -07:00
# endif
# if defined(sun) && !defined(__sun__)
# define __sun__
# endif
# if !defined(sun) && defined(__sun__)
# define sun
# endif
# if defined (sun)
# undef HAVE_SYS_IOCTL_H
# endif
# ifdef __GNUC__
# define _GNU_SOURCE
# else
# define _XOPEN_SOURCE 600
# define _XOPEN_SOURCE_EXTENDED 1
# endif
1999-08-17 18:24:23 -07:00
/********************* Debugging stuff *********************/
/* As Keith Bunge would say, don't crap with the debugging stuff below
* unless you develop this mess. :^) -- mej
*/
# ifndef DEBUG
# define DEBUG 0
# endif
/********************* Random development stuff ***************************/
#ifdef ENABLE_PROFILE
# define PROFILE_SCREEN
# define PROFILE_X_EVENTS
# define COUNT_X_EVENTS
1999-08-17 18:24:23 -07:00
#endif
#define OPTIMIZE_HACKS
#define USE_EFFECTS
/* For Pablo I/O Trace Library */
#ifdef IOTRACE
# include <IOTrace.h>
# include <PabloTrace.h>
# define PABLO_START_TRACING() do {setTraceProcessorNumber(0); setTraceFileName("Eterm-pablo-trace.sddf"); initIOTrace(); \
enableLifetimeSummaries(); enableTimeWindowSummaries(0.1); enableFileRegionSummaries(8192); \
} while (0)
# define PABLO_STOP_TRACING() do {endIOTrace(); endTracing();} while (0)
#else
# define PABLO_START_TRACING() ((void) 0)
# define PABLO_STOP_TRACING() ((void) 0)
#endif
# include <stdio.h>
# include <stdlib.h>
# include <libast.h>
# include "eterm_debug.h"
1999-08-17 18:24:23 -07:00
/********************* Color, screen, and image stuff *********************/
/* Support for background pixmap cycling */
#define BACKGROUND_CYCLING_SUPPORT
/* The environment variable in which Eterm looks for a search path for
config files and pixmaps */
#define PATH_ENV "ETERMPATH"
/* Disable the secondary screen ("\E[?47h" / "\E[?47l") */
/* #define NO_SECONDARY_SCREEN */
/* The number of screenfuls between refreshes. Anything higher than 1
* will cause gaps in the scrollback buffer. */
# define REFRESH_PERIOD 1
1999-08-17 18:24:23 -07:00
/* This will force clearing of characters before writing new ones on top of
* them. This is experimental - added in order to try and fix pixel dropping
* problems some people have had. */
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org> This is the first public availability of the work thus far on Eterm 0.9.1. There's quite a bit of new stuff here. * Added scrollbar thumb support. * Completely redid the terminfo/termcap stuff. The terminfo file is now compiled (by tic) and installed by default (unless you specify --without-terminfo). The config files still say xterm, though, because some programs (like SLang and GNU mc) use the silly algorithm of "Is $TERM set to xterm?" to detect mouse reporting support in a terminal. =P But if you don't ever use xterm, you can use Eterm's termcap and just name it "xterm" instead. Thanks to Marius Gedminas <mgedmin@takas.lt> for his patch that started this whole revamp. * Added the kEsetroot script for KDE users from Dax Games <dgames@isoc.net>. * You can now configure the Home and End emulation via --with-home= and --with-end= options to configure. The --with-terminfo option is also new, and --enable-xim is now the default. * Added a new image state, disabled, for when Eterm loses focus. This is supported by all widgets (well, all those that could possibly be on screen when Eterm lost focus), even the background image. So you could actually have all your images darken on focus out and restore to normal on focus in. * Widget colors formerly dealt with as colors (menu text color, scrollbar color, etc.) are now handled by the imageclasses. Each image state can have a foreground and background color defined. The current exception is the background image; I hope to add that later. The foreground is the text color and the background is the object color (for solid color mode). So menu text color is set by the menu imageclass. And again, for unfocused colors, use the disabled state of the imageclass. * Proportionally-spaced fonts are now handled much better. They are still forced into evenly-spaced columns (it's a terminal for crying out loud!) but at least you don't end up with Eterm's wider than your screen. :-) * Home on refresh is gone, as is home on echo. It's now much simpler. There are two options: home on output, and home on input, the former being a combination of echo and refresh. Also, keypresses that don't necessarily have corresonding output can trigger a home on input, like Ctrl-End or whatever...ones that don't have special meaning. Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out this issue and the one with "m-" in font names. * I finally got around to re-merging the new parser stuff from my work on the Not Game. Closed up some old potential behavior quirks with theme parsing. * Added a new escape sequence to fork-and-exec a program. Also added a scrollback search capability to highlight all occurances of a string in your scrollback buffer. Use the new "Etsearch" utility to access it. "Etsearch string" to search for a string, then "Etsearch" by itself to reset the highlighting. * And of course, the biggie. Eterm now supports a completely- customizeable buttonbar. Not a menubar, a buttonbar. It can have an arbitrary number of buttons, and each button can perform an action, just like a menuitem. So a button could bring up a menu (like a menubar) or launch a program (like a launchbar) or perform an operation (like a toolbar). Each button can have an icon, text, or both. And you can have buttons left- or right-justified in the buttonbar. You will eventually be able to have an arbitrary number of buttonbars, but I'm still working on that. As with any change this big, things could very easily be broken. So beware. :-) I have tested this myself, and everything seems to work, but I can't test every possibility. Let me know if you find anything that's broken, and enjoy! SVN revision: 2048
2000-02-10 16:25:07 -08:00
/*# define FORCE_CLEAR_CHARS*/
1999-08-17 18:24:23 -07:00
/* The command through which to pipe print-screen requests */
#define PRINTPIPE "lp"
/* If the screen can handle 24-bit graphics, force them */
/* #define PREFER_24BIT */
/* Offer some support for the Offix DND (Drag 'n' Drop) protocol (untested) */
/* #define OFFIX_DND */
/* Allows the -w and --border-width options for specifying the width of the
* border (in pixels) between the actual X client window and the program-useable
* terminal window. -- mej
*/
# define BORDER_WIDTH_OPTION
/********************* Key and key-bindings options *********************/
/* Pick the hotkey for changing the font size */
# define HOTKEY_CTRL
/* #define HOTKEY_META */
/* Use Home = "\E[1~" and End = "\E[4~" instead of Home = "\E[7~" and End = "\E[8~" */
/* #define LINUX_KEYS */
/* Allow the "keysym" attribute in config files for remapping keysyms */
#define KEYSYM_ATTRIBUTE
/* Allow unshifted Next and Prior keys to scroll, in addition to their shifted
* counterparts */
/* #define UNSHIFTED_SCROLLKEYS */
/********************* Mouse, scrollbar, and menu bar options *********************/
/* Disable sending escape sequences from the scrollbar when mouse reporting
* is enabled */
/* #define NO_SCROLLBAR_REPORT */
/* Set the default number of lines in the scrollback buffer */
/* #define SAVELINES 256 */
/* Set the default separator characters for double-click word selection */
#define CUTCHARS "\"&'()*,;<=>?@[\\]^`{|} \t"
1999-08-17 18:24:23 -07:00
/* Make it an option */
#define CUTCHAR_OPTION
/* To activate double-click reporting for button 1 */
/* #define MOUSE_REPORT_DOUBLECLICK */
/* The delay in milliseconds between multiple clicks */
/* #define MULTICLICK_TIME 500 */
/* Support for the old xterm-style scrollbar */
#define XTERM_SCROLLBAR
/* Support for the traditional motif-style scrollbar */
#define MOTIF_SCROLLBAR
/* Support for a NeXT-style scrollbar */
#define NEXT_SCROLLBAR
/* Default scrollbar type */
#define SCROLLBAR_DEFAULT_TYPE SCROLLBAR_MOTIF
/* The default width (in pixels) of the scrollbar. */
#define SB_WIDTH 10
/* Continuous scrolling by pressing the scrollbar arrow buttons */
#define SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
/* Delay periods for continuous scrolling */
/* #define SCROLLBAR_INITIAL_DELAY 40 */
/* #define SCROLLBAR_CONTINUOUS_DELAY 2 */
/* How many lines of context to keep on screen when paging up/down */
#define CONTEXT_LINES 1
1999-08-17 18:24:23 -07:00
/********************* Multi-lingual support options *********************/
/* Allow option/attribute for Meta to set the 8th bit */
#define META8_OPTION
/* Attempt to deactivate UTF-8 and similar locales. */
/* #define NO_UTF8_LOCALE */
1999-08-17 18:24:23 -07:00
/********************* Miscellaneous options *********************/
/* To have "\E[7n" reply with the display name. This is a potential security risk,
* so its use is discouraged and unsupported. */
/* #define ENABLE_DISPLAY_ANSWER */
/* To control what the Eterm detection sequence, ESC-Z, replies with */
/* #define ESCZ_ANSWER "\033[?1;2C" */
/* Defining NO_ENQ_ANS disables the response to the ENQ (Ctrl-E) character. I
* don't believe xterm answers this one, so neither will we by default. xterm
* does, however, answer the ANSI/ECMA-48 DA sequence \e[c (the u9 capability).
* We won't. It seems to cause trouble on some systems.
1999-08-17 18:24:23 -07:00
*/
#define NO_ENQ_ANS
#define NO_VT100_ANS
1999-08-17 18:24:23 -07:00
/* Allow changing of the foreground and background colors with "\E]39;color^G" */
#define XTERM_COLOR_CHANGE
1999-08-17 18:24:23 -07:00
/* Disable automatic de-iconify on bell altogether */
/* #define NO_MAPALERT */
/* Make it an option */
#define MAPALERT_OPTION
/********************* Anti-cl00bie protection (sigh) *********************/
/* EDITING THIS FILE BELOW THIS LINE IS UNSUPPORTED! YOU HAVE BEEN WARNED! */
#ifdef MULTI_CHARSET
# undef GREEK_SUPPORT
# undef XTERM_FONT_CHANGE
# undef DEFINE_XTERM_COLOR
#endif /* MULTI_CHARSET */
#define FONT0_IDX 2
#ifndef PIXMAP_SUPPORT
# undef PIXMAP_OFFSET
# undef IMLIB_TRANS
# undef BACKGROUND_CYCLING_SUPPORT
# undef WATCH_PIXMAP_OPTION
#endif
#ifndef PIXMAP_OFFSET
# undef WATCH_DESKTOP_OPTION
#endif
#ifndef HAVE_MEMMOVE
inline void *memmove(void *, const void *, size_t);
#endif
#define APL_NAME "Eterm"
/* COLORTERM, TERM environment variables */
#define TERMENV "Eterm"
#define COLORTERMENV "Eterm"
1999-08-17 18:24:23 -07:00
#ifdef NO_MOUSE_REPORT
# ifndef NO_MOUSE_REPORT_SCROLLBAR
# define NO_MOUSE_REPORT_SCROLLBAR
# endif
#endif
#ifndef DEFAULT_BORDER_WIDTH
# define DEFAULT_BORDER_WIDTH 5
#endif
#ifndef SB_WIDTH
# define SB_WIDTH 10
#endif
#ifndef SAVELINES
# define SAVELINES 256
#endif
#ifdef NO_SECONDARY_SCREEN
# define NSCREENS 0
#else
# define NSCREENS 1
#endif
#ifndef DEFAULT_REFRESH
1999-08-17 18:24:23 -07:00
# define DEFAULT_REFRESH FAST_REFRESH
#endif
#ifndef CUTCHARS
# define CUTCHARS "\"&'()*,;<=>?@[\\]^`{|}~"
#endif
#if defined (__sun__) || defined (__svr4__)
# define NO_DELETE_KEY /* These systems seem to be anal this way*/
#endif
#if !defined(HAVE_X11_EXTENSIONS_XRES_H)
# undef HAVE_XRES_EXT
#endif
1999-08-17 18:24:23 -07:00
#ifndef PATH_ENV
# define PATH_ENV "ETERMPATH"
#endif
#if defined(_POSIX_VERSION) && defined(_POSIX_SAVED_IDS)
# ifdef HAVE_SAVED_UIDS
# undef HAVE_SAVED_UIDS
# endif
# define HAVE_SAVED_UIDS 1
#endif
1999-08-17 18:24:23 -07:00
/* utmp doesn't work on CygWin32 */
#ifdef __CYGWIN32__
# undef UTMP_SUPPORT
#endif
#endif /* _FEATURE_H_ */