2000-03-08 19:38:31 -08:00
|
|
|
/*
|
|
|
|
* Copyright (C) 1997-2000, Michael Jennings
|
1999-09-21 19:34:13 -07:00
|
|
|
*
|
2000-03-08 19:38:31 -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 18:12:47 -07:00
|
|
|
*
|
2000-03-08 19:38:31 -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 18:12:47 -07:00
|
|
|
*
|
2000-03-08 19:38:31 -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 18:12:47 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
static const char cvs_ident[] = "$Id$";
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "feature.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
|
|
|
#include "../libmej/debug.h"
|
|
|
|
#include "../libmej/mem.h"
|
|
|
|
#include "../libmej/strings.h"
|
|
|
|
#include "debug.h"
|
|
|
|
#include "actions.h"
|
2000-02-15 19:37:34 -08:00
|
|
|
#include "buttons.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "command.h"
|
|
|
|
#include "e.h"
|
|
|
|
#include "events.h"
|
1999-09-21 19:34:13 -07:00
|
|
|
#include "font.h"
|
2000-03-14 19:17:45 -08:00
|
|
|
#include "misc.h"
|
1999-10-07 15:18:14 -07:00
|
|
|
#include "startup.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "options.h"
|
|
|
|
#include "pixmap.h"
|
|
|
|
#include "screen.h"
|
|
|
|
#include "scrollbar.h"
|
|
|
|
#include "term.h"
|
|
|
|
#include "windows.h"
|
|
|
|
|
|
|
|
#ifdef META8_OPTION
|
|
|
|
unsigned char meta_char = 033; /* Alt-key prefix */
|
|
|
|
#endif
|
|
|
|
unsigned long PrivateModes = PrivMode_Default;
|
|
|
|
unsigned long SavedModes = PrivMode_Default;
|
|
|
|
char *def_colorName[] =
|
|
|
|
{
|
|
|
|
"rgb:ff/ff/ff", "rgb:0/0/0", /* fg/bg */
|
|
|
|
"rgb:0/0/0", /* 0: black (#000000) */
|
|
|
|
#ifndef NO_BRIGHTCOLOR
|
|
|
|
/* low-intensity colors */
|
|
|
|
"rgb:cc/00/00", /* 1: red */
|
|
|
|
"rgb:00/cc/00", /* 2: green */
|
|
|
|
"rgb:cc/cc/00", /* 3: yellow */
|
|
|
|
"rgb:00/00/cc", /* 4: blue */
|
|
|
|
"rgb:cc/00/cc", /* 5: magenta */
|
|
|
|
"rgb:00/cc/cc", /* 6: cyan */
|
|
|
|
"rgb:fa/eb/d7", /* 7: white */
|
|
|
|
/* high-intensity colors */
|
|
|
|
"rgb:33/33/33", /* 8: bright black */
|
|
|
|
#endif /* NO_BRIGHTCOLOR */
|
|
|
|
"rgb:ff/00/00", /* 1/9: bright red */
|
|
|
|
"rgb:00/ff/00", /* 2/10: bright green */
|
|
|
|
"rgb:ff/ff/00", /* 3/11: bright yellow */
|
|
|
|
"rgb:00/00/ff", /* 4/12: bright blue */
|
|
|
|
"rgb:ff/00/ff", /* 5/13: bright magenta */
|
|
|
|
"rgb:00/ff/ff", /* 6/14: bright cyan */
|
|
|
|
"rgb:ff/ff/ff", /* 7/15: bright white */
|
|
|
|
#ifndef NO_CURSORCOLOR
|
|
|
|
NULL, NULL, /* cursorColor, cursorColor2 */
|
|
|
|
#endif /* NO_CURSORCOLOR */
|
|
|
|
NULL, NULL /* pointerColor, borderColor */
|
|
|
|
#ifndef NO_BOLDUNDERLINE
|
|
|
|
,NULL, NULL /* colorBD, colorUL */
|
|
|
|
#endif /* NO_BOLDUNDERLINE */
|
|
|
|
,"rgb:ff/ff/ff" /* menuTextColor */
|
|
|
|
,"rgb:b2/b2/b2" /* scrollColor: match Netscape color */
|
|
|
|
,NULL /* menuColor: match scrollbar color */
|
|
|
|
,NULL /* unfocusedscrollColor: somebody chose black? */
|
|
|
|
,NULL /* unfocusedMenuColor */
|
|
|
|
};
|
|
|
|
char *rs_color[NRS_COLORS];
|
|
|
|
Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
|
1999-12-02 18:31:33 -08:00
|
|
|
unsigned int MetaMask = 0, AltMask = 0, NumLockMask = 0;
|
|
|
|
unsigned int modmasks[] = { Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* This function queries X to see which modifier keys (specifically Alt, Meta, and NumLock,
|
|
|
|
since that's really all we care about) are bound to the 5 modifier masks. It then sets
|
|
|
|
the variables MetaMask, AltMask, and NumLockMask to the appropriate modifier mask (e.g.,
|
|
|
|
Mod1Mask). That way, we can use MetaMask in lookup_key() instead of using a specific
|
|
|
|
ModMask. This function also handles fallbacks, so that if there is no Meta key, the Alt
|
|
|
|
key will be used as Meta, and vice versa. get_modifiers() is called once on startup and
|
|
|
|
after each MappingNotify event. */
|
1999-12-02 18:31:33 -08:00
|
|
|
void
|
|
|
|
get_modifiers(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
unsigned short i;
|
|
|
|
XModifierKeymap *modmap;
|
|
|
|
KeyCode *kc;
|
|
|
|
|
|
|
|
modmap = XGetModifierMapping(Xdisplay);
|
|
|
|
kc = modmap->modifiermap;
|
2000-03-01 19:31:41 -08:00
|
|
|
|
|
|
|
/* For each of the 5 modifier masks... */
|
1999-12-02 18:31:33 -08:00
|
|
|
for (i = Mod5MapIndex; i >= Mod1MapIndex; i--) {
|
|
|
|
unsigned short j;
|
|
|
|
register unsigned short k, l;
|
|
|
|
|
|
|
|
k = i * modmap->max_keypermod;
|
|
|
|
l = i - Mod1MapIndex;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Find each key bound to it... */
|
1999-12-02 18:31:33 -08:00
|
|
|
for (j = 0; j < modmap->max_keypermod; j++, k++) {
|
|
|
|
unsigned char match = 0;
|
|
|
|
|
|
|
|
if (kc[k] == 0) {
|
|
|
|
break;
|
|
|
|
}
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Check to see if it's one that we care about. */
|
1999-12-02 18:31:33 -08:00
|
|
|
switch (XKeycodeToKeysym(Xdisplay, kc[k], 0)) {
|
|
|
|
case XK_Meta_L:
|
|
|
|
case XK_Meta_R:
|
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
|
|
|
D_X11(("Found Meta key as mod %d\n", l + 1));
|
1999-12-02 18:31:33 -08:00
|
|
|
match = MetaMask = modmasks[l];
|
|
|
|
break;
|
|
|
|
case XK_Alt_L:
|
|
|
|
case XK_Alt_R:
|
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
|
|
|
D_X11(("Found Alt key as mod %d\n", l + 1));
|
1999-12-02 18:31:33 -08:00
|
|
|
match = AltMask = modmasks[l];
|
|
|
|
break;
|
|
|
|
case XK_Num_Lock:
|
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
|
|
|
D_X11(("Found NumLock key as mod %d\n", l + 1));
|
1999-12-02 18:31:33 -08:00
|
|
|
match = NumLockMask = modmasks[l];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (match) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
XFreeModifiermap(modmap);
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Fallbacks. */
|
1999-12-02 18:31:33 -08:00
|
|
|
if (MetaMask == 0) {
|
|
|
|
if (AltMask != 0) {
|
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
|
|
|
D_X11(("Defaulted Meta key to match Alt mask\n"));
|
1999-12-02 18:31:33 -08:00
|
|
|
MetaMask = AltMask;
|
|
|
|
} else {
|
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
|
|
|
D_X11(("Defaulted Meta key to mod 1\n"));
|
1999-12-02 18:31:33 -08:00
|
|
|
MetaMask = Mod1Mask;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (AltMask == 0) {
|
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
|
|
|
D_X11(("Defaulted Alt key to match Meta mask\n"));
|
1999-12-02 18:31:33 -08:00
|
|
|
AltMask = MetaMask; /* MetaMask will always be defined at this point. */
|
|
|
|
}
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
|
1999-09-14 16:22:06 -07:00
|
|
|
/* To handle buffer overflows properly, we must malloc a buffer. Free it when done. */
|
|
|
|
#ifdef USE_XIM
|
|
|
|
# define LK_RET() do {if (kbuf_alloced) FREE(kbuf); return;} while (0)
|
|
|
|
#else
|
|
|
|
# define LK_RET() return
|
|
|
|
#endif
|
2000-03-01 19:31:41 -08:00
|
|
|
|
|
|
|
/* This function is called for every keypress event we receive. Its job is to convert
|
|
|
|
the keypress into its corresponding action. It is responsible for calling the action
|
|
|
|
bindings routine to see if there is an action binding for that keysym; if there is,
|
|
|
|
this routine will exit. If not, it continues. It then uses the keysym to determine
|
|
|
|
the action or escape sequence which should result from the keypress. Actions are
|
|
|
|
performed and the event discarded. Escape sequences are generated and sent to the
|
|
|
|
child process. */
|
1999-08-17 18:12:47 -07:00
|
|
|
void
|
|
|
|
lookup_key(XEvent * ev)
|
|
|
|
{
|
|
|
|
|
|
|
|
static int numlock_state = 0;
|
|
|
|
int ctrl, meta, shft, len;
|
|
|
|
KeySym keysym;
|
|
|
|
#ifdef USE_XIM
|
1999-11-12 19:15:18 -08:00
|
|
|
int valid_keysym = 0;
|
1999-09-14 16:22:06 -07:00
|
|
|
static unsigned char short_buf[256];
|
|
|
|
unsigned char *kbuf = short_buf;
|
|
|
|
int kbuf_alloced = 0;
|
|
|
|
#else
|
|
|
|
static unsigned char kbuf[KBUFSZ];
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
#ifdef GREEK_SUPPORT
|
|
|
|
static short greek_mode = 0;
|
|
|
|
#endif
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Quick boolean variables tell us which modifier keys were pressed. */
|
1999-08-17 18:12:47 -07:00
|
|
|
shft = (ev->xkey.state & ShiftMask);
|
|
|
|
ctrl = (ev->xkey.state & ControlMask);
|
1999-12-02 18:31:33 -08:00
|
|
|
meta = (ev->xkey.state & MetaMask);
|
2000-03-01 19:31:41 -08:00
|
|
|
|
|
|
|
/* The num lock key toggles application keypad
|
|
|
|
mode. Num lock on, app. keypad mode off. */
|
1999-12-02 18:31:33 -08:00
|
|
|
if (numlock_state || (ev->xkey.state & NumLockMask)) {
|
|
|
|
numlock_state = (ev->xkey.state & NumLockMask);
|
1999-08-17 18:12:47 -07:00
|
|
|
PrivMode((!numlock_state), PrivMode_aplKP);
|
|
|
|
}
|
|
|
|
#ifdef USE_XIM
|
1999-11-19 15:21:09 -08:00
|
|
|
if (xim_input_context != NULL) {
|
1999-08-17 18:12:47 -07:00
|
|
|
Status status_return;
|
|
|
|
|
|
|
|
kbuf[0] = '\0';
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Lookup the string equivalent in terms of the XIM input context. */
|
|
|
|
len = XmbLookupString(xim_input_context, &ev->xkey, (char *) kbuf, sizeof(short_buf), &keysym, &status_return);
|
2000-03-14 19:17:45 -08:00
|
|
|
D_TTY(("XmbLookupString() gave us len %d, keysym 0x%04x, and buffer \"%s\" based on the XIM input context %010p\n",
|
|
|
|
len, keysym, safe_print_string(kbuf, len), xim_input_context));
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Whoops, it's too long. Allocate a new buffer and repeat the call. */
|
1999-09-14 16:22:06 -07:00
|
|
|
if (status_return == XBufferOverflow) {
|
|
|
|
kbuf = (unsigned char *) MALLOC(len + 1);
|
|
|
|
kbuf_alloced = 1;
|
1999-11-19 15:21:09 -08:00
|
|
|
len = XmbLookupString(xim_input_context, &ev->xkey, (char *) kbuf, len, &keysym, &status_return);
|
2000-03-14 19:17:45 -08:00
|
|
|
D_TTY(("XmbLookupString() gave us len %d, keysym 0x%04x, and buffer \"%s\" based on the XIM input context %010p\n",
|
|
|
|
len, keysym, safe_print_string(kbuf, len), xim_input_context));
|
1999-09-14 16:22:06 -07:00
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
valid_keysym = (status_return == XLookupKeySym) || (status_return == XLookupBoth);
|
|
|
|
} else {
|
2000-03-01 19:31:41 -08:00
|
|
|
/* No XIM input context. Do it the normal way. */
|
1999-10-27 11:10:40 -07:00
|
|
|
len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(short_buf), &keysym, NULL);
|
2000-03-14 19:17:45 -08:00
|
|
|
D_TTY(("XLookupString() gave us len %d, keysym 0x%04x, and buffer \"%s\"\n", len, keysym, safe_print_string(kbuf, len)));
|
1999-11-18 20:05:24 -08:00
|
|
|
valid_keysym = 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
#else /* USE_XIM */
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Translate the key event into its corresponding string according to X. This also gets us a keysym. */
|
1999-10-27 11:10:40 -07:00
|
|
|
len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, NULL);
|
2000-03-14 19:17:45 -08:00
|
|
|
D_TTY(("XLookupString() gave us len %d, keysym 0x%04x, and buffer \"%s\"\n", len, keysym, safe_print_string(kbuf, len)));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* If there is no string and it's a Latin2-4 character, replace it with the Latin1 character instead. */
|
1999-08-17 18:12:47 -07:00
|
|
|
if (!len && (keysym >= 0x0100) && (keysym < 0x0400)) {
|
|
|
|
len = 1;
|
|
|
|
kbuf[0] = (keysym & 0xff);
|
|
|
|
}
|
|
|
|
#endif /* USE_XIM */
|
|
|
|
|
1999-09-08 10:57:06 -07:00
|
|
|
#ifdef USE_XIM
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Don't do anything without a valid keysym. */
|
1999-09-08 10:57:06 -07:00
|
|
|
if (valid_keysym) {
|
|
|
|
#endif
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Check for a corresponding action binding. If there is one, we're done with this event. */
|
1999-08-17 18:12:47 -07:00
|
|
|
if (action_dispatch(ev, keysym)) {
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
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
|
|
|
}
|
2000-03-17 20:55:14 -08:00
|
|
|
if (len) {
|
|
|
|
/* If we're in pause mode, exit. */
|
|
|
|
if (keypress_exit) {
|
1999-08-17 18:12:47 -07:00
|
|
|
exit(0);
|
2000-03-17 20:55:14 -08:00
|
|
|
}
|
|
|
|
/* Only home for keypresses with length. */
|
|
|
|
if (Options & Opt_home_on_input) {
|
|
|
|
TermWin.view_start = 0;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* This is a special mode that reports all extended keysyms (above 0xff00) to the application
|
|
|
|
as escape sequences. Very few applications use it, but it can be a handy thing to have. */
|
1999-08-17 18:12:47 -07:00
|
|
|
if ((Options & Opt_report_as_keysyms) && (keysym >= 0xff00)) {
|
1999-10-27 11:10:40 -07:00
|
|
|
len = sprintf((char *) kbuf, "\033[k%X;%X~", (unsigned int) (ev->xkey.state & 0xff), (unsigned int) (keysym & 0xff));
|
1999-08-17 18:12:47 -07:00
|
|
|
tt_write(kbuf, len);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
#ifdef HOTKEY
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Ctrl-> and Ctrl-< should change font sizes. (Meta if HOTKEY has been changed to Meta.) */
|
1999-08-17 18:12:47 -07:00
|
|
|
if (HOTKEY) {
|
|
|
|
if (keysym == ks_bigfont) {
|
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
|
|
|
change_font(0, BIGGER_FONT);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
} else if (keysym == ks_smallfont) {
|
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
|
|
|
change_font(0, SMALLER_FONT);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (shft) {
|
|
|
|
/* Shift + F1 - F10 generates F11 - F20 */
|
|
|
|
if (keysym >= XK_F1 && keysym <= XK_F10) {
|
|
|
|
keysym += (XK_F11 - XK_F1);
|
2000-03-01 19:31:41 -08:00
|
|
|
shft = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
} else if (!ctrl && !meta && (PrivateModes & PrivMode_ShiftKeys)) {
|
|
|
|
switch (keysym) {
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_Prior: /* Shift-PgUp scrolls up a page */
|
1999-08-17 18:12:47 -07:00
|
|
|
if (TermWin.saveLines) {
|
2000-03-17 20:55:14 -08:00
|
|
|
scr_page(UP, (TermWin.nrow - CONTEXT_LINES));
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_Next: /* Shift-PgDn scrolls down a page */
|
1999-08-17 18:12:47 -07:00
|
|
|
if (TermWin.saveLines) {
|
2000-03-17 20:55:14 -08:00
|
|
|
scr_page(DN, (TermWin.nrow - CONTEXT_LINES));
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_Insert: /* Shift-Ins pastes the current selection. */
|
1999-08-17 18:12:47 -07:00
|
|
|
selection_request(ev->xkey.time, ev->xkey.x, ev->xkey.y);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_KP_Add: /* Shift-Plus on the keypad increases the font size */
|
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
|
|
|
change_font(0, BIGGER_FONT);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_KP_Subtract: /* Shift-Minus on the keypad decreases the font size */
|
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
|
|
|
change_font(0, SMALLER_FONT);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#ifdef UNSHIFTED_SCROLLKEYS
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Allow PgUp/PgDn by themselves to scroll. Not recommended. */
|
1999-08-17 18:12:47 -07:00
|
|
|
else if (!ctrl && !meta) {
|
|
|
|
switch (keysym) {
|
|
|
|
case XK_Prior:
|
|
|
|
if (TermWin.saveLines) {
|
2000-03-17 20:55:14 -08:00
|
|
|
scr_page(UP, TermWin.nrow - CONTEXT_LINES);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XK_Next:
|
|
|
|
if (TermWin.saveLines) {
|
2000-03-17 20:55:14 -08:00
|
|
|
scr_page(DN, TermWin.nrow - CONTEXT_LINES);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
switch (keysym) {
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_Print: /* Print the screen contents out to the print pipe */
|
1999-08-17 18:12:47 -07:00
|
|
|
#if DEBUG >= DEBUG_SELECTION
|
|
|
|
if (debug_level >= DEBUG_SELECTION) {
|
|
|
|
debug_selection();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef PRINTPIPE
|
|
|
|
scr_printscreen(ctrl | shft);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XK_Mode_switch:
|
|
|
|
#ifdef GREEK_SUPPORT
|
|
|
|
greek_mode = !greek_mode;
|
|
|
|
if (greek_mode) {
|
|
|
|
xterm_seq(XTerm_title, (greek_getmode() == GREEK_ELOT928 ? "[Greek: iso]" : "[Greek: ibm]"));
|
|
|
|
greek_reset();
|
|
|
|
} else
|
|
|
|
xterm_seq(XTerm_title, APL_NAME "-" VERSION);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Process extended keysyms. This is where the conversion to escape sequences happens. */
|
|
|
|
if (keysym >= 0xff00 && keysym <= 0xffff) {
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef KEYSYM_ATTRIBUTE
|
2000-03-01 19:31:41 -08:00
|
|
|
/* The "keysym" attribute in the config file gets handled here. */
|
|
|
|
if (!(shft | ctrl) && KeySym_map[keysym - 0xff00] != NULL) {
|
1999-08-17 18:12:47 -07:00
|
|
|
|
1999-09-28 12:38:43 -07:00
|
|
|
const unsigned char *tmpbuf;
|
1999-08-17 18:12:47 -07:00
|
|
|
unsigned int len;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
tmpbuf = (KeySym_map[keysym - 0xff00]);
|
1999-09-28 12:38:43 -07:00
|
|
|
len = *tmpbuf++;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
|
|
|
/* escape prefix */
|
|
|
|
if (meta
|
|
|
|
# ifdef META8_OPTION
|
|
|
|
&& (meta_char == 033)
|
|
|
|
# endif
|
|
|
|
) {
|
|
|
|
const unsigned char ch = '\033';
|
|
|
|
|
|
|
|
tt_write(&ch, 1);
|
|
|
|
}
|
1999-09-28 12:38:43 -07:00
|
|
|
tt_write(tmpbuf, len);
|
1999-09-14 16:22:06 -07:00
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
} else
|
|
|
|
#endif
|
2000-03-01 19:31:41 -08:00
|
|
|
/* This is a big-ass switch statement that handles all the special keysyms */
|
1999-08-17 18:12:47 -07:00
|
|
|
switch (keysym) {
|
|
|
|
case XK_BackSpace:
|
|
|
|
len = 1;
|
|
|
|
#ifdef FORCE_BACKSPACE
|
|
|
|
kbuf[0] = (!(shft | ctrl) ? '\b' : '\177');
|
|
|
|
#elif defined(FORCE_DELETE)
|
|
|
|
kbuf[0] = ((shft | ctrl) ? '\b' : '\177');
|
|
|
|
#else
|
|
|
|
kbuf[0] = (((PrivateModes & PrivMode_BackSpace) ? !(shft | ctrl) : (shft | ctrl)) ? '\b' : '\177');
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Tab key is normal unless it's shift-tab. */
|
1999-08-17 18:12:47 -07:00
|
|
|
case XK_Tab:
|
|
|
|
if (shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033[Z");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef XK_KP_Home
|
|
|
|
case XK_KP_Home:
|
|
|
|
/* allow shift to override */
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Ow");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* -> else FALL THROUGH */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
case XK_Home:
|
1999-09-28 12:38:43 -07:00
|
|
|
len = strlen(strcpy(kbuf, KS_HOME));
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef XK_KP_Left
|
2000-03-01 19:31:41 -08:00
|
|
|
case XK_KP_Left: /* \033Ot or standard cursor key */
|
|
|
|
case XK_KP_Up: /* \033Ox or standard cursor key */
|
|
|
|
case XK_KP_Right: /* \033Ov or standard cursor key */
|
|
|
|
case XK_KP_Down: /* \033Or or standard cursor key */
|
2000-01-14 16:37:22 -08:00
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
1999-08-17 18:12:47 -07:00
|
|
|
len = 3;
|
2000-03-01 19:31:41 -08:00
|
|
|
strcpy(kbuf, "\033OZ"); /* The Z is replaced by t, x, v, or r */
|
2000-01-14 16:37:22 -08:00
|
|
|
kbuf[2] = ("txvr"[keysym - XK_KP_Left]);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
keysym = XK_Left + (keysym - XK_KP_Left);
|
|
|
|
}
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Continue on with the normal cursor keys... */
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
case XK_Left: /* "\033[D" */
|
|
|
|
case XK_Up: /* "\033[A" */
|
|
|
|
case XK_Right: /* "\033[C" */
|
|
|
|
case XK_Down: /* "\033[B" */
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033[@");
|
|
|
|
kbuf[2] = ("DACB"[keysym - XK_Left]);
|
|
|
|
if (PrivateModes & PrivMode_aplCUR) {
|
|
|
|
kbuf[1] = 'O';
|
|
|
|
} else if (shft) { /* do Shift first */
|
|
|
|
kbuf[2] = ("dacb"[keysym - XK_Left]);
|
|
|
|
} else if (ctrl) {
|
|
|
|
kbuf[1] = 'O';
|
|
|
|
kbuf[2] = ("dacb"[keysym - XK_Left]);
|
|
|
|
}
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
|
|
|
|
/* Keypad and normal PgUp/PgDn */
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifndef UNSHIFTED_SCROLLKEYS
|
|
|
|
# ifdef XK_KP_Prior
|
|
|
|
case XK_KP_Prior:
|
|
|
|
/* allow shift to override */
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Oy");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* -> else FALL THROUGH */
|
|
|
|
# endif /* XK_KP_Prior */
|
|
|
|
case XK_Prior:
|
|
|
|
len = 4;
|
|
|
|
strcpy(kbuf, "\033[5~");
|
|
|
|
break;
|
|
|
|
# ifdef XK_KP_Next
|
|
|
|
case XK_KP_Next:
|
|
|
|
/* allow shift to override */
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Os");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* -> else FALL THROUGH */
|
|
|
|
# endif /* XK_KP_Next */
|
|
|
|
case XK_Next:
|
|
|
|
len = 4;
|
|
|
|
strcpy(kbuf, "\033[6~");
|
|
|
|
break;
|
|
|
|
#endif /* UNSHIFTED_SCROLLKEYS */
|
2000-03-01 19:31:41 -08:00
|
|
|
|
|
|
|
/* End key */
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef XK_KP_End
|
|
|
|
case XK_KP_End:
|
|
|
|
/* allow shift to override */
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Oq");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* -> else FALL THROUGH */
|
|
|
|
#endif /* XK_KP_End */
|
|
|
|
case XK_End:
|
|
|
|
len = strlen(strcpy(kbuf, KS_END));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XK_Select:
|
|
|
|
len = 4;
|
|
|
|
strcpy(kbuf, "\033[4~");
|
|
|
|
break;
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
#ifdef DXK_Remove
|
|
|
|
case DXK_Remove:
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
case XK_Execute:
|
|
|
|
len = 4;
|
|
|
|
strcpy(kbuf, "\033[3~");
|
|
|
|
break;
|
2000-01-17 13:29:27 -08:00
|
|
|
|
|
|
|
#ifdef XK_KP_Insert
|
|
|
|
case XK_KP_Insert:
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Op");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
case XK_Insert:
|
|
|
|
len = 4;
|
|
|
|
strcpy(kbuf, "\033[2~");
|
|
|
|
break;
|
|
|
|
|
2000-01-17 13:29:27 -08:00
|
|
|
#ifdef XK_KP_Delete
|
|
|
|
case XK_KP_Delete:
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033On");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
case XK_Delete:
|
|
|
|
#ifdef KS_DELETE
|
|
|
|
len = strlen(strcpy(kbuf, KS_DELETE));
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
1999-08-17 18:12:47 -07:00
|
|
|
case XK_Menu:
|
|
|
|
len = 5;
|
|
|
|
strcpy(kbuf, "\033[29~");
|
|
|
|
break;
|
|
|
|
case XK_Find:
|
|
|
|
len = 4;
|
|
|
|
strcpy(kbuf, "\033[1~");
|
|
|
|
break;
|
|
|
|
case XK_Help:
|
|
|
|
len = 5;
|
|
|
|
strcpy(kbuf, "\033[28~");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XK_KP_Enter:
|
|
|
|
/* allow shift to override */
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033OM");
|
|
|
|
} else {
|
|
|
|
len = 1;
|
|
|
|
kbuf[0] = '\r';
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#ifdef XK_KP_Begin
|
|
|
|
case XK_KP_Begin:
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Ou");
|
|
|
|
break;
|
|
|
|
#endif /* XK_KP_Begin */
|
|
|
|
|
|
|
|
case XK_KP_F1: /* "\033OP" */
|
|
|
|
case XK_KP_F2: /* "\033OQ" */
|
|
|
|
case XK_KP_F3: /* "\033OR" */
|
|
|
|
case XK_KP_F4: /* "\033OS" */
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033OP");
|
|
|
|
kbuf[2] += (keysym - XK_KP_F1);
|
|
|
|
break;
|
|
|
|
|
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
|
|
|
case XK_KP_Multiply: /* "\033Oj" : "*" */
|
|
|
|
case XK_KP_Add: /* "\033Ok" : "+" */
|
|
|
|
case XK_KP_Separator: /* "\033Ol" : "," */
|
|
|
|
case XK_KP_Subtract: /* "\033Om" : "-" */
|
|
|
|
case XK_KP_Decimal: /* "\033On" : "." */
|
|
|
|
case XK_KP_Divide: /* "\033Oo" : "/" */
|
|
|
|
case XK_KP_0: /* "\033Op" : "0" */
|
|
|
|
case XK_KP_1: /* "\033Oq" : "1" */
|
|
|
|
case XK_KP_2: /* "\033Or" : "2" */
|
|
|
|
case XK_KP_3: /* "\033Os" : "3" */
|
|
|
|
case XK_KP_4: /* "\033Ot" : "4" */
|
|
|
|
case XK_KP_5: /* "\033Ou" : "5" */
|
|
|
|
case XK_KP_6: /* "\033Ov" : "6" */
|
|
|
|
case XK_KP_7: /* "\033Ow" : "7" */
|
|
|
|
case XK_KP_8: /* "\033Ox" : "8" */
|
|
|
|
case XK_KP_9: /* "\033Oy" : "9" */
|
1999-08-17 18:12:47 -07:00
|
|
|
/* allow shift to override */
|
|
|
|
if ((PrivateModes & PrivMode_aplKP) ? !shft : shft) {
|
|
|
|
len = 3;
|
|
|
|
strcpy(kbuf, "\033Oj");
|
|
|
|
kbuf[2] += (keysym - XK_KP_Multiply);
|
|
|
|
} else {
|
|
|
|
len = 1;
|
|
|
|
kbuf[0] = ('*' + (keysym - XK_KP_Multiply));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
#define FKEY(n,fkey) do { \
|
|
|
|
len = 5; \
|
1999-10-27 11:10:40 -07:00
|
|
|
sprintf((char *) kbuf,"\033[%02d~", (int)((n) + (keysym - fkey))); \
|
1999-08-17 18:12:47 -07:00
|
|
|
} while (0);
|
|
|
|
|
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
|
|
|
case XK_F1: /* "\033[11~" */
|
|
|
|
case XK_F2: /* "\033[12~" */
|
|
|
|
case XK_F3: /* "\033[13~" */
|
|
|
|
case XK_F4: /* "\033[14~" */
|
|
|
|
case XK_F5: /* "\033[15~" */
|
|
|
|
FKEY(11, XK_F1);
|
|
|
|
break;
|
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
|
|
|
case XK_F6: /* "\033[17~" */
|
|
|
|
case XK_F7: /* "\033[18~" */
|
|
|
|
case XK_F8: /* "\033[19~" */
|
|
|
|
case XK_F9: /* "\033[20~" */
|
|
|
|
case XK_F10: /* "\033[21~" */
|
|
|
|
FKEY(17, XK_F6);
|
|
|
|
break;
|
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
|
|
|
case XK_F11: /* "\033[23~" */
|
|
|
|
case XK_F12: /* "\033[24~" */
|
|
|
|
case XK_F13: /* "\033[25~" */
|
|
|
|
case XK_F14: /* "\033[26~" */
|
|
|
|
FKEY(23, XK_F11);
|
|
|
|
break;
|
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
|
|
|
case XK_F15: /* "\033[28~" */
|
|
|
|
case XK_F16: /* "\033[29~" */
|
|
|
|
FKEY(28, XK_F15);
|
|
|
|
break;
|
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
|
|
|
case XK_F17: /* "\033[31~" */
|
|
|
|
case XK_F18: /* "\033[32~" */
|
|
|
|
case XK_F19: /* "\033[33~" */
|
|
|
|
case XK_F20: /* "\033[34~" */
|
|
|
|
case XK_F21: /* "\033[35~" */
|
|
|
|
case XK_F22: /* "\033[36~" */
|
|
|
|
case XK_F23: /* "\033[37~" */
|
|
|
|
case XK_F24: /* "\033[38~" */
|
|
|
|
case XK_F25: /* "\033[39~" */
|
|
|
|
case XK_F26: /* "\033[40~" */
|
|
|
|
case XK_F27: /* "\033[41~" */
|
|
|
|
case XK_F28: /* "\033[42~" */
|
|
|
|
case XK_F29: /* "\033[43~" */
|
|
|
|
case XK_F30: /* "\033[44~" */
|
|
|
|
case XK_F31: /* "\033[45~" */
|
|
|
|
case XK_F32: /* "\033[46~" */
|
|
|
|
case XK_F33: /* "\033[47~" */
|
|
|
|
case XK_F34: /* "\033[48~" */
|
|
|
|
case XK_F35: /* "\033[49~" */
|
|
|
|
FKEY(31, XK_F17);
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
#undef FKEY
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef META8_OPTION
|
|
|
|
if (meta && (meta_char == 0x80) && len > 0) {
|
|
|
|
kbuf[len - 1] |= 0x80;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
} else if (ctrl && keysym == XK_minus) {
|
|
|
|
len = 1;
|
|
|
|
kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */
|
|
|
|
} else {
|
|
|
|
#ifdef META8_OPTION
|
|
|
|
/* set 8-bit on */
|
|
|
|
if (meta && (meta_char == 0x80)) {
|
|
|
|
|
|
|
|
unsigned char *ch;
|
|
|
|
|
|
|
|
for (ch = kbuf; ch < kbuf + len; ch++)
|
|
|
|
*ch |= 0x80;
|
|
|
|
meta = 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef GREEK_SUPPORT
|
|
|
|
if (greek_mode)
|
|
|
|
len = greek_xlat(kbuf, len);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef USE_XIM
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* All processed. If there's still no string, we're done. */
|
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 (len <= 0) {
|
|
|
|
LK_RET();
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* these modifications only affect the static keybuffer
|
|
|
|
* pass Shift/Control indicators for function keys ending with `~'
|
|
|
|
*
|
|
|
|
* eg,
|
|
|
|
* Prior = "ESC[5~"
|
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
|
|
|
* Shift+Prior = "ESC[5$"
|
1999-08-17 18:12:47 -07:00
|
|
|
* Ctrl+Prior = "ESC[5^"
|
|
|
|
* Ctrl+Shift+Prior = "ESC[5@"
|
|
|
|
*/
|
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 (kbuf[0] == '\033' && kbuf[1] == '[' && kbuf[len - 1] == '~') {
|
1999-08-17 18:12:47 -07:00
|
|
|
kbuf[len - 1] = (shft ? (ctrl ? '@' : '$') : (ctrl ? '^' : '~'));
|
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
|
|
|
|
|
|
|
/* escape prefix */
|
|
|
|
if (meta
|
|
|
|
#ifdef META8_OPTION
|
|
|
|
&& (meta_char == 033)
|
|
|
|
#endif
|
|
|
|
) {
|
|
|
|
|
|
|
|
const unsigned char ch = '\033';
|
|
|
|
|
|
|
|
tt_write(&ch, 1);
|
|
|
|
}
|
2000-03-14 19:17:45 -08:00
|
|
|
D_TTY(("After handling: len %d, keysym 0x%04x, and buffer \"%s\"\n", len, keysym, safe_print_string(kbuf, len)));
|
2000-03-01 19:31:41 -08:00
|
|
|
tt_write(kbuf, len); /* Send the resulting string to the child process */
|
1999-09-14 18:37:01 -07:00
|
|
|
|
|
|
|
LK_RET();
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef PRINTPIPE
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Open the print pipe. */
|
1999-08-17 18:12:47 -07:00
|
|
|
FILE *
|
|
|
|
popen_printer(void)
|
|
|
|
{
|
2000-03-01 19:31:41 -08:00
|
|
|
FILE *stream;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
if (((my_ruid != my_euid) || (my_rgid != my_egid)) && (strcmp(rs_print_pipe, PRINTPIPE))) {
|
|
|
|
print_warning("Running setuid/setgid. Refusing to use custom printpipe.");
|
|
|
|
RESET_AND_ASSIGN(rs_print_pipe, StrDup(PRINTPIPE));
|
|
|
|
}
|
|
|
|
if ((stream = (FILE *) popen(rs_print_pipe, "w")) == NULL) {
|
|
|
|
print_error("Can't open printer pipe \"%s\" -- %s", rs_print_pipe, strerror(errno));
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
return stream;
|
|
|
|
}
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Close the print pipe. */
|
1999-08-17 18:12:47 -07:00
|
|
|
int
|
|
|
|
pclose_printer(FILE * stream)
|
|
|
|
{
|
|
|
|
fflush(stream);
|
|
|
|
return pclose(stream);
|
|
|
|
}
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Print everything until we hit a \e[4i sequence. */
|
1999-08-17 18:12:47 -07:00
|
|
|
void
|
|
|
|
process_print_pipe(void)
|
|
|
|
{
|
|
|
|
const char *const escape_seq = "\033[4i";
|
|
|
|
const char *const rev_escape_seq = "i4[\033";
|
|
|
|
int index;
|
|
|
|
FILE *fd;
|
|
|
|
|
|
|
|
if ((fd = popen_printer()) != NULL) {
|
|
|
|
for (index = 0; index < 4; /* nil */ ) {
|
|
|
|
unsigned char ch = cmd_getc();
|
|
|
|
|
|
|
|
if (ch == escape_seq[index])
|
|
|
|
index++;
|
|
|
|
else if (index)
|
|
|
|
for ( /*nil */ ; index > 0; index--)
|
|
|
|
fputc(rev_escape_seq[index - 1], fd);
|
|
|
|
|
|
|
|
if (index == 0)
|
|
|
|
fputc(ch, fd);
|
|
|
|
}
|
|
|
|
pclose_printer(fd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* PRINTPIPE */
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* This routine processes escape sequences; i.e., when a \033 character is encountered in the
|
|
|
|
input stream, this function is called to process it. First, we get the next character off
|
|
|
|
the input stream (the one after the ESC) and store it in ch. Then we proceed based on what
|
|
|
|
ch is. Some escape sequences are only ESC followed by a single character, so the
|
|
|
|
processing of those ends here. Others are longer and get passed on to other functions from
|
|
|
|
this one. */
|
1999-08-17 18:12:47 -07:00
|
|
|
void
|
|
|
|
process_escape_seq(void)
|
|
|
|
{
|
|
|
|
unsigned char ch = cmd_getc();
|
|
|
|
|
|
|
|
switch (ch) {
|
|
|
|
case '#':
|
|
|
|
if (cmd_getc() == '8')
|
|
|
|
scr_E();
|
|
|
|
break;
|
|
|
|
case '(':
|
|
|
|
scr_charset_set(0, cmd_getc());
|
|
|
|
break;
|
|
|
|
case ')':
|
|
|
|
scr_charset_set(1, cmd_getc());
|
|
|
|
break;
|
|
|
|
case '*':
|
|
|
|
scr_charset_set(2, cmd_getc());
|
|
|
|
break;
|
|
|
|
case '+':
|
|
|
|
scr_charset_set(3, cmd_getc());
|
|
|
|
break;
|
|
|
|
#ifdef MULTI_CHARSET
|
|
|
|
case '$':
|
|
|
|
scr_charset_set(-2, cmd_getc());
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case '7':
|
|
|
|
scr_cursor(SAVE);
|
|
|
|
break;
|
|
|
|
case '8':
|
|
|
|
scr_cursor(RESTORE);
|
|
|
|
break;
|
|
|
|
case '=':
|
|
|
|
case '>':
|
|
|
|
PrivMode((ch == '='), PrivMode_aplKP);
|
|
|
|
break;
|
|
|
|
case '@':
|
|
|
|
(void) cmd_getc();
|
|
|
|
break;
|
|
|
|
case 'D':
|
|
|
|
scr_index(UP);
|
|
|
|
break;
|
|
|
|
case 'E':
|
1999-10-27 11:10:40 -07:00
|
|
|
scr_add_lines((unsigned char *) "\n\r", 1, 2);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 'G':
|
1999-10-11 12:29:45 -07:00
|
|
|
if ((ch = cmd_getc()) == 'Q') { /* query graphics */
|
1999-10-27 11:10:40 -07:00
|
|
|
tt_printf((unsigned char *) "\033G0\n"); /* no graphics */
|
1999-10-11 12:29:45 -07:00
|
|
|
} else {
|
|
|
|
do {
|
|
|
|
ch = cmd_getc();
|
|
|
|
} while (ch != ':');
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 'H':
|
|
|
|
scr_set_tab(1);
|
|
|
|
break;
|
|
|
|
case 'M':
|
|
|
|
scr_index(DN);
|
|
|
|
break;
|
|
|
|
case 'Z':
|
1999-10-27 11:10:40 -07:00
|
|
|
tt_printf((unsigned char *) ESCZ_ANSWER);
|
2000-03-01 19:31:41 -08:00
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
case '[':
|
|
|
|
process_csi_seq();
|
|
|
|
break;
|
|
|
|
case ']':
|
|
|
|
process_xterm_seq();
|
|
|
|
break;
|
|
|
|
case 'c':
|
|
|
|
scr_poweron();
|
|
|
|
break;
|
|
|
|
case 'n':
|
|
|
|
scr_charset_choose(2);
|
|
|
|
break;
|
|
|
|
case 'o':
|
|
|
|
scr_charset_choose(3);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-03-01 19:31:41 -08:00
|
|
|
/* This function handles Code Sequence Introducer (CSI) escape sequences. At this point,
|
|
|
|
we've read "\e[" from the input stream. CSI sequences take an arbitrary number of
|
|
|
|
parameters and are used almost exclusively for terminal window navigation and
|
|
|
|
manipulation. */
|
1999-08-17 18:12:47 -07:00
|
|
|
void
|
|
|
|
process_csi_seq(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
unsigned char ch, priv;
|
|
|
|
unsigned int nargs;
|
|
|
|
int arg[ESC_ARGS];
|
|
|
|
|
|
|
|
nargs = 0;
|
|
|
|
arg[0] = 0;
|
|
|
|
arg[1] = 0;
|
|
|
|
|
|
|
|
priv = 0;
|
2000-03-01 19:31:41 -08:00
|
|
|
ch = cmd_getc(); /* Get the next character */
|
1999-08-17 18:12:47 -07:00
|
|
|
if (ch >= '<' && ch <= '?') {
|
2000-03-01 19:31:41 -08:00
|
|
|
priv = ch; /* DEC private mode sequence. Get next character. */
|
1999-08-17 18:12:47 -07:00
|
|
|
ch = cmd_getc();
|
|
|
|
}
|
2000-03-01 19:31:41 -08:00
|
|
|
/* Read semicolon-delimited numerical arguments, if any. */
|
1999-08-17 18:12:47 -07:00
|
|
|
do {
|
|
|
|
int n;
|
|
|
|
|
|
|
|
for (n = 0; isdigit(ch); ch = cmd_getc())
|
|
|
|
n = n * 10 + (ch - '0');
|
|
|
|
|
|
|
|
if (nargs < ESC_ARGS)
|
|
|
|
arg[nargs++] = n;
|
|
|
|
if (ch == '\b') {
|
|
|
|
scr_backspace();
|
|
|
|
} else if (ch == 033) {
|
2000-03-01 19:31:41 -08:00
|
|
|
cmd_ungetc(); /* New escape sequence starting in the middle of one. Punt. */
|
1999-08-17 18:12:47 -07:00
|
|
|
return;
|
|
|
|
} else if (ch < ' ') {
|
2000-03-01 19:31:41 -08:00
|
|
|
scr_add_lines(&ch, 0, 1); /* Insert verbatim non-printable character (NPC) */
|
1999-08-17 18:12:47 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (ch < '@')
|
2000-03-01 19:31:41 -08:00
|
|
|
ch = cmd_getc(); /* Separator. Go to next digit or operation. */
|
|
|
|
} while (ch >= ' ' && ch < '@');
|
1999-08-17 18:12:47 -07:00
|
|
|
if (ch == 033) {
|
2000-03-01 19:31:41 -08:00
|
|
|
cmd_ungetc();
|
1999-08-17 18:12:47 -07:00
|
|
|
return;
|
|
|
|
} else if (ch < ' ')
|
2000-03-01 19:31:41 -08:00
|
|
|
return; /* An NPC. Punt. */
|
1999-08-17 18:12:47 -07:00
|
|
|
|
|
|
|
switch (ch) {
|
|
|
|
#ifdef PRINTPIPE
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'i':
|
1999-08-17 18:12:47 -07:00
|
|
|
switch (arg[0]) {
|
|
|
|
case 0:
|
2000-03-01 19:31:41 -08:00
|
|
|
scr_printscreen(0); /* Print screen "\e[0i" */
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 5:
|
2000-03-01 19:31:41 -08:00
|
|
|
process_print_pipe(); /* Start printing to print pipe "\e[5i" */
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case 'A':
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'e': /* Cursor up n lines "\e[<n>A" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc((arg[0] ? -arg[0] : -1), 0, RELATIVE);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'B': /* Cursor down n lines "\e[<n>B" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc((arg[0] ? +arg[0] : +1), 0, RELATIVE);
|
|
|
|
break;
|
|
|
|
case 'C':
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'a': /* Cursor right n columns "\e[<n>C" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc(0, (arg[0] ? +arg[0] : +1), RELATIVE);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'D': /* Cursor left n columns "\e[<n>D" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc(0, (arg[0] ? -arg[0] : -1), RELATIVE);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'E': /* Cursor down n lines and to first column "\e[<n>E" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc((arg[0] ? +arg[0] : +1), 0, R_RELATIVE);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'F': /* Cursor up n lines and to first column "\e[<n>F" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc((arg[0] ? -arg[0] : -1), 0, R_RELATIVE);
|
|
|
|
break;
|
|
|
|
case 'G':
|
2000-03-01 19:31:41 -08:00
|
|
|
case '`': /* Cursor to column n "\e[<n>G" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc(0, (arg[0] ? arg[0] - 1 : +1), R_RELATIVE);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'd': /* Cursor to row n "\e[<n>d" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_gotorc((arg[0] ? arg[0] - 1 : +1), 0, C_RELATIVE);
|
|
|
|
break;
|
|
|
|
case 'H':
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'f': /* Cursor to row r, column c "\e[<r>;<c>H" */
|
1999-08-17 18:12:47 -07:00
|
|
|
switch (nargs) {
|
|
|
|
case 0:
|
|
|
|
scr_gotorc(0, 0, 0);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
scr_gotorc((arg[0] ? arg[0] - 1 : 0), 0, 0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
scr_gotorc(arg[0] - 1, arg[1] - 1, 0);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'I': /* Tab right n tab stops "\e[<n>I" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_tab(arg[0] ? +arg[0] : +1);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'Z': /* Tab left n tab stops "\e[<n>Z" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_tab(arg[0] ? -arg[0] : -1);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'J': /* Clear part or all of screen, depending on n "\e[<n>J" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_erase_screen(arg[0]);
|
|
|
|
break;
|
2000-03-01 19:31:41 -08:00
|
|
|
case 'K': /* Clear part or all of line, depending on n "\e[<n>K" */
|
1999-08-17 18:12:47 -07:00
|
|
|
scr_erase_line(arg[0]);
|
|
|
|
break;
|
|
|
|
case '@':
|
|
|
|
scr_insdel_chars((arg[0] ? arg[0] : 1), INSERT);
|
|
|
|
break;
|
|
|
|
case 'L':
|
|
|
|
scr_insdel_lines((arg[0] ? arg[0] : 1), INSERT);
|
|
|
|
break;
|
|
|
|
case 'M':
|
|
|
|
scr_insdel_lines((arg[0] ? arg[0] : 1), DELETE);
|
|
|
|
break;
|
|
|
|
case 'X':
|
|
|
|
scr_insdel_chars((arg[0] ? arg[0] : 1), ERASE);
|
|
|
|
break;
|
|
|
|
case 'P':
|
|
|
|
scr_insdel_chars((arg[0] ? arg[0] : 1), DELETE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'c':
|
|
|
|
#ifndef NO_VT100_ANS
|
|
|
|
tt_printf(VT100_ANS);
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case 'm':
|
|
|
|
process_sgr_mode(nargs, arg);
|
|
|
|
break;
|
|
|
|
case 'n': /* request for information */
|
|
|
|
switch (arg[0]) {
|
|
|
|
case 5:
|
1999-10-27 11:10:40 -07:00
|
|
|
tt_printf((unsigned char *) "\033[0n");
|
1999-08-17 18:12:47 -07:00
|
|
|
break; /* ready */
|
|
|
|
case 6:
|
|
|
|
scr_report_position();
|
|
|
|
break;
|
|
|
|
#if defined (ENABLE_DISPLAY_ANSWER)
|
|
|
|
case 7:
|
2000-01-07 07:51:22 -08:00
|
|
|
tt_write((unsigned char *) display_name, strlen(display_name));
|
2000-01-10 01:41:12 -08:00
|
|
|
tt_write("\n", 1);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case 8:
|
|
|
|
xterm_seq(XTerm_title, APL_NAME "-" VERSION);
|
|
|
|
break;
|
|
|
|
case 9:
|
|
|
|
#ifdef PIXMAP_OFFSET
|
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
|
|
|
if (image_mode_is(image_bg, MODE_TRANS)) {
|
1999-08-17 18:12:47 -07:00
|
|
|
char tbuff[70];
|
|
|
|
char shading = 0;
|
|
|
|
unsigned long tint = 0xffffff;
|
|
|
|
|
|
|
|
if (images[image_bg].current->iml->mod) {
|
|
|
|
shading = images[image_bg].current->iml->mod->brightness / 0xff * 100;
|
|
|
|
}
|
|
|
|
if (images[image_bg].current->iml->rmod) {
|
|
|
|
tint = (tint & 0x00ffff) | ((images[image_bg].current->iml->rmod->brightness & 0xff) << 16);
|
|
|
|
}
|
|
|
|
if (images[image_bg].current->iml->gmod) {
|
|
|
|
tint = (tint & 0xff00ff) | ((images[image_bg].current->iml->gmod->brightness & 0xff) << 8);
|
|
|
|
}
|
|
|
|
if (images[image_bg].current->iml->bmod) {
|
|
|
|
tint = (tint & 0xffff00) | (images[image_bg].current->iml->bmod->brightness & 0xff);
|
|
|
|
}
|
|
|
|
snprintf(tbuff, sizeof(tbuff), APL_NAME "-" VERSION ": Transparent - %d%% shading - 0x%06lx tint mask",
|
|
|
|
shading, tint);
|
|
|
|
xterm_seq(XTerm_title, tbuff);
|
|
|
|
} else
|
|
|
|
#endif
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
{
|
|
|
|
char *tbuff;
|
|
|
|
unsigned short len;
|
|
|
|
|
|
|
|
if (background_is_pixmap()) {
|
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
|
|
|
const char *fname;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
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
|
|
|
imlib_context_set_image(images[image_bg].current->iml->im);
|
|
|
|
fname = imlib_image_get_filename();
|
1999-08-17 18:12:47 -07:00
|
|
|
len = strlen(fname) + sizeof(APL_NAME) + sizeof(VERSION) + 5;
|
|
|
|
tbuff = MALLOC(len);
|
|
|
|
snprintf(tbuff, len, APL_NAME "-" VERSION ": %s", fname);
|
|
|
|
xterm_seq(XTerm_title, tbuff);
|
|
|
|
FREE(tbuff);
|
|
|
|
} else {
|
|
|
|
xterm_seq(XTerm_title, APL_NAME "-" VERSION ": No Pixmap");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* PIXMAP_SUPPORT */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'r': /* set top and bottom margins */
|
|
|
|
if (priv != '?') {
|
|
|
|
if (nargs < 2 || arg[0] >= arg[1])
|
|
|
|
scr_scroll_region(0, 10000);
|
|
|
|
else
|
|
|
|
scr_scroll_region(arg[0] - 1, arg[1] - 1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* drop */
|
|
|
|
case 't':
|
|
|
|
if (priv != '?') {
|
|
|
|
process_window_mode(nargs, arg);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* drop */
|
|
|
|
case 's':
|
|
|
|
if (ch == 's' && !nargs) {
|
|
|
|
scr_cursor(SAVE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* drop */
|
|
|
|
case 'h':
|
|
|
|
case 'l':
|
|
|
|
process_terminal_mode(ch, priv, nargs, arg);
|
|
|
|
break;
|
|
|
|
case 'u':
|
|
|
|
if (!nargs) {
|
|
|
|
scr_cursor(RESTORE);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'g':
|
|
|
|
switch (arg[0]) {
|
|
|
|
case 0:
|
|
|
|
scr_set_tab(0);
|
|
|
|
break; /* delete tab */
|
|
|
|
case 3:
|
|
|
|
scr_set_tab(-1);
|
|
|
|
break; /* clear all tabs */
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'W':
|
|
|
|
switch (arg[0]) {
|
|
|
|
case 0:
|
|
|
|
scr_set_tab(1);
|
|
|
|
break; /* = ESC H */
|
|
|
|
case 2:
|
|
|
|
scr_set_tab(0);
|
|
|
|
break; /* = ESC [ 0 g */
|
|
|
|
case 5:
|
|
|
|
scr_set_tab(-1);
|
|
|
|
break; /* = ESC [ 3 g */
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* process xterm text parameters sequences `ESC ] Ps ; Pt BEL' */
|
|
|
|
void
|
|
|
|
process_xterm_seq(void)
|
|
|
|
{
|
|
|
|
unsigned char ch, string[STRING_MAX];
|
|
|
|
int arg;
|
|
|
|
|
|
|
|
ch = cmd_getc();
|
|
|
|
if (isdigit(ch)) {
|
|
|
|
for (arg = 0; isdigit(ch); ch = cmd_getc()) {
|
|
|
|
arg = arg * 10 + (ch - '0');
|
|
|
|
}
|
|
|
|
} else if (ch == ';') {
|
|
|
|
arg = 0;
|
|
|
|
} else {
|
|
|
|
arg = ch;
|
|
|
|
ch = cmd_getc();
|
|
|
|
}
|
2000-03-24 18:18:14 -08:00
|
|
|
if (arg == 'R') {
|
|
|
|
stored_palette(RESTORE);
|
|
|
|
redraw_image(image_bg);
|
|
|
|
set_colorfgbg();
|
|
|
|
scr_touch();
|
|
|
|
scr_refresh(DEFAULT_REFRESH);
|
|
|
|
return;
|
|
|
|
} else if (arg == 'P') {
|
|
|
|
unsigned char i, idx;
|
|
|
|
|
2000-03-27 12:49:34 -08:00
|
|
|
idx = ((ch <= '9') ? (ch - '0') : (tolower(ch) - 'a' + 10)) + minColor;
|
2000-03-24 18:18:14 -08:00
|
|
|
string[0] = '#';
|
2000-03-27 12:49:34 -08:00
|
|
|
string[7] = 0;
|
2000-03-24 18:18:14 -08:00
|
|
|
for (i = 1; i < 7; i++) {
|
|
|
|
string[i] = cmd_getc();
|
|
|
|
}
|
|
|
|
set_window_color(idx, string);
|
|
|
|
return;
|
|
|
|
} else if (ch == ';') {
|
1999-08-17 18:12:47 -07:00
|
|
|
unsigned long n = 0;
|
|
|
|
|
|
|
|
while ((ch = cmd_getc()) != 007) {
|
|
|
|
if (ch) {
|
|
|
|
if (ch == '\t')
|
|
|
|
ch = ' '; /* translate '\t' to space */
|
|
|
|
else if ((ch < ' ') && !(isspace(ch) && arg == XTerm_EtermIPC))
|
|
|
|
return; /* control character - exit */
|
|
|
|
|
|
|
|
if (n < sizeof(string) - 1)
|
|
|
|
string[n++] = ch;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
string[n] = '\0';
|
1999-10-27 11:10:40 -07:00
|
|
|
xterm_seq(arg, (char *) string);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
|
|
|
} else {
|
|
|
|
unsigned long n = 0;
|
|
|
|
|
1999-10-27 11:10:40 -07:00
|
|
|
for (; ch != '\033'; ch = cmd_getc()) {
|
1999-08-17 18:12:47 -07:00
|
|
|
if (ch) {
|
|
|
|
if (ch == '\t')
|
|
|
|
ch = ' '; /* translate '\t' to space */
|
|
|
|
else if (ch < ' ')
|
|
|
|
return; /* control character - exit */
|
|
|
|
|
|
|
|
if (n < sizeof(string) - 1)
|
|
|
|
string[n++] = ch;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
string[n] = '\0';
|
|
|
|
|
|
|
|
if ((ch = cmd_getc()) != '\\') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
switch (arg) {
|
|
|
|
case 'l':
|
1999-10-27 11:10:40 -07:00
|
|
|
xterm_seq(XTerm_title, (char *) string);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 'L':
|
1999-10-27 11:10:40 -07:00
|
|
|
xterm_seq(XTerm_iconName, (char *) string);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 'I':
|
1999-10-27 11:10:40 -07:00
|
|
|
set_icon_pixmap((char *) string, NULL);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Process window manipulations */
|
|
|
|
void
|
|
|
|
process_window_mode(unsigned int nargs, int args[])
|
|
|
|
{
|
|
|
|
|
|
|
|
register unsigned int i;
|
1999-10-27 11:10:40 -07:00
|
|
|
int x, y;
|
1999-08-17 18:12:47 -07:00
|
|
|
Screen *scr;
|
|
|
|
Window dummy_child;
|
|
|
|
char buff[128], *name;
|
|
|
|
|
|
|
|
if (!nargs)
|
|
|
|
return;
|
|
|
|
scr = ScreenOfDisplay(Xdisplay, Xscreen);
|
|
|
|
if (!scr)
|
|
|
|
return;
|
|
|
|
|
|
|
|
for (i = 0; i < nargs; i++) {
|
|
|
|
if (args[i] == 14) {
|
|
|
|
int dummy_x, dummy_y;
|
|
|
|
unsigned int dummy_border, dummy_depth;
|
|
|
|
|
|
|
|
/* Store current width and height in x and y */
|
1999-10-27 11:10:40 -07:00
|
|
|
XGetGeometry(Xdisplay, TermWin.parent, &dummy_child, &dummy_x, &dummy_y, (unsigned int *) (&x), (unsigned int *) (&y), &dummy_border, &dummy_depth);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
switch (args[i]) {
|
|
|
|
case 1:
|
|
|
|
XRaiseWindow(Xdisplay, TermWin.parent);
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
XIconifyWindow(Xdisplay, TermWin.parent, Xscreen);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
if (i + 2 >= nargs)
|
|
|
|
return; /* Make sure there are 2 args left */
|
|
|
|
x = args[++i];
|
|
|
|
y = args[++i];
|
1999-10-27 11:10:40 -07:00
|
|
|
if (((unsigned int) x > (unsigned int) scr->width) || ((unsigned int) y > (unsigned int) scr->height))
|
1999-08-17 18:12:47 -07:00
|
|
|
return; /* Don't move off-screen */
|
|
|
|
XMoveWindow(Xdisplay, TermWin.parent, x, y);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (i + 2 >= nargs)
|
|
|
|
return; /* Make sure there are 2 args left */
|
|
|
|
y = args[++i];
|
|
|
|
x = args[++i];
|
|
|
|
XResizeWindow(Xdisplay, TermWin.parent, x, y);
|
|
|
|
#ifdef USE_XIM
|
|
|
|
xim_set_status_position();
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
XRaiseWindow(Xdisplay, TermWin.parent);
|
|
|
|
break;
|
|
|
|
case 6:
|
|
|
|
XLowerWindow(Xdisplay, TermWin.parent);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
XClearWindow(Xdisplay, TermWin.vt);
|
|
|
|
XSync(Xdisplay, False);
|
|
|
|
scr_touch();
|
1999-09-14 16:22:06 -07:00
|
|
|
scr_refresh(DEFAULT_REFRESH);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
if (i + 2 >= nargs)
|
|
|
|
return; /* Make sure there are 2 args left */
|
|
|
|
y = args[++i];
|
|
|
|
x = args[++i];
|
|
|
|
XResizeWindow(Xdisplay, TermWin.parent,
|
1999-11-18 20:05:24 -08:00
|
|
|
Width2Pixel(x) + 2 * TermWin.internalBorder + (scrollbar_is_visible()? scrollbar_trough_width() : 0),
|
1999-08-17 18:12:47 -07:00
|
|
|
Height2Pixel(y) + 2 * TermWin.internalBorder);
|
|
|
|
break;
|
|
|
|
case 11:
|
|
|
|
break;
|
|
|
|
case 13:
|
|
|
|
XTranslateCoordinates(Xdisplay, TermWin.parent, Xroot, 0, 0, &x, &y, &dummy_child);
|
1999-10-27 11:10:40 -07:00
|
|
|
snprintf(buff, sizeof(buff), "\033[3;%d;%dt", x, y);
|
|
|
|
tt_write((unsigned char *) buff, strlen(buff));
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 14:
|
1999-10-27 11:10:40 -07:00
|
|
|
snprintf(buff, sizeof(buff), "\033[4;%d;%dt", y, x);
|
|
|
|
tt_write((unsigned char *) buff, strlen(buff));
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 18:
|
1999-10-27 11:10:40 -07:00
|
|
|
snprintf(buff, sizeof(buff), "\033[8;%d;%dt", TermWin.nrow, TermWin.ncol);
|
|
|
|
tt_write((unsigned char *) buff, strlen(buff));
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 20:
|
|
|
|
XGetIconName(Xdisplay, TermWin.parent, &name);
|
1999-10-27 11:10:40 -07:00
|
|
|
snprintf(buff, sizeof(buff), "\033]L%s\033\\", name);
|
|
|
|
tt_write((unsigned char *) buff, strlen(buff));
|
1999-08-17 18:12:47 -07:00
|
|
|
XFree(name);
|
|
|
|
break;
|
|
|
|
case 21:
|
|
|
|
XFetchName(Xdisplay, TermWin.parent, &name);
|
1999-10-27 11:10:40 -07:00
|
|
|
snprintf(buff, sizeof(buff), "\033]l%s\033\\", name);
|
|
|
|
tt_write((unsigned char *) buff, strlen(buff));
|
1999-08-17 18:12:47 -07:00
|
|
|
XFree(name);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* process DEC private mode sequences `ESC [ ? Ps mode' */
|
|
|
|
/*
|
|
|
|
* mode can only have the following values:
|
|
|
|
* 'l' = low
|
|
|
|
* 'h' = high
|
|
|
|
* 's' = save
|
|
|
|
* 'r' = restore
|
|
|
|
* 't' = toggle
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
process_terminal_mode(int mode, int priv, unsigned int nargs, int arg[])
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
int state;
|
|
|
|
|
|
|
|
if (nargs == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* make lo/hi boolean */
|
|
|
|
switch (mode) {
|
|
|
|
case 'l':
|
|
|
|
mode = 0;
|
|
|
|
break;
|
|
|
|
case 'h':
|
|
|
|
mode = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (priv) {
|
|
|
|
case 0:
|
|
|
|
if (mode && mode != 1)
|
|
|
|
return; /* only do high/low */
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
switch (arg[i]) {
|
|
|
|
case 4:
|
|
|
|
scr_insert_mode(mode);
|
|
|
|
break;
|
|
|
|
/* case 38: TEK mode */
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case '?':
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
switch (arg[i]) {
|
|
|
|
case 1: /* application cursor keys */
|
|
|
|
PrivCases(PrivMode_aplCUR);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* case 2: - reset charsets to USASCII */
|
|
|
|
|
|
|
|
case 3: /* 80/132 */
|
|
|
|
PrivCases(PrivMode_132);
|
|
|
|
if (PrivateModes & PrivMode_132OK)
|
|
|
|
set_width(state ? 132 : 80);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* case 4: - smooth scrolling */
|
|
|
|
|
|
|
|
case 5: /* reverse video */
|
|
|
|
PrivCases(PrivMode_rVideo);
|
|
|
|
scr_rvideo_mode(state);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 6: /* relative/absolute origins */
|
|
|
|
PrivCases(PrivMode_relOrigin);
|
|
|
|
scr_relative_origin(state);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 7: /* autowrap */
|
|
|
|
PrivCases(PrivMode_Autowrap);
|
|
|
|
scr_autowrap(state);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* case 8: - auto repeat, can't do on a per window basis */
|
|
|
|
|
|
|
|
case 9: /* X10 mouse reporting */
|
|
|
|
PrivCases(PrivMode_MouseX10);
|
|
|
|
/* orthogonal */
|
|
|
|
if (PrivateModes & PrivMode_MouseX10)
|
|
|
|
PrivateModes &= ~(PrivMode_MouseX11);
|
|
|
|
break;
|
|
|
|
|
1999-11-18 20:05:24 -08:00
|
|
|
#ifdef scrollbar_esc
|
|
|
|
case scrollbar_esc:
|
|
|
|
PrivCases(PrivMode_scrollbar);
|
1999-08-17 18:12:47 -07:00
|
|
|
map_scrollbar(state);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case 25: /* visible/invisible cursor */
|
|
|
|
PrivCases(PrivMode_VisibleCursor);
|
|
|
|
scr_cursor_visible(state);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 35:
|
|
|
|
PrivCases(PrivMode_ShiftKeys);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 40: /* 80 <--> 132 mode */
|
|
|
|
PrivCases(PrivMode_132OK);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 47: /* secondary screen */
|
|
|
|
PrivCases(PrivMode_Screen);
|
|
|
|
scr_change_screen(state);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 66: /* application key pad */
|
|
|
|
PrivCases(PrivMode_aplKP);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 67:
|
|
|
|
PrivCases(PrivMode_BackSpace);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1000: /* X11 mouse reporting */
|
|
|
|
PrivCases(PrivMode_MouseX11);
|
|
|
|
/* orthogonal */
|
|
|
|
if (PrivateModes & PrivMode_MouseX11)
|
|
|
|
PrivateModes &= ~(PrivMode_MouseX10);
|
|
|
|
break;
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
case 1001:
|
|
|
|
break; /* X11 mouse highlighting */
|
|
|
|
#endif
|
|
|
|
case 1010: /* Scroll to bottom on TTY output */
|
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 (Options & Opt_home_on_output)
|
|
|
|
Options &= ~Opt_home_on_output;
|
1999-08-17 18:12:47 -07:00
|
|
|
else
|
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
|
|
|
Options |= Opt_home_on_output;
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 1012: /* Scroll to bottom on TTY input */
|
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 (Options & Opt_home_on_input)
|
|
|
|
Options &= ~Opt_home_on_input;
|
1999-08-17 18:12:47 -07:00
|
|
|
else
|
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
|
|
|
Options |= Opt_home_on_input;
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* process sgr sequences */
|
|
|
|
void
|
|
|
|
process_sgr_mode(unsigned int nargs, int arg[])
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
if (nargs == 0) {
|
|
|
|
scr_rendition(0, ~RS_None);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
for (i = 0; i < nargs; i++)
|
|
|
|
switch (arg[i]) {
|
|
|
|
case 0:
|
|
|
|
scr_rendition(0, ~RS_None);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
scr_rendition(1, RS_Bold);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
scr_rendition(1, RS_Uline);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
scr_rendition(1, RS_Blink);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
scr_rendition(1, RS_RVid);
|
|
|
|
break;
|
|
|
|
case 22:
|
|
|
|
scr_rendition(0, RS_Bold);
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
scr_rendition(0, RS_Uline);
|
|
|
|
break;
|
|
|
|
case 25:
|
|
|
|
scr_rendition(0, RS_Blink);
|
|
|
|
break;
|
|
|
|
case 27:
|
|
|
|
scr_rendition(0, RS_RVid);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 30:
|
|
|
|
case 31: /* set fg color */
|
|
|
|
case 32:
|
|
|
|
case 33:
|
|
|
|
case 34:
|
|
|
|
case 35:
|
|
|
|
case 36:
|
|
|
|
case 37:
|
|
|
|
scr_color(minColor + (arg[i] - 30), RS_Bold);
|
|
|
|
break;
|
|
|
|
case 39: /* default fg */
|
|
|
|
scr_color(restoreFG, RS_Bold);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 40:
|
|
|
|
case 41: /* set bg color */
|
|
|
|
case 42:
|
|
|
|
case 43:
|
|
|
|
case 44:
|
|
|
|
case 45:
|
|
|
|
case 46:
|
|
|
|
case 47:
|
|
|
|
scr_color(minColor + (arg[i] - 40), RS_Blink);
|
|
|
|
break;
|
|
|
|
case 49: /* default bg */
|
|
|
|
scr_color(restoreBG, RS_Blink);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find if fg/bg matches any of the normal (low-intensity) colors */
|
|
|
|
#ifndef NO_BRIGHTCOLOR
|
|
|
|
void
|
|
|
|
set_colorfgbg(void)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
static char *colorfgbg_env = NULL;
|
|
|
|
char *p;
|
|
|
|
int fg = -1, bg = -1;
|
|
|
|
|
|
|
|
if (!colorfgbg_env) {
|
2000-01-07 07:51:22 -08:00
|
|
|
colorfgbg_env = (char *) MALLOC(30);
|
1999-08-17 18:12:47 -07:00
|
|
|
strcpy(colorfgbg_env, "COLORFGBG=default;default;bg");
|
|
|
|
}
|
|
|
|
for (i = BlackColor; i <= WhiteColor; i++) {
|
|
|
|
if (PixColors[fgColor] == PixColors[i]) {
|
|
|
|
fg = (i - BlackColor);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (i = BlackColor; i <= WhiteColor; i++) {
|
|
|
|
if (PixColors[bgColor] == PixColors[i]) {
|
|
|
|
bg = (i - BlackColor);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
p = strchr(colorfgbg_env, '=');
|
|
|
|
p++;
|
|
|
|
if (fg >= 0)
|
|
|
|
sprintf(p, "%d;", fg);
|
|
|
|
else
|
|
|
|
strcpy(p, "default;");
|
|
|
|
p = strchr(p, '\0');
|
|
|
|
if (bg >= 0)
|
|
|
|
sprintf(p,
|
|
|
|
# ifdef PIXMAP_SUPPORT
|
|
|
|
"default;"
|
|
|
|
# endif
|
|
|
|
"%d", bg);
|
|
|
|
else
|
|
|
|
strcpy(p, "default");
|
|
|
|
putenv(colorfgbg_env);
|
|
|
|
|
|
|
|
colorfgbg = DEFAULT_RSTYLE;
|
|
|
|
for (i = minColor; i <= maxColor; i++) {
|
|
|
|
if (PixColors[fgColor] == PixColors[i]
|
|
|
|
# ifndef NO_BOLDUNDERLINE
|
|
|
|
&& PixColors[fgColor] == PixColors[colorBD]
|
|
|
|
# endif /* NO_BOLDUNDERLINE */
|
|
|
|
/* if we wanted boldFont to have precedence */
|
|
|
|
# if 0 /* ifndef NO_BOLDFONT */
|
|
|
|
&& TermWin.boldFont == NULL
|
|
|
|
# endif /* NO_BOLDFONT */
|
|
|
|
)
|
|
|
|
colorfgbg = SET_FGCOLOR(colorfgbg, i);
|
|
|
|
if (PixColors[bgColor] == PixColors[i])
|
|
|
|
colorfgbg = SET_BGCOLOR(colorfgbg, i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* NO_BRIGHTCOLOR */
|
|
|
|
|
|
|
|
static void
|
|
|
|
set_title(const char *str)
|
|
|
|
{
|
1999-12-28 02:05:43 -08:00
|
|
|
static char *name = NULL;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
1999-12-28 02:05:43 -08:00
|
|
|
if (!str) {
|
|
|
|
str = APL_NAME "-" VERSION;
|
1999-10-11 11:37:55 -07:00
|
|
|
}
|
|
|
|
if (name == NULL || strcmp(name, str)) {
|
1999-12-28 02:05:43 -08:00
|
|
|
if (name != NULL) {
|
|
|
|
FREE(name);
|
|
|
|
}
|
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
|
|
|
D_X11(("Setting window title to \"%s\"\n", str));
|
1999-08-17 18:12:47 -07:00
|
|
|
XStoreName(Xdisplay, TermWin.parent, str);
|
1999-12-28 02:05:43 -08:00
|
|
|
name = StrDup(str);
|
1999-10-11 11:37:55 -07:00
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1999-10-11 11:37:55 -07:00
|
|
|
set_icon_name(const char *str)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
1999-12-28 02:05:43 -08:00
|
|
|
static char *name = NULL;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
1999-11-12 19:51:58 -08:00
|
|
|
if (!str) str = APL_NAME "-" VERSION;
|
1999-10-11 11:37:55 -07:00
|
|
|
if (name == NULL || strcmp(name, str)) {
|
1999-12-28 02:05:43 -08:00
|
|
|
if (name != NULL) {
|
|
|
|
FREE(name);
|
|
|
|
}
|
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
|
|
|
D_X11(("Setting window icon name to \"%s\"\n", str));
|
1999-08-17 18:12:47 -07:00
|
|
|
XSetIconName(Xdisplay, TermWin.parent, str);
|
1999-12-28 02:05:43 -08:00
|
|
|
name = StrDup(str);
|
1999-10-11 11:37:55 -07:00
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* XTerm escape sequences: ESC ] Ps;Pt BEL
|
|
|
|
* 0 = change iconName/title
|
|
|
|
* 1 = change iconName
|
|
|
|
* 2 = change title
|
|
|
|
* 46 = change logfile (not implemented)
|
|
|
|
* 50 = change font
|
|
|
|
*
|
|
|
|
* rxvt/Eterm extensions:
|
|
|
|
* 5 = Hostile takeover (grab focus and raise)
|
|
|
|
* 6 = Transparency mode stuff
|
|
|
|
* 10 = menu
|
|
|
|
* 20 = bg pixmap
|
|
|
|
* 39 = change default fg color
|
|
|
|
* 49 = change default bg color
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
xterm_seq(int op, const char *str)
|
|
|
|
{
|
|
|
|
|
|
|
|
XColor xcol;
|
1999-09-20 21:09:53 -07:00
|
|
|
char *nstr, *tnstr, *orig_tnstr, *valptr;
|
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
|
|
|
unsigned char eterm_seq_op, which = 0;
|
2000-03-31 15:13:57 -08:00
|
|
|
XWMHints *wm_hints;
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
unsigned char changed = 0, scaled = 0;
|
1999-09-20 21:09:53 -07:00
|
|
|
char *color, *mod;
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
if (!str)
|
|
|
|
return;
|
|
|
|
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
orig_tnstr = tnstr = StrDup(str);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
switch (op) {
|
|
|
|
case XTerm_title:
|
|
|
|
set_title(str);
|
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
|
|
|
break;
|
|
|
|
case XTerm_prop:
|
1999-10-27 11:10:40 -07:00
|
|
|
if ((nstr = (char *) strsep(&tnstr, ";")) == NULL) {
|
1999-09-20 21:09:53 -07:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
if ((valptr = strchr(nstr, '=')) != NULL) {
|
|
|
|
*(valptr++) = 0;
|
|
|
|
}
|
|
|
|
set_text_property(TermWin.parent, nstr, valptr);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case XTerm_name:
|
|
|
|
set_title(str); /* drop */
|
|
|
|
case XTerm_iconName:
|
1999-10-11 11:37:55 -07:00
|
|
|
set_icon_name(str);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case XTerm_Takeover:
|
|
|
|
XSetInputFocus(Xdisplay, TermWin.parent, RevertToParent, CurrentTime);
|
|
|
|
XRaiseWindow(Xdisplay, TermWin.parent);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XTerm_EtermSeq:
|
|
|
|
|
|
|
|
/* Eterm proprietary escape sequences
|
|
|
|
|
|
|
|
Syntax: ESC ] 6 ; <op> ; <arg> BEL
|
|
|
|
|
|
|
|
where <op> is: 0 Set/toggle transparency
|
1999-10-11 11:37:55 -07:00
|
|
|
1 Set color modifiers
|
|
|
|
3 Force update of pseudo-transparent background
|
1999-08-17 18:12:47 -07:00
|
|
|
10 Set scrollbar type/width
|
|
|
|
11 Set/toggle right-side scrollbar
|
|
|
|
12 Set/toggle floating scrollbar
|
|
|
|
13 Set/toggle popup scrollbar
|
|
|
|
20 Set/toggle visual bell
|
|
|
|
21 Set/toggle map alert
|
|
|
|
22 Set/toggle xterm selection behavior
|
|
|
|
23 Set/toggle triple-click line selection
|
|
|
|
24 Set/toggle viewport mode
|
|
|
|
25 Set/toggle selection of trailing spaces
|
|
|
|
30 Do not use
|
|
|
|
40 Do not use
|
|
|
|
50 Move window to another desktop
|
|
|
|
70 Exit Eterm
|
|
|
|
71 Save current configuration to a file
|
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
|
|
|
72 Search scrollback for a string
|
1999-08-17 18:12:47 -07:00
|
|
|
and <arg> is an optional argument, depending
|
|
|
|
on the particular sequence being used. It
|
|
|
|
(along with its preceeding semicolon) may or
|
|
|
|
may not be needed.
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
D_CMD(("Got XTerm_EtermSeq sequence\n"));
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
eterm_seq_op = (unsigned char) strtol(nstr, (char **) NULL, 10);
|
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
|
|
|
D_CMD((" XTerm_EtermSeq operation is %d\n", eterm_seq_op));
|
1999-08-17 18:12:47 -07:00
|
|
|
/* Yes, there is order to the numbers for this stuff. And here it is:
|
2000-02-15 19:37:34 -08:00
|
|
|
0-9 Image Class/Mode Configuration
|
|
|
|
10-19 Scrollbar/Buttonbar/Menu Configuration
|
1999-08-17 18:12:47 -07:00
|
|
|
20-29 Miscellaneous Toggles
|
|
|
|
30-39 Foreground/Text Color Configuration
|
|
|
|
40-49 Background Color Configuration
|
|
|
|
50-69 Window/Window Manager Configuration/Interaction
|
|
|
|
70-79 Internal Eterm Operations
|
|
|
|
*/
|
|
|
|
switch (eterm_seq_op) {
|
2000-03-28 18:44:41 -08:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
1999-08-17 18:12:47 -07:00
|
|
|
case 0:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
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
|
|
|
if (nstr) {
|
|
|
|
if (BOOL_OPT_ISTRUE(nstr)) {
|
|
|
|
D_CMD((" Request to enable transparency.\n"));
|
|
|
|
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_TRANS) && image_mode_is(idx, ALLOW_TRANS)) { \
|
|
|
|
image_set_mode(idx, MODE_TRANS); \
|
|
|
|
if (images[idx].current->pmap->pixmap != None) { \
|
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
|
|
|
imlib_free_pixmap_and_mask(images[idx].current->pmap->pixmap); \
|
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
|
|
|
} \
|
|
|
|
images[idx].current->pmap->pixmap = None; \
|
|
|
|
});
|
|
|
|
} else if (BOOL_OPT_ISFALSE(nstr)) {
|
|
|
|
D_CMD((" Request to disable transparency.\n"));
|
2000-03-28 18:44:41 -08:00
|
|
|
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} \
|
|
|
|
else {image_set_mode(idx, MODE_SOLID);}});
|
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
|
|
|
} else {
|
|
|
|
D_CMD((" Bad boolean value in transparency request.\n"));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
D_CMD((" Request to toggle transparency.\n"));
|
|
|
|
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_TRANS) && image_mode_is(idx, ALLOW_TRANS)) { \
|
|
|
|
image_set_mode(idx, MODE_TRANS); \
|
|
|
|
if (images[idx].current->pmap->pixmap != None) { \
|
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
|
|
|
imlib_free_pixmap_and_mask(images[idx].current->pmap->pixmap); \
|
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
|
|
|
} \
|
|
|
|
images[idx].current->pmap->pixmap = None; \
|
2000-03-28 18:44:41 -08:00
|
|
|
} else if (image_mode_is(idx, MODE_TRANS)) {if (image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);} \
|
|
|
|
else {image_set_mode(idx, MODE_SOLID);}});
|
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
|
|
|
}
|
|
|
|
redraw_all_images();
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 1:
|
1999-11-17 17:21:26 -08:00
|
|
|
changed = 0;
|
|
|
|
for (; 1;) {
|
1999-10-27 11:10:40 -07:00
|
|
|
if ((color = (char *) strsep(&tnstr, ";")) == NULL) {
|
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
|
|
|
break;
|
|
|
|
}
|
2000-03-28 18:44:41 -08:00
|
|
|
which = image_max;
|
|
|
|
FOREACH_IMAGE(if (!strcasecmp(color, (get_image_type(idx) + 6))) {which = idx; break;});
|
|
|
|
if (which != image_max) {
|
1999-11-17 17:21:26 -08:00
|
|
|
if ((color = (char *) strsep(&tnstr, ";")) == NULL) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
which = image_bg;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
if ((mod = (char *) strsep(&tnstr, ";")) == NULL) {
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
if (!strcasecmp(mod, "clear")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
|
2000-01-10 03:48:13 -08:00
|
|
|
D_CMD(("Clearing the %s color modifier of the %s image\n", color, get_image_type(which)));
|
1999-11-17 17:21:26 -08:00
|
|
|
if (!strcasecmp(color, "image")) {
|
|
|
|
FREE(iml->mod);
|
|
|
|
} else if (!strcasecmp(color, "red")) {
|
|
|
|
FREE(iml->rmod);
|
|
|
|
} else if (!strcasecmp(color, "green")) {
|
|
|
|
FREE(iml->gmod);
|
|
|
|
} else if (!strcasecmp(color, "blue")) {
|
|
|
|
FREE(iml->bmod);
|
|
|
|
}
|
2000-01-10 03:48:13 -08:00
|
|
|
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
|
|
|
free_desktop_pixmap();
|
|
|
|
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
|
|
|
|
XFreePixmap(Xdisplay, viewport_pixmap);
|
|
|
|
viewport_pixmap = None; /* Force the re-read */
|
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
changed = 1;
|
|
|
|
continue;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
if ((valptr = (char *) strsep(&tnstr, ";")) == NULL) {
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
D_CMD(("Modifying the %s attribute of the %s color modifier of the %s image to be %s\n", mod, color, get_image_type(which), valptr));
|
|
|
|
changed = 1;
|
|
|
|
if (image_mode_is(which, MODE_TRANS) && (desktop_pixmap != None)) {
|
|
|
|
free_desktop_pixmap();
|
2000-01-10 03:48:13 -08:00
|
|
|
} else if (image_mode_is(which, MODE_VIEWPORT) && (viewport_pixmap != None)) {
|
1999-11-17 17:21:26 -08:00
|
|
|
XFreePixmap(Xdisplay, viewport_pixmap);
|
|
|
|
viewport_pixmap = None; /* Force the re-read */
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
if (!strcasecmp(color, "image")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
|
|
|
|
if (iml->mod == NULL) {
|
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
|
|
|
iml->mod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->mod->brightness = iml->mod->contrast = iml->mod->gamma = 0x100;
|
1999-11-17 17:21:26 -08:00
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP("brightness", mod)) {
|
|
|
|
iml->mod->brightness = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("contrast", mod)) {
|
|
|
|
iml->mod->contrast = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("gamma", mod)) {
|
|
|
|
iml->mod->gamma = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!strcasecmp(color, "red")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
|
|
|
|
if (iml->rmod == NULL) {
|
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
|
|
|
iml->rmod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->rmod->brightness = iml->rmod->contrast = iml->rmod->gamma = 0x100;
|
1999-11-17 17:21:26 -08:00
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP("brightness", mod)) {
|
|
|
|
iml->rmod->brightness = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("contrast", mod)) {
|
|
|
|
iml->rmod->contrast = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("gamma", mod)) {
|
|
|
|
iml->rmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!strcasecmp(color, "green")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
|
|
|
|
if (iml->gmod == NULL) {
|
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
|
|
|
iml->gmod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->gmod->brightness = iml->gmod->contrast = iml->gmod->gamma = 0x100;
|
1999-11-17 17:21:26 -08:00
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP("brightness", mod)) {
|
|
|
|
iml->gmod->brightness = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("contrast", mod)) {
|
|
|
|
iml->gmod->contrast = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("gamma", mod)) {
|
|
|
|
iml->gmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (!strcasecmp(color, "blue")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
|
|
|
|
if (iml->bmod == NULL) {
|
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
|
|
|
iml->bmod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->bmod->brightness = iml->bmod->contrast = iml->bmod->gamma = 0x100;
|
1999-11-17 17:21:26 -08:00
|
|
|
}
|
|
|
|
if (!BEG_STRCASECMP("brightness", mod)) {
|
|
|
|
iml->bmod->brightness = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("contrast", mod)) {
|
|
|
|
iml->bmod->contrast = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
} else if (!BEG_STRCASECMP("gamma", mod)) {
|
|
|
|
iml->bmod->gamma = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
}
|
1999-11-17 17:21:26 -08:00
|
|
|
if (changed) {
|
|
|
|
redraw_all_images();
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
2000-03-28 18:44:41 -08:00
|
|
|
case 2:
|
|
|
|
changed = 0;
|
|
|
|
which = image_max;
|
|
|
|
if ((nstr = (char *) strsep(&tnstr, ";")) == NULL || (valptr = (char *) strsep(&tnstr, ";")) == NULL) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
FOREACH_IMAGE(if (!strcasecmp(valptr, (get_image_type(idx) + 6))) {which = idx; break;});
|
|
|
|
if (which != image_max) {
|
|
|
|
if ((valptr = (char *) strsep(&tnstr, ";")) == NULL) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
which = image_bg;
|
|
|
|
}
|
|
|
|
D_PIXMAP(("Operation == \"%s\", which == %d, value == \"%s\"\n", nstr, (int) which, valptr));
|
|
|
|
if (!strcasecmp(nstr, "shade")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
int s;
|
|
|
|
|
|
|
|
s = (int) strtol(valptr, (char **) NULL, 0);
|
|
|
|
s = ((100 - s) << 8) / 100;
|
|
|
|
if (s == 0x100) {
|
|
|
|
if (iml->mod != NULL) {
|
|
|
|
if (iml->mod->brightness != 0x100) {
|
|
|
|
iml->mod->brightness = 0x100;
|
|
|
|
changed = 1;
|
|
|
|
}
|
|
|
|
if (iml->mod->contrast == 0x100 && iml->mod->gamma == 0x100) {
|
|
|
|
FREE(iml->mod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (iml->mod == NULL) {
|
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
|
|
|
iml->mod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->mod->contrast = iml->mod->gamma = 0x100;
|
|
|
|
}
|
|
|
|
if (iml->mod->brightness != s) {
|
|
|
|
iml->mod->brightness = s;
|
|
|
|
changed = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(nstr, "tint")) {
|
|
|
|
imlib_t *iml = images[which].current->iml;
|
|
|
|
unsigned long t, r, g, b;
|
|
|
|
|
|
|
|
if (!isdigit(*valptr)) {
|
|
|
|
t = get_tint_by_color_name(valptr);
|
|
|
|
} else {
|
|
|
|
t = (unsigned long) strtoul(valptr, (char **) NULL, 0);
|
|
|
|
D_PIXMAP(("Got numerical tint 0x%06x\n", t));
|
|
|
|
}
|
|
|
|
r = (t & 0xff0000) >> 16;
|
|
|
|
if (r == 0xff) {
|
|
|
|
if (iml->rmod != NULL) {
|
|
|
|
if (iml->rmod->brightness != 0x100) {
|
|
|
|
iml->rmod->brightness = 0x100;
|
|
|
|
changed = 1;
|
|
|
|
if (iml->rmod->contrast == 0x100 && iml->rmod->gamma == 0x100) {
|
|
|
|
FREE(iml->rmod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (iml->rmod == NULL) {
|
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
|
|
|
iml->rmod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->rmod->contrast = iml->rmod->gamma = 0x100;
|
|
|
|
}
|
|
|
|
if (iml->rmod->brightness != (int) r) {
|
|
|
|
iml->rmod->brightness = r;
|
|
|
|
changed = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g = (t & 0xff00) >> 8;
|
|
|
|
if (g == 0xff) {
|
|
|
|
if (iml->gmod != NULL) {
|
|
|
|
if (iml->gmod->brightness != 0x100) {
|
|
|
|
iml->gmod->brightness = 0x100;
|
|
|
|
changed = 1;
|
|
|
|
if (iml->gmod->contrast == 0x100 && iml->gmod->gamma == 0x100) {
|
|
|
|
FREE(iml->gmod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (iml->gmod == NULL) {
|
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
|
|
|
iml->gmod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->gmod->contrast = iml->gmod->gamma = 0x100;
|
|
|
|
}
|
|
|
|
if (iml->gmod->brightness != (int) g) {
|
|
|
|
iml->gmod->brightness = g;
|
|
|
|
changed = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
b = t & 0xff;
|
|
|
|
if (b == 0xff) {
|
|
|
|
if (iml->bmod != NULL) {
|
|
|
|
if (iml->bmod->brightness != 0x100) {
|
|
|
|
iml->bmod->brightness = 0x100;
|
|
|
|
changed = 1;
|
|
|
|
if (iml->bmod->contrast == 0x100 && iml->bmod->gamma == 0x100) {
|
|
|
|
FREE(iml->bmod);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (iml->bmod == NULL) {
|
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
|
|
|
iml->bmod = (colormod_t *) MALLOC(sizeof(colormod_t));
|
2000-03-28 18:44:41 -08:00
|
|
|
iml->bmod->contrast = iml->bmod->gamma = 0x100;
|
|
|
|
}
|
|
|
|
if (iml->bmod->brightness != (int) b) {
|
|
|
|
iml->bmod->brightness = b;
|
|
|
|
changed = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (changed) {
|
|
|
|
if (image_mode_is(which, MODE_TRANS)) {
|
|
|
|
free_desktop_pixmap();
|
|
|
|
}
|
|
|
|
redraw_image(which);
|
|
|
|
}
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
case 3:
|
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
|
|
|
get_desktop_window();
|
|
|
|
if (desktop_window == None) {
|
|
|
|
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);});
|
|
|
|
break;
|
|
|
|
}
|
1999-10-28 07:02:35 -07:00
|
|
|
get_desktop_pixmap();
|
2000-01-04 02:46:47 -08:00
|
|
|
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case 10:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr && *nstr) {
|
|
|
|
if (!strcasecmp(nstr, "xterm")) {
|
|
|
|
#ifdef XTERM_SCROLLBAR
|
1999-11-12 19:15:18 -08:00
|
|
|
scrollbar_change_type(SCROLLBAR_XTERM);
|
1999-08-17 18:12:47 -07:00
|
|
|
#else
|
|
|
|
print_error("Support for xterm scrollbars was not compiled in. Sorry.");
|
|
|
|
#endif
|
|
|
|
} else if (!strcasecmp(nstr, "next")) {
|
|
|
|
#ifdef NEXT_SCROLLBAR
|
1999-11-12 19:15:18 -08:00
|
|
|
scrollbar_change_type(SCROLLBAR_NEXT);
|
1999-08-17 18:12:47 -07:00
|
|
|
#else
|
|
|
|
print_error("Support for NeXT scrollbars was not compiled in. Sorry.");
|
|
|
|
#endif
|
|
|
|
} else if (!strcasecmp(nstr, "motif")) {
|
|
|
|
#ifdef MOTIF_SCROLLBAR
|
1999-11-12 19:15:18 -08:00
|
|
|
scrollbar_change_type(SCROLLBAR_MOTIF);
|
1999-08-17 18:12:47 -07:00
|
|
|
#else
|
|
|
|
print_error("Support for motif scrollbars was not compiled in. Sorry.");
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
print_error("Unrecognized scrollbar type \"%s\".", nstr);
|
|
|
|
}
|
|
|
|
}
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr && *nstr) {
|
1999-11-12 19:15:18 -08:00
|
|
|
scrollbar_change_width((unsigned short) strtoul(nstr, (char **) NULL, 0));
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 11:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-11-18 20:05:24 -08:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_right);
|
1999-11-19 16:51:26 -08:00
|
|
|
scr_touch();
|
|
|
|
parent_resize();
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 12:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-11-18 20:05:24 -08:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_floating);
|
1999-11-19 16:51:26 -08:00
|
|
|
scrollbar_reposition_and_always_draw();
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 13:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_popup);
|
|
|
|
break;
|
2000-02-15 19:37:34 -08:00
|
|
|
case 14:
|
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
|
|
|
if (!(nstr) || !(*(nstr))) {
|
|
|
|
bbar_show_all(-1);
|
|
|
|
parent_resize();
|
|
|
|
} else if (BOOL_OPT_ISTRUE(nstr)) {
|
|
|
|
bbar_show_all(1);
|
|
|
|
parent_resize();
|
|
|
|
} else if (BOOL_OPT_ISFALSE(nstr)) {
|
|
|
|
bbar_show_all(0);
|
|
|
|
parent_resize();
|
|
|
|
}
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
case 20:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_visualBell);
|
|
|
|
break;
|
|
|
|
#ifdef MAPALERT_OPTION
|
|
|
|
case 21:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_mapAlert);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
case 22:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_xterm_select);
|
|
|
|
break;
|
|
|
|
case 23:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_whole_line);
|
|
|
|
break;
|
|
|
|
case 24:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
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
|
|
|
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_VIEWPORT) && image_mode_is(idx, ALLOW_VIEWPORT)) {image_set_mode(idx, MODE_VIEWPORT);});
|
2000-01-04 02:46:47 -08:00
|
|
|
redraw_images_by_mode(MODE_VIEWPORT);
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case 25:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_select_trailing_spaces);
|
|
|
|
break;
|
|
|
|
case 26:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_report_as_keysyms);
|
|
|
|
break;
|
2000-03-31 15:13:57 -08:00
|
|
|
case 27:
|
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
|
|
|
OPT_SET_OR_TOGGLE(nstr, Options, Opt_no_input);
|
|
|
|
wm_hints = XGetWMHints(Xdisplay, TermWin.parent);
|
|
|
|
wm_hints->flags |= InputHint;
|
|
|
|
wm_hints->input = ((Options & Opt_no_input) ? False : True);
|
|
|
|
XSetWMHints(Xdisplay, TermWin.parent, wm_hints);
|
|
|
|
XFree(wm_hints);
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
case 30:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr) {
|
|
|
|
if (XParseColor(Xdisplay, cmap, nstr, &xcol) && XAllocColor(Xdisplay, cmap, &xcol)) {
|
|
|
|
PixColors[fgColor] = xcol.pixel;
|
|
|
|
scr_refresh(DEFAULT_REFRESH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 40:
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr) {
|
|
|
|
if (XParseColor(Xdisplay, cmap, nstr, &xcol) && XAllocColor(Xdisplay, cmap, &xcol)) {
|
|
|
|
PixColors[bgColor] = xcol.pixel;
|
|
|
|
scr_refresh(DEFAULT_REFRESH);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 50:
|
|
|
|
/* Change desktops */
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr && *nstr) {
|
|
|
|
XClientMessageEvent xev;
|
|
|
|
|
|
|
|
rs_desktop = (int) strtol(nstr, (char **) NULL, 0);
|
|
|
|
xev.type = ClientMessage;
|
|
|
|
xev.window = TermWin.parent;
|
|
|
|
xev.message_type = XInternAtom(Xdisplay, "_WIN_WORKSPACE", False);
|
|
|
|
xev.format = 32;
|
|
|
|
xev.data.l[0] = rs_desktop;
|
|
|
|
XChangeProperty(Xdisplay, TermWin.parent, xev.message_type, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &rs_desktop, 1);
|
|
|
|
XSendEvent(Xdisplay, Xroot, False, SubstructureNotifyMask, (XEvent *) & xev);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 70:
|
|
|
|
/* Exit Eterm */
|
|
|
|
exit(0);
|
|
|
|
break;
|
|
|
|
case 71:
|
|
|
|
/* Save current config */
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr && *nstr) {
|
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
|
|
|
valptr = (char *) strsep(&tnstr, ";");
|
|
|
|
if (!strcasecmp(nstr, "theme")) {
|
|
|
|
save_config(valptr, SAVE_THEME_CONFIG);
|
|
|
|
} else {
|
|
|
|
save_config(valptr, SAVE_USER_CONFIG);
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
} else {
|
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
|
|
|
save_config(NULL, SAVE_USER_CONFIG);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
break;
|
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
|
|
|
case 72:
|
|
|
|
/* Search scrollback buffer for a string. NULL to clear. */
|
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
|
|
|
if (nstr && *nstr) {
|
|
|
|
scr_search_scrollback(nstr);
|
|
|
|
} else {
|
|
|
|
scr_search_scrollback(NULL);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 73:
|
|
|
|
/* Spawn a subprogram */
|
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
|
|
|
if (nstr && *nstr) {
|
|
|
|
system_no_wait(nstr);
|
|
|
|
}
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
case 80:
|
|
|
|
/* Set debugging level */
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr && *nstr) {
|
|
|
|
debug_level = (unsigned int) strtoul(nstr, (char **) NULL, 0);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XTerm_Pixmap:
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
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
|
|
|
FOREACH_IMAGE(if (!image_mode_is(idx, MODE_IMAGE) && image_mode_is(idx, ALLOW_IMAGE)) {image_set_mode(idx, MODE_IMAGE);});
|
1999-08-17 18:12:47 -07:00
|
|
|
if (!strcmp(str, ";")) {
|
1999-12-21 08:04:02 -08:00
|
|
|
image_set_mode(image_bg, MODE_SOLID);
|
1999-08-17 18:12:47 -07:00
|
|
|
bg_needs_update = 1;
|
|
|
|
} else {
|
1999-10-27 11:10:40 -07:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
1999-08-17 18:12:47 -07:00
|
|
|
if (nstr) {
|
|
|
|
if (*nstr) {
|
|
|
|
set_pixmap_scale("", images[image_bg].current->pmap);
|
|
|
|
bg_needs_update = 1;
|
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
|
|
|
load_image(nstr, images[image_bg].current);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
1999-10-27 11:10:40 -07:00
|
|
|
while ((nstr = (char *) strsep(&tnstr, ";")) && *nstr) {
|
1999-08-17 18:12:47 -07:00
|
|
|
changed += set_pixmap_scale(nstr, images[image_bg].current->pmap);
|
|
|
|
scaled = 1;
|
|
|
|
}
|
|
|
|
} else {
|
1999-12-21 08:04:02 -08:00
|
|
|
image_set_mode(image_bg, MODE_SOLID);
|
1999-08-17 18:12:47 -07:00
|
|
|
bg_needs_update = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((changed) || (bg_needs_update)) {
|
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
|
|
|
redraw_image(image_bg);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
#endif /* PIXMAP_SUPPORT */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XTerm_EtermIPC:
|
1999-10-27 11:10:40 -07:00
|
|
|
for (; (nstr = (char *) strsep(&tnstr, ";"));) {
|
1999-08-17 18:12:47 -07:00
|
|
|
eterm_ipc_parse(nstr);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case XTerm_restoreFG:
|
|
|
|
#ifdef XTERM_COLOR_CHANGE
|
|
|
|
set_window_color(fgColor, str);
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
case XTerm_restoreBG:
|
|
|
|
#ifdef XTERM_COLOR_CHANGE
|
|
|
|
set_window_color(bgColor, str);
|
|
|
|
#endif
|
|
|
|
break;
|
2000-02-17 15:15:19 -08:00
|
|
|
case XTerm_DumpScreen:
|
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
|
|
|
if (nstr && *nstr) {
|
|
|
|
scr_dump_to_file(nstr);
|
|
|
|
}
|
|
|
|
break;
|
1999-08-17 18:12:47 -07:00
|
|
|
case XTerm_logfile:
|
2000-02-17 15:15:19 -08:00
|
|
|
nstr = (char *) strsep(&tnstr, ";");
|
|
|
|
if (nstr && *nstr && BOOL_OPT_ISTRUE(nstr)) {
|
|
|
|
/* Logging on */
|
|
|
|
} else {
|
|
|
|
/* Logging off */
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
break;
|
|
|
|
case XTerm_font:
|
|
|
|
change_font(0, str);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
D_CMD(("Unsupported xterm escape sequence operator: 0x%02x\n", op));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
#ifdef PIXMAP_SUPPORT
|
|
|
|
FREE(orig_tnstr);
|
|
|
|
#endif
|
|
|
|
}
|