1999-11-18 20:05:24 -08:00
|
|
|
/*
|
2004-01-11 14:10:29 -08:00
|
|
|
* Copyright (C) 1997-2004, Michael Jennings
|
1999-08-17 16:01:18 -07:00
|
|
|
*
|
1999-11-18 20:05:24 -08: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 16:01:18 -07:00
|
|
|
*
|
1999-11-18 20:05:24 -08: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 16:01:18 -07:00
|
|
|
*
|
1999-11-18 20:05:24 -08: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 16:01:18 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
static const char cvs_ident[] = "$Id$";
|
|
|
|
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "config.h"
|
1999-08-17 16:01:18 -07:00
|
|
|
#include "feature.h"
|
|
|
|
|
1999-08-17 18:12:47 -07:00
|
|
|
#include <stdio.h>
|
1999-08-17 16:01:18 -07:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
1999-08-17 18:12:47 -07:00
|
|
|
#include <sys/wait.h>
|
|
|
|
#include <fcntl.h>
|
2000-02-17 21:39:39 -08:00
|
|
|
#include <dirent.h>
|
1999-08-17 16:01:18 -07:00
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
1999-08-17 18:12:47 -07:00
|
|
|
#include <signal.h>
|
1999-08-17 16:01:18 -07:00
|
|
|
#include <X11/keysym.h>
|
1999-08-17 18:12:47 -07:00
|
|
|
|
|
|
|
#include "actions.h"
|
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
|
|
|
#include "buttons.h"
|
1999-08-17 16:01:18 -07:00
|
|
|
#include "command.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "events.h"
|
1999-09-21 19:34:13 -07:00
|
|
|
#include "font.h"
|
1999-08-17 16:01:18 -07:00
|
|
|
#include "grkelot.h"
|
1999-10-07 15:18:14 -07:00
|
|
|
#include "startup.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "menus.h"
|
1999-08-17 16:01:18 -07:00
|
|
|
#include "options.h"
|
|
|
|
#include "pixmap.h"
|
|
|
|
#include "scrollbar.h"
|
|
|
|
#include "screen.h"
|
|
|
|
#include "system.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "term.h"
|
|
|
|
#include "windows.h"
|
2002-02-20 06:44:46 -08:00
|
|
|
#include "defaultfont.h"
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-02-21 16:09:23 -08:00
|
|
|
#ifndef CONFIG_BUFF
|
|
|
|
# define CONFIG_BUFF 20480
|
|
|
|
#endif
|
|
|
|
|
2002-10-04 18:19:41 -07:00
|
|
|
static void usage(void);
|
|
|
|
static void version(void);
|
|
|
|
static void handle_attribute(char *);
|
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
|
|
|
static void *parse_color(char *, void *);
|
|
|
|
static void *parse_attributes(char *, void *);
|
|
|
|
static void *parse_toggles(char *, void *);
|
|
|
|
static void *parse_keyboard(char *, void *);
|
|
|
|
static void *parse_misc(char *, void *);
|
|
|
|
static void *parse_imageclasses(char *, void *);
|
|
|
|
static void *parse_image(char *, void *);
|
|
|
|
static void *parse_actions(char *, void *);
|
|
|
|
static void *parse_menu(char *, void *);
|
|
|
|
static void *parse_menuitem(char *, void *);
|
|
|
|
static void *parse_bbar(char *, void *);
|
|
|
|
static void *parse_xim(char *, void *);
|
|
|
|
static void *parse_multichar(char *, void *);
|
2002-10-08 21:06:40 -07:00
|
|
|
static void *parse_escreen(char *, void *);
|
Mon Jun 11 17:49:55 PDT 2001 Michael Jennings <mej@eterm.org>
Okay, first off, I removed 3 scaled backgrounds. See www.kainx.org or
my post to enlightenment-devel for details.
Second, I redid the default bindings for the mouse wheel. Basically,
the wheel alone will scroll by pages. Ctrl+wheel will scroll by pages
in groups of 5. Shift+wheel will scroll by a single line. If you
hold down the Alt key, the same combinations will work the same way,
but instead of scrolling within Eterm, they'll scroll the application
in the terminal (by sending PgUp/PgDn and up/down arrows). This works
in less, bash, and any other application which groks those keys.
I also added a --without-mousewheel option to configure that will turn
off the default scrollwheel bindings. Of course, you can always use
action bindings in the config file to bind/rebind these any way you
like.
While I was at it, I found and fixed a bug in the handling of the
Alt and Meta keys.
I added a scroll() function to the script stuff which allows you to
bind keys/buttons to scroll up and down. While I was at it, I added
comments to script.c for each function you can use.
And finally, the config file parser was moved to libast.
SVN revision: 4806
2001-06-11 18:04:45 -07:00
|
|
|
|
2000-03-08 19:38:31 -08:00
|
|
|
static char *rs_pipe_name = NULL;
|
2001-10-21 06:21:05 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2000-03-28 12:32:42 -08:00
|
|
|
static int rs_shade = 0;
|
|
|
|
static char *rs_tint = NULL;
|
2001-10-21 06:21:05 -07:00
|
|
|
#endif
|
2000-04-03 16:43:15 -07:00
|
|
|
static unsigned long rs_buttonbars = 1;
|
Fri May 26 20:43:03 PDT 2000 Michael Jennings <mej@eterm.org>
Okay, there are a few changes here. First off, I made multi-byte font
support the default now, as long as you have ISO 10646 fonts. In
order to do this, I made the default encoding type "Latin1" so as not
to interfere with 8-bit ISO 8859-1 characters. This means that if you
relied on the default multi-byte encoding method to be SJIS, you'll
need to update your theme files.
I also set it up so that Eterm will ignore SIGHUP, at least until I do
something with it (like reloading the theme or something).
I fixed the proportional font size algorithm. If there is more than
a 3-pixel variance between the minimum and maximum sizes for glyphs in
a proportional font, Eterm will set the size to 2 standard deviations
above the average width. This is so that they won't look so spread
out and ugly, but it still doesn't look perfect. Not much I can do on
that front...terminals must have fixed-width columns.
And then there's the biggie. I put in the ability to configure the
now-infamous font effects. I left a black drop shadow in as the
default, but you can now customize it via the --font-fx option or in
the config file using "font effects <stuff>" in the attributes
context. You can even use "fx" instead of "effects" for short.
So what goes in the <stuff> part? Well, you have several options.
To use a single-color outline, say "outline <color>". Likewise, a
single-color drop shadow is "shadow [corner] <color>"; "bottom_right"
is the default corner if you don't specify one. For a 3-D embossed
look, "emboss <dark_color> <light_color>". The opposite, a carved-
out look, can be had with "carved <dark_color> <light_color>". (Of
course, with those last two, the 3-D look will only work if you
choose the colors wisely.)
Those are all the shortcuts. The long way is to specify a series of
corner/color pairs, like "tl blue" for top-left blue, or
"bottom_right green". You can abbreviate using "tl," "tr," "bl," or
"br," or you can spell out "top_left," "top_right," "bottom_left," or
"bottom_right." If you omit a corner name, the first one defaults to
top-left, the second to top-right, and so on as listed above.
SVN revision: 2714
2000-05-26 20:41:22 -07:00
|
|
|
static char *rs_font_effects = NULL;
|
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
|
|
|
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
|
|
|
static char *rs_bigfont_key = NULL;
|
|
|
|
static char *rs_smallfont_key = NULL;
|
|
|
|
#endif
|
|
|
|
#ifdef MULTI_CHARSET
|
|
|
|
static char *rs_multichar_encoding = NULL;
|
|
|
|
#endif
|
|
|
|
#ifdef GREEK_SUPPORT
|
|
|
|
static char *rs_greek_keyboard = NULL;
|
|
|
|
#endif
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2003-08-24 08:09:32 -07:00
|
|
|
unsigned long eterm_options = (ETERM_OPTIONS_SCROLLBAR | ETERM_OPTIONS_SELECT_TRAILING_SPACES);
|
2003-08-25 18:45:11 -07:00
|
|
|
unsigned long vt_options = (VT_OPTIONS_SECONDARY_SCREEN | VT_OPTIONS_OVERSTRIKE_BOLD | VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND |
|
|
|
|
VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND | VT_OPTIONS_COLORS_SUPPRESS_BOLD);
|
2003-08-24 08:09:32 -07:00
|
|
|
unsigned long image_options = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
char *theme_dir = NULL, *user_dir = NULL;
|
2002-05-04 07:25:30 -07:00
|
|
|
char **rs_exec_args = NULL; /* Args to exec (-e or --exec) */
|
|
|
|
char *rs_title = NULL; /* Window title */
|
|
|
|
char *rs_iconName = NULL; /* Icon name */
|
|
|
|
char *rs_geometry = NULL; /* Geometry string */
|
1999-08-17 16:01:18 -07:00
|
|
|
int rs_desktop = -1;
|
|
|
|
char *rs_path = NULL;
|
2002-05-04 07:25:30 -07:00
|
|
|
int rs_saveLines = SAVELINES; /* Lines in the scrollback buffer */
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef USE_XIM
|
1999-11-12 19:15:18 -08:00
|
|
|
char *rs_input_method = NULL;
|
|
|
|
char *rs_preedit_type = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
char *rs_name = NULL;
|
|
|
|
#ifndef NO_BOLDFONT
|
1999-09-28 12:38:43 -07:00
|
|
|
char *rs_boldFont = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef PRINTPIPE
|
|
|
|
char *rs_print_pipe = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
char *rs_cutchars = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
unsigned short rs_min_anchor_size = 0;
|
|
|
|
char *rs_scrollbar_type = NULL;
|
|
|
|
unsigned long rs_scrollbar_width = 0;
|
2000-07-10 14:14:56 -07:00
|
|
|
char *rs_finished_title = NULL;
|
|
|
|
char *rs_finished_text = NULL;
|
1999-08-17 18:12:47 -07:00
|
|
|
char *rs_term_name = NULL;
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
char *rs_pixmapScale = NULL;
|
|
|
|
char *rs_icon = NULL;
|
|
|
|
char *rs_cmod_image = NULL;
|
|
|
|
char *rs_cmod_red = NULL;
|
|
|
|
char *rs_cmod_green = NULL;
|
|
|
|
char *rs_cmod_blue = NULL;
|
2000-07-12 22:18:46 -07:00
|
|
|
unsigned long rs_cache_size = (unsigned long) -1;
|
1999-08-17 18:12:47 -07:00
|
|
|
# ifdef BACKGROUND_CYCLING_SUPPORT
|
|
|
|
char *rs_anim_pixmap_list = NULL;
|
|
|
|
char **rs_anim_pixmaps = NULL;
|
|
|
|
time_t rs_anim_delay = 0;
|
|
|
|
# endif
|
|
|
|
static char *rs_pixmaps[image_max];
|
|
|
|
#endif
|
|
|
|
char *rs_theme = NULL;
|
|
|
|
char *rs_config_file = NULL;
|
2002-05-04 07:25:30 -07:00
|
|
|
#ifdef ESCREEN
|
|
|
|
char *rs_url = NULL;
|
2002-05-13 15:47:08 -07:00
|
|
|
char *rs_hop = NULL;
|
2002-05-22 08:38:35 -07:00
|
|
|
int rs_delay = -1;
|
2002-10-24 20:57:17 -07:00
|
|
|
unsigned char rs_es_dock = BBAR_DOCKED_BOTTOM;
|
|
|
|
char *rs_es_font = NULL;
|
2002-05-04 07:25:30 -07:00
|
|
|
#endif
|
2005-02-23 12:38:24 -08:00
|
|
|
spif_charptr_t rs_beep_command = NULL;
|
2004-12-14 15:24:33 -08:00
|
|
|
spif_uint32_t rs_opacity = 0xffffffff;
|
1999-08-17 18:12:47 -07:00
|
|
|
unsigned int rs_line_space = 0;
|
1999-12-02 18:31:33 -08:00
|
|
|
unsigned int rs_meta_mod = 0, rs_alt_mod = 0, rs_numlock_mod = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef KEYSYM_ATTRIBUTE
|
2002-05-04 07:25:30 -07:00
|
|
|
unsigned char *KeySym_map[256]; /* probably mostly empty */
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
|
|
|
/* recognized when combined with HOTKEY */
|
|
|
|
KeySym ks_bigfont = XK_greater;
|
|
|
|
KeySym ks_smallfont = XK_less;
|
|
|
|
#endif
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2003-08-21 21:09:40 -07:00
|
|
|
/* Eterm options structure */
|
2002-10-04 18:19:41 -07:00
|
|
|
spifopt_t option_list[] = {
|
|
|
|
SPIFOPT_STR_PP('t', "theme", "select a theme", rs_theme),
|
|
|
|
SPIFOPT_STR_PP('X', "config-file", "choose an alternate config file", rs_config_file),
|
|
|
|
SPIFOPT_STR_PP('d', "display", "X server to connect to", display_name),
|
1999-08-17 16:01:18 -07:00
|
|
|
#if DEBUG <= 0
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (support not compiled in)", DEBUG_LEVEL),
|
1999-08-17 16:01:18 -07:00
|
|
|
#elif DEBUG == 1
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (0-1)", DEBUG_LEVEL),
|
1999-08-17 16:01:18 -07:00
|
|
|
#elif DEBUG == 2
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (0-2)", DEBUG_LEVEL),
|
1999-08-17 16:01:18 -07:00
|
|
|
#elif DEBUG == 3
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (0-3)", DEBUG_LEVEL),
|
1999-08-17 16:01:18 -07:00
|
|
|
#elif DEBUG == 4
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (0-4)", DEBUG_LEVEL),
|
|
|
|
#else
|
|
|
|
SPIFOPT_INT_LONG_PP("debug", "level of debugging information to show (0-5)", DEBUG_LEVEL),
|
|
|
|
#endif
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL_LONG_PP("install", "install a private colormap", eterm_options, ETERM_OPTIONS_INSTALL),
|
2002-10-04 18:19:41 -07:00
|
|
|
|
|
|
|
SPIFOPT_ABST_PP('h', "help", "display usage information", usage),
|
|
|
|
SPIFOPT_ABST_LONG_PP("version", "display version and configuration information", version),
|
|
|
|
|
|
|
|
/* =======[ Color options ]======= */
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('r', "reverse-video", "reverse video", vt_options, VT_OPTIONS_REVERSE_VIDEO),
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('b', "background-color", "background color", rs_color[bgColor]),
|
|
|
|
SPIFOPT_STR('f', "foreground-color", "foreground color", rs_color[fgColor]),
|
|
|
|
SPIFOPT_STR_LONG("color0", "color 0", rs_color[minColor]),
|
|
|
|
SPIFOPT_STR_LONG("color1", "color 1", rs_color[minColor + 1]),
|
|
|
|
SPIFOPT_STR_LONG("color2", "color 2", rs_color[minColor + 2]),
|
|
|
|
SPIFOPT_STR_LONG("color3", "color 3", rs_color[minColor + 3]),
|
|
|
|
SPIFOPT_STR_LONG("color4", "color 4", rs_color[minColor + 4]),
|
|
|
|
SPIFOPT_STR_LONG("color5", "color 5", rs_color[minColor + 5]),
|
|
|
|
SPIFOPT_STR_LONG("color6", "color 6", rs_color[minColor + 6]),
|
|
|
|
SPIFOPT_STR_LONG("color7", "color 7", rs_color[minColor + 7]),
|
|
|
|
SPIFOPT_STR_LONG("color8", "color 8", rs_color[minBright]),
|
|
|
|
SPIFOPT_STR_LONG("color9", "color 9", rs_color[minBright + 1]),
|
|
|
|
SPIFOPT_STR_LONG("color10", "color 10", rs_color[minBright + 2]),
|
|
|
|
SPIFOPT_STR_LONG("color11", "color 11", rs_color[minBright + 3]),
|
|
|
|
SPIFOPT_STR_LONG("color12", "color 12", rs_color[minBright + 4]),
|
|
|
|
SPIFOPT_STR_LONG("color13", "color 13", rs_color[minBright + 5]),
|
|
|
|
SPIFOPT_STR_LONG("color14", "color 14", rs_color[minBright + 6]),
|
|
|
|
SPIFOPT_STR_LONG("color15", "color 15", rs_color[minBright + 7]),
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDUNDERLINE
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("colorBD", "bold color", rs_color[colorBD]),
|
|
|
|
SPIFOPT_STR_LONG("colorUL", "underline color", rs_color[colorUL]),
|
|
|
|
#endif /* NO_BOLDUNDERLINE */
|
|
|
|
SPIFOPT_STR_LONG("pointer-color", "mouse pointer color", rs_color[pointerColor]),
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_CURSORCOLOR
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('c', "cursor-color", "cursor color", rs_color[cursorColor]),
|
|
|
|
SPIFOPT_STR_LONG("cursor-text-color", "cursor text color", rs_color[cursorColor2]),
|
|
|
|
#endif /* NO_CURSORCOLOR */
|
|
|
|
|
2002-06-28 13:44:40 -07:00
|
|
|
/* =======[ X11 options ]======= */
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('g', "geometry", "WxH+X+Y = size and position", rs_geometry),
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('i', "iconic", "start iconified", eterm_options, ETERM_OPTIONS_ICONIC),
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('n', "name", "client instance, icon, and title strings", rs_name),
|
|
|
|
SPIFOPT_STR('T', "title", "title string", rs_title),
|
|
|
|
SPIFOPT_STR_LONG("icon-name", "icon name", rs_iconName),
|
|
|
|
SPIFOPT_STR('B', "scrollbar-type", "choose the scrollbar type (motif, next, xterm)", rs_scrollbar_type),
|
|
|
|
SPIFOPT_INT_LONG("scrollbar-width", "choose the width (in pixels) of the scrollbar", rs_scrollbar_width),
|
|
|
|
SPIFOPT_INT('D', "desktop", "desktop to start on (requires compliant WM)", rs_desktop),
|
|
|
|
SPIFOPT_INT_LONG("line-space", "number of extra dots between lines", rs_line_space),
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDFONT
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("bold-font", "bold text font", rs_boldFont),
|
|
|
|
#endif
|
|
|
|
SPIFOPT_STR('F', "font", "normal text font", rs_font[0]),
|
|
|
|
SPIFOPT_INT_LONG("default-font-index", "set the index of the default font", def_font_idx),
|
|
|
|
SPIFOPT_STR_LONG("font1", "font 1", rs_font[1]),
|
|
|
|
SPIFOPT_STR_LONG("font2", "font 2", rs_font[2]),
|
|
|
|
SPIFOPT_STR_LONG("font3", "font 3", rs_font[3]),
|
|
|
|
SPIFOPT_STR_LONG("font4", "font 4", rs_font[4]),
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL_LONG("proportional", "toggle proportional font optimizations", vt_options, VT_OPTIONS_PROPORTIONAL),
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("font-fx", "specify font effects for the terminal fonts", rs_font_effects),
|
|
|
|
|
2002-06-28 13:44:40 -07:00
|
|
|
/* =======[ Pixmap options ]======= */
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('P', "background-pixmap", "background pixmap", rs_pixmaps[image_bg]),
|
|
|
|
SPIFOPT_STR('I', "icon", "icon pixmap", rs_icon),
|
|
|
|
SPIFOPT_STR_LONG("up-arrow-pixmap", "up arrow pixmap", rs_pixmaps[image_up]),
|
|
|
|
SPIFOPT_STR_LONG("down-arrow-pixmap", "down arrow pixmap", rs_pixmaps[image_down]),
|
|
|
|
SPIFOPT_STR_LONG("trough-pixmap", "scrollbar background (trough) pixmap", rs_pixmaps[image_sb]),
|
|
|
|
SPIFOPT_STR_LONG("anchor-pixmap", "scrollbar anchor pixmap", rs_pixmaps[image_sa]),
|
|
|
|
SPIFOPT_STR_LONG("menu-pixmap", "menu pixmap", rs_pixmaps[image_menu]),
|
2004-12-14 15:24:33 -08:00
|
|
|
SPIFOPT_INT('o', "opacity", "window opacity (0-255; requires X COMPOSITE extension)", rs_opacity),
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('O', "trans", "creates a pseudo-transparent Eterm", image_options, IMAGE_OPTIONS_TRANS),
|
|
|
|
SPIFOPT_BOOL('0', "itrans", "use immotile-optimized transparency", image_options, IMAGE_OPTIONS_ITRANS),
|
|
|
|
SPIFOPT_BOOL_LONG("viewport-mode", "use viewport mode for the background image", image_options, IMAGE_OPTIONS_VIEWPORT),
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG("shade", "old-style shade percentage (deprecated)", rs_shade),
|
|
|
|
SPIFOPT_STR_LONG("tint", "old-style tint mask (deprecated)", rs_tint),
|
|
|
|
SPIFOPT_STR_LONG("cmod", "image color modifier (\"brightness contrast gamma\")", rs_cmod_image),
|
|
|
|
SPIFOPT_STR_LONG("cmod-red", "red-only color modifier (\"brightness contrast gamma\")", rs_cmod_red),
|
|
|
|
SPIFOPT_STR_LONG("cmod-green", "green-only color modifier (\"brightness contrast gamma\")", rs_cmod_green),
|
|
|
|
SPIFOPT_STR_LONG("cmod-blue", "blue-only color modifier (\"brightness contrast gamma\")", rs_cmod_blue),
|
|
|
|
SPIFOPT_STR('p', "path", "pixmap file search path", rs_path),
|
|
|
|
SPIFOPT_INT_LONG("cache", "set Imlib2 image/pixmap cache size", rs_cache_size),
|
1999-08-17 16:01:18 -07:00
|
|
|
# ifdef BACKGROUND_CYCLING_SUPPORT
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('N', "anim", "a delay and list of pixmaps for cycling", rs_anim_pixmap_list),
|
|
|
|
# endif /* BACKGROUND_CYCLING_SUPPORT */
|
|
|
|
#endif /* PIXMAP_SUPPORT */
|
|
|
|
|
2002-06-28 13:44:40 -07:00
|
|
|
/* =======[ Kanji options ]======= */
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef MULTI_CHARSET
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('M', "mfont", "normal text multichar font", rs_mfont[0]),
|
|
|
|
SPIFOPT_STR_LONG("mfont1", "multichar font 1", rs_mfont[1]),
|
|
|
|
SPIFOPT_STR_LONG("mfont2", "multichar font 2", rs_mfont[2]),
|
|
|
|
SPIFOPT_STR_LONG("mfont3", "multichar font 3", rs_mfont[3]),
|
|
|
|
SPIFOPT_STR_LONG("mfont4", "multichar font 4", rs_mfont[4]),
|
|
|
|
SPIFOPT_STR_LONG("mencoding", "multichar encoding mode (eucj/sjis/euckr/big5/gb)", rs_multichar_encoding),
|
|
|
|
#endif /* MULTI_CHARSET */
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef USE_XIM
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("input-method", "XIM input method", rs_input_method),
|
|
|
|
SPIFOPT_STR_LONG("preedit-type", "XIM preedit type", rs_preedit_type),
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
2002-10-04 18:19:41 -07:00
|
|
|
|
2002-06-28 13:44:40 -07:00
|
|
|
/* =======[ Toggles ]======= */
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('l', "login-shell", "login shell, prepend - to shell name", eterm_options, ETERM_OPTIONS_LOGIN_SHELL),
|
|
|
|
SPIFOPT_BOOL('s', "scrollbar", "display scrollbar", eterm_options, ETERM_OPTIONS_SCROLLBAR),
|
|
|
|
SPIFOPT_BOOL('u', "utmp-logging", "make a utmp entry", eterm_options, ETERM_OPTIONS_WRITE_UTMP),
|
|
|
|
SPIFOPT_BOOL('v', "visual-bell", "visual bell", vt_options, VT_OPTIONS_VISUAL_BELL),
|
|
|
|
SPIFOPT_BOOL('H', "home-on-output", "jump to bottom on output", vt_options, VT_OPTIONS_HOME_ON_OUTPUT),
|
|
|
|
SPIFOPT_BOOL_LONG("home-on-input", "jump to bottom on input", vt_options, VT_OPTIONS_HOME_ON_INPUT),
|
|
|
|
SPIFOPT_BOOL('q', "no-input", "configure for output only", eterm_options, ETERM_OPTIONS_NO_INPUT),
|
|
|
|
SPIFOPT_BOOL_LONG("scrollbar-right", "display the scrollbar on the right", eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT),
|
|
|
|
SPIFOPT_BOOL_LONG("scrollbar-floating", "display the scrollbar with no trough", eterm_options, ETERM_OPTIONS_SCROLLBAR_FLOATING),
|
|
|
|
SPIFOPT_BOOL_LONG("scrollbar-popup", "popup the scrollbar only when focused", eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP),
|
|
|
|
SPIFOPT_BOOL('x', "borderless", "force Eterm to have no borders", eterm_options, ETERM_OPTIONS_BORDERLESS),
|
2003-08-25 18:45:11 -07:00
|
|
|
SPIFOPT_BOOL_LONG("overstrike-bold", "simulate bold by overstriking characters", vt_options, VT_OPTIONS_OVERSTRIKE_BOLD),
|
|
|
|
SPIFOPT_BOOL_LONG("bold-brightens-foreground", "\"bold\" attribute brightens foreground color", vt_options, VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND),
|
|
|
|
SPIFOPT_BOOL_LONG("blink-brightens-background", "\"blink\" attribute brightens background color", vt_options, VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND),
|
|
|
|
SPIFOPT_BOOL_LONG("colors-suppress-bold", "do not make ANSI colors 0-16 bold", vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD),
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_MAPALERT
|
|
|
|
# ifdef MAPALERT_OPTION
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('m', "map-alert", "uniconify on beep", vt_options, VT_OPTIONS_MAP_ALERT),
|
1999-08-17 16:01:18 -07:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#ifdef META8_OPTION
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('8', "meta-8", "Meta key toggles 8-bit", vt_options, VT_OPTIONS_META8),
|
|
|
|
#endif
|
|
|
|
SPIFOPT_BOOL_LONG("double-buffer", "reduce exposes using double-buffering (and more memory)", eterm_options, ETERM_OPTIONS_DOUBLE_BUFFER),
|
|
|
|
SPIFOPT_BOOL_LONG("no-cursor", "disable the text cursor", eterm_options, ETERM_OPTIONS_NO_CURSOR),
|
|
|
|
SPIFOPT_BOOL_LONG("pause", "pause after the child process exits", eterm_options, ETERM_OPTIONS_PAUSE),
|
|
|
|
SPIFOPT_BOOL_LONG("xterm-select", "duplicate xterm's selection behavior", eterm_options, ETERM_OPTIONS_XTERM_SELECT),
|
|
|
|
SPIFOPT_BOOL_LONG("select-line", "triple-click selects whole line", eterm_options, ETERM_OPTIONS_SELECT_WHOLE_LINE),
|
|
|
|
SPIFOPT_BOOL_LONG("select-trailing-spaces", "do not skip trailing spaces when selecting", eterm_options, ETERM_OPTIONS_SELECT_TRAILING_SPACES),
|
|
|
|
SPIFOPT_BOOL_LONG("report-as-keysyms", "report special keys as keysyms", vt_options, VT_OPTIONS_REPORT_AS_KEYSYMS),
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_BOOL_LONG("buttonbar", "toggle the display of all buttonbars", rs_buttonbars, BBAR_FORCE_TOGGLE),
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL_LONG("resize-gravity", "toggle gravitation to nearest corner on resize", eterm_options, ETERM_OPTIONS_RESIZE_GRAVITY),
|
|
|
|
SPIFOPT_BOOL_LONG("secondary-screen", "toggle use of secondary screen", vt_options, VT_OPTIONS_SECONDARY_SCREEN),
|
2002-10-04 18:19:41 -07:00
|
|
|
|
|
|
|
/* =======[ Keyboard options ]======= */
|
1999-08-17 16:01:18 -07:00
|
|
|
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("big-font-key", "keysym for font size increase", rs_bigfont_key),
|
|
|
|
SPIFOPT_STR_LONG("small-font-key", "keysym for font size decrease", rs_smallfont_key),
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT_LONG("meta-mod", "modifier to interpret as the Meta key", rs_meta_mod),
|
|
|
|
SPIFOPT_INT_LONG("alt-mod", "modifier to interpret as the Alt key", rs_alt_mod),
|
|
|
|
SPIFOPT_INT_LONG("numlock-mod", "modifier to interpret as the NumLock key", rs_numlock_mod),
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef GREEK_SUPPORT
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("greek-keyboard", "greek keyboard mapping (iso or ibm)", rs_greek_keyboard),
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_BOOL_LONG("app-keypad", "application keypad mode", PrivateModes, PrivMode_aplKP),
|
|
|
|
SPIFOPT_BOOL_LONG("app-cursor", "application cursor key mode", PrivateModes, PrivMode_aplCUR),
|
|
|
|
|
2002-06-28 13:44:40 -07:00
|
|
|
/* =======[ Misc options ]======= */
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT('L', "save-lines", "lines to save in scrollback buffer", rs_saveLines),
|
|
|
|
SPIFOPT_INT_LONG("min-anchor-size", "minimum size of the scrollbar anchor", rs_min_anchor_size),
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef BORDER_WIDTH_OPTION
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_INT('w', "border-width", "term window border width", TermWin.internalBorder),
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PRINTPIPE
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("print-pipe", "print command", rs_print_pipe),
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef CUTCHAR_OPTION
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR_LONG("cut-chars", "seperators for double-click selection", rs_cutchars),
|
|
|
|
#endif /* CUTCHAR_OPTION */
|
|
|
|
SPIFOPT_STR_LONG("finished-title", "post-termination window title text", rs_finished_title),
|
|
|
|
SPIFOPT_STR_LONG("finished-text", "post-termination terminal text", rs_finished_text),
|
|
|
|
SPIFOPT_STR_LONG("term-name", "value to use for setting $TERM", rs_term_name),
|
|
|
|
SPIFOPT_STR_LONG("pipe-name", "filename of console pipe to emulate -C", rs_pipe_name),
|
2005-02-23 12:38:24 -08:00
|
|
|
SPIFOPT_STR_LONG("beep-command", "command to run instead of normal beep", rs_beep_command),
|
2002-06-08 08:44:08 -07:00
|
|
|
#ifdef ESCREEN
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_STR('U', "url", "a URL pointing to a screen session to pick up", rs_url),
|
|
|
|
SPIFOPT_STR('Z', "firewall", "connect session via forwarded port", rs_hop),
|
|
|
|
SPIFOPT_INT('z', "delay", "initial delay in seconds", rs_delay),
|
2002-06-08 08:44:08 -07:00
|
|
|
#endif
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_ABST('a', "attribute", "parse an attribute in the specified context", handle_attribute),
|
2003-08-24 08:09:32 -07:00
|
|
|
SPIFOPT_BOOL('C', "console", "grab console messages", vt_options, VT_OPTIONS_CONSOLE),
|
2002-10-04 18:19:41 -07:00
|
|
|
SPIFOPT_ARGS('e', "exec", "execute a command rather than a shell", rs_exec_args)
|
1999-08-17 16:01:18 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Print usage information */
|
|
|
|
#define INDENT "5"
|
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("Eterm Enlightened Terminal Emulator for the X Window System\n");
|
2004-01-11 14:10:29 -08:00
|
|
|
printf("Copyright (c) 1997-2004, " AUTHORS "\n\n");
|
2002-10-04 18:19:41 -07:00
|
|
|
|
2003-08-21 20:19:43 -07:00
|
|
|
printf("OPTION types:\n");
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" (bool) -- Boolean option ('1', 'on', 'yes', or 'true' to activate, '0', 'off', 'no', or 'false' to deactivate)\n");
|
|
|
|
printf(" (int) -- Integer option (any signed number of reasonable value, usually in decimal/octal/hex)\n");
|
2002-10-04 18:19:41 -07:00
|
|
|
printf(" (str) -- String option (be sure to quote strings if needed to avoid shell expansion)\n");
|
|
|
|
printf(" (strs) -- Stringlist option (quoting strings will be split on whitespace)\n\n");
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
printf("NOTE: Long options can be separated from their values by an equal sign ('='), or you can\n");
|
|
|
|
printf(" pass the value as the following argument on the command line (e.g., '--scrollbar 0'\n");
|
|
|
|
printf(" or '--scrollbar=0'). Short options must have their values passed after them on the\n");
|
|
|
|
printf(" command line, and in the case of boolean short options, cannot have values (they\n");
|
|
|
|
printf(" default to true) (e.g., '-F shine' or '-s').\n");
|
|
|
|
|
|
|
|
printf("\nPlease consult the Eterm(1) man page for more detailed\n");
|
|
|
|
printf("information on command line options.\n\n");
|
2002-10-04 18:19:41 -07:00
|
|
|
|
|
|
|
spifopt_usage();
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Print version and configuration information */
|
|
|
|
static void
|
|
|
|
version(void)
|
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("Eterm " VERSION "\n");
|
2004-01-11 14:10:29 -08:00
|
|
|
printf("Copyright (c) 1997-2004, " AUTHORS "\n\n");
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
printf("Build info:\n");
|
|
|
|
printf(" Built on " BUILD_DATE "\n");
|
|
|
|
printf(" " ACTIONS_IDENT "\n"
|
|
|
|
" " BUTTONS_IDENT "\n"
|
|
|
|
" " COMMAND_IDENT "\n"
|
|
|
|
" " DRAW_IDENT "\n"
|
|
|
|
" " E_IDENT "\n"
|
|
|
|
" " EVENTS_IDENT "\n"
|
|
|
|
" " FONT_IDENT "\n"
|
|
|
|
" " GRKELOT_IDENT "\n"
|
|
|
|
" " MAIN_IDENT "\n"
|
|
|
|
" " MENUS_IDENT "\n"
|
|
|
|
" " MISC_IDENT "\n"
|
|
|
|
" " NETDISP_IDENT "\n"
|
|
|
|
" " OPTIONS_IDENT "\n"
|
|
|
|
" " PIXMAP_IDENT "\n"
|
|
|
|
" " SCREEN_IDENT "\n"
|
|
|
|
" " SCROLLBAR_IDENT "\n"
|
2002-10-04 18:19:41 -07:00
|
|
|
" " STARTUP_IDENT "\n"
|
2005-02-23 12:38:24 -08:00
|
|
|
" " SYSTEM_IDENT "\n"
|
|
|
|
" " TERM_IDENT "\n"
|
|
|
|
" " TIMER_IDENT "\n"
|
|
|
|
" " UTMP_IDENT "\n"
|
|
|
|
" " WINDOWS_IDENT "\n" "\n");
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
printf("Debugging configuration: ");
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef DEBUG
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("DEBUG=%d", DEBUG);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("-DEBUG");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if DEBUG >= DEBUG_SCREEN
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_SCREEN");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_CMD
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_CMD");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_TTY
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_TTY");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_SELECTION
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_SELECTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_UTMP
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_UTMP");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2003-08-21 21:09:40 -07:00
|
|
|
#if DEBUG >= DEBUG_OPTIONS
|
|
|
|
printf(" +DEBUG_OPTIONS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_IMLIB
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_IMLIB");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_PIXMAP
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_PIXMAP");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_EVENTS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_EVENTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2000-08-30 22:41:44 -07:00
|
|
|
#if DEBUG >= DEBUG_MEM
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_MEM");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_X11
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_X11");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_MENU
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_MENU");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_TTYMODE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_TTYMODE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_COLORS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_COLORS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#if DEBUG >= DEBUG_X
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEBUG_X");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("\n\nCompile-time toggles: ");
|
1999-08-17 16:01:18 -07:00
|
|
|
|
|
|
|
#ifdef PROFILE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +PROFILE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PROFILE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PROFILE_SCREEN
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +PROFILE_SCREEN");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PROFILE_SCREEN");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PROFILE_X_EVENTS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +PROFILE_X_EVENTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PROFILE_X_EVENTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef COUNT_X_EVENTS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +COUNT_X_EVENTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -COUNT_X_EVENTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef OPTIMIZE_HACKS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +OPTIMIZE_HACKS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -OPTIMIZE_HACKS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +PIXMAP_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PIXMAP_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PIXMAP_OFFSET
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +PIXMAP_OFFSET");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PIXMAP_OFFSET");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef BACKGROUND_CYCLING_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +BACKGROUND_CYCLING_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -BACKGROUND_CYCLING_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef USE_EFFECTS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +USE_EFFECTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -USE_EFFECTS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_CURSORCOLOR
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_CURSORCOLOR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_CURSORCOLOR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_BOLDUNDERLINE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_BOLDUNDERLINE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_BOLDUNDERLINE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_BOLDFONT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_BOLDFONT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_BOLDFONT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_SECONDARY_SCREEN
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_SECONDARY_SCREEN");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_SECONDARY_SCREEN");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef FORCE_CLEAR_CHARS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +FORCE_CLEAR_CHARS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -FORCE_CLEAR_CHARS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PREFER_24BIT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +PREFER_24BIT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PREFER_24BIT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef OFFIX_DND
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +OFFIX_DND");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -OFFIX_DND");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef BORDER_WIDTH_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +BORDER_WIDTH_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -BORDER_WIDTH_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_DELETE_KEY
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_DELETE_KEY");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_DELETE_KEY");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef FORCE_BACKSPACE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +FORCE_BACKSPACE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -FORCE_BACKSPACE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef FORCE_DELETE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +FORCE_DELETE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -FORCE_DELETE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef HOTKEY_CTRL
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +HOTKEY_CTRL");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -HOTKEY_CTRL");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef HOTKEY_META
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +HOTKEY_META");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -HOTKEY_META");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef LINUX_KEYS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +LINUX_KEYS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -LINUX_KEYS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef KEYSYM_ATTRIBUTE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +KEYSYM_ATTRIBUTE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -KEYSYM_ATTRIBUTE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef USE_XIM
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +XIM");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -XIM");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef UNSHIFTED_SCROLLKEYS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +UNSHIFTED_SCROLLKEYS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -UNSHIFTED_SCROLLKEYS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_SCROLLBAR_REPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_SCROLLBAR_REPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_SCROLLBAR_REPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef CUTCHAR_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +CUTCHAR_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -CUTCHAR_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef MOUSE_REPORT_DOUBLECLICK
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +MOUSE_REPORT_DOUBLECLICK");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -MOUSE_REPORT_DOUBLECLICK");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef XTERM_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +XTERM_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -XTERM_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef MOTIF_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +MOTIF_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -MOTIF_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NEXT_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NEXT_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NEXT_SCROLLBAR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +SCROLLBAR_BUTTON_CONTINUAL_SCROLLING");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -SCROLLBAR_BUTTON_CONTINUAL_SCROLLING");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef META8_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +META8_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -META8_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef GREEK_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +GREEK_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -GREEK_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +MULTI_CHARSET");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -MULTI_CHARSET");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef DISPLAY_IS_IP
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DISPLAY_IS_IP");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -DISPLAY_IS_IP");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_DISPLAY_ANSWER
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +ENABLE_DISPLAY_ANSWER");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -ENABLE_DISPLAY_ANSWER");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_VT100_ANS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_VT100_ANS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_VT100_ANS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef XTERM_COLOR_CHANGE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +XTERM_COLOR_CHANGE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -XTERM_COLOR_CHANGE");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef DEFINE_XTERM_COLOR
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +DEFINE_XTERM_COLOR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -DEFINE_XTERM_COLOR");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef NO_MAPALERT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +NO_MAPALERT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -NO_MAPALERT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef MAPALERT_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +MAPALERT_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -MAPALERT_OPTION");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef UTMP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +UTMP_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -UTMP_SUPPORT");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SAVED_UIDS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +HAVE_SAVED_UIDS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -HAVE_SAVED_UIDS");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef ALLOW_BACKQUOTE_EXEC
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +ALLOW_BACKQUOTE_EXEC");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -ALLOW_BACKQUOTE_EXEC");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef WARN_OLDER
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" +WARN_OLDER");
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -WARN_OLDER");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-10-29 20:44:36 -08:00
|
|
|
#ifdef ESCREEN
|
|
|
|
printf(" +ESCREEN");
|
|
|
|
#else
|
|
|
|
printf(" -ESCREEN");
|
|
|
|
#endif
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("\n\nCompile-time definitions:\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
|
|
|
|
#ifdef PATH_ENV
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" PATH_ENV=\"%s\"\n", safe_print_string(PATH_ENV, sizeof(PATH_ENV) - 1));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PATH_ENV\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef REFRESH_PERIOD
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" REFRESH_PERIOD=%d\n", REFRESH_PERIOD);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -REFRESH_PERIOD\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PRINTPIPE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" PRINTPIPE=\"%s\"\n", safe_print_string(PRINTPIPE, sizeof(PRINTPIPE) - 1));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PRINTPIPE\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef KS_DELETE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" KS_DELETE=\"%s\"\n", safe_print_string(KS_DELETE, sizeof(KS_DELETE) - 1));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -KS_DELETE\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef SAVELINES
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" SAVELINES=%d\n", SAVELINES);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -SAVELINES\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef CUTCHARS
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" CUTCHARS=\"%s\"\n", safe_print_string(CUTCHARS, sizeof(CUTCHARS) - 1));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -CUTCHARS\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef MULTICLICK_TIME
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" MULTICLICK_TIME=%d\n", MULTICLICK_TIME);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -MULTICLICK_TIME\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef SCROLLBAR_DEFAULT_TYPE
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" SCROLLBAR_DEFAULT_TYPE=%d\n", SCROLLBAR_DEFAULT_TYPE);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -SCROLLBAR_DEFAULT_TYPE\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef SB_WIDTH
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" SB_WIDTH=%d\n", SB_WIDTH);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -SB_WIDTH\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef SCROLLBAR_INITIAL_DELAY
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" SCROLLBAR_INITIAL_DELAY=%d\n", SCROLLBAR_INITIAL_DELAY);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -SCROLLBAR_INITIAL_DELAY\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef SCROLLBAR_CONTINUOUS_DELAY
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" SCROLLBAR_CONTINUOUS_DELAY=%d\n", SCROLLBAR_CONTINUOUS_DELAY);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -SCROLLBAR_CONTINUOUS_DELAY\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef ESCZ_ANSWER
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" ESCZ_ANSWER=\"%s\"\n", safe_print_string(ESCZ_ANSWER, sizeof(ESCZ_ANSWER) - 1));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -ESCZ_ANSWER\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-12-30 04:44:45 -08:00
|
|
|
#ifdef PTY_GRP_NAME
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" PTY_GRP_NAME=\"%s\"\n", PTY_GRP_NAME);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -PTY_GRP_NAME\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_SEARCH_PATH
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" CONFIG_SEARCH_PATH=\"%s\"\n", CONFIG_SEARCH_PATH);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -CONFIG_SEARCH_PATH\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef THEME_CFG
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" THEME_CFG=\"%s\"\n", THEME_CFG);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -THEME_CFG\n");
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
#ifdef USER_CFG
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" USER_CFG=\"%s\"\n", USER_CFG);
|
1999-08-17 18:12:47 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
printf(" -USER_CFG\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
printf("\n");
|
|
|
|
exit(EXIT_SUCCESS);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
2002-10-04 18:19:41 -07:00
|
|
|
static void
|
|
|
|
handle_attribute(char *val_ptr)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-10-04 18:19:41 -07:00
|
|
|
conf_parse_line(NULL, val_ptr);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* The config file parsers. Each function handles a given context. */
|
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
|
|
|
static void *
|
|
|
|
parse_color(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "foreground ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_color[fgColor], get_word(2, buff));
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "background ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_color[bgColor], get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "cursor ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
|
|
|
|
#ifndef NO_CURSORCOLOR
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_color[cursorColor], get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the cursor attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "cursor_text ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_CURSORCOLOR
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_color[cursorColor2], get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the cursor_text attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "pointer ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_color[pointerColor], get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-10-22 20:03:27 -07:00
|
|
|
#ifdef ESCREEN
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "es_current ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_color[ES_COLOR_CURRENT], get_word(2, buff));
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "es_active ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_color[ES_COLOR_ACTIVE], get_word(2, buff));
|
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "video ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp = get_pword(2, buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!BEG_STRCASECMP(tmp, "reverse")) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_REVERSE_VIDEO);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (BEG_STRCASECMP(tmp, "normal")) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid value \"%s\" for attribute video\n",
|
|
|
|
file_peek_path(), file_peek_line(), tmp);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "color ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp = 0, *r1, *g1, *b1;
|
|
|
|
unsigned int n, r, g, b, index = 0;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
n = num_words(buff);
|
|
|
|
if (n < 3) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list \"%s\" for \n"
|
|
|
|
"attribute color", file_peek_path(), file_peek_line(), NONULL(tmp));
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
tmp = get_pword(2, buff);
|
|
|
|
r1 = get_pword(3, buff);
|
|
|
|
if (!isdigit(*r1)) {
|
|
|
|
if (isdigit(*tmp)) {
|
|
|
|
n = strtoul(tmp, (char **) NULL, 0);
|
|
|
|
if (n <= 7) {
|
|
|
|
index = minColor + n;
|
|
|
|
} else if (n >= 8 && n <= 15) {
|
|
|
|
index = minBright + n - 8;
|
|
|
|
}
|
|
|
|
RESET_AND_ASSIGN(rs_color[index], get_word(1, r1));
|
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
if (!BEG_STRCASECMP(tmp, "bd ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDUNDERLINE
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_color[colorBD], get_word(1, r1));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the color bd attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
} else if (!BEG_STRCASECMP(tmp, "ul ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDUNDERLINE
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_color[colorUL], get_word(1, r1));
|
|
|
|
#else
|
|
|
|
print_warning("Support for the color ul attribute was not compiled in, ignoring\n");
|
|
|
|
#endif
|
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
tmp = get_word(1, tmp);
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid color index \"%s\"\n",
|
|
|
|
file_peek_path(), file_peek_line(), NONULL(tmp));
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(tmp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (n != 5) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list \"%s\" for \n"
|
|
|
|
"attribute color", file_peek_path(), file_peek_line(), NONULL(tmp));
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
g1 = get_pword(4, buff);
|
|
|
|
b1 = get_pword(5, buff);
|
|
|
|
if (isdigit(*tmp)) {
|
|
|
|
n = strtoul(tmp, (char **) NULL, 0);
|
|
|
|
r = strtoul(r1, (char **) NULL, 0);
|
|
|
|
g = strtoul(g1, (char **) NULL, 0);
|
|
|
|
b = strtoul(b1, (char **) NULL, 0);
|
|
|
|
if (n <= 7) {
|
|
|
|
index = minColor + n;
|
|
|
|
RESET_AND_ASSIGN(rs_color[index], MALLOC(14));
|
|
|
|
sprintf(rs_color[index], "#%02x%02x%02x", r, g, b);
|
|
|
|
} else if (n >= 8 && n <= 15) {
|
|
|
|
index = minBright + n - 8;
|
|
|
|
RESET_AND_ASSIGN(rs_color[index], MALLOC(14));
|
|
|
|
sprintf(rs_color[index], "#%02x%02x%02x", r, g, b);
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid color index %lu\n", file_peek_path(), file_peek_line(), n);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(tmp, "bd ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDUNDERLINE
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_color[colorBD], MALLOC(14));
|
|
|
|
r = strtoul(r1, (char **) NULL, 0);
|
|
|
|
g = strtoul(g1, (char **) NULL, 0);
|
|
|
|
b = strtoul(b1, (char **) NULL, 0);
|
|
|
|
sprintf(rs_color[colorBD], "#%02x%02x%02x", r, g, b);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the color bd attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(tmp, "ul ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDUNDERLINE
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_color[colorUL], MALLOC(14));
|
|
|
|
r = strtoul(r1, (char **) NULL, 0);
|
|
|
|
g = strtoul(g1, (char **) NULL, 0);
|
|
|
|
b = strtoul(b1, (char **) NULL, 0);
|
|
|
|
sprintf(rs_color[colorUL], "#%02x%02x%02x", r, g, b);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the color ul attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
tmp = get_word(1, tmp);
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid color index \"%s\"\n", file_peek_path(), file_peek_line(), NONULL(tmp));
|
|
|
|
FREE(tmp);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context color\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return state;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_attributes(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "geometry ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_geometry, get_word(2, buff));
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "title ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_title, get_word(2, buff));
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "name ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_name, get_word(2, buff));
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "iconname ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_iconName, get_word(2, buff));
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "desktop ")) {
|
|
|
|
rs_desktop = (int) strtol(buff, (char **) NULL, 0);
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "scrollbar_type ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_scrollbar_type, get_word(2, buff));
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "scrollbar_width ")) {
|
|
|
|
rs_scrollbar_width = strtoul(get_pword(2, buff), (char **) NULL, 0);
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "font ")) {
|
|
|
|
|
|
|
|
char *tmp = get_pword(2, buff);
|
2003-11-07 09:28:42 -08:00
|
|
|
unsigned long n;
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
if (!BEG_STRCASECMP(tmp, "fx ") || !BEG_STRCASECMP(tmp, "effect")) {
|
|
|
|
if (parse_font_fx(get_pword(2, tmp)) != 1) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Syntax error in font effects specification\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(tmp, "prop")) {
|
|
|
|
tmp = get_pword(2, tmp);
|
|
|
|
if (BOOL_OPT_ISTRUE(tmp)) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_PROPORTIONAL);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_PROPORTIONAL);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid/missing boolean value for attribute proportional\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (isdigit(*tmp)) {
|
2003-11-07 09:28:42 -08:00
|
|
|
n = strtoul(tmp, (char **) NULL, 0);
|
2002-05-04 07:25:30 -07:00
|
|
|
if (n <= 255) {
|
|
|
|
eterm_font_add(&etfonts, get_pword(2, tmp), n);
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid font index %d\n", file_peek_path(), file_peek_line(), n);
|
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(tmp, "bold ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifndef NO_BOLDFONT
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_boldFont, get_word(2, tmp));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the bold font attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(tmp, "default ")) {
|
|
|
|
def_font_idx = strtoul(get_pword(2, tmp), (char **) NULL, 0);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
tmp = get_word(1, tmp);
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid font index \"%s\"\n", file_peek_path(), file_peek_line(), NONULL(tmp));
|
|
|
|
FREE(tmp);
|
|
|
|
}
|
Fri Nov 19 23:05:31 PST 1999 Michael Jennings <mej@eterm.org>
Once again, I've rendered old themes obselete. :-)
I added a new config file attribute and command-line parameter. The
option is --default-font-index, but I wouldn't necessarily use it.
The config file attribute makes more sense. :-)
Anyway, your themes will now need to have a line like this:
font default <index>
in the attributes section. This tells Eterm which font it should use
on startup. (<index> is a number between 0 and the highest-numbered
font you define.) You can now have up to 256 fonts. Font 0 is no
longer necessarily the default font; it is the smallest font. And the
larger the font index, the larger the font should be. (Of course,
this assumes you want Ctrl-> and Ctrl-< to increase/decrease your font
size. In reality, you can have your fonts in any order, and those
keys will cycle through them in order.)
Before, font 0 was always the default, and you didn't have much
freedom in rearranging your fonts. Plus, you were limited to 5. Not
any more. :-) The new system is much more straight-forward, logical,
and powerful.
So please be sure to update your themes by hand, or remove your theme
directory before installing this new version. If your theme lacks
the "font default" line, your Eterms will start with the wrong font.
:-]
SVN revision: 1344
1999-11-19 21:17:29 -08:00
|
|
|
|
1999-08-17 16:01:18 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context attributes\n",
|
|
|
|
file_peek_path(), file_peek_line(), (buff ? buff : ""));
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return state;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_toggles(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp;
|
|
|
|
unsigned char bool_val;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!(tmp = get_pword(2, buff))) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing boolean value in context toggles\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (BOOL_OPT_ISTRUE(tmp)) {
|
|
|
|
bool_val = 1;
|
|
|
|
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
|
|
|
bool_val = 0;
|
1999-08-17 16:01:18 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid boolean value \"%s\" in context toggles\n",
|
|
|
|
file_peek_path(), file_peek_line(), tmp);
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
if (!BEG_STRCASECMP(buff, "map_alert ")) {
|
|
|
|
#if !defined(NO_MAPALERT) && defined(MAPALERT_OPTION)
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_MAP_ALERT);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_MAP_ALERT);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the map_alert attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "visual_bell ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_VISUAL_BELL);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_VISUAL_BELL);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "login_shell ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_LOGIN_SHELL);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_LOGIN_SHELL);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "scrollbar ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SCROLLBAR);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "utmp_logging ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef UTMP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_WRITE_UTMP);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_WRITE_UTMP);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the utmp_logging attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "meta8 ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef META8_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_META8);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_META8);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the meta8 attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "iconic ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_ICONIC);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_ICONIC);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "home_on_output ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_HOME_ON_OUTPUT);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_HOME_ON_OUTPUT);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "home_on_input ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_HOME_ON_INPUT);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_HOME_ON_INPUT);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "no_input ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_NO_INPUT);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_NO_INPUT);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2000-03-30 20:38:01 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "scrollbar_floating ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_FLOATING);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SCROLLBAR_FLOATING);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "scrollbar_right ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "scrollbar_popup ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "borderless ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_BORDERLESS);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_BORDERLESS);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "double_buffer ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_DOUBLE_BUFFER);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_DOUBLE_BUFFER);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-12-10 18:06:33 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "no_cursor ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_NO_CURSOR);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_NO_CURSOR);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "pause ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_PAUSE);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_PAUSE);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "xterm_select ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_XTERM_SELECT);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_XTERM_SELECT);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "select_line ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_SELECT_WHOLE_LINE);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SELECT_WHOLE_LINE);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "select_trailing_spaces ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_SELECT_TRAILING_SPACES);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SELECT_TRAILING_SPACES);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "report_as_keysyms ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_REPORT_AS_KEYSYMS);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_REPORT_AS_KEYSYMS);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "mbyte_cursor ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_MBYTE_CURSOR);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_MBYTE_CURSOR);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2000-12-29 14:59:13 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "itrans ") || !BEG_STRCASECMP(buff, "immotile_trans ")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(image_options, IMAGE_OPTIONS_ITRANS);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(image_options, IMAGE_OPTIONS_ITRANS);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
Mon Mar 6 21:11:13 PST 2000 Michael Jennings <mej@eterm.org>
Added a new option. -0 (that's a zero) or --itrans will invoke the
immotile optimization for transparency, so named because it works best
on windows that don't move around much on the desktop. It works even
better for windows that are sticky between desktops. So if you have
logging windows (running tail -f and the like) that are shaded/tinted,
you definitely want to have this. It will even benefit ordinary Eterm
windows, provided you don't move them around a lot. Eterms that do
not change desktops may be better off with the other way; Eterms that
are not shaded or tinted at all will not behave any differently.
Here's the technical explanation for those who are interested. The
old (and still the default) behavior is for Eterm to check to see if
any color modifiers are applied to the image_bg class, and if so, to
make a copy of the *entire* desktop image which is then shaded/tinted
appropriately. It then snapshots a portion of that for the actual
background. This way, if the Eterm window is moved, all the shading
and tinting will have already been done, so all it has to do is grab
another portion of the desktop and use it. However, this involves a
LOT of calculations (one per pixel of the desktop pixmap) on startup
and at every desktop switch.
The immotile optimization is intended to reverse that logic by
optimizing for windows that do not move (hence the term "immotile").
It takes the snapshot of the desktop pixmap and applies any shading
or tinting *after* taking the portion it needs. This requires much
fewer calculations on startup and when changing desktops, but the
entire set of calculations must be repeated whenever the window is
moved. This is fine for small windows or windows that don't move
very often, but that's not always the case. So it is to your
advantage to pick one or the other depending on how you use each
particular theme or window.
Two notes. One, keep in mind that the -0/--itrans option doesn't
*activate* transparency; you still need -O/--trans for that. Two,
this does not affect Eterms with no color modifiers applied to the
background. In that case, Eterm still references the existing
desktop pixmap to save memory.
SVN revision: 2191
2000-03-06 21:30:33 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "buttonbar")) {
|
|
|
|
if (bool_val) {
|
2002-06-08 08:44:08 -07:00
|
|
|
FOREACH_BUTTONBAR(bbar_set_visible(bbar, 1););
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_buttonbars = 1; /* Reset for future use. */
|
|
|
|
} else {
|
2002-06-08 08:44:08 -07:00
|
|
|
FOREACH_BUTTONBAR(bbar_set_visible(bbar, 0););
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_buttonbars = 1; /* Reset for future use. */
|
|
|
|
}
|
2001-06-25 17:46:33 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "resize_gravity")) {
|
|
|
|
if (bool_val) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_SET(eterm_options, ETERM_OPTIONS_RESIZE_GRAVITY);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_RESIZE_GRAVITY);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2003-08-25 18:45:11 -07:00
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "overstrike_bold ")) {
|
|
|
|
if (bool_val) {
|
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_OVERSTRIKE_BOLD);
|
|
|
|
} else {
|
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_OVERSTRIKE_BOLD);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "bold_brightens_foreground ")) {
|
|
|
|
if (bool_val) {
|
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND);
|
|
|
|
} else {
|
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_BOLD_BRIGHTENS_FOREGROUND);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "blink_brightens_background ")) {
|
|
|
|
if (bool_val) {
|
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND);
|
|
|
|
} else {
|
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_BLINK_BRIGHTENS_BACKGROUND);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "colors_suppress_bold ")) {
|
|
|
|
if (bool_val) {
|
|
|
|
BITFIELD_SET(vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD);
|
|
|
|
} else {
|
|
|
|
BITFIELD_CLEAR(vt_options, VT_OPTIONS_COLORS_SUPPRESS_BOLD);
|
|
|
|
}
|
|
|
|
|
2001-06-25 17:46:33 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context toggles\n", file_peek_path(),
|
|
|
|
file_peek_line(), buff);
|
2001-06-25 17:46:33 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return state;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_keyboard(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "smallfont_key ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_smallfont_key, get_word(2, buff));
|
2003-08-21 20:19:43 -07:00
|
|
|
TO_KEYSYM(&ks_smallfont, rs_smallfont_key);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the smallfont_key attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "bigfont_key ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_bigfont_key, get_word(2, buff));
|
2003-08-21 20:19:43 -07:00
|
|
|
TO_KEYSYM(&ks_bigfont, rs_bigfont_key);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the bigfont_key attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "keysym ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef KEYSYM_ATTRIBUTE
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
int sym, len;
|
|
|
|
char *str = buff + 7, *s;
|
|
|
|
|
|
|
|
sym = (int) strtol(str, (char **) NULL, 0);
|
|
|
|
if (sym != (int) 2147483647L) {
|
|
|
|
|
|
|
|
if (sym >= 0xff00)
|
|
|
|
sym -= 0xff00;
|
|
|
|
if (sym < 0 || sym > 0xff) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Keysym 0x%x out of range 0xff00-0xffff\n",
|
|
|
|
file_peek_path(), file_peek_line(), sym + 0xff00);
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
s = get_word(3, buff);
|
|
|
|
str = (char *) MALLOC(strlen(s) + 2);
|
|
|
|
strcpy(str, s);
|
|
|
|
FREE(s);
|
|
|
|
chomp(str);
|
|
|
|
len = parse_escaped_string(str);
|
|
|
|
if (len > 255)
|
|
|
|
len = 255; /* We can only handle lengths that will fit in a char */
|
|
|
|
if (len && KeySym_map[sym] == NULL) {
|
|
|
|
|
|
|
|
char *p = MALLOC(len + 1);
|
|
|
|
|
|
|
|
*p = len;
|
|
|
|
strncpy(p + 1, str, len);
|
|
|
|
KeySym_map[sym] = (unsigned char *) p;
|
|
|
|
}
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the keysym attributes was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "meta_mod ")) {
|
|
|
|
char *tmp = get_pword(2, buff);
|
1999-12-02 18:31:33 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!tmp) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Missing modifier value for attribute meta_mod\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
rs_meta_mod = (unsigned int) strtoul(tmp, (char **) NULL, 0);
|
2000-11-24 18:55:40 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "alt_mod ")) {
|
|
|
|
char *tmp = get_pword(2, buff);
|
1999-12-02 18:31:33 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!tmp) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Missing modifier value for attribute alt_mod\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
rs_alt_mod = (unsigned int) strtoul(tmp, (char **) NULL, 0);
|
1999-12-02 18:31:33 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "numlock_mod ")) {
|
|
|
|
char *tmp = get_pword(2, buff);
|
|
|
|
|
|
|
|
if (!tmp) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Missing modifier value for attribute numlock_mod\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
rs_numlock_mod = (unsigned int) strtoul(tmp, (char **) NULL, 0);
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "greek ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef GREEK_SUPPORT
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp = get_pword(2, buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!tmp) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Missing boolean value for attribute greek\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (BOOL_OPT_ISTRUE(tmp)) {
|
|
|
|
RESET_AND_ASSIGN(rs_greek_keyboard, get_word(3, buff));
|
|
|
|
if (BEG_STRCASECMP(rs_greek_keyboard, "iso")) {
|
|
|
|
greek_setmode(GREEK_ELOT928);
|
|
|
|
} else if (BEG_STRCASECMP(rs_greek_keyboard, "ibm")) {
|
|
|
|
greek_setmode(GREEK_IBM437);
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid greek keyboard mode \"%s\"\n",
|
|
|
|
file_peek_path(), file_peek_line(), (rs_greek_keyboard ? rs_greek_keyboard : ""));
|
|
|
|
}
|
|
|
|
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
|
|
|
/* This space intentionally left no longer blank =^) */
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid boolean value \"%s\" for attribute %s\n",
|
|
|
|
file_peek_path(), file_peek_line(), tmp, buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the greek attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "app_keypad ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp = get_pword(2, buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!tmp) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Missing boolean value for attribute app_keypad\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (BOOL_OPT_ISTRUE(tmp)) {
|
|
|
|
PrivateModes |= PrivMode_aplKP;
|
|
|
|
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
|
|
|
PrivateModes &= ~(PrivMode_aplKP);
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid boolean value \"%s\" for attribute app_keypad\n",
|
|
|
|
file_peek_path(), file_peek_line(), tmp);
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "app_cursor ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp = get_pword(2, buff);
|
|
|
|
|
|
|
|
if (!tmp) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Missing boolean value for attribute app_cursor\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (BOOL_OPT_ISTRUE(tmp)) {
|
|
|
|
PrivateModes |= PrivMode_aplCUR;
|
|
|
|
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
|
|
|
PrivateModes &= ~(PrivMode_aplCUR);
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid boolean value \"%s\" for attribute app_cursor\n",
|
|
|
|
file_peek_path(), file_peek_line(), tmp);
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context keyboard\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return state;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_misc(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "print_pipe ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef PRINTPIPE
|
2004-04-05 14:00:36 -07:00
|
|
|
RESET_AND_ASSIGN(rs_print_pipe, get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the print_pipe attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "save_lines ")) {
|
|
|
|
rs_saveLines = strtol(get_pword(2, buff), (char **) NULL, 0);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "min_anchor_size ")) {
|
|
|
|
rs_min_anchor_size = strtol(get_pword(2, buff), (char **) NULL, 0);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "border_width ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef BORDER_WIDTH_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
TermWin.internalBorder = (short) strtol(get_pword(2, buff), (char **) NULL, 0);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the border_width attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "line_space ")) {
|
|
|
|
rs_line_space = strtol(get_pword(2, buff), (char **) NULL, 0);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "finished_title ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_finished_title, get_word(2, buff));
|
2000-07-10 14:14:56 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "finished_text ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_finished_text, get_word(2, buff));
|
2000-07-10 14:14:56 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "term_name ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_term_name, get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2005-02-23 12:38:24 -08:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "beep_command ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_beep_command, get_word(2, buff));
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "debug ")) {
|
|
|
|
DEBUG_LEVEL = (unsigned int) strtoul(get_pword(2, buff), (char **) NULL, 0);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "exec ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
register unsigned short k, n;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_exec_args, (char **) MALLOC(sizeof(char *) * ((n = num_words(get_pword(2, buff))) + 1)));
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
for (k = 0; k < n; k++) {
|
|
|
|
rs_exec_args[k] = get_word(k + 2, buff);
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("rs_exec_args[%d] == %s\n", k, rs_exec_args[k]));
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
rs_exec_args[n] = (char *) NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "cut_chars ")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef CUTCHAR_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_cutchars, get_word(2, buff));
|
|
|
|
chomp(rs_cutchars);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the cut_chars attribute was not compiled in, ignoring\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context misc\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return state;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_imageclasses(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!BEG_STRCASECMP(buff, "icon ")) {
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
RESET_AND_ASSIGN(rs_icon, get_word(2, buff));
|
2000-05-02 16:46:08 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Pixmap support was not compiled in, ignoring \"icon\" attribute\n");
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "cache")) {
|
2000-07-12 22:18:46 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_cache_size = strtoul(get_pword(2, buff), (char **) NULL, 0);
|
2000-07-12 22:18:46 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Pixmap support was not compiled in, ignoring \"cache\" attribute\n");
|
2000-07-12 22:18:46 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "path ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_path, get_word(2, buff));
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "anim ")) {
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef BACKGROUND_CYCLING_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp = get_pword(2, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (tmp) {
|
|
|
|
rs_anim_pixmap_list = STRDUP(tmp);
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list \"\" for attribute anim\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2000-05-02 16:46:08 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_warning("Support for the anim attribute was not compiled in, ignoring\n");
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context imageclasses\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return state;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_image(char *buff, void *state)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
int idx;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (*buff == CONF_BEGIN_CHAR) {
|
|
|
|
int *tmp;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
tmp = (int *) MALLOC(sizeof(int));
|
|
|
|
*tmp = -1;
|
|
|
|
return ((void *) tmp);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
ASSERT_RVAL(state != NULL, (void *) (file_skip_to_end(), NULL));
|
|
|
|
if (*buff == CONF_END_CHAR) {
|
|
|
|
int *tmp;
|
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
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
tmp = (int *) state;
|
|
|
|
FREE(tmp);
|
|
|
|
return NULL;
|
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
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
idx = *((int *) state);
|
|
|
|
if (!BEG_STRCASECMP(buff, "type ")) {
|
|
|
|
char *type = get_pword(2, buff);
|
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
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!type) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing image type\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!strcasecmp(type, "background")) {
|
|
|
|
idx = image_bg;
|
|
|
|
} else if (!strcasecmp(type, "trough")) {
|
|
|
|
idx = image_sb;
|
|
|
|
} else if (!strcasecmp(type, "anchor")) {
|
|
|
|
idx = image_sa;
|
|
|
|
} else if (!strcasecmp(type, "thumb")) {
|
|
|
|
idx = image_st;
|
|
|
|
} else if (!strcasecmp(type, "up_arrow")) {
|
|
|
|
idx = image_up;
|
|
|
|
} else if (!strcasecmp(type, "down_arrow")) {
|
|
|
|
idx = image_down;
|
|
|
|
} else if (!strcasecmp(type, "left_arrow")) {
|
|
|
|
idx = image_left;
|
|
|
|
} else if (!strcasecmp(type, "right_arrow")) {
|
|
|
|
idx = image_right;
|
|
|
|
} else if (!strcasecmp(type, "menu")) {
|
|
|
|
idx = image_menu;
|
|
|
|
} else if (!strcasecmp(type, "menuitem")) {
|
|
|
|
idx = image_menuitem;
|
|
|
|
} else if (!strcasecmp(type, "submenu")) {
|
|
|
|
idx = image_submenu;
|
|
|
|
} else if (!strcasecmp(type, "button")) {
|
|
|
|
idx = image_button;
|
|
|
|
} else if (!strcasecmp(type, "button_bar") || !strcasecmp(type, "buttonbar")) {
|
|
|
|
idx = image_bbar;
|
|
|
|
} else if (!strcasecmp(type, "grab_bar")) {
|
|
|
|
idx = image_gbar;
|
|
|
|
} else if (!strcasecmp(type, "dialog_box")) {
|
|
|
|
idx = image_dialog;
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid image type \"%s\"\n", file_peek_path(), file_peek_line(), type);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
*((int *) state) = idx;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "mode ")) {
|
|
|
|
char *mode = get_pword(2, buff);
|
|
|
|
char *allow_list = get_pword(4, buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"mode\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!mode) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing parameters for mode line\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(mode, "image")) {
|
|
|
|
images[idx].mode = (MODE_IMAGE | ALLOW_IMAGE);
|
|
|
|
} else if (!BEG_STRCASECMP(mode, "trans")) {
|
|
|
|
images[idx].mode = (MODE_TRANS | ALLOW_TRANS);
|
|
|
|
} else if (!BEG_STRCASECMP(mode, "viewport")) {
|
|
|
|
images[idx].mode = (MODE_VIEWPORT | ALLOW_VIEWPORT);
|
|
|
|
} else if (!BEG_STRCASECMP(mode, "auto")) {
|
|
|
|
images[idx].mode = (MODE_AUTO | ALLOW_AUTO);
|
|
|
|
} else if (!BEG_STRCASECMP(mode, "solid")) {
|
|
|
|
images[idx].mode = MODE_SOLID;
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"\n", file_peek_path(), file_peek_line(), mode);
|
|
|
|
}
|
|
|
|
if (allow_list) {
|
|
|
|
char *allow;
|
|
|
|
|
|
|
|
for (; (allow = (char *) strsep(&allow_list, " ")) != NULL;) {
|
2002-11-27 12:18:24 -08:00
|
|
|
if (!BEG_STRCASECMP(allow, "image")) {
|
2002-05-04 07:25:30 -07:00
|
|
|
images[idx].mode |= ALLOW_IMAGE;
|
2002-11-27 12:18:24 -08:00
|
|
|
} else if (!BEG_STRCASECMP(allow, "trans")) {
|
2002-05-04 07:25:30 -07:00
|
|
|
images[idx].mode |= ALLOW_TRANS;
|
2002-11-27 12:18:24 -08:00
|
|
|
} else if (!BEG_STRCASECMP(allow, "viewport")) {
|
2002-05-04 07:25:30 -07:00
|
|
|
images[idx].mode |= ALLOW_VIEWPORT;
|
2002-11-27 12:18:24 -08:00
|
|
|
} else if (!BEG_STRCASECMP(allow, "auto")) {
|
2002-05-04 07:25:30 -07:00
|
|
|
images[idx].mode |= ALLOW_AUTO;
|
2002-11-27 12:18:24 -08:00
|
|
|
} else if (!BEG_STRCASECMP(allow, "solid")) {
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"\n", file_peek_path(), file_peek_line(), allow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "state ")) {
|
|
|
|
char *state = get_pword(2, buff), new = 0;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!state) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing state\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"state\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!strcasecmp(state, "normal")) {
|
|
|
|
if (images[idx].norm == NULL) {
|
|
|
|
images[idx].norm = (simage_t *) MALLOC(sizeof(simage_t));
|
|
|
|
new = 1;
|
|
|
|
}
|
|
|
|
images[idx].current = images[idx].norm;
|
|
|
|
} else if (!strcasecmp(state, "selected")) {
|
|
|
|
if (images[idx].selected == NULL) {
|
|
|
|
images[idx].selected = (simage_t *) MALLOC(sizeof(simage_t));
|
|
|
|
new = 1;
|
|
|
|
}
|
|
|
|
images[idx].current = images[idx].selected;
|
|
|
|
} else if (!strcasecmp(state, "clicked")) {
|
|
|
|
if (images[idx].clicked == NULL) {
|
|
|
|
images[idx].clicked = (simage_t *) MALLOC(sizeof(simage_t));
|
|
|
|
new = 1;
|
|
|
|
}
|
|
|
|
images[idx].current = images[idx].clicked;
|
|
|
|
} else if (!strcasecmp(state, "disabled")) {
|
|
|
|
if (images[idx].disabled == NULL) {
|
|
|
|
images[idx].disabled = (simage_t *) MALLOC(sizeof(simage_t));
|
|
|
|
new = 1;
|
|
|
|
}
|
|
|
|
images[idx].current = images[idx].disabled;
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid state \"%s\"\n", file_peek_path(), file_peek_line(), state);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (new) {
|
|
|
|
MEMSET(images[idx].current, 0, sizeof(simage_t));
|
|
|
|
images[idx].current->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t));
|
|
|
|
images[idx].current->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
|
|
|
|
MEMSET(images[idx].current->pmap, 0, sizeof(pixmap_t));
|
|
|
|
MEMSET(images[idx].current->iml, 0, sizeof(imlib_t));
|
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "color ")) {
|
|
|
|
char *fg = get_word(2, buff), *bg = get_word(3, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"color\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current == NULL) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"color\" with no image state defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!fg || !bg) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Foreground and background colors must be specified with \"color\"\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(fg, "0x")) {
|
|
|
|
images[idx].current->fg = get_color_by_pixel((Pixel) strtoul(fg, (char **) NULL, 0), WhitePixel(Xdisplay, Xscreen));
|
|
|
|
} else {
|
|
|
|
images[idx].current->fg = get_color_by_name(fg, "white");
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(bg, "0x")) {
|
|
|
|
images[idx].current->bg = get_color_by_pixel((Pixel) strtoul(bg, (char **) NULL, 0), BlackPixel(Xdisplay, Xscreen));
|
|
|
|
} else {
|
|
|
|
images[idx].current->bg = get_color_by_name(bg, "black");
|
|
|
|
}
|
|
|
|
FREE(fg);
|
|
|
|
FREE(bg);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "file ")) {
|
2002-10-12 22:28:36 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
char *filename = get_pword(2, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"file\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current == NULL) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"file\" with no image state defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!filename) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing filename\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!load_image(filename, images[idx].current)) {
|
|
|
|
images[idx].mode &= ~(MODE_IMAGE | ALLOW_IMAGE);
|
|
|
|
D_PIXMAP(("New image mode is 0x%02x, iml->im is 0x%08x\n", images[idx].mode, images[idx].current->iml->im));
|
|
|
|
}
|
2002-10-12 22:28:36 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "geom ")) {
|
2002-10-12 22:28:36 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
char *geom = get_pword(2, buff);
|
|
|
|
|
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"geom\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current == NULL) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"geom\" with no image state defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!geom) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing geometry string\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
set_pixmap_scale(geom, images[idx].current->pmap);
|
2002-10-12 22:28:36 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "cmod ") || !BEG_STRCASECMP(buff, "colormod ")) {
|
2002-10-12 22:28:36 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
char *color = get_pword(2, buff);
|
|
|
|
char *mods = get_pword(3, buff);
|
|
|
|
unsigned char n;
|
|
|
|
imlib_t *iml = images[idx].current->iml;
|
|
|
|
|
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered color modifier with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current == NULL) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered color modifier with no image state defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!color) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing color name\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!mods) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing modifier(s)\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
n = num_words(mods);
|
|
|
|
|
|
|
|
if (!BEG_STRCASECMP(color, "image ")) {
|
|
|
|
if (iml->mod) {
|
|
|
|
free_colormod(iml->mod);
|
|
|
|
}
|
|
|
|
iml->mod = create_colormod();
|
|
|
|
iml->mod->brightness = (int) strtol(mods, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->mod->contrast = (int) strtol(get_pword(2, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
if (n > 2) {
|
|
|
|
iml->mod->gamma = (int) strtol(get_pword(3, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
update_cmod(iml->mod);
|
|
|
|
} else if (!BEG_STRCASECMP(color, "red ")) {
|
|
|
|
if (iml->rmod) {
|
|
|
|
free_colormod(iml->rmod);
|
|
|
|
}
|
|
|
|
iml->rmod = create_colormod();
|
|
|
|
iml->rmod->brightness = (int) strtol(mods, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->rmod->contrast = (int) strtol(get_pword(2, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
if (n > 2) {
|
|
|
|
iml->rmod->gamma = (int) strtol(get_pword(3, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
update_cmod(iml->rmod);
|
|
|
|
} else if (!BEG_STRCASECMP(color, "green ")) {
|
|
|
|
if (iml->gmod) {
|
|
|
|
free_colormod(iml->gmod);
|
|
|
|
}
|
|
|
|
iml->gmod = create_colormod();
|
|
|
|
iml->gmod->brightness = (int) strtol(mods, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->gmod->contrast = (int) strtol(get_pword(2, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
if (n > 2) {
|
|
|
|
iml->gmod->gamma = (int) strtol(get_pword(3, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
update_cmod(iml->gmod);
|
|
|
|
} else if (!BEG_STRCASECMP(color, "blue ")) {
|
|
|
|
if (iml->bmod) {
|
|
|
|
free_colormod(iml->bmod);
|
|
|
|
}
|
|
|
|
iml->bmod = create_colormod();
|
|
|
|
iml->bmod->brightness = (int) strtol(mods, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->bmod->contrast = (int) strtol(get_pword(2, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
if (n > 2) {
|
|
|
|
iml->bmod->gamma = (int) strtol(get_pword(3, mods), (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
update_cmod(iml->bmod);
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Color must be either \"image\", \"red\", \"green\", or \"blue\"\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "border ")) {
|
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"border\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (num_words(buff + 7) < 4) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list for attribute \"border\"\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
RESET_AND_ASSIGN(images[idx].current->iml->border, (Imlib_Border *) MALLOC(sizeof(Imlib_Border)));
|
|
|
|
|
|
|
|
images[idx].current->iml->border->left = (unsigned short) strtoul(get_pword(2, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->border->right = (unsigned short) strtoul(get_pword(3, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->border->top = (unsigned short) strtoul(get_pword(4, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->border->bottom = (unsigned short) strtoul(get_pword(5, buff), (char **) NULL, 0);
|
|
|
|
|
|
|
|
if ((images[idx].current->iml->border->left == 0) && (images[idx].current->iml->border->right == 0)
|
|
|
|
&& (images[idx].current->iml->border->top == 0) && (images[idx].current->iml->border->bottom == 0)) {
|
|
|
|
FREE(images[idx].current->iml->border);
|
2002-10-04 18:19:41 -07:00
|
|
|
images[idx].current->iml->border = (Imlib_Border *) NULL; /* No sense in wasting CPU time and memory if there are no borders */
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "bevel ")) {
|
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"bevel\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current == NULL) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"bevel\" with no image state defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (num_words(buff + 6) < 5) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list for attribute \"bevel\"\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current->iml->bevel != NULL) {
|
|
|
|
FREE(images[idx].current->iml->bevel->edges);
|
|
|
|
FREE(images[idx].current->iml->bevel);
|
|
|
|
}
|
|
|
|
images[idx].current->iml->bevel = (bevel_t *) MALLOC(sizeof(bevel_t));
|
|
|
|
images[idx].current->iml->bevel->edges = (Imlib_Border *) MALLOC(sizeof(Imlib_Border));
|
|
|
|
|
|
|
|
if (!BEG_STRCASECMP(get_pword(2, buff), "down")) {
|
|
|
|
images[idx].current->iml->bevel->up = 0;
|
|
|
|
} else {
|
|
|
|
images[idx].current->iml->bevel->up = 1;
|
|
|
|
}
|
|
|
|
images[idx].current->iml->bevel->edges->left = (unsigned short) strtoul(get_pword(3, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->bevel->edges->right = (unsigned short) strtoul(get_pword(4, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->bevel->edges->top = (unsigned short) strtoul(get_pword(5, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->bevel->edges->bottom = (unsigned short) strtoul(get_pword(6, buff), (char **) NULL, 0);
|
|
|
|
|
|
|
|
if ((images[idx].current->iml->bevel->edges->left == 0) && (images[idx].current->iml->bevel->edges->right == 0)
|
|
|
|
&& (images[idx].current->iml->bevel->edges->top == 0) && (images[idx].current->iml->bevel->edges->bottom == 0)) {
|
|
|
|
FREE(images[idx].current->iml->bevel->edges);
|
|
|
|
images[idx].current->iml->bevel->edges = (Imlib_Border *) NULL;
|
|
|
|
FREE(images[idx].current->iml->bevel);
|
|
|
|
images[idx].current->iml->bevel = (bevel_t *) NULL;
|
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "padding ")) {
|
|
|
|
if (!CHECK_VALID_INDEX(idx)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"padding\" with no image type defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (images[idx].current == NULL) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Encountered \"padding\" with no image state defined\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (num_words(buff + 8) < 4) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list for attribute \"padding\"\n", file_peek_path(),
|
|
|
|
file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
RESET_AND_ASSIGN(images[idx].current->iml->pad, (Imlib_Border *) MALLOC(sizeof(Imlib_Border)));
|
|
|
|
|
|
|
|
images[idx].current->iml->pad->left = (unsigned short) strtoul(get_pword(2, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->pad->right = (unsigned short) strtoul(get_pword(3, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->pad->top = (unsigned short) strtoul(get_pword(4, buff), (char **) NULL, 0);
|
|
|
|
images[idx].current->iml->pad->bottom = (unsigned short) strtoul(get_pword(5, buff), (char **) NULL, 0);
|
|
|
|
|
|
|
|
if ((images[idx].current->iml->pad->left == 0) && (images[idx].current->iml->pad->right == 0)
|
|
|
|
&& (images[idx].current->iml->pad->top == 0) && (images[idx].current->iml->pad->bottom == 0)) {
|
|
|
|
FREE(images[idx].current->iml->pad);
|
|
|
|
images[idx].current->iml->pad = (Imlib_Border *) NULL;
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context image\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return ((void *) state);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
static void *
|
|
|
|
parse_actions(char *buff, void *state)
|
|
|
|
{
|
|
|
|
unsigned short mod = MOD_NONE;
|
|
|
|
unsigned char button = BUTTON_NONE;
|
|
|
|
KeySym keysym = 0;
|
|
|
|
char *str;
|
|
|
|
unsigned short i;
|
|
|
|
|
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!BEG_STRCASECMP(buff, "bind ")) {
|
|
|
|
for (i = 2; (str = get_word(i, buff)) && strcasecmp(str, "to"); i++) {
|
|
|
|
if (!BEG_STRCASECMP(str, "anymod")) {
|
|
|
|
mod = MOD_ANY;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "ctrl")) {
|
|
|
|
mod |= MOD_CTRL;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "shift")) {
|
|
|
|
mod |= MOD_SHIFT;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "lock")) {
|
|
|
|
mod |= MOD_LOCK;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "meta")) {
|
|
|
|
mod |= MOD_META;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "alt")) {
|
|
|
|
mod |= MOD_ALT;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "mod1")) {
|
|
|
|
mod |= MOD_MOD1;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "mod2")) {
|
|
|
|
mod |= MOD_MOD2;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "mod3")) {
|
|
|
|
mod |= MOD_MOD3;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "mod4")) {
|
|
|
|
mod |= MOD_MOD4;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "mod5")) {
|
|
|
|
mod |= MOD_MOD5;
|
|
|
|
} else if (!BEG_STRCASECMP(str, "button")) {
|
|
|
|
button = *(str + 6) - '0';
|
|
|
|
} else if (isdigit(*str)) {
|
|
|
|
keysym = (KeySym) strtoul(str, (char **) NULL, 0);
|
|
|
|
} else {
|
|
|
|
keysym = XStringToKeysym(str);
|
|
|
|
}
|
|
|
|
FREE(str);
|
|
|
|
}
|
|
|
|
if (!str) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Syntax error (\"to\" not found)\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
FREE(str);
|
|
|
|
if ((button == BUTTON_NONE) && (keysym == 0)) {
|
|
|
|
print_error("Parse error in file %s, line %lu: No valid button/keysym found for action\n", file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
str = get_pword(i, buff);
|
|
|
|
if (!BEG_STRCASECMP(str, "string")) {
|
|
|
|
str = get_word(i + 1, buff);
|
|
|
|
action_add(mod, button, keysym, ACTION_STRING, (void *) str);
|
|
|
|
FREE(str);
|
|
|
|
} else if (!BEG_STRCASECMP(str, "echo")) {
|
|
|
|
str = get_word(i + 1, buff);
|
|
|
|
action_add(mod, button, keysym, ACTION_ECHO, (void *) str);
|
|
|
|
FREE(str);
|
|
|
|
} else if (!BEG_STRCASECMP(str, "menu")) {
|
|
|
|
menu_t *menu;
|
|
|
|
|
|
|
|
str = get_word(i + 1, buff);
|
|
|
|
menu = find_menu_by_title(menu_list, str);
|
|
|
|
action_add(mod, button, keysym, ACTION_MENU, (void *) menu);
|
|
|
|
FREE(str);
|
|
|
|
} else if (!BEG_STRCASECMP(str, "script")) {
|
|
|
|
str = get_word(i + 1, buff);
|
|
|
|
action_add(mod, button, keysym, ACTION_SCRIPT, (void *) str);
|
|
|
|
FREE(str);
|
|
|
|
} else {
|
|
|
|
print_error
|
|
|
|
("Parse error in file %s, line %lu: No valid action type found. Valid types are \"string,\" \"echo,\" \"menu,\" and \"script.\"\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context action\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return state;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_menu(char *buff, void *state)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
menu_t *menu;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (*buff == CONF_BEGIN_CHAR) {
|
|
|
|
char *title = get_pword(2, buff + 6);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
menu = menu_create(title);
|
|
|
|
return ((void *) menu);
|
|
|
|
}
|
|
|
|
ASSERT_RVAL(state != NULL, (void *) (file_skip_to_end(), NULL));
|
|
|
|
menu = (menu_t *) state;
|
|
|
|
if (*buff == CONF_END_CHAR) {
|
|
|
|
if (!(*(menu->title))) {
|
|
|
|
char tmp[20];
|
|
|
|
|
|
|
|
sprintf(tmp, "Eterm_Menu_%u", menu_list->nummenus);
|
|
|
|
menu_set_title(menu, tmp);
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Menu context ended without giving a title. Defaulted to \"%s\".\n",
|
|
|
|
file_peek_path(), file_peek_line(), tmp);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
menu_list = menulist_add_menu(menu_list, menu);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "title ")) {
|
|
|
|
char *title = get_word(2, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
menu_set_title(menu, title);
|
|
|
|
FREE(title);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "font ")) {
|
|
|
|
char *name = get_word(2, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!name) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing font name.\n", file_peek_path(), file_peek_line());
|
|
|
|
return ((void *) menu);
|
|
|
|
}
|
|
|
|
menu_set_font(menu, name);
|
|
|
|
FREE(name);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "sep") || !BEG_STRCASECMP(buff, "-")) {
|
|
|
|
menuitem_t *item;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
item = menuitem_create((char *) NULL);
|
|
|
|
menu_add_item(menu, item);
|
|
|
|
menuitem_set_action(item, MENUITEM_SEP, (char *) NULL);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context menu\n", file_peek_path(),
|
|
|
|
file_peek_line(), buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return ((void *) menu);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_menuitem(char *buff, void *state)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
static menu_t *menu;
|
|
|
|
menuitem_t *curitem;
|
|
|
|
|
|
|
|
ASSERT_RVAL(state != NULL, (void *) (file_skip_to_end(), NULL));
|
|
|
|
if (*buff == CONF_BEGIN_CHAR) {
|
|
|
|
menu = (menu_t *) state;
|
|
|
|
curitem = menuitem_create(NULL);
|
|
|
|
return ((void *) curitem);
|
|
|
|
}
|
|
|
|
curitem = (menuitem_t *) state;
|
|
|
|
ASSERT_RVAL(menu != NULL, state);
|
|
|
|
if (*buff == CONF_END_CHAR) {
|
|
|
|
if (!(curitem->text)) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Menuitem context ended with no text given. Discarding this entry.\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(curitem);
|
|
|
|
} else {
|
|
|
|
menu_add_item(menu, curitem);
|
|
|
|
}
|
|
|
|
return ((void *) menu);
|
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
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!BEG_STRCASECMP(buff, "text ")) {
|
|
|
|
char *text = get_word(2, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!text) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing menuitem text.\n", file_peek_path(), file_peek_line());
|
|
|
|
return ((void *) curitem);
|
|
|
|
}
|
|
|
|
menuitem_set_text(curitem, text);
|
|
|
|
FREE(text);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "rtext ")) {
|
|
|
|
char *rtext = get_word(2, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!rtext) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing menuitem right-justified text.\n", file_peek_path(), file_peek_line());
|
|
|
|
return ((void *) curitem);
|
|
|
|
}
|
|
|
|
menuitem_set_rtext(curitem, rtext);
|
|
|
|
FREE(rtext);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "icon ")) {
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "action ")) {
|
|
|
|
char *type = get_pword(2, buff);
|
|
|
|
char *action = get_word(3, buff);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!BEG_STRCASECMP(type, "submenu ")) {
|
|
|
|
menuitem_set_action(curitem, MENUITEM_SUBMENU, action);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(type, "string ")) {
|
|
|
|
menuitem_set_action(curitem, MENUITEM_STRING, action);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(type, "script ")) {
|
|
|
|
menuitem_set_action(curitem, MENUITEM_SCRIPT, action);
|
2001-05-09 17:20:15 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(type, "echo ")) {
|
|
|
|
menuitem_set_action(curitem, MENUITEM_ECHO, action);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(type, "separator")) {
|
|
|
|
menuitem_set_action(curitem, MENUITEM_SEP, action);
|
|
|
|
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid menu item action \"%s\"\n", file_peek_path(), file_peek_line(),
|
|
|
|
NONULL(type));
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
FREE(action);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context menu\n", file_peek_path(),
|
|
|
|
file_peek_line(), buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return ((void *) curitem);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_bbar(char *buff, void *state)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
buttonbar_t *bbar;
|
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
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (*buff == CONF_BEGIN_CHAR) {
|
|
|
|
bbar = bbar_create();
|
|
|
|
return ((void *) bbar);
|
2000-02-15 19:37:34 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
ASSERT_RVAL(state != NULL, (void *) (file_skip_to_end(), NULL));
|
|
|
|
bbar = (buttonbar_t *) state;
|
|
|
|
if (*buff == CONF_END_CHAR) {
|
|
|
|
bbar_add(bbar);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "font ")) {
|
|
|
|
char *font = get_word(2, buff);
|
|
|
|
|
|
|
|
bbar_set_font(bbar, font);
|
|
|
|
FREE(font);
|
|
|
|
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "dock ")) {
|
|
|
|
char *where = get_pword(2, buff);
|
|
|
|
|
|
|
|
if (!where) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Attribute dock requires a parameter\n", file_peek_path(), file_peek_line());
|
|
|
|
} else if (!BEG_STRCASECMP(where, "top")) {
|
|
|
|
bbar_set_docked(bbar, BBAR_DOCKED_TOP);
|
2002-10-04 18:19:41 -07:00
|
|
|
} else if (!BEG_STRCASECMP(where, "bot")) { /* "bot" or "bottom" */
|
2002-05-04 07:25:30 -07:00
|
|
|
bbar_set_docked(bbar, BBAR_DOCKED_BOTTOM);
|
2002-10-04 18:19:41 -07:00
|
|
|
} else if (!BEG_STRCASECMP(where, "no")) { /* "no" or "none" */
|
2002-05-04 07:25:30 -07:00
|
|
|
bbar_set_docked(bbar, BBAR_UNDOCKED);
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter \"%s\" to attribute dock\n", file_peek_path(),
|
|
|
|
file_peek_line(), where);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2000-02-15 19:37:34 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "visible ")) {
|
|
|
|
char *tmp = get_pword(2, buff);
|
2000-02-15 19:37:34 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (BOOL_OPT_ISTRUE(tmp)) {
|
|
|
|
bbar_set_visible(bbar, 1);
|
|
|
|
} else if (BOOL_OPT_ISFALSE(tmp)) {
|
|
|
|
bbar_set_visible(bbar, 0);
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid boolean value \"%s\" in context button_bar\n", file_peek_path(),
|
|
|
|
file_peek_line(), tmp);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2000-02-15 19:37:34 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "button ") || !BEG_STRCASECMP(buff, "rbutton ")) {
|
|
|
|
char *text = get_pword(2, buff);
|
|
|
|
char *icon = strcasestr(buff, "icon ");
|
|
|
|
char *action = strcasestr(buff, "action ");
|
|
|
|
button_t *button;
|
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
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (text == icon) {
|
|
|
|
text = NULL;
|
|
|
|
} else {
|
|
|
|
text = get_word(2, buff);
|
|
|
|
}
|
|
|
|
if (!text && !icon) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing button specifications\n", file_peek_path(), file_peek_line());
|
|
|
|
return ((void *) bbar);
|
|
|
|
}
|
|
|
|
|
|
|
|
button = button_create(text);
|
|
|
|
if (icon) {
|
|
|
|
simage_t *simg;
|
|
|
|
|
|
|
|
icon = get_word(2, icon);
|
|
|
|
simg = create_simage();
|
|
|
|
if (load_image(icon, simg)) {
|
|
|
|
button_set_icon(button, simg);
|
|
|
|
} else {
|
|
|
|
free_simage(simg);
|
|
|
|
}
|
|
|
|
FREE(icon);
|
|
|
|
}
|
|
|
|
if (action) {
|
|
|
|
char *type = get_pword(2, action);
|
|
|
|
|
|
|
|
action = get_word(2, type);
|
|
|
|
if (!BEG_STRCASECMP(type, "menu ")) {
|
|
|
|
button_set_action(button, ACTION_MENU, action);
|
|
|
|
} else if (!BEG_STRCASECMP(type, "string ")) {
|
|
|
|
button_set_action(button, ACTION_STRING, action);
|
|
|
|
} else if (!BEG_STRCASECMP(type, "echo ")) {
|
|
|
|
button_set_action(button, ACTION_ECHO, action);
|
|
|
|
} else if (!BEG_STRCASECMP(type, "script ")) {
|
|
|
|
button_set_action(button, ACTION_SCRIPT, action);
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid button action \"%s\"\n", file_peek_path(), file_peek_line(), type);
|
|
|
|
FREE(action);
|
|
|
|
FREE(button);
|
|
|
|
return ((void *) bbar);
|
|
|
|
}
|
|
|
|
FREE(action);
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Missing button action\n", file_peek_path(), file_peek_line());
|
|
|
|
FREE(button);
|
|
|
|
return ((void *) bbar);
|
|
|
|
}
|
|
|
|
if (tolower(*buff) == 'r') {
|
|
|
|
bbar_add_rbutton(bbar, button);
|
|
|
|
} else {
|
|
|
|
bbar_add_button(bbar, button);
|
|
|
|
}
|
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
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context menu\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
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
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return ((void *) bbar);
|
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
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_xim(char *buff, void *state)
|
|
|
|
{
|
Mon Sep 20 18:32:01 PDT 1999 Michael Jennings <mej@eterm.org>
Lots of changes here. First off, this should fix the background draw
bug with transparency that several people pointed out. While I was
at it, I also cleaned up a lot of other related stuff. Three-state
images should be a lot more robust now.
Then again, some stuff may be broken entirely from this, so let me
know. :-)
For one thing, the various image modes should work as expected now.
You can allow and disallow modes for the various widgets. The
fallback mode is "solid" now, rather than "image," so you can cause
a certain widget to refuse to use an image if you want to. If you
specify an image without specifying a "mode" line that allows the
"image" mode, your image will not appear. <-- READ THIS TWICE! I
had to go back and fix all the theme files because of this, so you
will need to remove your current theme directory and allow Eterm's
"make install" to put the new ones in place; otherwise, everything
will go back to being solid colors. =]
Anytime something changes this drastically, there are bound to be
problems. Let me know if you find any of them. :)
SVN revision: 348
1999-09-20 18:16:46 -07:00
|
|
|
#ifdef USE_XIM
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "input_method ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_input_method, get_word(2, buff));
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "preedit_type ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_preedit_type, get_word(2, buff));
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context xim\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
print_warning("XIM support was not compiled in, ignoring entire context\n");
|
|
|
|
file_poke_skip(1);
|
|
|
|
#endif
|
|
|
|
return state;
|
|
|
|
buff = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
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
|
|
|
static void *
|
|
|
|
parse_multichar(char *buff, void *state)
|
1999-08-17 16:01:18 -07:00
|
|
|
{
|
Mon Sep 20 18:32:01 PDT 1999 Michael Jennings <mej@eterm.org>
Lots of changes here. First off, this should fix the background draw
bug with transparency that several people pointed out. While I was
at it, I also cleaned up a lot of other related stuff. Three-state
images should be a lot more robust now.
Then again, some stuff may be broken entirely from this, so let me
know. :-)
For one thing, the various image modes should work as expected now.
You can allow and disallow modes for the various widgets. The
fallback mode is "solid" now, rather than "image," so you can cause
a certain widget to refuse to use an image if you want to. If you
specify an image without specifying a "mode" line that allows the
"image" mode, your image will not appear. <-- READ THIS TWICE! I
had to go back and fix all the theme files because of this, so you
will need to remove your current theme directory and allow Eterm's
"make install" to put the new ones in place; otherwise, everything
will go back to being solid colors. =]
Anytime something changes this drastically, there are bound to be
problems. Let me know if you find any of them. :)
SVN revision: 348
1999-09-20 18:16:46 -07:00
|
|
|
#ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "encoding ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_multichar_encoding, get_word(2, buff));
|
|
|
|
if (rs_multichar_encoding != NULL) {
|
|
|
|
if (BEG_STRCASECMP(rs_multichar_encoding, "eucj")
|
|
|
|
&& BEG_STRCASECMP(rs_multichar_encoding, "sjis")
|
|
|
|
&& BEG_STRCASECMP(rs_multichar_encoding, "euckr")
|
|
|
|
&& BEG_STRCASECMP(rs_multichar_encoding, "big5")
|
|
|
|
&& BEG_STRCASECMP(rs_multichar_encoding, "gb")
|
|
|
|
&& BEG_STRCASECMP(rs_multichar_encoding, "iso-10646")
|
|
|
|
&& BEG_STRCASECMP(rs_multichar_encoding, "none")) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid multichar encoding mode \"%s\"\n",
|
|
|
|
file_peek_path(), file_peek_line(), rs_multichar_encoding);
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(rs_multichar_encoding);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list \"\" for attribute encoding\n",
|
|
|
|
file_peek_path(), file_peek_line());
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "font ")) {
|
|
|
|
|
|
|
|
char *tmp = get_pword(2, buff);
|
2003-11-07 09:28:42 -08:00
|
|
|
unsigned long n;
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
if (num_words(buff) != 3) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter list \"%s\" for attribute font\n",
|
|
|
|
file_peek_path(), file_peek_line(), NONULL(tmp));
|
2002-05-04 07:25:30 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (isdigit(*tmp)) {
|
2003-11-07 09:28:42 -08:00
|
|
|
n = strtoul(tmp, (char **) NULL, 0);
|
2002-05-04 07:25:30 -07:00
|
|
|
if (n <= 255) {
|
|
|
|
eterm_font_add(&etmfonts, get_pword(2, tmp), n);
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid font index %d\n", file_peek_path(), file_peek_line(), n);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
tmp = get_word(1, tmp);
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid font index \"%s\"\n", file_peek_path(), file_peek_line(), NONULL(tmp));
|
|
|
|
FREE(tmp);
|
|
|
|
}
|
|
|
|
|
1999-08-17 16:01:18 -07:00
|
|
|
} else {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context multichar\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
if (*buff == CONF_BEGIN_CHAR) {
|
|
|
|
print_warning("Multichar support was not compiled in, ignoring entire context\n");
|
|
|
|
file_poke_skip(1);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
return state;
|
|
|
|
buff = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
2002-10-08 21:06:40 -07:00
|
|
|
static void *
|
|
|
|
parse_escreen(char *buff, void *state)
|
|
|
|
{
|
|
|
|
#ifdef ESCREEN
|
|
|
|
if ((*buff == CONF_BEGIN_CHAR) || (*buff == CONF_END_CHAR)) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP(buff, "url ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_url, get_word(2, buff));
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "firewall ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_hop, get_word(2, buff));
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "delay ")) {
|
|
|
|
rs_delay = strtol(get_pword(2, buff), (char **) NULL, 0);
|
2002-10-24 20:57:17 -07:00
|
|
|
} else if (!BEG_STRCASECMP(buff, "bbar_font ")) {
|
|
|
|
RESET_AND_ASSIGN(rs_es_font, get_word(2, buff));
|
|
|
|
} else if (!BEG_STRCASECMP(buff, "bbar_dock ")) {
|
|
|
|
char *where = get_pword(2, buff);
|
|
|
|
|
|
|
|
if (!where) {
|
|
|
|
print_error("Parse error in file %s, line %lu: Attribute bbar_dock requires a parameter\n", file_peek_path(), file_peek_line());
|
|
|
|
} else if (!BEG_STRCASECMP(where, "top")) {
|
|
|
|
rs_es_dock = BBAR_DOCKED_TOP;
|
|
|
|
} else if (!BEG_STRCASECMP(where, "bot")) { /* "bot" or "bottom" */
|
|
|
|
rs_es_dock = BBAR_DOCKED_BOTTOM;
|
|
|
|
} else if (!BEG_STRCASECMP(where, "no")) { /* "no" or "none" */
|
|
|
|
rs_es_dock = BBAR_UNDOCKED;
|
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Invalid parameter \"%s\" to attribute bbar_dock\n", file_peek_path(),
|
|
|
|
file_peek_line(), where);
|
|
|
|
}
|
2002-10-08 21:06:40 -07:00
|
|
|
} else {
|
|
|
|
print_error("Parse error in file %s, line %lu: Attribute \"%s\" is not valid within context escreen\n",
|
|
|
|
file_peek_path(), file_peek_line(), buff);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
print_warning("Escreen support was not compiled in, ignoring entire context\n");
|
|
|
|
file_poke_skip(1);
|
|
|
|
#endif
|
|
|
|
return state;
|
|
|
|
buff = NULL;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
char *
|
2000-07-03 12:08:41 -07:00
|
|
|
conf_parse_theme(char **theme, char *conf_name, unsigned char fallback)
|
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
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
static char path[CONFIG_BUFF];
|
|
|
|
char *ret = NULL;
|
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
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!(*path)) {
|
|
|
|
char *path_env;
|
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
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
path_env = getenv(PATH_ENV);
|
|
|
|
if (path_env) {
|
2003-06-10 09:20:01 -07:00
|
|
|
snprintf(path, sizeof(path), "%s:%s", CONFIG_SEARCH_PATH,
|
|
|
|
path_env);
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2003-06-10 09:20:01 -07:00
|
|
|
snprintf(path, sizeof(path), CONFIG_SEARCH_PATH);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
shell_expand(path);
|
|
|
|
}
|
|
|
|
if (fallback & PARSE_TRY_USER_THEME) {
|
|
|
|
if (theme && *theme && (ret = conf_parse(conf_name, *theme, path)) != NULL) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fallback & PARSE_TRY_DEFAULT_THEME) {
|
|
|
|
RESET_AND_ASSIGN(*theme, STRDUP(PACKAGE));
|
|
|
|
if ((ret = conf_parse(conf_name, *theme, path)) != NULL) {
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fallback & PARSE_TRY_NO_THEME) {
|
|
|
|
RESET_AND_ASSIGN(*theme, NULL);
|
|
|
|
return (conf_parse(conf_name, *theme, path));
|
|
|
|
}
|
|
|
|
return NULL;
|
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
|
|
|
}
|
|
|
|
|
2002-10-04 18:19:41 -07:00
|
|
|
void
|
|
|
|
init_libast(void)
|
|
|
|
{
|
|
|
|
libast_set_program_name(PACKAGE);
|
|
|
|
libast_set_program_version(VERSION);
|
|
|
|
SPIFOPT_OPTLIST_SET(option_list);
|
|
|
|
SPIFOPT_NUMOPTS_SET(sizeof(option_list) / sizeof(spifopt_t));
|
|
|
|
SPIFOPT_ALLOWBAD_SET(3);
|
|
|
|
}
|
|
|
|
|
1999-08-17 16:01:18 -07:00
|
|
|
/* Initialize the default values for everything */
|
|
|
|
void
|
|
|
|
init_defaults(void)
|
|
|
|
{
|
2002-02-25 20:13:57 -08:00
|
|
|
#ifndef AUTO_ENCODING
|
2002-05-04 07:25:30 -07:00
|
|
|
unsigned char i;
|
2002-02-25 20:13:57 -08:00
|
|
|
#endif
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2000-08-30 22:41:44 -07:00
|
|
|
#if DEBUG >= DEBUG_MEM
|
2002-05-04 07:25:30 -07:00
|
|
|
if (DEBUG_LEVEL >= DEBUG_MEM) {
|
|
|
|
memrec_init();
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
Xdisplay = NULL;
|
|
|
|
rs_term_name = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef CUTCHAR_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_cutchars = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifndef NO_BOLDFONT
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_boldFont = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef PRINTPIPE
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_print_pipe = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_title = NULL; /* title name for window */
|
|
|
|
rs_iconName = NULL; /* icon name for window */
|
|
|
|
rs_geometry = NULL; /* window geometry */
|
1999-08-17 16:01:18 -07:00
|
|
|
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_path = NULL;
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
colorfgbg = DEFAULT_RSTYLE;
|
2003-04-24 11:30:17 -07:00
|
|
|
|
|
|
|
/* Font stuff. */
|
2002-05-04 07:25:30 -07:00
|
|
|
MEMSET(rs_font, 0, sizeof(char *) * NFONTS);
|
2002-02-20 06:44:46 -08:00
|
|
|
#if AUTO_ENCODING
|
2003-04-24 11:30:17 -07:00
|
|
|
/* Auto-encoding means the default fonts are chosen by locale. */
|
|
|
|
# ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
eterm_default_font_locale(&etfonts, &etmfonts, &rs_multichar_encoding, &def_font_idx);
|
2003-04-24 11:30:17 -07:00
|
|
|
# else
|
2002-05-04 07:25:30 -07:00
|
|
|
eterm_default_font_locale(&etfonts, NULL, NULL, &def_font_idx);
|
2003-04-24 11:30:17 -07:00
|
|
|
# endif
|
2002-02-20 06:44:46 -08:00
|
|
|
#else
|
2003-04-24 11:30:17 -07:00
|
|
|
/* No auto-encoding, so use built-in ISO-8859-1 fonts. */
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < NFONTS; i++) {
|
|
|
|
eterm_font_add(&etfonts, def_fontName[i], i);
|
2003-04-24 11:30:17 -07:00
|
|
|
# ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
eterm_font_add(&etmfonts, def_mfontName[i], i);
|
2003-04-24 11:30:17 -07:00
|
|
|
# endif
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2003-04-24 11:30:17 -07:00
|
|
|
# ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_multichar_encoding = STRDUP(MULTICHAR_ENCODING);
|
2003-04-24 11:30:17 -07:00
|
|
|
# endif
|
2002-05-04 07:25:30 -07:00
|
|
|
#endif
|
2003-04-24 11:30:17 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
TermWin.internalBorder = DEFAULT_BORDER_WIDTH;
|
|
|
|
|
|
|
|
/* Initialize the parser */
|
|
|
|
conf_init_subsystem();
|
|
|
|
|
|
|
|
/* Register Eterm's context parsers. */
|
|
|
|
conf_register_context("color", parse_color);
|
|
|
|
conf_register_context("attributes", parse_attributes);
|
|
|
|
conf_register_context("toggles", parse_toggles);
|
|
|
|
conf_register_context("keyboard", parse_keyboard);
|
|
|
|
conf_register_context("misc", parse_misc);
|
|
|
|
conf_register_context("imageclasses", parse_imageclasses);
|
|
|
|
conf_register_context("image", parse_image);
|
|
|
|
conf_register_context("actions", parse_actions);
|
|
|
|
conf_register_context("menu", parse_menu);
|
|
|
|
conf_register_context("menuitem", parse_menuitem);
|
|
|
|
conf_register_context("button_bar", parse_bbar);
|
|
|
|
conf_register_context("xim", parse_xim);
|
|
|
|
conf_register_context("multichar", parse_multichar);
|
2002-10-08 21:06:40 -07:00
|
|
|
conf_register_context("escreen", parse_escreen);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Sync up options with our internal data after parsing options and configs */
|
|
|
|
void
|
|
|
|
post_parse(void)
|
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
register int i;
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2005-03-15 13:48:14 -08:00
|
|
|
#if DEBUG > 0
|
|
|
|
if (DEBUG_LEVEL > DEBUG) {
|
|
|
|
print_warning("Requested debug level of %d exceeds compile-time maximum of %d\n",
|
|
|
|
DEBUG_LEVEL, DEBUG);
|
|
|
|
} else if (DEBUG_LEVEL > 0) {
|
|
|
|
DPRINTF1(("Now running with debugging level of %d\n", DEBUG_LEVEL));
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_scrollbar_type) {
|
|
|
|
if (!strcasecmp(rs_scrollbar_type, "xterm")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef XTERM_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
scrollbar_set_type(SCROLLBAR_XTERM);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_error("Support for xterm scrollbars was not compiled in. Sorry.\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!strcasecmp(rs_scrollbar_type, "next")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef NEXT_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
scrollbar_set_type(SCROLLBAR_NEXT);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_error("Support for NeXT scrollbars was not compiled in. Sorry.\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
} else if (!strcasecmp(rs_scrollbar_type, "motif")) {
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef MOTIF_SCROLLBAR
|
2002-05-04 07:25:30 -07:00
|
|
|
scrollbar_set_type(SCROLLBAR_MOTIF);
|
1999-08-17 16:01:18 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
print_error("Support for motif scrollbars was not compiled in. Sorry.\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
print_error("Unrecognized scrollbar type \"%s\".\n", rs_scrollbar_type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (rs_scrollbar_width) {
|
|
|
|
scrollbar_set_width(rs_scrollbar_width);
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
/* set any defaults not already set */
|
|
|
|
if (rs_name == NULL) {
|
|
|
|
if (rs_exec_args != NULL) {
|
|
|
|
rs_name = STRDUP(rs_exec_args[0]);
|
|
|
|
} else {
|
|
|
|
rs_name = STRDUP(APL_NAME " " VERSION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!rs_title) {
|
|
|
|
rs_title = rs_name;
|
|
|
|
}
|
|
|
|
if (!rs_iconName) {
|
|
|
|
rs_iconName = rs_name;
|
|
|
|
}
|
|
|
|
if ((TermWin.saveLines = rs_saveLines) < 0) {
|
|
|
|
TermWin.saveLines = SAVELINES;
|
|
|
|
}
|
|
|
|
/* no point having a scrollbar without having any scrollback! */
|
|
|
|
if (!TermWin.saveLines) {
|
2003-08-24 08:09:32 -07:00
|
|
|
BITFIELD_CLEAR(eterm_options, ETERM_OPTIONS_SCROLLBAR);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef PRINTPIPE
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!rs_print_pipe) {
|
|
|
|
rs_print_pipe = STRDUP(PRINTPIPE);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
#ifdef CUTCHAR_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!rs_cutchars) {
|
|
|
|
rs_cutchars = STRDUP(CUTCHARS);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef NO_BOLDFONT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_font[0] == NULL && rs_boldFont != NULL) {
|
|
|
|
rs_font[0] = rs_boldFont;
|
|
|
|
rs_boldFont = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
2003-04-24 11:30:17 -07:00
|
|
|
|
|
|
|
/* Add any fonts we got from the command line. */
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < NFONTS; i++) {
|
|
|
|
if (rs_font[i]) {
|
|
|
|
if (def_font_idx == 0) {
|
|
|
|
eterm_font_add(&etfonts, rs_font[i], i);
|
|
|
|
RESET_AND_ASSIGN(rs_font[i], NULL);
|
|
|
|
} else {
|
2003-04-24 11:30:17 -07:00
|
|
|
/* If they changed the default font index to something other than 0,
|
|
|
|
put rs_font[0] in that position. Any indexes less than that are
|
|
|
|
reduced by one so that rs_font[1-n] (n being the default font
|
|
|
|
index) will be assigned to etfonts[0-(n-1)], and rs_font[0] will
|
|
|
|
be etfonts[n]. Anything higher than n stays as is. */
|
2002-05-04 07:25:30 -07:00
|
|
|
eterm_font_add(&etfonts, rs_font[i], ((i == 0) ? def_font_idx : ((i <= def_font_idx) ? (i - 1) : i)));
|
|
|
|
RESET_AND_ASSIGN(rs_font[i], NULL);
|
|
|
|
}
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_mfont[i]) {
|
|
|
|
if (def_font_idx == 0) {
|
|
|
|
eterm_font_add(&etmfonts, rs_mfont[i], i);
|
|
|
|
RESET_AND_ASSIGN(rs_mfont[i], NULL);
|
|
|
|
} else {
|
|
|
|
eterm_font_add(&etmfonts, rs_mfont[i], ((i == 0) ? def_font_idx : ((i <= def_font_idx) ? (i - 1) : i)));
|
|
|
|
RESET_AND_ASSIGN(rs_mfont[i], NULL);
|
|
|
|
}
|
2003-04-24 11:30:17 -07:00
|
|
|
} else {
|
|
|
|
eterm_font_add(&etmfonts, etfonts[i], i);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2003-04-24 11:30:17 -07:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
/* Make sure all fonts 0 through font_cnt are populated for both normal
|
|
|
|
and multi-byte font structures. */
|
|
|
|
for (; i < font_cnt; i++) {
|
|
|
|
if (!etfonts[i]) {
|
|
|
|
eterm_font_add(&etfonts, etfonts[def_font_idx], i);
|
|
|
|
}
|
|
|
|
#ifdef MULTI_CHARSET
|
|
|
|
if (!etmfonts[i]) {
|
|
|
|
if (etmfonts[def_font_idx]) {
|
|
|
|
eterm_font_add(&etmfonts, etmfonts[def_font_idx], i);
|
|
|
|
} else {
|
|
|
|
eterm_font_add(&etmfonts, etfonts[i], i);
|
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
Fri May 26 20:43:03 PDT 2000 Michael Jennings <mej@eterm.org>
Okay, there are a few changes here. First off, I made multi-byte font
support the default now, as long as you have ISO 10646 fonts. In
order to do this, I made the default encoding type "Latin1" so as not
to interfere with 8-bit ISO 8859-1 characters. This means that if you
relied on the default multi-byte encoding method to be SJIS, you'll
need to update your theme files.
I also set it up so that Eterm will ignore SIGHUP, at least until I do
something with it (like reloading the theme or something).
I fixed the proportional font size algorithm. If there is more than
a 3-pixel variance between the minimum and maximum sizes for glyphs in
a proportional font, Eterm will set the size to 2 standard deviations
above the average width. This is so that they won't look so spread
out and ugly, but it still doesn't look perfect. Not much I can do on
that front...terminals must have fixed-width columns.
And then there's the biggie. I put in the ability to configure the
now-infamous font effects. I left a black drop shadow in as the
default, but you can now customize it via the --font-fx option or in
the config file using "font effects <stuff>" in the attributes
context. You can even use "fx" instead of "effects" for short.
So what goes in the <stuff> part? Well, you have several options.
To use a single-color outline, say "outline <color>". Likewise, a
single-color drop shadow is "shadow [corner] <color>"; "bottom_right"
is the default corner if you don't specify one. For a 3-D embossed
look, "emboss <dark_color> <light_color>". The opposite, a carved-
out look, can be had with "carved <dark_color> <light_color>". (Of
course, with those last two, the 3-D look will only work if you
choose the colors wisely.)
Those are all the shortcuts. The long way is to specify a series of
corner/color pairs, like "tl blue" for top-left blue, or
"bottom_right green". You can abbreviate using "tl," "tr," "bl," or
"br," or you can spell out "top_left," "top_right," "bottom_left," or
"bottom_right." If you omit a corner name, the first one defaults to
top-left, the second to top-right, and so on as listed above.
SVN revision: 2714
2000-05-26 20:41:22 -07:00
|
|
|
}
|
2003-04-24 11:30:17 -07:00
|
|
|
#ifdef MULTI_CHARSET
|
|
|
|
if (rs_multichar_encoding != NULL) {
|
|
|
|
set_multichar_encoding(rs_multichar_encoding);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_font_effects) {
|
|
|
|
if (parse_font_fx(rs_font_effects) != 1) {
|
|
|
|
print_error("Syntax error in the font effects specified on the command line.\n");
|
|
|
|
}
|
|
|
|
RESET_AND_ASSIGN(rs_font_effects, NULL);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
/* Clean up image stuff */
|
|
|
|
for (i = 0; i < image_max; i++) {
|
|
|
|
simage_t *simg;
|
|
|
|
imlib_t *iml;
|
|
|
|
|
|
|
|
if (images[i].norm) {
|
|
|
|
simg = images[i].norm;
|
|
|
|
iml = simg->iml;
|
|
|
|
/* If we have a bevel but no border, use the bevel as a border. */
|
|
|
|
if (iml->bevel && !(iml->border)) {
|
|
|
|
iml->border = iml->bevel->edges;
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (iml->im) {
|
|
|
|
imlib_context_set_image(iml->im);
|
|
|
|
update_cmod_tables(iml);
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
images[i].userdef = 1;
|
|
|
|
} else {
|
|
|
|
simg = images[i].norm = (simage_t *) MALLOC(sizeof(simage_t));
|
|
|
|
simg->pmap = (pixmap_t *) MALLOC(sizeof(pixmap_t));
|
|
|
|
simg->iml = (imlib_t *) MALLOC(sizeof(imlib_t));
|
|
|
|
simg->fg = WhitePixel(Xdisplay, Xscreen);
|
|
|
|
simg->bg = BlackPixel(Xdisplay, Xscreen);
|
|
|
|
MEMSET(simg->pmap, 0, sizeof(pixmap_t));
|
|
|
|
MEMSET(simg->iml, 0, sizeof(imlib_t));
|
|
|
|
images[i].mode = MODE_IMAGE & ALLOW_IMAGE;
|
|
|
|
}
|
|
|
|
images[i].current = simg;
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_pixmaps[i]) {
|
|
|
|
reset_simage(images[i].norm, RESET_ALL_SIMG);
|
|
|
|
load_image(rs_pixmaps[i], images[i].norm);
|
2002-10-04 18:19:41 -07:00
|
|
|
FREE(rs_pixmaps[i]); /* These are created by STRDUP() */
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
/* Right now, solid mode is the only thing we can do without pixmap support. */
|
|
|
|
images[i].mode = MODE_SOLID & ALLOW_SOLID;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (images[i].selected) {
|
|
|
|
simage_t *norm_simg = images[i].norm;
|
|
|
|
|
|
|
|
simg = images[i].selected;
|
|
|
|
iml = simg->iml;
|
|
|
|
/* If we have a bevel but no border, use the bevel as a border. */
|
|
|
|
if (iml->bevel && !(iml->border)) {
|
|
|
|
iml->border = iml->bevel->edges;
|
|
|
|
}
|
|
|
|
/* If normal has an image but we don't, copy it. */
|
|
|
|
if (!(simg->iml->im) && (norm_simg->iml->im)) {
|
|
|
|
simg->iml->im = norm_simg->iml->im;
|
|
|
|
*(simg->pmap) = *(norm_simg->pmap);
|
|
|
|
}
|
|
|
|
if (simg->fg == 0 && simg->bg == 0) {
|
|
|
|
simg->fg = norm_simg->fg;
|
|
|
|
simg->bg = norm_simg->bg;
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (iml->im) {
|
|
|
|
imlib_context_set_image(iml->im);
|
|
|
|
update_cmod_tables(iml);
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
D_PIXMAP(("No \"selected\" state for image %s. Setting fallback to the normal state.\n", get_image_type(i)));
|
|
|
|
images[i].selected = images[i].norm;
|
|
|
|
}
|
|
|
|
if (images[i].clicked) {
|
|
|
|
simage_t *norm_simg = images[i].norm;
|
|
|
|
|
|
|
|
simg = images[i].clicked;
|
|
|
|
iml = simg->iml;
|
|
|
|
/* If we have a bevel but no border, use the bevel as a border. */
|
|
|
|
if (iml->bevel && !(iml->border)) {
|
|
|
|
iml->border = iml->bevel->edges;
|
|
|
|
}
|
|
|
|
/* If normal has an image but we don't, copy it. */
|
|
|
|
if (!(simg->iml->im) && (norm_simg->iml->im)) {
|
|
|
|
simg->iml->im = norm_simg->iml->im;
|
|
|
|
*(simg->pmap) = *(norm_simg->pmap);
|
|
|
|
}
|
|
|
|
if (simg->fg == 0 && simg->bg == 0) {
|
|
|
|
simg->fg = norm_simg->fg;
|
|
|
|
simg->bg = norm_simg->bg;
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (iml->im) {
|
|
|
|
imlib_context_set_image(iml->im);
|
|
|
|
update_cmod_tables(iml);
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
D_PIXMAP(("No \"clicked\" state for image %s. Setting fallback to the selected state.\n", get_image_type(i)));
|
|
|
|
images[i].clicked = images[i].selected;
|
|
|
|
}
|
|
|
|
if (images[i].disabled) {
|
|
|
|
simage_t *norm_simg = images[i].norm;
|
|
|
|
|
|
|
|
simg = images[i].disabled;
|
|
|
|
iml = simg->iml;
|
|
|
|
/* If we have a bevel but no border, use the bevel as a border. */
|
|
|
|
if (iml->bevel && !(iml->border)) {
|
|
|
|
iml->border = iml->bevel->edges;
|
|
|
|
}
|
|
|
|
/* If normal has an image but we don't, copy it. */
|
|
|
|
if (!(simg->iml->im) && (norm_simg->iml->im)) {
|
|
|
|
simg->iml->im = norm_simg->iml->im;
|
|
|
|
*(simg->pmap) = *(norm_simg->pmap);
|
|
|
|
}
|
|
|
|
if (simg->fg == 0 && simg->bg == 0) {
|
|
|
|
simg->fg = norm_simg->fg;
|
|
|
|
simg->bg = norm_simg->bg;
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (iml->im) {
|
|
|
|
imlib_context_set_image(iml->im);
|
|
|
|
update_cmod_tables(iml);
|
|
|
|
}
|
2001-10-21 06:21:05 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
D_PIXMAP(("No \"disabled\" state for image %s. Setting fallback to the normal state.\n", get_image_type(i)));
|
|
|
|
images[i].disabled = images[i].norm;
|
|
|
|
}
|
2003-08-24 08:09:32 -07:00
|
|
|
if ((BITFIELD_IS_SET(image_options, IMAGE_OPTIONS_TRANS)) && (image_mode_is(i, ALLOW_TRANS))) {
|
2002-05-04 07:25:30 -07:00
|
|
|
D_PIXMAP(("Detected transparency option. Enabling transparency on image %s\n", get_image_type(i)));
|
|
|
|
image_set_mode(i, MODE_TRANS);
|
2003-08-24 08:09:32 -07:00
|
|
|
} else if ((BITFIELD_IS_SET(image_options, IMAGE_OPTIONS_VIEWPORT)) && (image_mode_is(i, ALLOW_VIEWPORT))) {
|
2002-05-04 07:25:30 -07:00
|
|
|
D_PIXMAP(("Detected viewport option. Enabling viewport mode on image %s\n", get_image_type(i)));
|
|
|
|
image_set_mode(i, MODE_VIEWPORT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (images[image_bg].norm->fg || images[image_bg].norm->bg) {
|
|
|
|
/* They specified their colors here, so copy them to the right place. */
|
|
|
|
PixColors[fgColor] = images[image_bg].norm->fg;
|
|
|
|
PixColors[bgColor] = images[image_bg].norm->bg;
|
2000-04-03 16:43:15 -07:00
|
|
|
}
|
2000-03-08 19:38:31 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
/* rs_buttonbars is set to 1. If it stays 1, the option was never
|
|
|
|
specified. If specified, it will either become 3 (on) or 0 (off). */
|
|
|
|
if (rs_buttonbars != 1) {
|
|
|
|
if (rs_buttonbars) {
|
2002-06-08 08:44:08 -07:00
|
|
|
FOREACH_BUTTONBAR(bbar_set_visible(bbar, 1););
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
2002-06-08 08:44:08 -07:00
|
|
|
FOREACH_BUTTONBAR(bbar_set_visible(bbar, 0););
|
2000-03-08 19:38:31 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_buttonbars = 1; /* Reset for future use. */
|
2000-03-08 19:38:31 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
/* Update buttonbar sizes based on new imageclass info. */
|
|
|
|
bbar_resize_all(-1);
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
/* Support the deprecated forms by converting the syntax to the new system */
|
|
|
|
if (rs_shade != 0) {
|
|
|
|
char buff[10];
|
|
|
|
|
|
|
|
sprintf(buff, "0x%03x", ((100 - rs_shade) << 8) / 100);
|
|
|
|
rs_cmod_image = STRDUP(buff);
|
|
|
|
D_PIXMAP(("--shade value of %d converted to cmod value of %s\n", rs_shade, rs_cmod_image));
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_tint) {
|
|
|
|
char buff[10];
|
|
|
|
unsigned long r, g, b, t;
|
|
|
|
|
|
|
|
if (!isdigit(*rs_tint)) {
|
|
|
|
t = get_tint_by_color_name(rs_tint);
|
|
|
|
} else {
|
|
|
|
t = (unsigned long) strtoul(rs_tint, (char **) NULL, 0);
|
|
|
|
D_PIXMAP(("Got numerical tint 0x%06x\n", t));
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (t != 0xffffff) {
|
|
|
|
r = (t & 0xff0000) >> 16;
|
|
|
|
if (r != 0xff) {
|
|
|
|
sprintf(buff, "0x%03lx", r);
|
|
|
|
rs_cmod_red = STRDUP(buff);
|
|
|
|
}
|
|
|
|
g = (t & 0xff00) >> 8;
|
|
|
|
if (g != 0xff) {
|
|
|
|
sprintf(buff, "0x%03lx", g);
|
|
|
|
rs_cmod_green = STRDUP(buff);
|
|
|
|
}
|
|
|
|
b = t & 0xff;
|
|
|
|
if (b != 0xff) {
|
|
|
|
sprintf(buff, "0x%03lx", b);
|
|
|
|
rs_cmod_blue = STRDUP(buff);
|
|
|
|
}
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(rs_tint);
|
|
|
|
}
|
|
|
|
if (rs_cmod_image) {
|
|
|
|
unsigned char n = num_words(rs_cmod_image);
|
|
|
|
imlib_t *iml = images[image_bg].norm->iml;
|
|
|
|
|
|
|
|
if (iml->mod) {
|
|
|
|
free_colormod(iml->mod);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
iml->mod = create_colormod();
|
|
|
|
iml->mod->brightness = (int) strtol(rs_cmod_image, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->mod->contrast = (int) strtol(get_pword(2, rs_cmod_image), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (n > 2) {
|
|
|
|
iml->mod->gamma = (int) strtol(get_pword(3, rs_cmod_image), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-10-04 18:19:41 -07:00
|
|
|
D_PIXMAP(("From image cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_image,
|
|
|
|
iml->mod->brightness, iml->mod->contrast, iml->mod->gamma));
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(rs_cmod_image);
|
|
|
|
}
|
|
|
|
if (rs_cmod_red) {
|
|
|
|
unsigned char n = num_words(rs_cmod_red);
|
|
|
|
imlib_t *iml = images[image_bg].norm->iml;
|
|
|
|
|
|
|
|
if (iml->rmod) {
|
|
|
|
free_colormod(iml->rmod);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
iml->rmod = create_colormod();
|
|
|
|
iml->rmod->brightness = (int) strtol(rs_cmod_red, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->rmod->contrast = (int) strtol(get_pword(2, rs_cmod_red), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (n > 2) {
|
|
|
|
iml->rmod->gamma = (int) strtol(get_pword(3, rs_cmod_red), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-10-04 18:19:41 -07:00
|
|
|
D_PIXMAP(("From red cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_red,
|
|
|
|
iml->rmod->brightness, iml->rmod->contrast, iml->rmod->gamma));
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(rs_cmod_red);
|
|
|
|
update_cmod(iml->rmod);
|
|
|
|
}
|
|
|
|
if (rs_cmod_green) {
|
|
|
|
unsigned char n = num_words(rs_cmod_green);
|
|
|
|
imlib_t *iml = images[image_bg].norm->iml;
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (iml->gmod) {
|
|
|
|
free_colormod(iml->gmod);
|
Wed Apr 12 21:18:19 PDT 2000 Michael Jennings <mej@eterm.org>
This is the initial commit with Imlib2 support. READ THIS CAREFULLY.
There is important information in this commit message that will keep
you from getting screwed.
First off, support for Imlib 1.x is GONE. It is no longer supported
as of now. If you want to continue using it, do NOT install this
version. I tried to support both for awhile, but the code ended up
being way too ugly and hackish. Imlib2 is the future. And trust me,
when you see what we do with this future, you'll be happy for the
switch.
The good news is that most of the basics work. Transparency still
works, and the basic image stuff works. Most users won't notice any
major problems, so long as your Imlib2 is 100% up-to-date.
However, a few things still don't work:
1. Auto mode is a bit broken. You'll get X errors in XFree86 4.0.
Don't use it if you're running XFree 4.
2. Color modifiers for images don't work. At all.
3. Transparency shading/tinting will not work in 8bpp or lower. Life
blows sometimes. Sorry. Time for a real video card. :-)
4. The built-in icon is broken.
5. You WILL need to update your theme.cfg files. The borders on the
horizontal and vertical bar images were incorrect when combined with
the new anti-aliased scaling. The horizontal bars should have a right
border of 3. Vertical bars should have a bottom border of 3. The
menu images should have both right *and* bottom borders of 3. You can
either make those changes by hand, or use the --with-theme-update
option to autogen.sh. Your call.
I think that covers everything I've run into. I will point out that
I don't really take advantage of a lot of the Imlib2 features just
yet. My first priority is to make all the stuff that worked before
work again (or at least the important stuff). Then I'll work on
new features.
So there it is. If you're not ready for it, don't use it. But if you
are, I hope you like it.
SVN revision: 2478
2000-04-12 21:19:05 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
iml->gmod = create_colormod();
|
|
|
|
iml->gmod->brightness = (int) strtol(rs_cmod_green, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->gmod->contrast = (int) strtol(get_pword(2, rs_cmod_green), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (n > 2) {
|
|
|
|
iml->gmod->gamma = (int) strtol(get_pword(3, rs_cmod_green), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-10-04 18:19:41 -07:00
|
|
|
D_PIXMAP(("From green cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_green,
|
|
|
|
iml->gmod->brightness, iml->gmod->contrast, iml->gmod->gamma));
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(rs_cmod_green);
|
|
|
|
update_cmod(iml->gmod);
|
|
|
|
}
|
|
|
|
if (rs_cmod_blue) {
|
|
|
|
unsigned char n = num_words(rs_cmod_blue);
|
|
|
|
imlib_t *iml = images[image_bg].norm->iml;
|
|
|
|
|
|
|
|
if (iml->bmod) {
|
|
|
|
free_colormod(iml->bmod);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
iml->bmod = create_colormod();
|
|
|
|
iml->bmod->brightness = (int) strtol(rs_cmod_blue, (char **) NULL, 0);
|
|
|
|
if (n > 1) {
|
|
|
|
iml->bmod->contrast = (int) strtol(get_pword(2, rs_cmod_blue), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (n > 2) {
|
|
|
|
iml->bmod->gamma = (int) strtol(get_pword(3, rs_cmod_blue), (char **) NULL, 0);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-10-04 18:19:41 -07:00
|
|
|
D_PIXMAP(("From blue cmod string %s to brightness %d, contrast %d, and gamma %d\n", rs_cmod_blue,
|
|
|
|
iml->bmod->brightness, iml->bmod->contrast, iml->bmod->gamma));
|
2002-05-04 07:25:30 -07:00
|
|
|
FREE(rs_cmod_blue);
|
|
|
|
update_cmod(iml->bmod);
|
|
|
|
}
|
|
|
|
if (images[image_bg].norm->iml->im) {
|
|
|
|
imlib_context_set_image(images[image_bg].norm->iml->im);
|
|
|
|
update_cmod_tables(images[image_bg].norm->iml);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rs_cache_size == (unsigned long) -1) {
|
|
|
|
imlib_set_cache_size(0);
|
|
|
|
} else {
|
|
|
|
imlib_set_cache_size(rs_cache_size);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-12-14 15:24:33 -08:00
|
|
|
if (rs_opacity < 0x100) {
|
|
|
|
rs_opacity |= (rs_opacity << 24) | (rs_opacity << 16) | (rs_opacity << 8);
|
|
|
|
} else {
|
|
|
|
rs_opacity = 0xffffffff;
|
|
|
|
}
|
|
|
|
|
2003-08-24 08:09:32 -07:00
|
|
|
if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_REVERSE_VIDEO)) {
|
2002-05-04 07:25:30 -07:00
|
|
|
char *tmp;
|
|
|
|
|
|
|
|
/* swap foreground/background colors */
|
|
|
|
|
|
|
|
tmp = rs_color[fgColor];
|
|
|
|
rs_color[fgColor] = rs_color[bgColor];
|
|
|
|
rs_color[bgColor] = tmp;
|
|
|
|
|
|
|
|
tmp = def_colorName[fgColor];
|
|
|
|
def_colorName[fgColor] = def_colorName[bgColor];
|
|
|
|
def_colorName[bgColor] = tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rs_meta_mod) {
|
|
|
|
MetaMask = modmasks[rs_meta_mod - 1];
|
|
|
|
}
|
|
|
|
if (rs_alt_mod) {
|
|
|
|
AltMask = modmasks[rs_alt_mod - 1];
|
|
|
|
}
|
|
|
|
if (rs_numlock_mod) {
|
|
|
|
NumLockMask = modmasks[rs_numlock_mod - 1];
|
|
|
|
}
|
|
|
|
#ifdef BACKGROUND_CYCLING_SUPPORT
|
|
|
|
if (rs_anim_pixmap_list != NULL) {
|
|
|
|
rs_anim_delay = strtoul(rs_anim_pixmap_list, (char **) NULL, 0);
|
|
|
|
fflush(stdout);
|
|
|
|
if (rs_anim_delay == 0) {
|
|
|
|
FREE(rs_anim_pixmap_list);
|
|
|
|
rs_anim_pixmap_list = NULL;
|
|
|
|
} else {
|
|
|
|
char *w1, *h1, *temp;
|
|
|
|
unsigned long w, h;
|
|
|
|
int count;
|
|
|
|
|
2002-10-04 18:19:41 -07:00
|
|
|
count = num_words(rs_anim_pixmap_list) - 1; /* -1 for the delay */
|
2002-05-04 07:25:30 -07:00
|
|
|
rs_anim_pixmaps = (char **) MALLOC(sizeof(char *) * (count + 1));
|
|
|
|
|
|
|
|
for (i = 0; i < count; i++) {
|
2002-10-04 18:19:41 -07:00
|
|
|
temp = get_word(i + 2, rs_anim_pixmap_list); /* +2 rather than +1 to account for the delay */
|
2002-05-04 07:25:30 -07:00
|
|
|
if (temp == NULL)
|
|
|
|
break;
|
|
|
|
if (num_words(temp) != 3) {
|
|
|
|
if (num_words(temp) == 1) {
|
|
|
|
rs_anim_pixmaps[i] = temp;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
w1 = get_pword(1, temp);
|
|
|
|
h1 = get_pword(2, temp);
|
|
|
|
w = strtol(w1, (char **) NULL, 0);
|
|
|
|
h = strtol(h1, (char **) NULL, 0);
|
|
|
|
if (w || h) {
|
|
|
|
rs_anim_pixmaps[i] = get_word(3, temp);
|
|
|
|
rs_anim_pixmaps[i] = (char *) REALLOC(rs_anim_pixmaps[i], strlen(rs_anim_pixmaps[i]) + 9);
|
|
|
|
strcat(rs_anim_pixmaps[i], "@100x100");
|
|
|
|
} else {
|
|
|
|
rs_anim_pixmaps[i] = get_word(3, temp);
|
|
|
|
rs_anim_pixmaps[i] = (char *) REALLOC(rs_anim_pixmaps[i], strlen(rs_anim_pixmaps[i]) + 5);
|
|
|
|
strcat(rs_anim_pixmaps[i], "@0x0");
|
|
|
|
}
|
|
|
|
FREE(temp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rs_anim_pixmaps[count] = NULL;
|
|
|
|
FREE(rs_anim_pixmap_list);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
rs_anim_delay = 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (rs_pipe_name) {
|
|
|
|
struct stat fst;
|
|
|
|
|
|
|
|
if (lstat(rs_pipe_name, &fst) != 0) {
|
|
|
|
print_error("Unable to stat console pipe \"%s\" -- %s\n", rs_pipe_name, strerror(errno));
|
|
|
|
} else {
|
|
|
|
if (S_ISREG(fst.st_mode) || S_ISDIR(fst.st_mode)) {
|
|
|
|
print_error("Directories and regular files are not valid console pipes. Sorry.\n");
|
|
|
|
} else {
|
|
|
|
pipe_fd = open(rs_pipe_name, O_RDONLY | O_NDELAY | O_NOCTTY);
|
|
|
|
if (pipe_fd < 0) {
|
|
|
|
print_error("Unable to open console pipe -- %s\n", strerror(errno));
|
|
|
|
}
|
|
|
|
}
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
|
|
|
save_config(char *path, unsigned char save_theme)
|
|
|
|
{
|
|
|
|
register FILE *fp;
|
|
|
|
register short i;
|
|
|
|
char *tmp_str, dt_stamp[50];
|
|
|
|
time_t cur_time = time(NULL);
|
|
|
|
struct tm *cur_tm;
|
|
|
|
struct stat fst;
|
|
|
|
simage_t *simg;
|
|
|
|
action_t *action;
|
|
|
|
buttonbar_t *bbar;
|
|
|
|
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Saving %s config to \"%s\"\n", (save_theme ? "theme" : "user"), NONULL(path)));
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
cur_tm = localtime(&cur_time);
|
|
|
|
|
|
|
|
if (save_theme) {
|
|
|
|
if (!path) {
|
|
|
|
path = (char *) MALLOC(PATH_MAX + 1);
|
|
|
|
strncpy(path, (theme_dir ? theme_dir : PKGDATADIR "/themes/Eterm"), PATH_MAX - sizeof("/" THEME_CFG));
|
|
|
|
path[PATH_MAX] = 0;
|
|
|
|
if (stat(path, &fst) || !S_ISDIR(fst.st_mode) || !CAN_WRITE(fst)) {
|
|
|
|
char *tmp = NULL;
|
|
|
|
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Problem with \"%s\". S_ISDIR == %d, CAN_WRITE == %d\n", path, S_ISDIR(fst.st_mode), CAN_WRITE(fst)));
|
2002-05-04 07:25:30 -07:00
|
|
|
if (theme_dir) {
|
|
|
|
tmp = strrchr(theme_dir, '/');
|
|
|
|
if (tmp) {
|
|
|
|
*tmp++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
snprintf(path, PATH_MAX, "%s/.Eterm/themes/%s", getenv("HOME"), (tmp ? tmp : "Eterm"));
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Trying \"%s\" instead, tmp == \"%s\"\n", path, tmp));
|
2002-05-04 07:25:30 -07:00
|
|
|
if (tmp) {
|
|
|
|
*(--tmp) = '/';
|
|
|
|
}
|
|
|
|
if (!mkdirhier(path) || (stat(path, &fst) && !CAN_WRITE(fst))) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("I couldn't write to \"%s\" or \"%s\". I give up.", (theme_dir ? theme_dir : PKGDATADIR "/themes/Eterm\n"),
|
|
|
|
path);
|
2002-05-04 07:25:30 -07:00
|
|
|
return errno;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
strcat(path, "/" THEME_CFG);
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Final path is \"%s\"\n", path));
|
2002-05-04 07:25:30 -07:00
|
|
|
path[PATH_MAX] = 0;
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
if (!path) {
|
|
|
|
path = (char *) MALLOC(PATH_MAX + 1);
|
|
|
|
strncpy(path, (user_dir ? user_dir : PKGDATADIR "/themes/Eterm"), PATH_MAX - sizeof("/" USER_CFG));
|
|
|
|
path[PATH_MAX] = 0;
|
|
|
|
if (stat(path, &fst) || !S_ISDIR(fst.st_mode) || !CAN_WRITE(fst)) {
|
|
|
|
char *tmp = NULL;
|
|
|
|
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Problem with \"%s\". S_ISDIR == %d, CAN_WRITE == %d\n", path, S_ISDIR(fst.st_mode), CAN_WRITE(fst)));
|
2002-05-04 07:25:30 -07:00
|
|
|
if (user_dir) {
|
|
|
|
tmp = strrchr(user_dir, '/');
|
|
|
|
if (tmp) {
|
|
|
|
*tmp++ = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
snprintf(path, PATH_MAX, "%s/.Eterm/themes/%s", getenv("HOME"), (tmp ? tmp : "Eterm"));
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Trying \"%s\" instead, tmp == \"%s\"\n", path, tmp));
|
2002-05-04 07:25:30 -07:00
|
|
|
if (tmp) {
|
|
|
|
*(--tmp) = '/';
|
|
|
|
}
|
|
|
|
if (!mkdirhier(path) || (stat(path, &fst) && !CAN_WRITE(fst))) {
|
2002-10-04 18:19:41 -07:00
|
|
|
print_error("I couldn't write to \"%s\" or \"%s\". I give up.", (user_dir ? user_dir : PKGDATADIR "/themes/Eterm\n"),
|
|
|
|
path);
|
2002-05-04 07:25:30 -07:00
|
|
|
return errno;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
strcat(path, "/" USER_CFG);
|
2003-08-21 21:09:40 -07:00
|
|
|
D_OPTIONS(("Final path is \"%s\"\n", path));
|
2002-05-04 07:25:30 -07:00
|
|
|
path[PATH_MAX] = 0;
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (!lstat(path, &fst)) {
|
|
|
|
char bak_path[PATH_MAX], timestamp[16];
|
|
|
|
|
|
|
|
/* File exists. Make a backup. */
|
|
|
|
strftime(timestamp, 16, "%Y%m%d.%H%M%S", cur_tm);
|
|
|
|
snprintf(bak_path, PATH_MAX - 1, "%s.%s", path, timestamp);
|
|
|
|
link(path, bak_path);
|
|
|
|
unlink(path);
|
|
|
|
}
|
|
|
|
if ((fp = fopen(path, "w")) == NULL) {
|
|
|
|
print_error("Unable to save configuration to file \"%s\" -- %s\n", path, strerror(errno));
|
|
|
|
return errno;
|
|
|
|
}
|
|
|
|
strftime(dt_stamp, 50, "%Y/%m/%d at %X", cur_tm);
|
|
|
|
fprintf(fp, "<" APL_NAME "-" VERSION ">\n");
|
|
|
|
fprintf(fp, "# Eterm Configuration File\n");
|
|
|
|
fprintf(fp, "# Automatically generated by " APL_NAME "-" VERSION " on %s\n", dt_stamp);
|
|
|
|
|
|
|
|
fprintf(fp, "begin color\n");
|
|
|
|
fprintf(fp, " foreground %s\n", COLOR_NAME(fgColor));
|
|
|
|
fprintf(fp, " background %s\n", COLOR_NAME(bgColor));
|
|
|
|
fprintf(fp, " cursor %s\n", COLOR_NAME(cursorColor));
|
|
|
|
fprintf(fp, " cursor_text %s\n", COLOR_NAME(cursorColor2));
|
|
|
|
fprintf(fp, " pointer %s\n", COLOR_NAME(pointerColor));
|
|
|
|
fprintf(fp, " video normal\n");
|
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
fprintf(fp, " color %d %s\n", i, COLOR_NAME(minColor + i));
|
|
|
|
}
|
|
|
|
#ifndef NO_BOLDUNDERLINE
|
|
|
|
if (rs_color[colorBD]) {
|
|
|
|
fprintf(fp, " color bd %s\n", COLOR_NAME(colorBD));
|
|
|
|
}
|
|
|
|
if (rs_color[colorUL]) {
|
|
|
|
fprintf(fp, " color ul %s\n", COLOR_NAME(colorUL));
|
|
|
|
}
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "end color\n\n");
|
|
|
|
|
|
|
|
fprintf(fp, "begin attributes\n");
|
|
|
|
if (save_theme) {
|
|
|
|
if (rs_geometry) {
|
|
|
|
fprintf(fp, " geometry %s\n", rs_geometry);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
XFetchName(Xdisplay, TermWin.parent, &tmp_str);
|
|
|
|
fprintf(fp, " title %s\n", tmp_str);
|
|
|
|
fprintf(fp, " name %s\n", rs_name);
|
|
|
|
XGetIconName(Xdisplay, TermWin.parent, &tmp_str);
|
|
|
|
fprintf(fp, " iconname %s\n", tmp_str);
|
|
|
|
if (rs_desktop != -1) {
|
|
|
|
fprintf(fp, " desktop %d\n", rs_desktop);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " scrollbar_type %s\n",
|
|
|
|
(scrollbar_get_type() == SCROLLBAR_XTERM ? "xterm" : (scrollbar_get_type() == SCROLLBAR_MOTIF ? "motif" : "next")));
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, " scrollbar_width %d\n", scrollbar_anchor_width());
|
|
|
|
fprintf(fp, " font default %u\n", (unsigned int) font_idx);
|
2003-08-24 08:09:32 -07:00
|
|
|
fprintf(fp, " font proportional %d\n", ((BITFIELD_IS_SET(vt_options, VT_OPTIONS_PROPORTIONAL)) ? 1 : 0));
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < font_cnt; i++) {
|
|
|
|
if (etfonts[i]) {
|
|
|
|
fprintf(fp, " font %d %s\n", i, etfonts[i]);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#ifndef NO_BOLDFONT
|
|
|
|
if (rs_boldFont) {
|
|
|
|
fprintf(fp, " font bold %s\n", rs_boldFont);
|
|
|
|
}
|
|
|
|
#endif
|
2003-08-20 07:20:51 -07:00
|
|
|
if (fshadow.do_shadow) {
|
|
|
|
const char *corners[] = {
|
|
|
|
"top_left",
|
|
|
|
"top_right",
|
|
|
|
"bottom_left",
|
|
|
|
"bottom_right"
|
|
|
|
};
|
|
|
|
unsigned char shad = 0;
|
|
|
|
|
|
|
|
fprintf(fp, " font effects");
|
|
|
|
for (i = 0; i < 4; i++) {
|
|
|
|
if (fshadow.shadow[i]) {
|
|
|
|
fprintf(fp, " %s 0x%08x", corners[i], (unsigned int) fshadow.color[i]);
|
|
|
|
shad = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (shad) {
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
} else {
|
|
|
|
fprintf(fp, " none\n");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
fprintf(fp, " font effects none\n");
|
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "end attributes\n\n");
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (save_theme) {
|
|
|
|
fprintf(fp, "begin imageclasses\n");
|
|
|
|
fprintf(fp, " path \"%s\"\n", rs_path);
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_icon != NULL) {
|
|
|
|
fprintf(fp, " icon %s\n", rs_icon);
|
Wed Apr 12 21:18:19 PDT 2000 Michael Jennings <mej@eterm.org>
This is the initial commit with Imlib2 support. READ THIS CAREFULLY.
There is important information in this commit message that will keep
you from getting screwed.
First off, support for Imlib 1.x is GONE. It is no longer supported
as of now. If you want to continue using it, do NOT install this
version. I tried to support both for awhile, but the code ended up
being way too ugly and hackish. Imlib2 is the future. And trust me,
when you see what we do with this future, you'll be happy for the
switch.
The good news is that most of the basics work. Transparency still
works, and the basic image stuff works. Most users won't notice any
major problems, so long as your Imlib2 is 100% up-to-date.
However, a few things still don't work:
1. Auto mode is a bit broken. You'll get X errors in XFree86 4.0.
Don't use it if you're running XFree 4.
2. Color modifiers for images don't work. At all.
3. Transparency shading/tinting will not work in 8bpp or lower. Life
blows sometimes. Sorry. Time for a real video card. :-)
4. The built-in icon is broken.
5. You WILL need to update your theme.cfg files. The borders on the
horizontal and vertical bar images were incorrect when combined with
the new anti-aliased scaling. The horizontal bars should have a right
border of 3. Vertical bars should have a bottom border of 3. The
menu images should have both right *and* bottom borders of 3. You can
either make those changes by hand, or use the --with-theme-update
option to autogen.sh. Your call.
I think that covers everything I've run into. I will point out that
I don't really take advantage of a lot of the Imlib2 features just
yet. My first priority is to make all the stuff that worked before
work again (or at least the important stuff). Then I'll work on
new features.
So there it is. If you're not ready for it, don't use it. But if you
are, I hope you like it.
SVN revision: 2478
2000-04-12 21:19:05 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_anim_delay) {
|
|
|
|
/* FIXME: Do something here! */
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
#endif
|
|
|
|
for (i = 0; i < image_max; i++) {
|
|
|
|
fprintf(fp, " begin image\n");
|
|
|
|
switch (i) {
|
|
|
|
case image_bg:
|
|
|
|
fprintf(fp, " type background\n");
|
|
|
|
break;
|
|
|
|
case image_sb:
|
|
|
|
fprintf(fp, " type trough\n");
|
|
|
|
break;
|
|
|
|
case image_sa:
|
|
|
|
fprintf(fp, " type anchor\n");
|
|
|
|
break;
|
|
|
|
case image_st:
|
|
|
|
fprintf(fp, " type thumb\n");
|
|
|
|
break;
|
|
|
|
case image_up:
|
|
|
|
fprintf(fp, " type up_arrow\n");
|
|
|
|
break;
|
|
|
|
case image_down:
|
|
|
|
fprintf(fp, " type down_arrow\n");
|
|
|
|
break;
|
|
|
|
case image_left:
|
|
|
|
fprintf(fp, " type left_arrow\n");
|
|
|
|
break;
|
|
|
|
case image_right:
|
|
|
|
fprintf(fp, " type right_arrow\n");
|
|
|
|
break;
|
|
|
|
case image_menu:
|
|
|
|
fprintf(fp, " type menu\n");
|
|
|
|
break;
|
|
|
|
case image_menuitem:
|
|
|
|
fprintf(fp, " type menuitem\n");
|
|
|
|
break;
|
|
|
|
case image_submenu:
|
|
|
|
fprintf(fp, " type submenu\n");
|
|
|
|
break;
|
|
|
|
case image_button:
|
|
|
|
fprintf(fp, " type button\n");
|
|
|
|
break;
|
|
|
|
case image_bbar:
|
|
|
|
fprintf(fp, " type button_bar\n");
|
|
|
|
break;
|
|
|
|
case image_gbar:
|
|
|
|
fprintf(fp, " type grab_bar\n");
|
|
|
|
break;
|
|
|
|
case image_dialog:
|
|
|
|
fprintf(fp, " type dialog_box\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
fprintf(fp, " mode ");
|
|
|
|
switch (images[i].mode & MODE_MASK) {
|
|
|
|
case MODE_IMAGE:
|
|
|
|
fprintf(fp, "image");
|
|
|
|
break;
|
|
|
|
case MODE_TRANS:
|
|
|
|
fprintf(fp, "trans");
|
|
|
|
break;
|
|
|
|
case MODE_VIEWPORT:
|
|
|
|
fprintf(fp, "viewport");
|
|
|
|
break;
|
|
|
|
case MODE_AUTO:
|
|
|
|
fprintf(fp, "auto");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
fprintf(fp, "solid");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (images[i].mode & ALLOW_MASK) {
|
|
|
|
fprintf(fp, " allow");
|
|
|
|
if (image_mode_is(i, ALLOW_IMAGE)) {
|
|
|
|
fprintf(fp, " image");
|
|
|
|
}
|
|
|
|
if (image_mode_is(i, ALLOW_TRANS)) {
|
|
|
|
fprintf(fp, " trans");
|
|
|
|
}
|
|
|
|
if (image_mode_is(i, ALLOW_VIEWPORT)) {
|
|
|
|
fprintf(fp, " viewport");
|
|
|
|
}
|
|
|
|
if (image_mode_is(i, ALLOW_AUTO)) {
|
|
|
|
fprintf(fp, " auto");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
|
|
|
|
/* Now save each state. */
|
|
|
|
simg = images[i].norm;
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (simg->iml->im) {
|
|
|
|
imlib_context_set_image(simg->iml->im);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
fprintf(fp, " state normal\n");
|
|
|
|
if (simg->fg || simg->bg) {
|
|
|
|
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
|
|
|
|
}
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
|
|
|
|
}
|
|
|
|
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
|
|
|
|
if (simg->pmap->op & OP_TILE) {
|
|
|
|
fprintf(fp, ":tiled");
|
|
|
|
}
|
|
|
|
if ((simg->pmap->op & OP_SCALE) || ((simg->pmap->op & OP_HSCALE) && (simg->pmap->op & OP_VSCALE))) {
|
|
|
|
fprintf(fp, ":scaled");
|
|
|
|
} else if (simg->pmap->op & OP_HSCALE) {
|
|
|
|
fprintf(fp, ":hscaled");
|
|
|
|
} else if (simg->pmap->op & OP_VSCALE) {
|
|
|
|
fprintf(fp, ":vscaled");
|
|
|
|
}
|
|
|
|
if (simg->pmap->op & OP_PROPSCALE) {
|
|
|
|
fprintf(fp, ":propscaled");
|
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
if (simg->iml->mod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod image 0x%02x 0x%02x 0x%02x\n", simg->iml->mod->brightness, simg->iml->mod->contrast,
|
|
|
|
simg->iml->mod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->rmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod red 0x%02x 0x%02x 0x%02x\n", simg->iml->rmod->brightness, simg->iml->rmod->contrast,
|
|
|
|
simg->iml->rmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->gmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod green 0x%02x 0x%02x 0x%02x\n", simg->iml->gmod->brightness, simg->iml->gmod->contrast,
|
|
|
|
simg->iml->gmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast,
|
|
|
|
simg->iml->bmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (simg->iml->border) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top,
|
|
|
|
simg->iml->border->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bevel) {
|
|
|
|
fprintf(fp, " bevel %s %hu %hu %hu %hu\n", ((simg->iml->bevel->up) ? "up" : "down"), simg->iml->bevel->edges->left,
|
|
|
|
simg->iml->bevel->edges->right, simg->iml->bevel->edges->top, simg->iml->bevel->edges->bottom);
|
|
|
|
}
|
|
|
|
if (simg->iml->pad) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " padding %hu %hu %hu %hu\n", simg->iml->pad->left, simg->iml->pad->right, simg->iml->pad->top,
|
|
|
|
simg->iml->pad->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Selected state */
|
|
|
|
if (images[i].selected != images[i].norm) {
|
|
|
|
simg = images[i].selected;
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
imlib_context_set_image(simg->iml->im);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
fprintf(fp, " state selected\n");
|
|
|
|
if (simg->fg || simg->bg) {
|
|
|
|
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
|
|
|
|
}
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
|
|
|
|
}
|
|
|
|
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
|
|
|
|
if (simg->pmap->op & OP_TILE) {
|
|
|
|
fprintf(fp, ":tiled");
|
|
|
|
}
|
|
|
|
if ((simg->pmap->op & OP_SCALE) || ((simg->pmap->op & OP_HSCALE) && (simg->pmap->op & OP_VSCALE))) {
|
|
|
|
fprintf(fp, ":scaled");
|
|
|
|
} else if (simg->pmap->op & OP_HSCALE) {
|
|
|
|
fprintf(fp, ":hscaled");
|
|
|
|
} else if (simg->pmap->op & OP_VSCALE) {
|
|
|
|
fprintf(fp, ":vscaled");
|
|
|
|
}
|
|
|
|
if (simg->pmap->op & OP_PROPSCALE) {
|
|
|
|
fprintf(fp, ":propscaled");
|
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
if (simg->iml->mod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod image 0x%02x 0x%02x 0x%02x\n", simg->iml->mod->brightness, simg->iml->mod->contrast,
|
|
|
|
simg->iml->mod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->rmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod red 0x%02x 0x%02x 0x%02x\n", simg->iml->rmod->brightness, simg->iml->rmod->contrast,
|
|
|
|
simg->iml->rmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->gmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod green 0x%02x 0x%02x 0x%02x\n", simg->iml->gmod->brightness, simg->iml->gmod->contrast,
|
|
|
|
simg->iml->gmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast,
|
|
|
|
simg->iml->bmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (simg->iml->border) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top,
|
|
|
|
simg->iml->border->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bevel) {
|
|
|
|
fprintf(fp, " bevel %s %hu %hu %hu %hu\n", ((simg->iml->bevel->up) ? "up" : "down"), simg->iml->bevel->edges->left,
|
|
|
|
simg->iml->bevel->edges->right, simg->iml->bevel->edges->top, simg->iml->bevel->edges->bottom);
|
|
|
|
}
|
|
|
|
if (simg->iml->pad) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " padding %hu %hu %hu %hu\n", simg->iml->pad->left, simg->iml->pad->right, simg->iml->pad->top,
|
|
|
|
simg->iml->pad->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Clicked state */
|
|
|
|
if (images[i].clicked != images[i].norm) {
|
|
|
|
simg = images[i].clicked;
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
imlib_context_set_image(simg->iml->im);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
fprintf(fp, " state clicked\n");
|
|
|
|
if (simg->fg || simg->bg) {
|
|
|
|
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
|
|
|
|
}
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
|
|
|
|
}
|
|
|
|
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
|
|
|
|
if (simg->pmap->op & OP_TILE) {
|
|
|
|
fprintf(fp, ":tiled");
|
|
|
|
}
|
|
|
|
if ((simg->pmap->op & OP_SCALE) || ((simg->pmap->op & OP_HSCALE) && (simg->pmap->op & OP_VSCALE))) {
|
|
|
|
fprintf(fp, ":scaled");
|
|
|
|
} else if (simg->pmap->op & OP_HSCALE) {
|
|
|
|
fprintf(fp, ":hscaled");
|
|
|
|
} else if (simg->pmap->op & OP_VSCALE) {
|
|
|
|
fprintf(fp, ":vscaled");
|
|
|
|
}
|
|
|
|
if (simg->pmap->op & OP_PROPSCALE) {
|
|
|
|
fprintf(fp, ":propscaled");
|
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
if (simg->iml->mod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod image 0x%02x 0x%02x 0x%02x\n", simg->iml->mod->brightness, simg->iml->mod->contrast,
|
|
|
|
simg->iml->mod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->rmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod red 0x%02x 0x%02x 0x%02x\n", simg->iml->rmod->brightness, simg->iml->rmod->contrast,
|
|
|
|
simg->iml->rmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->gmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod green 0x%02x 0x%02x 0x%02x\n", simg->iml->gmod->brightness, simg->iml->gmod->contrast,
|
|
|
|
simg->iml->gmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast,
|
|
|
|
simg->iml->bmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (simg->iml->border) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top,
|
|
|
|
simg->iml->border->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bevel) {
|
|
|
|
fprintf(fp, " bevel %s %hu %hu %hu %hu\n", ((simg->iml->bevel->up) ? "up" : "down"), simg->iml->bevel->edges->left,
|
|
|
|
simg->iml->bevel->edges->right, simg->iml->bevel->edges->top, simg->iml->bevel->edges->bottom);
|
|
|
|
}
|
|
|
|
if (simg->iml->pad) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " padding %hu %hu %hu %hu\n", simg->iml->pad->left, simg->iml->pad->right, simg->iml->pad->top,
|
|
|
|
simg->iml->pad->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Disabled state */
|
|
|
|
if (images[i].disabled != images[i].norm) {
|
|
|
|
simg = images[i].disabled;
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
imlib_context_set_image(simg->iml->im);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
fprintf(fp, " state disabled\n");
|
|
|
|
if (simg->fg || simg->bg) {
|
|
|
|
fprintf(fp, " color 0x%08x 0x%08x\n", (unsigned int) simg->fg, (unsigned int) simg->bg);
|
|
|
|
}
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
if (simg->iml->im) {
|
|
|
|
fprintf(fp, " file %s\n", NONULL(imlib_image_get_filename()));
|
|
|
|
}
|
|
|
|
fprintf(fp, " geom %hdx%hd+%hd+%hd", simg->pmap->w, simg->pmap->h, simg->pmap->x, simg->pmap->y);
|
|
|
|
if (simg->pmap->op & OP_TILE) {
|
|
|
|
fprintf(fp, ":tiled");
|
|
|
|
}
|
|
|
|
if ((simg->pmap->op & OP_SCALE) || ((simg->pmap->op & OP_HSCALE) && (simg->pmap->op & OP_VSCALE))) {
|
|
|
|
fprintf(fp, ":scaled");
|
|
|
|
} else if (simg->pmap->op & OP_HSCALE) {
|
|
|
|
fprintf(fp, ":hscaled");
|
|
|
|
} else if (simg->pmap->op & OP_VSCALE) {
|
|
|
|
fprintf(fp, ":vscaled");
|
|
|
|
}
|
|
|
|
if (simg->pmap->op & OP_PROPSCALE) {
|
|
|
|
fprintf(fp, ":propscaled");
|
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
if (simg->iml->mod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod image 0x%02x 0x%02x 0x%02x\n", simg->iml->mod->brightness, simg->iml->mod->contrast,
|
|
|
|
simg->iml->mod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->rmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod red 0x%02x 0x%02x 0x%02x\n", simg->iml->rmod->brightness, simg->iml->rmod->contrast,
|
|
|
|
simg->iml->rmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->gmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod green 0x%02x 0x%02x 0x%02x\n", simg->iml->gmod->brightness, simg->iml->gmod->contrast,
|
|
|
|
simg->iml->gmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bmod) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " colormod blue 0x%02x 0x%02x 0x%02x\n", simg->iml->bmod->brightness, simg->iml->bmod->contrast,
|
|
|
|
simg->iml->bmod->gamma);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
if (simg->iml->border) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " border %hu %hu %hu %hu\n", simg->iml->border->left, simg->iml->border->right, simg->iml->border->top,
|
|
|
|
simg->iml->border->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
if (simg->iml->bevel) {
|
|
|
|
fprintf(fp, " bevel %s %hu %hu %hu %hu\n", ((simg->iml->bevel->up) ? "up" : "down"), simg->iml->bevel->edges->left,
|
|
|
|
simg->iml->bevel->edges->right, simg->iml->bevel->edges->top, simg->iml->bevel->edges->bottom);
|
|
|
|
}
|
|
|
|
if (simg->iml->pad) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " padding %hu %hu %hu %hu\n", simg->iml->pad->left, simg->iml->pad->right, simg->iml->pad->top,
|
|
|
|
simg->iml->pad->bottom);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(fp, " end image\n");
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "end imageclasses\n\n");
|
|
|
|
|
|
|
|
for (i = 0; i < menu_list->nummenus; i++) {
|
|
|
|
menu_t *menu = menu_list->menus[i];
|
|
|
|
unsigned short j;
|
|
|
|
|
|
|
|
fprintf(fp, "begin menu\n");
|
|
|
|
fprintf(fp, " title \"%s\"\n", menu->title);
|
|
|
|
if (menu->font) {
|
|
|
|
unsigned long tmp;
|
|
|
|
|
|
|
|
if ((XGetFontProperty(menu->font, XA_FONT_NAME, &tmp)) == True) {
|
|
|
|
fprintf(fp, " font '%s'\n", ((char *) tmp));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (j = 0; j < menu->numitems; j++) {
|
|
|
|
menuitem_t *item = menu->items[j];
|
|
|
|
|
|
|
|
if (item->type == MENUITEM_SEP) {
|
|
|
|
fprintf(fp, " -\n");
|
|
|
|
} else {
|
|
|
|
fprintf(fp, " begin menuitem\n");
|
|
|
|
fprintf(fp, " text \"%s\"\n", item->text);
|
|
|
|
if (item->rtext) {
|
|
|
|
fprintf(fp, " rtext \"%s\"\n", item->rtext);
|
|
|
|
}
|
|
|
|
fprintf(fp, " action ");
|
|
|
|
if (item->type == MENUITEM_STRING) {
|
|
|
|
fprintf(fp, "string '%s'\n", safe_print_string(item->action.string, -1));
|
|
|
|
} else if (item->type == MENUITEM_ECHO) {
|
|
|
|
fprintf(fp, "echo '%s'\n", safe_print_string(item->action.string, -1));
|
|
|
|
} else if (item->type == MENUITEM_SUBMENU) {
|
|
|
|
fprintf(fp, "submenu \"%s\"\n", (item->action.submenu)->title);
|
|
|
|
} else if (item->type == MENUITEM_SCRIPT) {
|
|
|
|
fprintf(fp, "script '%s'\n", item->action.script);
|
|
|
|
}
|
|
|
|
fprintf(fp, " end\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(fp, "end menu\n");
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
1999-11-08 10:28:48 -08:00
|
|
|
}
|
1999-11-08 08:52:29 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "begin actions\n");
|
|
|
|
for (action = action_list; action; action = action->next) {
|
|
|
|
fprintf(fp, " bind ");
|
|
|
|
if (action->mod != MOD_NONE) {
|
|
|
|
if (action->mod & MOD_ANY) {
|
|
|
|
fprintf(fp, "anymod ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_CTRL) {
|
|
|
|
fprintf(fp, "ctrl ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_SHIFT) {
|
|
|
|
fprintf(fp, "shift ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_LOCK) {
|
|
|
|
fprintf(fp, "lock ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_META) {
|
|
|
|
fprintf(fp, "meta ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_ALT) {
|
|
|
|
fprintf(fp, "alt ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_MOD1) {
|
|
|
|
fprintf(fp, "mod1 ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_MOD2) {
|
|
|
|
fprintf(fp, "mod2 ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_MOD3) {
|
|
|
|
fprintf(fp, "mod3 ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_MOD4) {
|
|
|
|
fprintf(fp, "mod4 ");
|
|
|
|
}
|
|
|
|
if (action->mod & MOD_MOD5) {
|
|
|
|
fprintf(fp, "mod5 ");
|
|
|
|
}
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (action->keysym) {
|
|
|
|
fprintf(fp, "0x%04x", (unsigned int) action->keysym);
|
Wed Apr 5 21:48:39 PDT 2000 Michael Jennings <mej@eterm.org>
There are now two different sets of settings you can save. You can
save user settings, which are the things that one would generally
consider to be user-specific (toggles, text colors, etc.). You can
also save theme settings, which saves *everything*, including the
stuff that user settings don't include (like imageclasses, menus,
etc.). Settings are saved to user.cfg and theme.cfg, respectively.
Also, Eterm will now detect if it cannot write to the location from
which it got the theme (i.e., a system-wide directory), and will fall
back on ~/.Eterm/themes/<theme>. It WILL create this directory tree
if it does not already exist.
Hopefully this will make more people happy. :-)
SVN revision: 2440
2000-04-05 21:52:52 -07:00
|
|
|
} else {
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "button%d", (int) action->button);
|
|
|
|
}
|
|
|
|
fprintf(fp, " to ");
|
|
|
|
if (action->type == ACTION_STRING) {
|
|
|
|
fprintf(fp, "string '%s'\n", safe_print_string(action->param.string, -1));
|
|
|
|
} else if (action->type == ACTION_ECHO) {
|
|
|
|
fprintf(fp, "echo '%s'\n", safe_print_string(action->param.string, -1));
|
|
|
|
} else if (action->type == ACTION_MENU) {
|
|
|
|
fprintf(fp, "menu \"%s\"\n", (action->param.menu)->title);
|
|
|
|
} else if (action->type == ACTION_SCRIPT) {
|
|
|
|
fprintf(fp, "script '%s'\n", action->param.script);
|
|
|
|
}
|
1999-11-08 08:52:29 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "end actions\n\n");
|
1999-11-08 08:52:29 -08:00
|
|
|
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef MULTI_CHARSET
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "begin multichar\n");
|
|
|
|
if (rs_multichar_encoding) {
|
|
|
|
fprintf(fp, " encoding %s\n", rs_multichar_encoding);
|
1999-12-02 18:31:33 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < font_cnt; i++) {
|
|
|
|
if (etmfonts[i]) {
|
|
|
|
fprintf(fp, " font %d %s\n", i, etmfonts[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(fp, "end multichar\n\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
|
|
|
|
1999-11-08 08:52:29 -08:00
|
|
|
#ifdef USE_XIM
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "begin xim\n");
|
|
|
|
if (rs_input_method) {
|
|
|
|
fprintf(fp, " input_method %s\n", rs_input_method);
|
|
|
|
}
|
|
|
|
if (rs_preedit_type) {
|
|
|
|
fprintf(fp, " preedit_type %s\n", rs_preedit_type);
|
|
|
|
}
|
|
|
|
fprintf(fp, "end xim\n\n");
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (save_theme) {
|
|
|
|
for (bbar = buttonbar; bbar; bbar = bbar->next) {
|
|
|
|
button_t *b;
|
|
|
|
|
|
|
|
fprintf(fp, "begin button_bar\n");
|
|
|
|
fprintf(fp, " font '%s'\n", NONULL(get_font_name(bbar->font)));
|
|
|
|
if (bbar_is_top_docked(bbar)) {
|
|
|
|
fprintf(fp, " dock top\n");
|
|
|
|
} else if (bbar_is_bottom_docked(bbar)) {
|
|
|
|
fprintf(fp, " dock bottom\n");
|
|
|
|
} else {
|
|
|
|
fprintf(fp, " dock none\n");
|
|
|
|
}
|
|
|
|
fprintf(fp, " visible %s\n", (bbar_is_visible(bbar) ? "yes" : "no"));
|
|
|
|
for (b = bbar->buttons; b; b = b->next) {
|
|
|
|
if (b->len) {
|
|
|
|
fprintf(fp, " button \"%s\" ", safe_print_string(b->text, b->len));
|
|
|
|
} else {
|
|
|
|
fprintf(fp, " button ");
|
|
|
|
}
|
2002-10-12 22:28:36 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (b->icon && b->icon->iml) {
|
|
|
|
imlib_context_set_image(b->icon->iml->im);
|
|
|
|
fprintf(fp, "icon \"%s\" ", NONULL(imlib_image_get_filename()));
|
|
|
|
}
|
2002-10-12 22:28:36 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "action ");
|
|
|
|
if (b->type == ACTION_STRING) {
|
|
|
|
fprintf(fp, "string '%s'\n", safe_print_string(b->action.string, -1));
|
|
|
|
} else if (b->type == ACTION_ECHO) {
|
|
|
|
fprintf(fp, "echo '%s'\n", safe_print_string(b->action.string, -1));
|
|
|
|
} else if (b->type == ACTION_MENU) {
|
|
|
|
fprintf(fp, "menu \"%s\"\n", (b->action.menu)->title);
|
|
|
|
} else if (b->type == ACTION_SCRIPT) {
|
|
|
|
fprintf(fp, "script '%s'\n", b->action.script);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (b = bbar->rbuttons; b; b = b->next) {
|
|
|
|
if (b->len) {
|
|
|
|
fprintf(fp, " rbutton \"%s\" ", safe_print_string(b->text, b->len));
|
|
|
|
} else {
|
|
|
|
fprintf(fp, " rbutton ");
|
|
|
|
}
|
2002-10-12 22:28:36 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (b->icon && b->icon->iml) {
|
|
|
|
imlib_context_set_image(b->icon->iml->im);
|
|
|
|
fprintf(fp, "icon \"%s\" ", NONULL(imlib_image_get_filename()));
|
|
|
|
}
|
2002-10-12 22:28:36 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "action ");
|
|
|
|
if (b->type == ACTION_STRING) {
|
|
|
|
fprintf(fp, "string '%s'\n", safe_print_string(b->action.string, -1));
|
|
|
|
} else if (b->type == ACTION_ECHO) {
|
|
|
|
fprintf(fp, "echo '%s'\n", safe_print_string(b->action.string, -1));
|
|
|
|
} else if (b->type == ACTION_MENU) {
|
|
|
|
fprintf(fp, "menu \"%s\"\n", (b->action.menu)->title);
|
|
|
|
} else if (b->type == ACTION_SCRIPT) {
|
|
|
|
fprintf(fp, "script '%s'\n", b->action.script);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fprintf(fp, "end button_bar\n\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf(fp, "begin toggles\n");
|
2003-08-24 08:09:32 -07:00
|
|
|
fprintf(fp, " map_alert %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_MAP_ALERT) ? 1 : 0));
|
|
|
|
fprintf(fp, " visual_bell %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_VISUAL_BELL) ? 1 : 0));
|
|
|
|
fprintf(fp, " login_shell %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_LOGIN_SHELL) ? 1 : 0));
|
|
|
|
fprintf(fp, " scrollbar %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR) ? 1 : 0));
|
|
|
|
fprintf(fp, " utmp_logging %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_WRITE_UTMP) ? 1 : 0));
|
|
|
|
fprintf(fp, " meta8 %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_META8) ? 1 : 0));
|
|
|
|
fprintf(fp, " iconic %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_ICONIC) ? 1 : 0));
|
|
|
|
fprintf(fp, " home_on_output %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_HOME_ON_OUTPUT) ? 1 : 0));
|
|
|
|
fprintf(fp, " home_on_input %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_HOME_ON_INPUT) ? 1 : 0));
|
|
|
|
fprintf(fp, " no_input %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_NO_INPUT) ? 1 : 0));
|
|
|
|
fprintf(fp, " scrollbar_floating %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_FLOATING) ? 1 : 0));
|
|
|
|
fprintf(fp, " scrollbar_right %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_RIGHT) ? 1 : 0));
|
|
|
|
fprintf(fp, " scrollbar_popup %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP) ? 1 : 0));
|
|
|
|
fprintf(fp, " borderless %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_BORDERLESS) ? 1 : 0));
|
|
|
|
fprintf(fp, " double_buffer %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_DOUBLE_BUFFER) ? 1 : 0));
|
|
|
|
fprintf(fp, " no_cursor %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_NO_CURSOR) ? 1 : 0));
|
|
|
|
fprintf(fp, " pause %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_PAUSE) ? 1 : 0));
|
|
|
|
fprintf(fp, " xterm_select %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_XTERM_SELECT) ? 1 : 0));
|
|
|
|
fprintf(fp, " select_line %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SELECT_WHOLE_LINE) ? 1 : 0));
|
|
|
|
fprintf(fp, " select_trailing_spaces %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SELECT_TRAILING_SPACES) ? 1 : 0));
|
|
|
|
fprintf(fp, " report_as_keysyms %d\n", (BITFIELD_IS_SET(vt_options, VT_OPTIONS_REPORT_AS_KEYSYMS) ? 1 : 0));
|
|
|
|
fprintf(fp, " itrans %d\n", (BITFIELD_IS_SET(image_options, IMAGE_OPTIONS_ITRANS) ? 1 : 0));
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, " buttonbar %d\n", ((buttonbar && bbar_is_visible(buttonbar)) ? 1 : 0));
|
2003-08-24 08:09:32 -07:00
|
|
|
fprintf(fp, " resize_gravity %d\n", (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_RESIZE_GRAVITY) ? 1 : 0));
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "end toggles\n\n");
|
|
|
|
|
|
|
|
fprintf(fp, "begin keyboard\n");
|
|
|
|
tmp_str = XKeysymToString(ks_smallfont);
|
|
|
|
if (tmp_str) {
|
|
|
|
fprintf(fp, " smallfont_key %s\n", tmp_str);
|
|
|
|
}
|
|
|
|
tmp_str = XKeysymToString(ks_bigfont);
|
|
|
|
if (tmp_str) {
|
|
|
|
fprintf(fp, " bigfont_key %s\n", tmp_str);
|
|
|
|
}
|
|
|
|
if (rs_meta_mod) {
|
|
|
|
fprintf(fp, " meta_mod %d\n", rs_meta_mod);
|
|
|
|
}
|
|
|
|
if (rs_alt_mod) {
|
|
|
|
fprintf(fp, " alt_mod %d\n", rs_alt_mod);
|
|
|
|
}
|
|
|
|
if (rs_numlock_mod) {
|
|
|
|
fprintf(fp, " numlock_mod %d\n", rs_numlock_mod);
|
|
|
|
}
|
|
|
|
for (i = 0; i < 256; i++) {
|
|
|
|
if (KeySym_map[i]) {
|
2002-10-04 18:19:41 -07:00
|
|
|
fprintf(fp, " keysym 0xff%02x \'%s\'\n", i,
|
|
|
|
safe_print_string((char *) (KeySym_map[i] + 1), (unsigned long) KeySym_map[i][0]));
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef GREEK_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_greek_keyboard) {
|
|
|
|
fprintf(fp, " greek on %s\n", rs_greek_keyboard);
|
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, " app_keypad %d\n", (PrivateModes & PrivMode_aplKP ? 1 : 0));
|
|
|
|
fprintf(fp, " app_cursor %d\n", (PrivateModes & PrivMode_aplCUR ? 1 : 0));
|
|
|
|
fprintf(fp, "end keyboard\n\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "begin misc\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
#ifdef PRINTPIPE
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_print_pipe) {
|
|
|
|
fprintf(fp, " print_pipe '%s'\n", rs_print_pipe);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
fprintf(fp, " save_lines %d\n", rs_saveLines);
|
|
|
|
fprintf(fp, " min_anchor_size %d\n", rs_min_anchor_size);
|
|
|
|
fprintf(fp, " border_width %d\n", TermWin.internalBorder);
|
|
|
|
fprintf(fp, " term_name %s\n", getenv("TERM"));
|
2005-03-15 13:48:14 -08:00
|
|
|
fprintf(fp, " beep_command \"%s\"\n", SPIF_CAST_PTR(char) (
|
|
|
|
(rs_beep_command)
|
|
|
|
? (SPIF_CAST_PTR(char) rs_beep_command)
|
|
|
|
: (SPIF_CAST_PTR(char) "")
|
|
|
|
));
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, " debug %d\n", DEBUG_LEVEL);
|
2004-04-20 10:50:14 -07:00
|
|
|
if (save_theme && rs_exec_args && rs_theme && strcmp(rs_theme, PACKAGE)) {
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, " exec ");
|
|
|
|
for (i = 0; rs_exec_args[i]; i++) {
|
|
|
|
fprintf(fp, "'%s' ", rs_exec_args[i]);
|
|
|
|
}
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
}
|
2003-08-21 21:09:40 -07:00
|
|
|
#ifdef CUTCHAR_OPTION
|
2002-05-04 07:25:30 -07:00
|
|
|
if (rs_cutchars) {
|
2005-03-15 13:48:14 -08:00
|
|
|
spif_charptr_t cut_chars_escaped;
|
|
|
|
|
|
|
|
cut_chars_escaped = escape_string(SPIF_CAST(charptr) rs_cutchars, '\"', 0);
|
|
|
|
fprintf(fp, " cut_chars \"%s\"\n", (char *) cut_chars_escaped);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
1999-08-17 16:01:18 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
fprintf(fp, "end misc\n\n");
|
1999-08-17 16:01:18 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
fclose(fp);
|
|
|
|
return 0;
|
1999-08-17 16:01:18 -07:00
|
|
|
}
|