Tue Aug 17 18:06:01 PDT 1999 Michael Jennings <mej@eterm.org>
Now that we have a fixed CVS server.... This includes the old 0.8.10 code, but it's now 0.9. It also includes a timer subsystem. SVN revision: 52
This commit is contained in:
parent
e64e1663de
commit
661b1b9448
140
Eterm.spec.in
140
Eterm.spec.in
|
@ -1,79 +1,107 @@
|
|||
# Note that this is NOT a relocatable package
|
||||
%define ver @VERSION@
|
||||
%define rel SNAP
|
||||
%define prefix /usr
|
||||
%define rel 1
|
||||
%define prefix @prefix@
|
||||
|
||||
Summary: Eterm Enlightened Terminal Emulator for X Windows
|
||||
Summary: Enlightened terminal emulator
|
||||
Name: Eterm
|
||||
Version: %ver
|
||||
Release: %rel
|
||||
Version: %{ver}
|
||||
Release: %{rel}
|
||||
Copyright: GPL
|
||||
Group: X11/Applications
|
||||
Source: ftp://ftp.enlightenment.org/pub/Eterm/Eterm-%{ver}.tar.gz
|
||||
BuildRoot: /tmp/Eterm-root
|
||||
Packager: technoir <technoir@themes.org>
|
||||
URL: http://e.themes.org/
|
||||
Requires: imlib >= 1.8
|
||||
|
||||
Docdir: %{prefix}/doc
|
||||
Group: Utilities/Terminal
|
||||
Source: ../SOURCES/Eterm-%{ver}.tar.gz
|
||||
BuildRoot: /tmp/Eterm-root/
|
||||
URL: http://www.eterm.org/
|
||||
Requires: imlib, libjpeg, libtiff, libungif, libpng, zlib, XFree86-libs
|
||||
Packager: Todd Nemanich <trnemani@eos.ncsu.edu>
|
||||
|
||||
%ifarch i386
|
||||
%description
|
||||
Eterm is a color vt102 terminal emulator intended as an xterm replacement for users who want a term program integrated with Enlightenment, or simply want a little more "eye candy". Eterm uses Imlib for advanced graphic abilities.
|
||||
This is an rpm of Eterm, a highly configurable and asethically pleasing
|
||||
terminal emulator.
|
||||
|
||||
This rpm was optimized for i486 and was built without support
|
||||
for libKenny.so.
|
||||
(Egads! They killed Kenny! You bastards!)
|
||||
%else
|
||||
%description
|
||||
This is an rpm of Eterm, a highly configurable and asethically pleasing
|
||||
terminal emulator.
|
||||
|
||||
This rpm contains no architecture specific optimizations, and
|
||||
was built without support for libKenny.so.
|
||||
(Egads! They killed Kenny! You bastards!)
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sun Jun 6 1999 Todd Nemanich <trnemani@eos.ncsu.edu>
|
||||
- Updated rpm to incorporate a few fixes for different architectures,
|
||||
- specify /usr/local/share/Eterm/themes/* as config files, and
|
||||
- a fix for the share directory problem.
|
||||
|
||||
* Wed Dec 30 1998 mej <mej@mw.3com.com>
|
||||
* Tue Apr 27 1999 Todd Nemanich <trnemani@eos.ncsu.edu>
|
||||
- Updated to version 8.9. Added a check to make sure /usr/local/lib
|
||||
- is in /etc/ld.so.conf because too many people don't know how
|
||||
- ld works.
|
||||
- Also moving, so new email address for me.
|
||||
|
||||
- Added spec file. Created by techn0ir <technoir@themes.org>
|
||||
* Sat Jan 23 1999 Todd Nemanich <tick@speak.rh.ncsu.edu>
|
||||
- Updated to version 8.8
|
||||
|
||||
* Sat Oct 23 1998 Todd Nemanich <tick@speak.rh.ncsu.edu>
|
||||
- Updated to version 0.8.7. A minor change in the Makefiles was made by hand,
|
||||
- due to a linkinkg problem. This should not cause problems to people using the
|
||||
- source rpm, but the call to configure has been removed.
|
||||
|
||||
* Mon Sep 21 1998 Todd Nemanich <tick@speak.rh.ncsu.edu>
|
||||
- Bad link in /usr/local/bin corrected. THX to Andy Dustman for pointing this out.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
rm -fr $RPM_BUILD_ROOT $RPM_BUILD_DIR/Eterm-%{ver}
|
||||
mkdir $RPM_BUILD_ROOT
|
||||
cd $RPM_BUILD_DIR
|
||||
tar -xzf $RPM_SOURCE_DIR/Eterm-%{ver}.tar.gz
|
||||
|
||||
%build
|
||||
# Optimize that damned code all the way
|
||||
if [ ! -z "`echo -n ${RPM_OPT_FLAGS} | grep pentium`" ]; then
|
||||
if [ ! -z `which egcs` ]; then
|
||||
CC="egcs"
|
||||
else
|
||||
if [ ! -z `which pgcc` ]; then
|
||||
CC="pgcc"
|
||||
fi
|
||||
fi
|
||||
CFLAGS="${RPM_OPT_FLAGS}"
|
||||
else
|
||||
CFLAGS="${RPM_OPT_FLAGS}"
|
||||
fi
|
||||
if [ ! -f configure ]; then
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./autogen.sh --prefix=%prefix
|
||||
else
|
||||
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%prefix
|
||||
fi
|
||||
|
||||
cd $RPM_BUILD_DIR/Eterm-%{ver}
|
||||
./configure --prefix=%{prefix}
|
||||
%ifarch i386
|
||||
make "CFLAGS=-O3 -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"
|
||||
%else
|
||||
make
|
||||
%endif
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
cd $RPM_BUILD_DIR/Eterm-%{ver}
|
||||
make prefix=$RPM_BUILD_ROOT%{prefix} install
|
||||
|
||||
|
||||
|
||||
%postinst
|
||||
LDPATH=`grep local /etc/ld.so.conf`
|
||||
|
||||
if [ "$LDPATH" = "" ] ; then
|
||||
NEW='/usr/local/lib'
|
||||
cat /etc/ld.so.conf >ld.tmp
|
||||
echo "$NEW">>new.ld
|
||||
cat ld.tmp new.ld > ld.so.conf
|
||||
mv ld.so.conf /etc/ld.so.conf
|
||||
rm -f new.ld ld.tmp
|
||||
fi
|
||||
|
||||
/sbin/ldconfig
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post
|
||||
|
||||
%postun
|
||||
rm -fr $RPM_BUILD_ROOT $RPM_BUILD_DIR/Eterm-%{ver}
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
|
||||
%{prefix}/bin/*
|
||||
%(prefix)/doc/*
|
||||
%{prefix}/lib/*
|
||||
%{prefix}/share/*
|
||||
%{prefix}/man/*
|
||||
|
||||
|
||||
%doc COPYING
|
||||
%doc ChangeLog
|
||||
%doc README
|
||||
%defattr(-,root,root)
|
||||
%doc $RPM_BUILD_DIR/Eterm-%{ver}/README
|
||||
%doc $RPM_BUILD_DIR/Eterm-%{ver}/COPYING
|
||||
%doc $RPM_BUILD_DIR/Eterm-%{ver}/ChangeLog
|
||||
%doc $RPM_BUILD_DIR/Eterm-%{ver}/ReleaseNotes
|
||||
%doc $RPM_BUILD_DIR/Eterm-%{ver}/CVS-README
|
||||
%doc $RPM_BUILD_DIR/Eterm-%{ver}/doc/*
|
||||
%doc %{prefix}/man
|
||||
%config %{prefix}/share/Eterm/themes/
|
||||
%{prefix}/bin
|
||||
%{prefix}/lib
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
SUBDIRS = libmej src themes utils doc bg
|
||||
SUBDIRS = libmej src themes utils doc bg pix
|
||||
|
||||
EXTRA_DIST = README ReleaseNotes CVS-README COPYING ChangeLog autogen.sh
|
||||
|
|
26
acconfig.h
26
acconfig.h
|
@ -270,6 +270,9 @@
|
|||
/* Do we need our own nanosleep()? */
|
||||
#undef HAVE_NANOSLEEP
|
||||
|
||||
/* Is our snprintf() implementation buggy? */
|
||||
#undef HAVE_SNPRINTF_BUG
|
||||
|
||||
/* Debugging level */
|
||||
#undef DEBUG
|
||||
|
||||
|
@ -286,6 +289,29 @@
|
|||
/* Do we have the X shape extension? */
|
||||
#undef HAVE_X_SHAPE_EXT
|
||||
|
||||
/* Support for various features */
|
||||
#undef USE_ACTIVE_TAGS
|
||||
#undef USE_POSIX_THREADS
|
||||
#undef MUTEX_SYNCH
|
||||
#undef PIXMAP_SUPPORT
|
||||
#undef PIXMAP_OFFSET
|
||||
#undef BACKING_STORE
|
||||
#undef FORCE_BACKSPACE
|
||||
#undef FORCE_DELETE
|
||||
#undef IMLIB_TRANS
|
||||
#undef KS_DELETE
|
||||
#undef NO_DELETE_KEY
|
||||
#undef NO_XLOCALE
|
||||
#undef PIXMAP_MENUBAR
|
||||
#undef PIXMAP_SCROLLBAR
|
||||
#undef UTMP_SUPPORT
|
||||
#undef MULTI_CHARSET
|
||||
#undef USE_XIM
|
||||
#undef USE_X11R6_XIM
|
||||
#undef NO_XLOCALE
|
||||
#undef GREEK_SUPPORT
|
||||
#undef CONFIG_SEARCH_PATH
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
|
|
20
autogen.sh
20
autogen.sh
|
@ -4,6 +4,8 @@
|
|||
|
||||
DIE=0
|
||||
|
||||
echo "Generating configuration files for Eterm, please wait...."
|
||||
|
||||
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
|
||||
echo
|
||||
echo "You must have autoconf installed to compile Eterm."
|
||||
|
@ -32,11 +34,16 @@ if test "$DIE" -eq 1; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo " libtoolize --copy --force"
|
||||
libtoolize --copy --force
|
||||
aclocal $ACLOCAL_FLAGS
|
||||
automake --add-missing
|
||||
autoconf
|
||||
echo " aclocal -I . $ACLOCAL_FLAGS"
|
||||
aclocal -I . $ACLOCAL_FLAGS
|
||||
echo " autoheader"
|
||||
autoheader
|
||||
echo " automake --add-missing"
|
||||
automake --add-missing
|
||||
echo " autoconf"
|
||||
autoconf
|
||||
|
||||
if [ -x config.status -a -z "$*" ]; then
|
||||
./config.status --recheck
|
||||
|
@ -50,3 +57,10 @@ else
|
|||
fi
|
||||
./configure "$@"
|
||||
fi
|
||||
|
||||
if [ -f cvs.motd ]; then
|
||||
echo "ATTENTION CVS Users!"
|
||||
echo ""
|
||||
cat cvs.motd
|
||||
echo ""
|
||||
fi
|
||||
|
|
|
@ -8,35 +8,45 @@ pixmapdir = $(pkgdatadir)/pix
|
|||
themedir = $(pkgdatadir)/themes
|
||||
|
||||
all: Makefile
|
||||
@echo "*** Generating pixmaps.list file from images in tile/ and scale/..."
|
||||
@echo "*** Generating pixmap list files from images in tile/ and scale/..."
|
||||
@true > pixmaps.list
|
||||
@cd tile ; \
|
||||
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore` ; do \
|
||||
echo '" 0 0 '$$i'"' >> ../pixmaps.list ; \
|
||||
true > tiled-pixmaps.list ; \
|
||||
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore | grep -v pixmaps.list` ; do \
|
||||
echo $$i >> tiled-pixmaps.list ; \
|
||||
echo '"'$$i'@0x0+0+0:tile"' >> ../pixmaps.list ; \
|
||||
done ; \
|
||||
cd .. ; \
|
||||
cd scale ; \
|
||||
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore` ; do \
|
||||
echo '"-1 -1 '$$i'"' >> ../pixmaps.list ; \
|
||||
true > scaled-pixmaps.list ; \
|
||||
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore | grep -v pixmaps.list` ; do \
|
||||
echo $$i >> scaled-pixmaps.list ; \
|
||||
echo '"'$$i'@100x100"' >> ../pixmaps.list ; \
|
||||
done
|
||||
|
||||
install-data-hook:
|
||||
@if test ! -f pixmaps.list ; then $(MAKE) all ; fi
|
||||
$(mkinstalldirs) $(DESTDIR)$(pixmapdir)
|
||||
@for j in $(DIRS) ; do echo "Installing pixmaps in $$j" ; cd $$j ; \
|
||||
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore` ; do \
|
||||
for i in `ls -1 | grep -v CVS | grep -v \.cvsignore | grep -v pixmaps.list` ; do \
|
||||
echo $(INSTALL_DATA) $$i $(DESTDIR)${pixmapdir} ; \
|
||||
$(INSTALL_DATA) $$i $(DESTDIR)${pixmapdir} ; \
|
||||
done ; cd .. ; \
|
||||
done
|
||||
@if test -f $(DESTDIR)${pixmapdir}/pixmaps.list ; then \
|
||||
$(CP) -p $(DESTDIR)${pixmapdir}/pixmaps.list $(DESTDIR)${pixmapdir}/pixmaps.list.old ; \
|
||||
echo "WARNING: Backup of existing pixmaps.list created." ; \
|
||||
fi
|
||||
$(INSTALL_DATA) pixmaps.list $(DESTDIR)${pixmapdir}
|
||||
@for i in `ls -1d $(DESTDIR)${themedir}/*` ; do \
|
||||
if test $$i != "." -a $$i != ".." -a ! -f $$i/pixmaps.list ; then \
|
||||
echo "$(LN_S) ../../pix/pixmaps.list $$i/pixmaps.list" ; \
|
||||
$(LN_S) ../../pix/pixmaps.list $$i/pixmaps.list ; \
|
||||
@for i in tiled-pixmaps.list scaled-pixmaps.list pixmaps.list ; do \
|
||||
if test -f $(DESTDIR)${pixmapdir}/$$i ; then \
|
||||
$(CP) -p $(DESTDIR)${pixmapdir}/$$i $(DESTDIR)${pixmapdir}/$$i.old ; \
|
||||
echo "WARNING: Backup of existing $$i created." ; \
|
||||
fi ; \
|
||||
done
|
||||
$(INSTALL_DATA) tile/tiled-pixmaps.list $(DESTDIR)${pixmapdir}
|
||||
$(INSTALL_DATA) scale/scaled-pixmaps.list $(DESTDIR)${pixmapdir}
|
||||
$(INSTALL_DATA) pixmaps.list $(DESTDIR)${pixmapdir}
|
||||
@for i in `ls -1d $(DESTDIR)${themedir}/*` ; do \
|
||||
for j in tiled-pixmaps.list scaled-pixmaps.list pixmaps.list ; do \
|
||||
if test $$i != "." -a $$i != ".." -a ! -f $$i/$$j ; then \
|
||||
echo "$(LN_S) ../../pix/$$j $$i/$$j" ; \
|
||||
$(LN_S) ../../pix/$$j $$i/$$j ; \
|
||||
fi ; \
|
||||
done ; \
|
||||
done
|
||||
|
|
203
configure.in
203
configure.in
|
@ -1,12 +1,12 @@
|
|||
dnl# $Id$
|
||||
|
||||
AC_INIT(src/feature.h.in)
|
||||
AM_INIT_AUTOMAKE(Eterm, 0.8.9)
|
||||
AC_INIT(src/feature.h)
|
||||
AM_INIT_AUTOMAKE(Eterm, 0.9)
|
||||
|
||||
dnl# Set some basic variables
|
||||
DATE="21 January 1999"
|
||||
DATE="`date '+%d %B %Y'`"
|
||||
AC_SUBST(DATE)
|
||||
AUTHORS="Tuomo Venalainen (vendu@cc.hut.fi) and Michael Jennings (mej@tcserv.com)"
|
||||
AUTHORS="Tuomo Venalainen (vendu@cc.hut.fi) and Michael Jennings (mej@eterm.org)"
|
||||
AC_SUBST(AUTHORS)
|
||||
|
||||
dnl# Supply default CFLAGS, if not specified by `CFLAGS=flags ./configure'
|
||||
|
@ -139,6 +139,7 @@ AC_TYPE_UID_T
|
|||
dnl# Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_CHECK_FUNCS(atexit _exit unsetenv setutent seteuid memmove putenv strsep setresuid setresgid memmem usleep snprintf)
|
||||
dps_snprintf_oflow()
|
||||
|
||||
dnl# Check for the need for -lutil on BSD systems
|
||||
AC_CHECK_FUNC(login,
|
||||
|
@ -153,14 +154,6 @@ AC_CHECK_FUNC(logout,
|
|||
))
|
||||
AC_CHECK_FUNC(getpwuid, , AC_CHECK_LIB(sun, getpwuid, LIBS="$LIBS -lsun"))
|
||||
|
||||
dnl# Check for POSIX threads library
|
||||
dnl# Don't comment this back in before multithreading actually works,
|
||||
dnl# so people don't need thread-safe X libs to be able to run unthreaded
|
||||
dnl# Eterm :) -vendu
|
||||
#AC_CHECK_LIB(pthread, pthread_create, CFLAGS="$CFLAGS -D_REENTRANT";
|
||||
# THREADLIBS="-lpthread", ,
|
||||
# -D_REENTRANT -L/usr/lib -L/lib -L/usr/local/lib)
|
||||
|
||||
dnl# Did they want debugging?
|
||||
AC_MSG_CHECKING(for debugging level)
|
||||
AC_ARG_WITH(debugging, [ --with-debugging[=num] enable debugging output, num is an optional level],
|
||||
|
@ -178,34 +171,144 @@ AC_ARG_WITH(debugging, [ --with-debugging[=num] enable debugging output, num i
|
|||
AC_DEFINE_UNQUOTED(DEBUG, 4)
|
||||
)
|
||||
|
||||
dnl# Check for support for menus
|
||||
AC_MSG_CHECKING(whether or not to enable menubar support)
|
||||
AC_ARG_ENABLE(menus, [ --disable-menus disable support for menubars (support enabled by default)],
|
||||
if test "$enableval" != "no"; then
|
||||
echo "yes" ; MENUSED="";
|
||||
else echo "no" ; MENUSED='s/define MENUBAR_MAX .*/define MENUBAR_MAX 0/g';
|
||||
fi, echo "yes" ; MENUSED="")
|
||||
|
||||
dnl# Check for graphics libraries.
|
||||
dnl# Force Imlib flags - see below. -vendu
|
||||
AC_MSG_CHECKING(whether or not to enable pixmap support)
|
||||
dnl#
|
||||
dnl# FEATURES
|
||||
dnl#
|
||||
AC_MSG_CHECKING(for pixmap support)
|
||||
AC_ARG_WITH(imlib,
|
||||
[ --with-imlib[=DIR] compile with Imlib support (Imlib residing in DIR/lib) [default]
|
||||
--without-imlib compile with pixmap support disabled],
|
||||
[ --with-imlib[=DIR] compile with Imlib support (Imlib residing in DIR/lib) (default)],
|
||||
if test "$withval" != "no"; then
|
||||
echo "yes" ; CFLAGS="$CFLAGS -I${withval}/include -L${withval}/lib";
|
||||
GRLIBS="-lImlib" ; PIXMAPSED="";
|
||||
else echo "no" ; PIXMAPSED='s/define PIXMAP_SUPPORT/undef PIXMAP_SUPPORT/g';
|
||||
GRLIBS="";
|
||||
fi, echo "yes" ; GRLIBS="-lImlib" ; PIXMAPSED="")
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="$CFLAGS -I${withval}/include -L${withval}/lib"
|
||||
GRLIBS="-lImlib"
|
||||
AC_DEFINE(PIXMAP_SUPPORT)
|
||||
AC_DEFINE(PIXMAP_SCROLLBAR)
|
||||
AC_DEFINE(PIXMAP_MENUBAR)
|
||||
AC_DEFINE(BACKING_STORE)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
GRLIBS=""
|
||||
fi, AC_MSG_RESULT(yes)
|
||||
GRLIBS="-lImlib"
|
||||
AC_DEFINE(PIXMAP_SUPPORT)
|
||||
AC_DEFINE(PIXMAP_SCROLLBAR)
|
||||
AC_DEFINE(PIXMAP_MENUBAR)
|
||||
AC_DEFINE(BACKING_STORE)
|
||||
)
|
||||
AC_MSG_CHECKING(for transparency support)
|
||||
AC_ARG_ENABLE(trans,
|
||||
[ --enable-trans[=imlib] compile with transparency support ("=imlib" will use Imlib instead of Xlib for transparency)],
|
||||
if test "$enableval" = "imlib"; then
|
||||
AC_MSG_RESULT(yes, using Imlib)
|
||||
AC_DEFINE(PIXMAP_OFFSET)
|
||||
AC_DEFINE(IMLIB_TRANS)
|
||||
elif test "$enableval" != "no"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PIXMAP_OFFSET)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi, AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(PIXMAP_OFFSET)
|
||||
)
|
||||
AC_MSG_CHECKING(for utmp support)
|
||||
AC_ARG_ENABLE(utmp,
|
||||
[ --enable-utmp compile with utmp support],
|
||||
if test "$enableval" != "no"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(UTMP_SUPPORT)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi, AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(UTMP_SUPPORT)
|
||||
)
|
||||
AC_MSG_CHECKING(for backspace key configuration)
|
||||
AC_ARG_WITH(backspace,
|
||||
[ --with-backspace=KEY force backspace to send KEY (KEY is either "bs" for ^H or "del" for ^?)],
|
||||
if test "$withval" = "bs"; then
|
||||
AC_MSG_RESULT(forcing Backspace to send Ctrl-H)
|
||||
AC_DEFINE(FORCE_BACKSPACE)
|
||||
elif test "$withval" = "del"; then
|
||||
AC_MSG_RESULT(forcing Backspace to send Ctrl-?)
|
||||
AC_DEFINE(FORCE_DELETE)
|
||||
else
|
||||
AC_MSG_RESULT(default)
|
||||
fi, AC_MSG_RESULT(default)
|
||||
)
|
||||
AC_MSG_CHECKING(for delete key configuration)
|
||||
AC_ARG_WITH(delete,
|
||||
[ --with-delete=SETTING force delete to SETTING ("server" to use the X server value always or
|
||||
a quoted string to use a specific string)],
|
||||
if test "$withval" = "server"; then
|
||||
AC_MSG_RESULT(X server value)
|
||||
AC_DEFINE(NO_DELETE_KEY)
|
||||
else
|
||||
AC_MSG_RESULT(forcing Delete to send "$withval")
|
||||
AC_DEFINE_UNQUOTED(KS_DELETE, "$withval")
|
||||
fi, AC_MSG_RESULT(default)
|
||||
AC_DEFINE_UNQUOTED(KS_DELETE, "\177")
|
||||
)
|
||||
AC_MSG_CHECKING(for multi-charset support)
|
||||
AC_ARG_ENABLE(multi-charset,
|
||||
[ --enable-multi-charset compile with multi-charset support],
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(MULTI_CHARSET)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi, AC_MSG_RESULT(no)
|
||||
)
|
||||
AC_MSG_CHECKING(for XIM support)
|
||||
AC_ARG_ENABLE(xim,
|
||||
[ --enable-xim compile with XIM support],
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_XIM)
|
||||
XIM="TRUE"
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
XIM="FALSE"
|
||||
fi, AC_MSG_RESULT(no)
|
||||
)
|
||||
AC_MSG_CHECKING(for Greek keyboard support)
|
||||
AC_ARG_ENABLE(greek,
|
||||
[ --enable-greek compile with support for Greek keyboards],
|
||||
if test "$enableval" = "yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(GREEK_SUPPORT)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi, AC_MSG_RESULT(no)
|
||||
)
|
||||
AC_MSG_CHECKING(which threads library to use)
|
||||
AC_ARG_WITH(threads,
|
||||
[ --with-threads[=STYLE] compile with threads support, STYLE is either "posix" or blank
|
||||
(disabled by default)],
|
||||
case $withval in
|
||||
[yes | posix )]
|
||||
AC_MSG_RESULT(POSIX)
|
||||
THREADS_LIB=posix
|
||||
;;
|
||||
[* )]
|
||||
AC_MSG_RESULT(none)
|
||||
;;
|
||||
esac
|
||||
, AC_MSG_RESULT(none))
|
||||
if test "$THREADS_LIB" = "posix"; then
|
||||
AC_CHECK_LIB(pthread, pthread_create, CFLAGS="$CFLAGS -D_REENTRANT" ; THREADLIBS="-lpthread"
|
||||
AC_DEFINE(USE_POSIX_THREADS)
|
||||
AC_DEFINE(MUTEX_SYNCH)
|
||||
, , -D_REENTRANT -L/usr/lib -L/lib -L/usr/local/lib)
|
||||
fi
|
||||
|
||||
dnl#
|
||||
dnl# X LIBRARIES
|
||||
dnl#
|
||||
AC_CHECK_LIB(X11, XOpenDisplay, X_LIBS="$X_LIBS -lX11", [
|
||||
echo "ERROR: You need libX11 to build Eterm. Verify that you have libX11.a or";
|
||||
echo " libX11.so installed and that it is located in the X libraries";
|
||||
echo " directory shown above. If it is in a different directory, try using";
|
||||
echo " the --x-libraries parameter to configure.";
|
||||
AC_MSG_ERROR([Fatal: libX11 not found.])], $X_LIBS $SUBLIBS)
|
||||
|
||||
AC_CHECK_LIB(Xext, XextAddDisplay, X_LIBS="-lXext $X_LIBS", [
|
||||
echo "ERROR: You need libXext to build Eterm. Verify that you have libXext.a or";
|
||||
echo " libXext.so installed and that it is located in the X libraries";
|
||||
|
@ -215,6 +318,14 @@ echo " the --x-libraries parameter to configure.";
|
|||
|
||||
AC_CHECK_LIB(Xext, XShapeQueryExtension, AC_DEFINE(HAVE_X_SHAPE_EXT), , $X_LIBS $SUBLIBS)
|
||||
|
||||
# check if we need X_LOCALE definition
|
||||
AC_CHECK_LIB(X11, _Xsetlocale, , AC_DEFINE(NO_XLOCALE), , $X_LIBS $SUBLIBS)
|
||||
|
||||
# check X11R6 for XIM
|
||||
if test "$XIM" = "TRUE"; then
|
||||
AC_CHECK_LIB(X11, XRegisterIMInstantiateCallback, AC_DEFINE(USE_X11R6_XIM), , $X_LIBS $SUBLIBS)
|
||||
fi
|
||||
|
||||
if test -z "$PIXMAPSED"; then
|
||||
|
||||
AC_CHECK_PROG(IMLIB_CONFIG, imlib-config, imlib-config, no)
|
||||
|
@ -325,6 +436,8 @@ AC_CHECK_LIB(Kenny, life_signs, , [
|
|||
])
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(CONFIG_SEARCH_PATH, "~/.Eterm/themes:~/.Eterm:${prefix}/share/Eterm/themes:${prefix}/share/Eterm")
|
||||
|
||||
CFLAGS=${CFLAGS--O}
|
||||
LDFLAGS=${LDFLAGS--O}
|
||||
|
||||
|
@ -338,12 +451,6 @@ AC_SUBST(THREADLIBS)
|
|||
AC_SUBST(GRLIBS)
|
||||
|
||||
basedir=.
|
||||
FEATURE_CMD="$SED -e \"s%@PREFIX@%${prefix}%g\" -e \"s%@DATADIR@%${datadir}%g\" -e \"$PIXMAPSED\" -e \"$MENUSED\" "'${DIST_ROOT}'"/src/feature.h.in > "'${DIST_ROOT}'"/src/feature.h"
|
||||
AC_SUBST(FEATURE_CMD)
|
||||
|
||||
dnl# common parts of the Makefile
|
||||
dnl# MCOMMON=./Make.common
|
||||
dnl# AC_SUBST_FILE(MCOMMON)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
|
@ -352,6 +459,7 @@ bg/Makefile \
|
|||
doc/Makefile \
|
||||
utils/Makefile \
|
||||
libmej/Makefile \
|
||||
pix/Makefile \
|
||||
src/Makefile \
|
||||
src/graphics/Makefile \
|
||||
themes/Makefile \
|
||||
|
@ -359,29 +467,24 @@ Eterm.spec \
|
|||
)
|
||||
|
||||
dnl If we're not building with Imlib support, don't build Esetroot
|
||||
if test -n "$PIXMAPSED"; then
|
||||
if test -z "$GRLIBS"; then
|
||||
sed -e 's/^bin_PROGRAMS.*$//g' doc/Makefile > doc/Makefile.new
|
||||
mv doc/Makefile.new doc/Makefile
|
||||
fi
|
||||
|
||||
echo "creating src/feature.h"
|
||||
eval ${FEATURE_CMD}.new
|
||||
if cmp -s ${DIST_ROOT}/src/feature.h.new ${DIST_ROOT}/src/feature.h 2>/dev/null ; then
|
||||
echo "feature.h is unchanged"
|
||||
rm -f ${DIST_ROOT}/src/feature.h.new
|
||||
else
|
||||
mv ${DIST_ROOT}/src/feature.h.new ${DIST_ROOT}/src/feature.h
|
||||
fi
|
||||
|
||||
echo "
|
||||
$PACKAGE $VERSION
|
||||
Configuration:
|
||||
--------------
|
||||
|
||||
Source code location: ${srcdir}
|
||||
Compiler: ${CC} ${CFLAGS}
|
||||
Host System Type: ${host}
|
||||
Graphics libraries: ${GRLIBS}
|
||||
X Windows libs/paths: ${X_LIBS}
|
||||
X libraries/paths: ${X_LIBS}
|
||||
Install path: ${prefix}
|
||||
|
||||
See src/feature.h for further configuration information."
|
||||
echo
|
||||
See src/feature.h for further configuration information.
|
||||
|
||||
Now type 'make' to build $PACKAGE $VERSION.
|
||||
"
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Yet another change to the Eterm theme files. Shading and tinting as
|
||||
you remember them no longer exist. Please update your Eterm theme
|
||||
files, or stuff will not work. See the ChangeLog for details!
|
|
@ -1249,7 +1249,7 @@ directive to allow for separation of the configuration information into
|
|||
separate files.
|
||||
|
||||
.SH AUTHORS
|
||||
Tuomo Venalainen (vendu@cc.hut.fi) and Michael Jennings (mej@tcserv.com).
|
||||
Michael Jennings (mej@eterm.org) and Tuomo Venäläinen (vendu@cc.hut.fi).
|
||||
Man page re-written for version 0.8 by Shaleh (shaleh@debian.org).
|
||||
|
||||
.SH URL(s)
|
||||
|
|
|
@ -450,7 +450,7 @@ If you run into problems with Eterm, please go through the steps outlined
|
|||
<OL>
|
||||
<LI> Comment out line 41 of <TT>src/feature.h</TT> where NDEBUG is defined.
|
||||
<LI> Recompile Eterm.
|
||||
<LI> Run the new copy of Eterm and mail the output to me (<I>mej@tcserv.com</I>).
|
||||
<LI> Run the new copy of Eterm and mail the output to me (<I>mej@eterm.org</I>).
|
||||
</OL>
|
||||
This is the only way we can get the information we need about where the
|
||||
program is when it runs into problems, or what privileges it has, or
|
||||
|
|
|
@ -6,7 +6,7 @@ libmej_la_SOURCES = debug.c mem.c strings.c snprintf.c
|
|||
|
||||
INCLUDES = -I. -I.. -I$(includedir) -I$(prefix)/include
|
||||
|
||||
libmej_la_LDFLAGS = -version-info 8:9:8
|
||||
libmej_la_LDFLAGS = -version-info 9:0:9
|
||||
|
||||
EXTRA_DIST = debug.h global.h mem.h strings.h strptime.h strptime.c
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* -- 20 December 1996 *
|
||||
*********************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -26,6 +26,9 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "config.h"
|
||||
#include "../src/feature.h"
|
||||
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -36,7 +39,6 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#define DEBUG_C
|
||||
#include "debug.h"
|
||||
|
||||
int
|
||||
|
@ -47,8 +49,7 @@ real_dprintf(const char *format,...)
|
|||
int n;
|
||||
|
||||
va_start(args, format);
|
||||
n = fprintf(stderr, "[debug] ");
|
||||
n += vfprintf(stderr, format, args);
|
||||
n = vfprintf(stderr, format, args);
|
||||
va_end(args);
|
||||
fflush(stderr);
|
||||
return (n);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* -- 20 December 1996 *
|
||||
**********************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -24,13 +24,11 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if !defined(DEBUG_C) && !defined(DEBUG_CC)
|
||||
extern int real_dprintf(const char *, ...);
|
||||
#endif
|
||||
|
||||
#ifndef _LIBMEJ_DEBUG_H
|
||||
# define _LIBMEJ_DEBUG_H
|
||||
|
||||
extern int real_dprintf(const char *, ...);
|
||||
|
||||
#include "../src/debug.h"
|
||||
|
||||
#endif /* _LIBMEJ_DEBUG_H */
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* -- 16 January 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -28,9 +28,6 @@
|
|||
|
||||
#define _GLOBAL_H_
|
||||
|
||||
#include "config.h"
|
||||
#include "src/feature.h"
|
||||
|
||||
/* Other compile-time defines */
|
||||
#ifdef LINUX
|
||||
# define _GNU_SOURCE
|
||||
|
|
76
libmej/mem.c
76
libmej/mem.c
|
@ -5,7 +5,7 @@
|
|||
* -- 07 January 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -27,6 +27,9 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "config.h"
|
||||
#include "../src/feature.h"
|
||||
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -35,7 +38,7 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <signal.h>
|
||||
#define MEM_C
|
||||
|
||||
#include "debug.h"
|
||||
#include "mem.h"
|
||||
|
||||
|
@ -44,12 +47,11 @@ static const char cvs_ident[] = "$Id$";
|
|||
* The beginning of each one's respective function. (The ones with capitalized
|
||||
* letters. I'm not sure that they'll be useful outside of gdb. Maybe.
|
||||
*/
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
#ifdef MALLOC_CALL_DEBUG
|
||||
static int malloc_count = 0;
|
||||
static int calloc_count = 0;
|
||||
static int realloc_count = 0;
|
||||
static int free_count = 0;
|
||||
|
||||
#endif
|
||||
|
||||
MemRec memrec =
|
||||
|
@ -240,38 +242,26 @@ void *
|
|||
Malloc(size_t size)
|
||||
{
|
||||
|
||||
#if 0
|
||||
char *temp = NULL;
|
||||
|
||||
#endif
|
||||
void *temp = NULL;
|
||||
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
++malloc_count;
|
||||
#ifdef MALLOC_CALL_DEBUG
|
||||
++malloc_count;
|
||||
if (!(malloc_count % MALLOC_MOD)) {
|
||||
fprintf(stderr, "Calls to malloc(): %d\n", malloc_count);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
|
||||
if (!memrec.init) {
|
||||
D_MALLOC(("WARNING: You must call memrec_init() before using the libmej memory management calls.\n"));
|
||||
memrec_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
temp = (char *) malloc(size);
|
||||
#endif
|
||||
temp = malloc(size);
|
||||
temp = (void *) malloc(size);
|
||||
if (!temp)
|
||||
return NULL;
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
if (debug_level >= DEBUG_MALLOC) {
|
||||
memrec_add_var(temp, size);
|
||||
#endif
|
||||
}
|
||||
return (temp);
|
||||
}
|
||||
|
||||
|
@ -279,33 +269,27 @@ void *
|
|||
Realloc(void *ptr, size_t size)
|
||||
{
|
||||
|
||||
char *temp = NULL;
|
||||
void *temp = NULL;
|
||||
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
#ifdef MALLOC_CALL_DEBUG
|
||||
++realloc_count;
|
||||
# ifdef MALLOC_CALL_DEBUG
|
||||
if (!(realloc_count % REALLOC_MOD)) {
|
||||
fprintf(stderr, "Calls to realloc(): %d\n", realloc_count);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
/*
|
||||
* Redundant. You know the drill :)
|
||||
* #if DEBUG >= DEBUG_MALLOC
|
||||
*/
|
||||
|
||||
if (!memrec.init) {
|
||||
D_MALLOC(("WARNING: You must call memrec_init() before using the libmej memory management calls.\n"));
|
||||
memrec_init();
|
||||
}
|
||||
/* #endif */
|
||||
|
||||
if (ptr == NULL) {
|
||||
temp = (char *) Malloc(size);
|
||||
temp = (void *) Malloc(size);
|
||||
} else {
|
||||
temp = (char *) realloc(ptr, size);
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
temp = (void *) realloc(ptr, size);
|
||||
if (debug_level >= DEBUG_MALLOC) {
|
||||
memrec_chg_var(ptr, temp, size);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (!temp)
|
||||
return NULL;
|
||||
|
@ -318,27 +302,22 @@ Calloc(size_t count, size_t size)
|
|||
|
||||
char *temp = NULL;
|
||||
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
++calloc_count;
|
||||
#ifdef MALLOC_CALL_DEBUG
|
||||
++calloc_count;
|
||||
if (!(calloc_count % CALLOC_MOD)) {
|
||||
fprintf(stderr, "Calls to calloc(): %d\n", calloc_count);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
|
||||
if (!memrec.init) {
|
||||
D_MALLOC(("WARNING: You must call memrec_init() before using the libmej memory management calls.\n"));
|
||||
memrec_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
temp = (char *) calloc(count, size);
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
if (debug_level >= DEBUG_MALLOC) {
|
||||
memrec_add_var(temp, size * count);
|
||||
#endif
|
||||
}
|
||||
if (!temp)
|
||||
return NULL;
|
||||
return (temp);
|
||||
|
@ -348,25 +327,22 @@ void
|
|||
Free(void *ptr)
|
||||
{
|
||||
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
++free_count;
|
||||
#ifdef MALLOC_CALL_DEBUG
|
||||
++free_count;
|
||||
if (!(free_count % FREE_MOD)) {
|
||||
fprintf(stderr, "Calls to free(): %d\n", free_count);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
|
||||
if (!memrec.init) {
|
||||
D_MALLOC(("WARNING: You must call memrec_init() before using the libmej memory management calls.\n"));
|
||||
memrec_init();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ptr) {
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
if (debug_level >= DEBUG_MALLOC) {
|
||||
memrec_rem_var(ptr);
|
||||
#endif
|
||||
}
|
||||
free(ptr);
|
||||
} else {
|
||||
D_MALLOC(("Caught attempt to free NULL pointer\n"));
|
||||
|
@ -384,12 +360,12 @@ HandleSigSegv(int sig)
|
|||
|
||||
/* Recursive seg faults are not cool.... */
|
||||
if (segv_again) {
|
||||
printf("RECURSIVE SEGMENTATION FAULT DETECTED!\n");
|
||||
printf("Recursive segmentation fault detected!\n");
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
segv_again = 1;
|
||||
#if DEBUG >= DEBUG_MALLOC
|
||||
fprintf(stderr, "SEGMENTATION FAULT! DUMPING MEMORY TABLE\n");
|
||||
fprintf(stderr, "Fatal memory fault (%d)! Dumping memory table.\n", sig);
|
||||
memrec_dump();
|
||||
#endif
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
17
libmej/mem.h
17
libmej/mem.h
|
@ -4,7 +4,7 @@
|
|||
* -- 07 January 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -41,12 +41,12 @@ typedef struct memrec_struct {
|
|||
# define CALLOC(type,n) calloc((n),(sizeof(type)))
|
||||
# define REALLOC(mem,sz) fixed_realloc((mem),(sz))
|
||||
# define FREE(ptr) free(ptr)
|
||||
#elif defined(DEBUG) || !defined(NDEBUG)
|
||||
#elif (DEBUG >= DEBUG_MALLOC)
|
||||
# define MALLOC(sz) Malloc(sz)
|
||||
# define CALLOC(type,n) Calloc((n),(sizeof(type)))
|
||||
# define REALLOC(mem,sz) Realloc((mem),(sz))
|
||||
/* # define FREE(ptr) Free(ptr) */
|
||||
# define FREE(ptr) { Free(ptr); ptr = NULL; }
|
||||
# define FREE(ptr) do { Free(ptr); ptr = NULL; } while(0)
|
||||
# define MALLOC_MOD 25
|
||||
# define REALLOC_MOD 25
|
||||
# define CALLOC_MOD 25
|
||||
|
@ -58,15 +58,13 @@ typedef struct memrec_struct {
|
|||
# define FREE(ptr) free(ptr)
|
||||
#endif
|
||||
|
||||
#ifndef MEM_C
|
||||
|
||||
extern char *SafeStr(char *, unsigned short);
|
||||
extern MemRec memrec;
|
||||
extern void memrec_init(void);
|
||||
void memrec_add_var(void *, size_t);
|
||||
void memrec_rem_var(void *);
|
||||
void memrec_chg_var(void *, void *, size_t);
|
||||
void memrec_dump(void);
|
||||
extern void memrec_add_var(void *, size_t);
|
||||
extern void memrec_rem_var(void *);
|
||||
extern void memrec_chg_var(void *, void *, size_t);
|
||||
extern void memrec_dump(void);
|
||||
extern void *Malloc(size_t);
|
||||
extern void *Realloc(void *, size_t);
|
||||
extern void *Calloc(size_t, size_t);
|
||||
|
@ -76,7 +74,6 @@ extern void HandleSigSegv(int);
|
|||
extern char *GarbageCollect(char *, size_t);
|
||||
extern char *FileGarbageCollect(char *, size_t);
|
||||
extern void *fixed_realloc(void *, size_t);
|
||||
#endif /* MEM_C */
|
||||
|
||||
#endif /* _MEM_H_ */
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#include "config.h"
|
||||
#include "../src/feature.h"
|
||||
|
||||
#include "global.h"
|
||||
#include <errno.h>
|
||||
|
||||
|
@ -13,7 +16,7 @@ static const char cvs_ident[] = "$Id$";
|
|||
* junk....
|
||||
*/
|
||||
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#if !defined(HAVE_SNPRINTF) || (HAVE_SNPRINTF_BUG == 1)
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* -- 08 January 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -26,6 +26,9 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "config.h"
|
||||
#include "../src/feature.h"
|
||||
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -38,7 +41,6 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include <ctype.h>
|
||||
#include "debug.h"
|
||||
#include "mem.h"
|
||||
#define STRINGS_C
|
||||
#include "strings.h"
|
||||
|
||||
#ifndef HAVE_MEMMEM
|
||||
|
@ -51,7 +53,7 @@ memmem(void *haystack, register size_t haystacklen, void *needle, register size_
|
|||
register char *hs = (char *) haystack;
|
||||
register char *n = (char *) needle;
|
||||
register unsigned long i;
|
||||
register len = haystacklen - needlelen;
|
||||
register size_t len = haystacklen - needlelen;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
if (!memcmp(hs + i, n, needlelen)) {
|
||||
|
@ -396,6 +398,19 @@ StrRev(register char *str)
|
|||
|
||||
}
|
||||
|
||||
char *
|
||||
StrDup(register const char *str)
|
||||
{
|
||||
|
||||
register char *newstr;
|
||||
register unsigned long len;
|
||||
|
||||
len = strlen(str) + 1; /* Copy NUL byte also */
|
||||
newstr = (char *) MALLOC(len);
|
||||
memcpy(newstr, str, len);
|
||||
return (newstr);
|
||||
}
|
||||
|
||||
#if !(HAVE_STRSEP)
|
||||
char *
|
||||
strsep(char **str, register char *sep)
|
||||
|
@ -404,7 +419,7 @@ strsep(char **str, register char *sep)
|
|||
register char *s = *str;
|
||||
char *sptr;
|
||||
|
||||
D_STRINGS(("StrSep(%s, %s) called.\n", *str, sep));
|
||||
D_STRINGS(("strsep(%s, %s) called.\n", *str, sep));
|
||||
sptr = s;
|
||||
for (; *s && !strchr(sep, *s); s++);
|
||||
if (!*s) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* -- 08 January 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -66,15 +66,15 @@
|
|||
# include <regex.h>
|
||||
#endif
|
||||
|
||||
#ifndef STRINGS_C
|
||||
extern char *LeftStr(const char *, unsigned long);
|
||||
extern char *MidStr(const char *, unsigned long, unsigned long);
|
||||
extern char *RightStr(const char *, unsigned long);
|
||||
#if defined(HAVE_REGEX_H) || defined(IRIX)
|
||||
extern unsigned char Match(const char *, const char *);
|
||||
#endif
|
||||
extern char *Word(unsigned long index, const char *str);
|
||||
extern char *PWord(unsigned long index, char *str);
|
||||
extern char *Word(unsigned long, const char *);
|
||||
extern char *PWord(unsigned long, char *);
|
||||
extern unsigned long NumWords(const char *);
|
||||
extern char *StripWhitespace(char *);
|
||||
extern char *LowerStr(char *);
|
||||
extern char *UpStr(char *);
|
||||
|
@ -82,6 +82,7 @@ extern char *StrCaseStr(char *, const char *);
|
|||
extern char *StrCaseChr(char *, char);
|
||||
extern char *StrCasePBrk(char *, char *);
|
||||
extern char *StrRev(char *);
|
||||
extern char *StrDup(const char *);
|
||||
#if !(HAVE_STRSEP)
|
||||
extern char *strsep(char **, char *);
|
||||
#endif
|
||||
|
@ -101,6 +102,5 @@ extern void usleep(unsigned long);
|
|||
extern void nanosleep(unsigned long);
|
||||
#endif
|
||||
*/
|
||||
#endif
|
||||
|
||||
#endif /* _STRINGS_H_ */
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* -- 2 April 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -29,12 +29,14 @@ static const char cvs_ident[] = "$Id$";
|
|||
|
||||
#ifdef IRIX
|
||||
|
||||
#include "config.h"
|
||||
#include "../src/feature.h"
|
||||
|
||||
#include "global.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#define STRPTIME_C
|
||||
#include "strptime.h"
|
||||
|
||||
char *
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* -- 2 April 1997 *
|
||||
***************************************************************/
|
||||
/*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com>.
|
||||
* This file is original work by Michael Jennings <mej@eterm.org>.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings
|
||||
*
|
||||
|
@ -63,14 +63,6 @@ static DTMap USMap = {
|
|||
"PM"
|
||||
};
|
||||
|
||||
#ifndef STRPTIME_C
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# else
|
||||
extern {
|
||||
# endif
|
||||
extern char *strptime(char *, const char *, struct tm *);
|
||||
}
|
||||
#endif
|
||||
extern char *strptime(char *, const char *, struct tm *);
|
||||
|
||||
#endif /* _STRPTIME_H_ */
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Makefile
|
||||
Makefile.in
|
|
@ -0,0 +1,14 @@
|
|||
# $Id$
|
||||
|
||||
EXTRA_DIST = bar_horizontal_1.png bar_horizontal_2.png bar_horizontal_3.png bar_vertical_1.png bar_vertical_2.png \
|
||||
bar_vertical_3.png button_arrow_down_1.png button_arrow_down_2.png button_arrow_down_3.png \
|
||||
button_arrow_up_1.png button_arrow_up_2.png button_arrow_up_3.png menu1.png menu2.png menu3.png
|
||||
|
||||
pixmapdir = $(pkgdatadir)/pix
|
||||
|
||||
install-data-hook:
|
||||
$(mkinstalldirs) $(DESTDIR)$(pixmapdir)
|
||||
@for i in $(EXTRA_DIST) ; do \
|
||||
echo $(INSTALL_DATA) $$i $(DESTDIR)${pixmapdir} ; \
|
||||
$(INSTALL_DATA) $$i $(DESTDIR)${pixmapdir} ; \
|
||||
done
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2,29 +2,22 @@
|
|||
|
||||
lib_LTLIBRARIES = libEterm.la
|
||||
|
||||
libEterm_la_SOURCES = activeconfig.c activeeterm.c activetags.c command.c \
|
||||
graphics.c grkelot.c menubar.c misc.c netdisp.c options.c \
|
||||
pixmap.c screen.c scrollbar.c system.c threads.c utmp.c
|
||||
libEterm_la_SOURCES = actions.c command.c e.c events.c graphics.c grkelot.c menus.c misc.c netdisp.c \
|
||||
options.c pixmap.c screen.c scrollbar.c system.c term.c threads.c timer.c utmp.c windows.c
|
||||
|
||||
libEterm_la_LDFLAGS = -version-info 8:9:8
|
||||
libEterm_la_LDFLAGS = -version-info 9:0:9
|
||||
|
||||
bin_PROGRAMS = Eterm
|
||||
|
||||
Eterm_SOURCES = main.c
|
||||
|
||||
Eterm_DEPENDENCIES = ../libmej/libmej.la feature.h
|
||||
Eterm_DEPENDENCIES = libEterm.la ../libmej/libmej.la feature.h
|
||||
|
||||
INCLUDES = -I. -I../libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS)
|
||||
INCLUDES = -I. -I$(top_srcdir)/libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS)
|
||||
|
||||
Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
|
||||
LDADD = -L$(DIST_ROOT)/src/.libs -lEterm -L$(DIST_ROOT)/libmej/.libs -L$(libdir) -L$(prefix)/lib $(LIBS) -lmej $(GRLIBS) $(X_LIBS)
|
||||
|
||||
EXTRA_DIST = activeconfig.h activeeterm.h activetags.h command.h debug.h \
|
||||
eterm_imlib.h feature.h.in graphics.h grkelot.h grx.h main.h \
|
||||
menubar.h misc.h options.h pixmap.h profile.h screen.h scrollbar.h \
|
||||
system.h threads.h graphics/Makefile.am graphics/Makefile.in \
|
||||
graphics/README graphics/data graphics/grxlib.c graphics/grxlib.h \
|
||||
graphics/qplot.c Eterm.xpm
|
||||
|
||||
feature.h: feature.h.in
|
||||
$(FEATURE_CMD)
|
||||
EXTRA_DIST = actions.h command.h debug.h e.h eterm_utmp.h events.h feature.h graphics.h grkelot.h grx.h main.h menus.h misc.h \
|
||||
options.h pixmap.h profile.h screen.h scrollbar.h system.h term.h threads.h timer.h windows.h graphics/Makefile.am \
|
||||
graphics/Makefile.in graphics/README graphics/data graphics/grxlib.c graphics/grxlib.h graphics/qplot.c Eterm.xpm
|
||||
|
|
|
@ -0,0 +1,158 @@
|
|||
/* actions.c -- Eterm action class module
|
||||
* -- 3 August 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1999-1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
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/strings.h"
|
||||
#include "debug.h"
|
||||
#include "main.h"
|
||||
#include "mem.h"
|
||||
#include "strings.h"
|
||||
#include "actions.h"
|
||||
#include "command.h"
|
||||
#include "e.h"
|
||||
#include "events.h"
|
||||
#include "graphics.h"
|
||||
#include "menus.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
#include "screen.h"
|
||||
#include "scrollbar.h"
|
||||
#include "term.h"
|
||||
#include "windows.h"
|
||||
|
||||
action_t *action_list = NULL;
|
||||
|
||||
unsigned char
|
||||
action_handle_string(event_t *ev, action_t *action) {
|
||||
REQUIRE_RVAL(action->param.string != NULL, 0);
|
||||
cmd_write(action->param.string, strlen(action->param.string));
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
action_handle_echo(event_t *ev, action_t *action) {
|
||||
REQUIRE_RVAL(action->param.string != NULL, 0);
|
||||
tt_write(action->param.string, strlen(action->param.string));
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
action_handle_menu(event_t *ev, action_t *action) {
|
||||
REQUIRE_RVAL(action->param.menu != NULL, 0);
|
||||
menu_invoke(ev->xbutton.x, ev->xbutton.y, TermWin.parent, action->param.menu, ev->xbutton.time);
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
action_dispatch(event_t *ev, KeySym keysym) {
|
||||
|
||||
action_t *action;
|
||||
|
||||
ASSERT(ev != NULL);
|
||||
for (action = action_list; action; action = action->next) {
|
||||
D_ACTIONS(("Checking action. mod == 0x%08x, button == %d, keysym == 0x%08x\n", action->mod, action->button, action->keysym));
|
||||
if (ev->xany.type == ButtonPress) {
|
||||
if ((action->button == BUTTON_NONE) || ((action->button != BUTTON_ANY) && (action->button != ev->xbutton.button))) {
|
||||
continue;
|
||||
}
|
||||
} else if (action->button != BUTTON_NONE) {
|
||||
continue;
|
||||
}
|
||||
D_ACTIONS(("Button passed.\n"));
|
||||
if (action->mod != MOD_ANY) {
|
||||
if (LOGICAL_XOR((action->mod & MOD_SHIFT), (ev->xkey.state & ShiftMask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_CTRL), (ev->xkey.state & ControlMask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_LOCK), (ev->xkey.state & LockMask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_MOD1), (ev->xkey.state & Mod1Mask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_MOD2), (ev->xkey.state & Mod2Mask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_MOD3), (ev->xkey.state & Mod3Mask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_MOD4), (ev->xkey.state & Mod4Mask))) {
|
||||
continue;
|
||||
}
|
||||
if (LOGICAL_XOR((action->mod & MOD_MOD5), (ev->xkey.state & Mod5Mask))) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
D_ACTIONS(("Modifiers passed. keysym == 0x%08x, action->keysym == 0x%08x\n", keysym, action->keysym));
|
||||
if ((keysym) && (action->keysym) && (keysym != action->keysym)) {
|
||||
continue;
|
||||
}
|
||||
D_ACTIONS(("Match found.\n"));
|
||||
/* If we've passed all the above tests, it's a match. Dispatch the handler. */
|
||||
return ((action->handler)(ev, action));
|
||||
}
|
||||
return (0);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
action_add(unsigned short mod, unsigned char button, KeySym keysym, action_type_t type, void *param) {
|
||||
|
||||
static action_t *action;
|
||||
|
||||
if (!action_list) {
|
||||
action_list = (action_t *) MALLOC(sizeof(action_t));
|
||||
action = action_list;
|
||||
} else {
|
||||
action->next = (action_t *) MALLOC(sizeof(action_t));
|
||||
action = action->next;
|
||||
}
|
||||
action->mod = mod;
|
||||
action->button = button;
|
||||
action->type = type;
|
||||
action->keysym = keysym;
|
||||
switch(type) {
|
||||
case ACTION_STRING: action->handler = (action_handler_t) action_handle_string; action->param.string = StrDup((char *) param); break;
|
||||
case ACTION_ECHO: action->handler = (action_handler_t) action_handle_echo; action->param.string = StrDup((char *) param); break;
|
||||
case ACTION_MENU: action->handler = (action_handler_t) action_handle_menu; action->param.menu = (menu_t *) param; break;
|
||||
default: break;
|
||||
}
|
||||
action->next = NULL;
|
||||
D_ACTIONS(("Added action. mod == 0x%08x, button == %d, keysym == 0x%08x\n", action->mod, action->button, action->keysym));
|
||||
}
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/* actions.h -- Eterm action class module header file
|
||||
* -- 3 August 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1999-1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ACTIONS_H_
|
||||
#define _ACTIONS_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
#include "events.h"
|
||||
#include "menus.h"
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
typedef enum {
|
||||
ACTION_NONE = 0,
|
||||
ACTION_STRING,
|
||||
ACTION_ECHO,
|
||||
ACTION_MENU
|
||||
} action_type_t;
|
||||
|
||||
#define KEYSYM_NONE (0UL)
|
||||
|
||||
#define MOD_NONE (0UL)
|
||||
#define MOD_CTRL (1UL << 0)
|
||||
#define MOD_SHIFT (1UL << 1)
|
||||
#define MOD_LOCK (1UL << 2)
|
||||
#define MOD_MOD1 (1UL << 3)
|
||||
#define MOD_MOD2 (1UL << 4)
|
||||
#define MOD_MOD3 (1UL << 5)
|
||||
#define MOD_MOD4 (1UL << 6)
|
||||
#define MOD_MOD5 (1UL << 7)
|
||||
#define MOD_ANY (1UL << 8)
|
||||
|
||||
#define BUTTON_NONE (0)
|
||||
#define BUTTON_ANY (0xff)
|
||||
|
||||
#define LOGICAL_XOR(a, b) !(((a) && (b)) || (!(a) && !(b)))
|
||||
|
||||
/************ Structures ************/
|
||||
typedef struct action_struct action_t;
|
||||
typedef unsigned char (*action_handler_t) (event_t *, action_t *);
|
||||
struct action_struct {
|
||||
unsigned short mod;
|
||||
unsigned char button;
|
||||
KeySym keysym;
|
||||
action_type_t type;
|
||||
action_handler_t handler;
|
||||
union {
|
||||
char *string;
|
||||
menu_t *menu;
|
||||
} param;
|
||||
struct action_struct *next;
|
||||
};
|
||||
|
||||
/************ Variables ************/
|
||||
extern action_t *action_list;
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern unsigned char action_handle_string(event_t *ev, action_t *action);
|
||||
extern unsigned char action_handle_echo(event_t *ev, action_t *action);
|
||||
extern unsigned char action_handle_menu(event_t *ev, action_t *action);
|
||||
extern unsigned char action_dispatch(event_t *ev, KeySym keysym);
|
||||
extern void action_add(unsigned short mod, unsigned char button, KeySym keysym, action_type_t type, void *param);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _ACTIONS_H_ */
|
|
@ -1,623 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: activeconfig.c
|
||||
*
|
||||
* Copyright 1997 Nat Friedman, Massachusetts Institute of Technology
|
||||
* <ndf@mit.edu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
/* This file contains all the config file parsing functionality */
|
||||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "feature.h"
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <pwd.h>
|
||||
|
||||
#include "activeconfig.h"
|
||||
|
||||
/* The basic design of the config file parsing routines revolves around the
|
||||
dispatch table below. The dispatch table relates file tokens with
|
||||
their parsing functions. In order to add a new config file token
|
||||
(for example "Foo=something"), simply define TAG_CONFIG_FOO, write
|
||||
parse_config_tag_foo, and then add the following line to the dispatch
|
||||
table:
|
||||
|
||||
{TAG_CONFIG_FOO, parse_config_tag_foo}
|
||||
|
||||
and it will magically work. */
|
||||
|
||||
/* This is the actual dispatch table. It should be terminated by a struct
|
||||
config_entry whose parser field is NULL. */
|
||||
struct config_entry config_dispatch[] =
|
||||
{
|
||||
{TAG_CONFIG_LOAD, parse_config_load},
|
||||
{TAG_CONFIG_DEFAULT_BINDING, parse_config_default_binding},
|
||||
{TAG_CONFIG_DEFAULT_HIGHLIGHT, parse_config_default_highlight},
|
||||
{TAG_CONFIG_DEFAULT_SEARCH_LINES, parse_config_default_search_lines},
|
||||
{TAG_CONFIG_NEW_TAG, parse_config_tag_begin},
|
||||
{TAG_CONFIG_END_TAG, parse_config_tag_end},
|
||||
{TAG_CONFIG_LATENT, parse_config_tag_latent},
|
||||
{TAG_CONFIG_BINDING, parse_config_tag_binding},
|
||||
{TAG_CONFIG_HIGHLIGHT, parse_config_tag_highlight},
|
||||
{TAG_CONFIG_MODES, parse_config_tag_modes},
|
||||
{TAG_CONFIG_REGEXP, parse_config_tag_regexp},
|
||||
{TAG_CONFIG_ACTION, parse_config_tag_action},
|
||||
{TAG_CONFIG_OUTPUT, parse_config_tag_output},
|
||||
{TAG_CONFIG_SEARCH_LINES, parse_config_tag_search_lines},
|
||||
{TAG_CONFIG_CLUE, parse_config_tag_clue},
|
||||
{TAG_CONFIG_ENV, parse_config_tag_env},
|
||||
{"", NULL}
|
||||
};
|
||||
|
||||
/*
|
||||
Dispatch Functions
|
||||
*/
|
||||
|
||||
int
|
||||
parse_config_tag_env(char *envlist, struct config_info *config_info)
|
||||
{
|
||||
char *p, *q;
|
||||
int nenvs = 0;
|
||||
|
||||
p = envlist;
|
||||
do {
|
||||
printf("Env...\n");
|
||||
if ((q = strchr(p, ',')) == NULL)
|
||||
q = p + strlen(p);
|
||||
strncpy(tag[config_info->curr_tag].env[nenvs], p, q - p);
|
||||
tag[config_info->curr_tag].env[nenvs][q - p] = '\0';
|
||||
printf("got env: %s\n", tag[config_info->curr_tag].env[nenvs]);
|
||||
nenvs++;
|
||||
if (*q != ',')
|
||||
p = NULL;
|
||||
else
|
||||
p = q + 1;
|
||||
} while (p != NULL);
|
||||
tag[config_info->curr_tag].num_envs = nenvs;
|
||||
|
||||
printf("Got envs for tag:\n");
|
||||
for (nenvs = 0; nenvs < tag[config_info->curr_tag].num_envs; nenvs++)
|
||||
printf("Env %d: (%s)\n", nenvs, tag[config_info->curr_tag].env[nenvs]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_load(char *filename, struct config_info *config_info)
|
||||
{
|
||||
struct config_info new_config_info;
|
||||
|
||||
/* Scope on Defaults is per-file */
|
||||
set_config_defaults(&new_config_info);
|
||||
new_config_info.curr_tag = config_info->curr_tag;
|
||||
|
||||
/* If it's a relative file name, make it absolute */
|
||||
if (*filename != '/') {
|
||||
char new_filename[1024];
|
||||
char *p, *q;
|
||||
|
||||
if ((p = strrchr(config_info->filename, '/')) == NULL)
|
||||
configerror(config_info, "Could not determine path to file!");
|
||||
q = config_info->filename;
|
||||
|
||||
strcpy(new_filename, q);
|
||||
new_filename[p - q] = '\0';
|
||||
strcat(new_filename, "/");
|
||||
strcat(new_filename, filename);
|
||||
printf("Filename: %s\n", new_filename);
|
||||
strcpy(filename, new_filename);
|
||||
}
|
||||
/* FIXME: This implementation forces pathnames to be absolute. We should
|
||||
allow relative pathnames somehow. */
|
||||
parse_tag_file(filename, &new_config_info);
|
||||
|
||||
config_info->curr_tag = new_config_info.curr_tag;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_default_binding(char *def,
|
||||
struct config_info *config_info)
|
||||
{
|
||||
config_info->default_binding = string_to_binding_mask(config_info, def);
|
||||
if (!(config_info->default_binding & (TAG_BINDING_BUTTON1 | TAG_BINDING_BUTTON2 |
|
||||
TAG_BINDING_BUTTON3))) {
|
||||
configerror(config_info, "Error reading default binding: binding _must_ "
|
||||
"include either Button1, Button2, or Button3. Reverting to "
|
||||
"compiled default.");
|
||||
config_info->default_binding = TAG_DEFAULT_BINDING_MASK;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_default_highlight(char *def,
|
||||
struct config_info *config_info)
|
||||
{
|
||||
string_to_highlight(config_info, &config_info->default_highlight, def);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_default_search_lines(char *def,
|
||||
struct config_info *config_info)
|
||||
{
|
||||
if ((config_info->default_search_lines = atoi(def)) == 0) {
|
||||
configerror(config_info, "Invalid default number of search lines. "
|
||||
"Reverting to compiled default.\n");
|
||||
config_info->default_search_lines = TAG_DEFAULT_SEARCH_LINES;
|
||||
}
|
||||
if (config_info->default_search_lines > MAX_SEARCH_LINES) {
|
||||
configerror(config_info, "Default number of search lines > maximum. "
|
||||
"Reverting to compiled default.\n");
|
||||
config_info->default_search_lines = TAG_DEFAULT_SEARCH_LINES;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_begin(char *s, struct config_info *config_info)
|
||||
{
|
||||
fprintf(stderr, "New tag\n");
|
||||
if (config_info->in_tag) {
|
||||
configerror(config_info, "Open brace inside braces");
|
||||
disable_tags();
|
||||
return -1;
|
||||
}
|
||||
if ((config_info->curr_tag + 1) >= MAX_TAGS) {
|
||||
configerror(config_info, "Too many tags! Increase the maximum number "
|
||||
"of tags and recompile!\n");
|
||||
disable_tags();
|
||||
return -1;
|
||||
}
|
||||
config_info->in_tag = 1;
|
||||
|
||||
/* Initialize the new tag with all the default values. */
|
||||
tag[config_info->curr_tag].binding_mask = config_info->default_binding;
|
||||
tag[config_info->curr_tag].search_lines = config_info->default_search_lines;
|
||||
tag[config_info->curr_tag].highlight.attributes =
|
||||
config_info->default_highlight.attributes;
|
||||
tag[config_info->curr_tag].highlight.fg_color =
|
||||
config_info->default_highlight.fg_color;
|
||||
tag[config_info->curr_tag].highlight.bg_color =
|
||||
config_info->default_highlight.bg_color;
|
||||
tag[config_info->curr_tag].num_modes = 0;
|
||||
tag[config_info->curr_tag].latent = 0;
|
||||
tag[config_info->curr_tag].output_type = TAG_OUTPUT_NULL;
|
||||
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
tag[config_info->curr_tag].rx = NULL;
|
||||
#endif
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_end(char *s, struct config_info *config_info)
|
||||
{
|
||||
if (!config_info->in_tag) {
|
||||
configerror(config_info, "close brace without open brace");
|
||||
disable_tags();
|
||||
return -1;
|
||||
}
|
||||
/* Make sure that the tag was setup properly before advancing to the next
|
||||
one in the list */
|
||||
|
||||
/* FIXME: we need a way of figuring this out if we're using POSIX regex */
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
if (tag[config_info->curr_tag].rx == NULL) {
|
||||
configerror("No regular epxression supplied for tag. Tag ignored.");
|
||||
config_info->curr_tag--;
|
||||
}
|
||||
#endif
|
||||
|
||||
config_info->in_tag = 0;
|
||||
config_info->curr_tag++;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_latent(char *latent, struct config_info *config_info)
|
||||
{
|
||||
if (!strcasecmp(latent, "true"))
|
||||
tag[config_info->curr_tag].latent = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_search_lines(char *sl, struct config_info *config_info)
|
||||
{
|
||||
if (atoi(sl))
|
||||
tag[config_info->curr_tag].search_lines = atoi(sl);
|
||||
|
||||
D_TAGS(("==> Setting tag %d's search lines to %d\n", config_info->curr_tag, atoi(sl)));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_binding(char *s, struct config_info *config_info)
|
||||
{
|
||||
tag[config_info->curr_tag].binding_mask = string_to_binding_mask(config_info, s);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_highlight(char *s, struct config_info *config_info)
|
||||
{
|
||||
string_to_highlight(config_info, &tag[config_info->curr_tag].highlight, s);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_modes(char *s, struct config_info *config_info)
|
||||
{
|
||||
char *mode, *p;
|
||||
|
||||
mode = s;
|
||||
|
||||
while (mode != NULL) {
|
||||
if ((p = strchr(mode, ',')) != NULL)
|
||||
*p = '\0';
|
||||
strcpy(tag[config_info->curr_tag].mode[tag[config_info->curr_tag].num_modes], mode);
|
||||
if (p != NULL)
|
||||
mode = p + 1;
|
||||
else
|
||||
mode = NULL;
|
||||
|
||||
tag[config_info->curr_tag].num_modes++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_regexp(char *regexp, struct config_info *config_info)
|
||||
{
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
if ((tag[config_info->curr_tag].rx = regcomp(regexp)) == NULL)
|
||||
#else
|
||||
if (regcomp(&tag[config_info->curr_tag].rx, regexp, REG_EXTENDED) != 0)
|
||||
#endif
|
||||
{
|
||||
configerror(config_info, "Couldn't compile regular expression");
|
||||
return -1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_action(char *action, struct config_info *config_info)
|
||||
{
|
||||
strcpy(tag[config_info->curr_tag].action, action);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_output(char *output, struct config_info *config_info)
|
||||
{
|
||||
if (!strcasecmp(output, "null"))
|
||||
tag[config_info->curr_tag].output_type = TAG_OUTPUT_NULL;
|
||||
else if (!strcasecmp(output, "loop"))
|
||||
tag[config_info->curr_tag].output_type = TAG_OUTPUT_LOOP;
|
||||
else if (!strcasecmp(output, "replace"))
|
||||
tag[config_info->curr_tag].output_type = TAG_OUTPUT_REPL;
|
||||
else if (!strcasecmp(output, "popup"))
|
||||
tag[config_info->curr_tag].output_type = TAG_OUTPUT_POPUP;
|
||||
else {
|
||||
configerror(config_info, "Unknown output method; defaulting to NULL");
|
||||
tag[config_info->curr_tag].output_type = TAG_OUTPUT_NULL;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int
|
||||
parse_config_tag_clue(char *clue, struct config_info *config_info)
|
||||
{
|
||||
strcpy(tag[config_info->curr_tag].clue, clue);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
set_config_defaults(struct config_info *config_info)
|
||||
{
|
||||
config_info->default_binding = TAG_DEFAULT_BINDING_MASK;
|
||||
config_info->default_search_lines = TAG_DEFAULT_SEARCH_LINES;
|
||||
config_info->default_highlight.bg_color = TAG_DEFAULT_HIGHLIGHT_BG;
|
||||
config_info->default_highlight.fg_color = TAG_DEFAULT_HIGHLIGHT_FG;
|
||||
config_info->default_highlight.attributes = TAG_DEFAULT_HIGHLIGHT_ATT;
|
||||
config_info->curr_tag = 0;
|
||||
config_info->line_num = 0;
|
||||
config_info->in_tag = 0;
|
||||
}
|
||||
|
||||
/* parse_tag_config actually reads the file and calls the dispatch functions
|
||||
where appropriate */
|
||||
void
|
||||
parse_tag_config(char *tag_config_file)
|
||||
{
|
||||
char file_name[1024];
|
||||
struct passwd *user;
|
||||
|
||||
struct config_info config_info;
|
||||
|
||||
/* Set the defaults */
|
||||
set_config_defaults(&config_info);
|
||||
|
||||
if (tag_config_file != NULL)
|
||||
if (!parse_tag_file(tag_config_file, &config_info)) {
|
||||
fprintf(stderr, "parse_tag_config: Couldn't open tag config"
|
||||
"file: %s\n", tag_config_file);
|
||||
tag_config_file = NULL;
|
||||
}
|
||||
if (tag_config_file == NULL) {
|
||||
user = getpwuid(getuid());
|
||||
sprintf(file_name, "%s/%s", user->pw_dir, TAG_CONFIG_USER_FILENAME);
|
||||
if (!parse_tag_file(file_name, &config_info)) {
|
||||
fprintf(stderr, "parse_tag_config: Couldn't open user tag config "
|
||||
"file: %s\n", file_name);
|
||||
fprintf(stderr, "parse_tag_config: Trying system config file\n");
|
||||
|
||||
/* Try the system-wide config file */
|
||||
if (!parse_tag_file(TAG_CONFIG_SYSTEM_FILENAME, &config_info)) {
|
||||
fprintf(stderr, "parse_tag_config: Error parsing config file: "
|
||||
"%s\n", TAG_CONFIG_SYSTEM_FILENAME);
|
||||
disable_tags();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
num_tags = config_info.curr_tag;
|
||||
printf("Num tags: %d\n", num_tags);
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < num_tags; i++)
|
||||
printf("Tag action(%d): %s\n", i, tag[i].action);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
parse_tag_file(const char *filename, struct config_info *config_info)
|
||||
{
|
||||
FILE *tag_file;
|
||||
char line[1024];
|
||||
int i;
|
||||
|
||||
if ((tag_file = fopen(filename, "r")) == NULL)
|
||||
return 0;
|
||||
|
||||
strcpy(config_info->filename, filename);
|
||||
|
||||
/* Loop through the config file lines */
|
||||
while (!feof(tag_file)) {
|
||||
fgets(line, sizeof(line), tag_file);
|
||||
config_info->line_num++;
|
||||
|
||||
if (feof(tag_file))
|
||||
break;
|
||||
|
||||
if (line[strlen(line) - 1] != '\n') {
|
||||
configerror(config_info, "line too long?");
|
||||
exit(1);
|
||||
}
|
||||
line[strlen(line) - 1] = '\0';
|
||||
|
||||
/* Loop through the config file lines, calling the appropriate
|
||||
functions from the dispatch table as we go. If there is no
|
||||
corresponding function, flag a warning and try to continue. */
|
||||
if ((line[0] != '#') && (!isspace(line[0])) && (strlen(line) != 0)) {
|
||||
for (i = 0; config_dispatch[i].parser != NULL; i++)
|
||||
if (TAG_CONFIG(config_dispatch[i].token)) {
|
||||
if ((strchr(line, '=') == NULL) && (*line != '{') &&
|
||||
(*line != '}') && !TAG_CONFIG(TAG_CONFIG_LOAD))
|
||||
configerror(config_info, "'=' not found");
|
||||
else {
|
||||
char *p;
|
||||
|
||||
p = line + strlen(config_dispatch[i].token) + 1;
|
||||
if (strchr(line, '=') != NULL) {
|
||||
p = strchr(line, '=') + 1;
|
||||
while (isspace(*p))
|
||||
p++;
|
||||
}
|
||||
if (!((config_dispatch[i].parser) (p, config_info)))
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (config_dispatch[i].parser == NULL)
|
||||
configerror(config_info, "Unrecognized token");
|
||||
}
|
||||
}
|
||||
fclose(tag_file);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
Internal Functions
|
||||
*/
|
||||
|
||||
/* Use this function to display errors encountered while parsing the config
|
||||
file to keep them looking uniform */
|
||||
void
|
||||
configerror(struct config_info *config_info, char *message)
|
||||
{
|
||||
fprintf(stderr, "active tags: error on line %d of config file %s: %s\n",
|
||||
config_info->line_num, config_info->filename, message);
|
||||
}
|
||||
|
||||
void
|
||||
string_to_color(struct config_info *config_info, tag_highlight_t * highlight,
|
||||
char *c)
|
||||
{
|
||||
#if 0
|
||||
int color;
|
||||
|
||||
#endif
|
||||
int color = 0;
|
||||
int bg = 0;
|
||||
char *p;
|
||||
|
||||
p = c;
|
||||
|
||||
/* Background colors are prefaced by a '*' */
|
||||
if (*p == '*') {
|
||||
bg = 1;
|
||||
p++;
|
||||
}
|
||||
if (!strcasecmp(p, "Black"))
|
||||
color = TAG_HIGHLIGHT_BLACK;
|
||||
else if (!strcasecmp(p, "White"))
|
||||
color = TAG_HIGHLIGHT_WHITE;
|
||||
else if (!strcasecmp(p, "Red"))
|
||||
color = TAG_HIGHLIGHT_RED;
|
||||
else if (!strcasecmp(p, "Green"))
|
||||
color = TAG_HIGHLIGHT_GREEN;
|
||||
else if (!strcasecmp(p, "Yellow"))
|
||||
color = TAG_HIGHLIGHT_YELLOW;
|
||||
else if (!strcasecmp(p, "Blue"))
|
||||
color = TAG_HIGHLIGHT_BLUE;
|
||||
else if (!strcasecmp(p, "Magenta"))
|
||||
color = TAG_HIGHLIGHT_MAGENTA;
|
||||
else if (!strcasecmp(p, "Cyan"))
|
||||
color = TAG_HIGHLIGHT_CYAN;
|
||||
else if (!strcasecmp(p, "Normal"))
|
||||
color = TAG_HIGHLIGHT_NORMAL;
|
||||
else
|
||||
configerror(config_info, "Unrecognized highlight token");
|
||||
|
||||
if (bg)
|
||||
highlight->bg_color = color;
|
||||
else
|
||||
highlight->fg_color = color;
|
||||
}
|
||||
|
||||
void
|
||||
string_to_highlight(struct config_info *config_info, tag_highlight_t *
|
||||
highlight, char *s)
|
||||
{
|
||||
char *h_bit;
|
||||
|
||||
/* att_set is 0 if we've set an attribute value and 1 otherwise. We have to
|
||||
keep track of this because setting an attribute value should override the
|
||||
default, so we can't blindly OR the new values with whatever was in
|
||||
highlight->attribute before. So, if we've already overriden the value,
|
||||
we OR. If we haven't yet overriden it, then we do so and set att_set to
|
||||
1. */
|
||||
int att_set = 0;
|
||||
|
||||
h_bit = strtok(s, "&");
|
||||
|
||||
while (h_bit != NULL) {
|
||||
if (!strcasecmp(h_bit, "Underline")) {
|
||||
if (att_set)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_ULINE;
|
||||
else {
|
||||
highlight->attributes = TAG_HIGHLIGHT_ULINE;
|
||||
highlight->fg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
highlight->bg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
att_set = 1;
|
||||
}
|
||||
} else if (!strcasecmp(h_bit, "Bold")) {
|
||||
if (att_set)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_BOLD;
|
||||
else {
|
||||
highlight->attributes = TAG_HIGHLIGHT_BOLD;
|
||||
highlight->fg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
highlight->bg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
att_set = 1;
|
||||
}
|
||||
} else if (!strcasecmp(h_bit, "RVid")) {
|
||||
if (att_set)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_RVID;
|
||||
else {
|
||||
highlight->attributes = TAG_HIGHLIGHT_RVID;
|
||||
highlight->fg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
highlight->bg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
att_set = 1;
|
||||
}
|
||||
} else if (!strcasecmp(h_bit, "Blink")) {
|
||||
if (att_set)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_BLINK;
|
||||
else {
|
||||
highlight->attributes = TAG_HIGHLIGHT_BLINK;
|
||||
highlight->fg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
highlight->bg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
att_set = 1;
|
||||
}
|
||||
} else {
|
||||
if (att_set)
|
||||
string_to_color(config_info, highlight, h_bit);
|
||||
else {
|
||||
att_set = 1;
|
||||
highlight->fg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
highlight->bg_color = TAG_HIGHLIGHT_NORMAL;
|
||||
highlight->attributes = 0;
|
||||
string_to_color(config_info, highlight, h_bit);
|
||||
}
|
||||
}
|
||||
|
||||
h_bit = strtok(NULL, "&");
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int
|
||||
string_to_binding_mask(struct config_info *config_info, char *s)
|
||||
{
|
||||
char *b_bit;
|
||||
unsigned int mask = 0;
|
||||
|
||||
b_bit = strtok(s, "&");
|
||||
while (b_bit != NULL) {
|
||||
if (!strcasecmp(b_bit, "Button1"))
|
||||
mask |= TAG_BINDING_BUTTON1;
|
||||
else if (!strcasecmp(b_bit, "Button2"))
|
||||
mask |= TAG_BINDING_BUTTON2;
|
||||
else if (!strcasecmp(b_bit, "Button3"))
|
||||
mask |= TAG_BINDING_BUTTON3;
|
||||
else if (!strcasecmp(b_bit, "Shift"))
|
||||
mask |= TAG_BINDING_SHIFT;
|
||||
else if (!strcasecmp(b_bit, "Control"))
|
||||
mask |= TAG_BINDING_CONTROL;
|
||||
else if (!strcasecmp(b_bit, "Meta"))
|
||||
mask |= TAG_BINDING_META;
|
||||
else
|
||||
configerror(config_info, "Unknown binding token");
|
||||
|
||||
b_bit = strtok(NULL, "&");
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
#endif /* USE_ACTIVE_TAGS */
|
|
@ -1,106 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: activeconfig.h
|
||||
*
|
||||
* Copyright 1996,1997 Nat Friedman, Massachusetts Institute of Technology
|
||||
* <ndf@mit.edu>
|
||||
*
|
||||
* You can do what you like with this source code as long as
|
||||
* you don't try to make money out of it and you include an
|
||||
* unaltered copy of this message (including the copyright).
|
||||
*
|
||||
* The author accepts no responsibility for anything whatsoever, nor does he
|
||||
* guarantee anything, nor are any guarantees, promises, or covenants implicit
|
||||
* with the use of this software.
|
||||
*
|
||||
* For information regarding this particular module, please see
|
||||
* README.ActiveTags.
|
||||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
#include "regexp/regexp.h"
|
||||
#else
|
||||
#include <regex.h>
|
||||
#endif
|
||||
|
||||
#include "activetags.h"
|
||||
|
||||
/* The default locations for the config file */
|
||||
#define TAG_CONFIG_USER_FILENAME ".active.tags"
|
||||
#define TAG_CONFIG_SYSTEM_FILENAME "/etc/active.tags"
|
||||
|
||||
/* Defaults */
|
||||
#define TAG_DEFAULT_SEARCH_LINES 1
|
||||
#define TAG_DEFAULT_BINDING_MASK TAG_BINDING_BUTTON3
|
||||
#define TAG_DEFAULT_HIGHLIGHT_BG TAG_HIGHLIGHT_NORMAL
|
||||
#define TAG_DEFAULT_HIGHLIGHT_FG TAG_HIGHLIGHT_BLUE
|
||||
#define TAG_DEFAULT_HIGHLIGHT_ATT 0
|
||||
|
||||
/* These are the config file tokens. */
|
||||
#define TAG_CONFIG_DEFAULT_BINDING "DefaultBinding"
|
||||
#define TAG_CONFIG_DEFAULT_HIGHLIGHT "DefaultHighlight"
|
||||
#define TAG_CONFIG_DEFAULT_SEARCH_LINES "DefaultSearchLines"
|
||||
#define TAG_CONFIG_SEARCH_LINES "SearchLines"
|
||||
#define TAG_CONFIG_NEW_TAG "{"
|
||||
#define TAG_CONFIG_END_TAG "}"
|
||||
#define TAG_CONFIG_OUTPUT "Output"
|
||||
#define TAG_CONFIG_LATENT "Latent"
|
||||
#define TAG_CONFIG_BINDING "Binding"
|
||||
#define TAG_CONFIG_HIGHLIGHT "Highlight"
|
||||
#define TAG_CONFIG_MODES "Modes"
|
||||
#define TAG_CONFIG_REGEXP "Regexp"
|
||||
#define TAG_CONFIG_ACTION "Action"
|
||||
#define TAG_CONFIG_LOOPACTION "LoopAction"
|
||||
#define TAG_CONFIG_CLUE "Clue"
|
||||
#define TAG_CONFIG_LOAD "Load"
|
||||
#define TAG_CONFIG_ENV "Env"
|
||||
|
||||
/* Macros for parsing the config file */
|
||||
#define TAG_CONFIG(x) (!strncmp(line, (x), strlen(x)))
|
||||
|
||||
/* The config_info structure holds all the information that each individual
|
||||
configuration parsing function needs as it runs */
|
||||
struct config_info {
|
||||
int line_num;
|
||||
int default_binding;
|
||||
tag_highlight_t default_highlight;
|
||||
int default_search_lines;
|
||||
int in_tag;
|
||||
int curr_tag;
|
||||
char filename[1024];
|
||||
};
|
||||
|
||||
/* Each dispatch table entry is of the following form */
|
||||
struct config_entry {
|
||||
char * token;
|
||||
int (*parser)(char *, struct config_info *);
|
||||
};
|
||||
|
||||
/* Configuration dispatch function prototypes */
|
||||
int parse_config_default_binding(char *, struct config_info *);
|
||||
int parse_config_default_highlight(char *, struct config_info *);
|
||||
int parse_config_default_search_lines(char *, struct config_info *);
|
||||
int parse_config_tag_begin(char *, struct config_info *);
|
||||
int parse_config_tag_end(char *, struct config_info *);
|
||||
int parse_config_tag_latent(char *, struct config_info *);
|
||||
int parse_config_tag_binding(char *, struct config_info *);
|
||||
int parse_config_tag_highlight(char *, struct config_info *);
|
||||
int parse_config_tag_modes(char *, struct config_info *);
|
||||
int parse_config_tag_regexp(char *, struct config_info *);
|
||||
int parse_config_tag_action(char *, struct config_info *);
|
||||
int parse_config_tag_search_lines(char *, struct config_info *);
|
||||
int parse_config_tag_output(char *, struct config_info *);
|
||||
int parse_config_tag_clue(char *, struct config_info *);
|
||||
int parse_config_load(char * filename, struct config_info * config_info);
|
||||
int parse_config_tag_env(char * envlist, struct config_info * config_info);
|
||||
|
||||
/* Internal helper functin prototypes */
|
||||
void configerror(struct config_info * config_info, char * message);
|
||||
void string_to_color(struct config_info * config_info, tag_highlight_t *
|
||||
highlight, char * c);
|
||||
void string_to_highlight(struct config_info * config_info, tag_highlight_t *
|
||||
highlight, char * s);
|
||||
unsigned int string_to_binding_mask(struct config_info * config_info,
|
||||
char * s);
|
||||
void set_config_defaults(struct config_info * config_info);
|
||||
int parse_tag_file(const char * filename, struct config_info * config_info);
|
|
@ -1,390 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: activeeterm.c
|
||||
*
|
||||
* Copyright 1997 Nat Friedman, Massachusetts Institute of Technology
|
||||
* <ndf@mit.edu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
/* This file contains the glue functions to make active tags work in eterm. */
|
||||
|
||||
/*
|
||||
In order to dingify a program, this plugin file must define the following
|
||||
functions with the specified behavior. Note that functions can be defined
|
||||
as macros just fine.
|
||||
|
||||
The functions are broken up into two groups. The first group of functions
|
||||
are the wrapper functions which get called by the main program. These
|
||||
functions call the internal active tags functions. The second group of
|
||||
functions are the internal functions which are called by the active
|
||||
tags functions.
|
||||
|
||||
WRAPPER FUNCTIONS
|
||||
|
||||
int tag_click( ... )
|
||||
This should call tag_activate after it has properly assembled the
|
||||
binding mask and determined the row and column properly. tag_click()
|
||||
is called from inside the main program.
|
||||
|
||||
void tag_pointer_new_position( ... )
|
||||
This should call show_tag after it has computed the row and column
|
||||
properly and done whatever processing it needs to do.
|
||||
|
||||
void tag_scroll( ... )
|
||||
void tag_init ( ... )
|
||||
void tag_sig_child ( ... )
|
||||
void tag_hide ( ... )
|
||||
|
||||
INTERNAL FUNCTIONS
|
||||
|
||||
void get_tag_mode(char * mode)
|
||||
This function stores a string containing the current mode in the
|
||||
mode parameter. This can be very simple (for example
|
||||
strcpy(mode, "browser") might be sufficient), or somewhat more complex
|
||||
for those programs which can change modes, such as rxvt.
|
||||
|
||||
int row_width(void)
|
||||
returns the maximum width of each row.
|
||||
|
||||
const char ** get_rows(void)
|
||||
returns the comparison region. current_row() and current_col() should
|
||||
be indexes into this region.
|
||||
|
||||
void set_tag_highlight(int row, int col, tag_highlight_t highlight)
|
||||
Highlights the specified character with the specified highlighting.
|
||||
|
||||
tag_highlight_t get_tag_highlight(int row, int col)
|
||||
Returns the current highlighting information for the specified
|
||||
character.
|
||||
*/
|
||||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "feature.h"
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "activetags.h"
|
||||
#include "activeeterm.h"
|
||||
#include "mem.h" /* From libmej */
|
||||
|
||||
/*
|
||||
WRAPPER FUNCTIONS
|
||||
*/
|
||||
|
||||
void
|
||||
tag_pointer_new_position(int x, int y)
|
||||
{
|
||||
int row, col;
|
||||
|
||||
if (!active_tags_enabled)
|
||||
return;
|
||||
|
||||
col = Pixel2Col(x);
|
||||
row = Pixel2Row(y);
|
||||
|
||||
#ifdef ACTIVE_TAG_CLICK_CLUES
|
||||
if (show_tag(row, col))
|
||||
set_click_clue_timer();
|
||||
else {
|
||||
destroy_click_clue();
|
||||
unset_click_clue_timer();
|
||||
}
|
||||
#else
|
||||
show_tag(row, col);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
tag_scroll(int nlines, int row1, int row2)
|
||||
{
|
||||
if (!active_tags_enabled)
|
||||
return;
|
||||
|
||||
#ifdef ACTIVE_TAG_CLICK_CLUES
|
||||
if (tag_screen_scroll(nlines, row1, row2)) {
|
||||
destroy_click_clue();
|
||||
unset_click_clue_timer();
|
||||
}
|
||||
#else
|
||||
(void) tag_screen_scroll(nlines, row1, row2);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
tag_init(void)
|
||||
{
|
||||
if (!active_tags_enabled)
|
||||
return;
|
||||
|
||||
tag_env = "X";
|
||||
|
||||
#ifdef ACTIVE_TAG_CLICK_CLUES
|
||||
init_click_clues();
|
||||
#endif
|
||||
|
||||
initialize_tags();
|
||||
}
|
||||
|
||||
#if 0
|
||||
void
|
||||
#endif
|
||||
inline void
|
||||
tag_hide(void)
|
||||
{
|
||||
if (!active_tags_enabled)
|
||||
return;
|
||||
|
||||
erase_tag_highlighting();
|
||||
}
|
||||
|
||||
int
|
||||
tag_click(int x, int y, unsigned int button, unsigned int keystate)
|
||||
{
|
||||
int binding_mask;
|
||||
int row, col;
|
||||
int retval;
|
||||
|
||||
if (!active_tags_enabled)
|
||||
return 0;
|
||||
|
||||
#ifdef ACTIVE_TAG_CLICK_CLUES
|
||||
destroy_click_clue();
|
||||
unset_click_clue_timer();
|
||||
#endif
|
||||
|
||||
/* Build the binding mask. Button3 == 3. We need it to be 4
|
||||
(100 binary) to fit in the binding mask properly. */
|
||||
if (button == Button3)
|
||||
button = TAG_BINDING_BUTTON3;
|
||||
|
||||
binding_mask = button;
|
||||
|
||||
if (keystate & ShiftMask)
|
||||
binding_mask |= TAG_BINDING_SHIFT;
|
||||
if (keystate & ControlMask)
|
||||
binding_mask |= TAG_BINDING_CONTROL;
|
||||
if (keystate & Mod1Mask)
|
||||
binding_mask |= TAG_BINDING_META;
|
||||
|
||||
row = Pixel2Row(y);
|
||||
col = Pixel2Col(x);
|
||||
retval = tag_activate(row, col, binding_mask);
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
INTERNAL FUNCTIONS
|
||||
*/
|
||||
|
||||
/* This function finds the current tag mode and stores it in the 'mode'
|
||||
parameter. The current mode is equivalent to argv[0] of the program
|
||||
currently controlling the eterm's terminal. */
|
||||
void
|
||||
get_tag_mode(char *mode)
|
||||
{
|
||||
char proc_name[1024];
|
||||
FILE *f;
|
||||
pid_t pid;
|
||||
|
||||
if ((pid = tcgetpgrp(cmd_fd)) == -1) {
|
||||
fprintf(stderr, "Couldn't get tag mode!\n");
|
||||
strcpy(mode, "");
|
||||
return;
|
||||
}
|
||||
sprintf(proc_name, "/proc/%d/cmdline", pid);
|
||||
if ((f = fopen(proc_name, "r")) == NULL) {
|
||||
fprintf(stderr, "Couldn't open proc!\n");
|
||||
strcpy(mode, "");
|
||||
return;
|
||||
}
|
||||
fscanf(f, "%s", mode);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
/* These were changed to macros and moved into activeeterm.h. -vendu */
|
||||
|
||||
#if 0
|
||||
int
|
||||
row_width(void)
|
||||
{
|
||||
return TermWin.ncol;
|
||||
}
|
||||
|
||||
int
|
||||
tag_min_row(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
tag_max_row(void)
|
||||
{
|
||||
return TermWin.nrow - 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
tag_get_row(int row_num, char **row)
|
||||
{
|
||||
/* FIXME: I guess this works :) -vendu */
|
||||
*row = drawn_text[row_num];
|
||||
}
|
||||
|
||||
int
|
||||
tag_eterm_color(int tag_color)
|
||||
{
|
||||
switch (tag_color) {
|
||||
case TAG_HIGHLIGHT_BLACK:
|
||||
return 2;
|
||||
case TAG_HIGHLIGHT_WHITE:
|
||||
return 1;
|
||||
case TAG_HIGHLIGHT_RED:
|
||||
return 3;
|
||||
case TAG_HIGHLIGHT_GREEN:
|
||||
return 4;
|
||||
case TAG_HIGHLIGHT_YELLOW:
|
||||
return 5;
|
||||
case TAG_HIGHLIGHT_BLUE:
|
||||
return 6;
|
||||
case TAG_HIGHLIGHT_MAGENTA:
|
||||
return 7;
|
||||
case TAG_HIGHLIGHT_CYAN:
|
||||
return 8;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
eterm_tag_color(int eterm_color)
|
||||
{
|
||||
switch (eterm_color) {
|
||||
case 0:
|
||||
return TAG_HIGHLIGHT_NORMAL;
|
||||
case 7:
|
||||
return TAG_HIGHLIGHT_MAGENTA;
|
||||
case 1:
|
||||
return TAG_HIGHLIGHT_WHITE;
|
||||
case 2:
|
||||
return TAG_HIGHLIGHT_BLACK;
|
||||
case 3:
|
||||
return TAG_HIGHLIGHT_RED;
|
||||
case 4:
|
||||
return TAG_HIGHLIGHT_GREEN;
|
||||
case 5:
|
||||
return TAG_HIGHLIGHT_YELLOW;
|
||||
case 6:
|
||||
return TAG_HIGHLIGHT_BLUE;
|
||||
case 8:
|
||||
return TAG_HIGHLIGHT_CYAN;
|
||||
default:
|
||||
return TAG_HIGHLIGHT_NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
set_tag_highlight(int row, int col, tag_highlight_t highlight)
|
||||
{
|
||||
unsigned int rend_mask = 0;
|
||||
unsigned int back;
|
||||
unsigned int fore;
|
||||
|
||||
/* rend_t ** rp = &(screen.rend[row + TermWin.saveLines - TermWin.view_start][col]); */
|
||||
|
||||
if (highlight.attributes & TAG_HIGHLIGHT_RVID)
|
||||
rend_mask |= RS_RVid;
|
||||
if (highlight.attributes & TAG_HIGHLIGHT_ULINE)
|
||||
rend_mask |= RS_Uline;
|
||||
if (highlight.attributes & TAG_HIGHLIGHT_BOLD)
|
||||
rend_mask |= RS_Bold;
|
||||
|
||||
if (highlight.fg_color == TAG_HIGHLIGHT_NORMAL)
|
||||
fore = SET_FGCOLOR(0, fgColor);
|
||||
else
|
||||
fore = SET_FGCOLOR(0, tag_eterm_color(highlight.fg_color));
|
||||
|
||||
if (highlight.bg_color == TAG_HIGHLIGHT_NORMAL)
|
||||
back = SET_BGCOLOR(0, bgColor);
|
||||
else
|
||||
back = SET_BGCOLOR(0, tag_eterm_color(highlight.bg_color));
|
||||
|
||||
screen.rend[row + TermWin.saveLines - TermWin.view_start][col] =
|
||||
rend_mask | fore | back;
|
||||
}
|
||||
|
||||
void
|
||||
get_tag_highlight(int row, int col, tag_highlight_t * highlight)
|
||||
{
|
||||
unsigned int rend;
|
||||
|
||||
rend = screen.rend[row + TermWin.saveLines - TermWin.view_start][col];
|
||||
|
||||
highlight->attributes = 0;
|
||||
if (rend & RS_RVid)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_RVID;
|
||||
if (rend & RS_Uline)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_ULINE;
|
||||
if (rend & RS_Bold)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_BOLD;
|
||||
if (rend & RS_Blink)
|
||||
highlight->attributes |= TAG_HIGHLIGHT_BLINK;
|
||||
|
||||
highlight->fg_color = eterm_tag_color(GET_FGCOLOR(rend));
|
||||
highlight->bg_color = eterm_tag_color(GET_BGCOLOR(rend));
|
||||
}
|
||||
|
||||
/* Set the UID appropriately */
|
||||
int
|
||||
set_tag_uid(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Set stdout for loop actions */
|
||||
int
|
||||
set_tag_stdout(void)
|
||||
{
|
||||
if (close(1) < 0) {
|
||||
perror("close");
|
||||
return 0;
|
||||
}
|
||||
if (dup(cmd_fd) < 0) {
|
||||
perror("dup");
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Set the PWD to the pwd of the process eterm is running */
|
||||
int
|
||||
set_tag_pwd(void)
|
||||
{
|
||||
char dir[1024];
|
||||
|
||||
sprintf(dir, "/proc/%d/cwd", cmd_pid);
|
||||
if (chdir(dir) < 0)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /* USE_ACTIVE_TAGS */
|
|
@ -1,48 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: activeeterm.h
|
||||
*
|
||||
* Copyright 1997 Nat Friedman, Massachusetts Institute of Technology
|
||||
* <ndf@mit.edu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _ACTIVEETERM_H
|
||||
# define ACTIVEETERM_H
|
||||
|
||||
# include "screen.h"
|
||||
# include "command.h"
|
||||
# include "main.h" /* for TermWin */
|
||||
/* #include "rxvtgrx.h" */
|
||||
|
||||
/* #define MAX_RXVT_ROWS 1024 */
|
||||
|
||||
int tag_click(int x, int y, unsigned int button, unsigned int keystate);
|
||||
void tag_pointer_new_position(int x, int y);
|
||||
void tag_init(void);
|
||||
|
||||
extern int cmd_fd;
|
||||
extern screen_t screen;
|
||||
|
||||
extern text_t **drawn_text;
|
||||
extern rend_t **drawn_rend;
|
||||
|
||||
# define row_width() (TermWin.ncol)
|
||||
# define tag_min_row() (0)
|
||||
# define tag_max_row() (TermWin.nrow - 1)
|
||||
|
||||
#endif /* ACTIVEETERM_H */
|
524
src/activetags.c
524
src/activetags.c
|
@ -1,524 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: activetags.c
|
||||
*
|
||||
* Copyright 1997 Nat Friedman, Massachusetts Institute of Technology
|
||||
* <ndf@mit.edu>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
This file contains all of the basic active tags functionality. These
|
||||
are the generalized routines which can be plugged into just about anything.
|
||||
If I've designed everything properly, which I believe I have, you should
|
||||
not have to change anything in this file in order to plug active tags into
|
||||
an application.
|
||||
|
||||
See activeeterm.c for the routines which interface these functions with Eterm
|
||||
*/
|
||||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "feature.h"
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "activetags.h"
|
||||
#include "activeeterm.h"
|
||||
|
||||
/* ============================ Global Variables =========================== */
|
||||
|
||||
/* This is for run-time enabling and disabling of tags. It is 1 if tags are
|
||||
enabled at 0 otherwise. */
|
||||
int active_tags_enabled = 1;
|
||||
|
||||
/* This is the global array of tag configurations. Each of the tags in the
|
||||
configuration file corresponds to a tag in this global array. These are
|
||||
allocated statically just to reduce the complexity of the code. Increase
|
||||
MAX_TAGS in activetags.h if you run out. */
|
||||
struct active_tag tag[MAX_TAGS];
|
||||
int num_tags = 0;
|
||||
|
||||
/* The tag environment (e.g. "X", "console", ... */
|
||||
char *tag_env;
|
||||
|
||||
/* The data regarding the last tag highlighted on the screen. NB: this model
|
||||
limits the number of highlighted tags on the screen to one. */
|
||||
int last_h_tag_index = -1, last_h_tag_begin_row = -1, last_h_tag_end_row = -1, last_h_tag_begin_col = -1, last_h_tag_end_col = -1;
|
||||
tag_highlight_t old_highlighting[MAX_SEARCH_LINES][MAX_SEARCH_COLS];
|
||||
|
||||
char *tag_config_file = NULL;
|
||||
|
||||
static char *thingy = "ActiveTags 1.0b4 -- Copyright 1997,1998 Nat Friedman <ndf@mit.edu> -- DINGUS UBER ALLES";
|
||||
|
||||
/* ============================== Tag Routines ============================= */
|
||||
|
||||
/* This is the tag intialization routine. It needs to be called upon
|
||||
startup. */
|
||||
void
|
||||
initialize_tags(void)
|
||||
{
|
||||
/* Parse the config file */
|
||||
parse_tag_config(tag_config_file);
|
||||
}
|
||||
|
||||
void
|
||||
disable_tags(void)
|
||||
{
|
||||
fprintf(stderr, "Active tags are disabled.\n");
|
||||
active_tags_enabled = 0;
|
||||
}
|
||||
|
||||
/* check_tag_mode returns true if the mode parameter is one of the modes
|
||||
for which the tag indexed by tag_index is active. Otherwise, it returns
|
||||
false. */
|
||||
int
|
||||
check_tag_mode(int tag_index, char *mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* If no modes are listed for a particular tag, that tag is always active. */
|
||||
if (tag[tag_index].num_modes == 0)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < tag[tag_index].num_modes; i++)
|
||||
if (!strcmp(mode, tag[tag_index].mode[i]))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
check_tag_env(int tag_index)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!tag[tag_index].num_envs)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < tag[tag_index].num_envs; i++)
|
||||
if (!strcasecmp(tag_env, tag[tag_index].env[i]))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Check the position specified by (row,col) for a tag. If there is
|
||||
a tag there, set tag_begin and tag_end to the proper offsets into
|
||||
screen.text and screen.rend, and set tag_index to the index of the
|
||||
tag that was identified. If no tag is found, return 0. Otherwise,
|
||||
return 1. If binding_mask is set, then only search tags whose
|
||||
binding mask matches the binding_mask passed to the function.
|
||||
Tag searching begins at the specified index, tag_begin_index. */
|
||||
int
|
||||
find_tag(int row, int col, int *tag_begin_row, int *tag_begin_col,
|
||||
int *tag_end_row, int *tag_end_col, int *tag_index,
|
||||
unsigned int binding_mask, int tag_begin_index)
|
||||
{
|
||||
char *curr_row;
|
||||
static char mode[1024];
|
||||
static int mode_check_count = 0;
|
||||
char compare_region[MAX_SEARCH_CHARS];
|
||||
int compare_offset, compare_region_pointer_position;
|
||||
int done;
|
||||
unsigned int region_size;
|
||||
unsigned int last_region_size = 0;
|
||||
|
||||
int start_row, end_row, i, dest_offset;
|
||||
|
||||
char *start_match_p, *end_match_p;
|
||||
|
||||
#ifndef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
regmatch_t regmatch[5];
|
||||
|
||||
#endif
|
||||
|
||||
D_TAGS(("==> find_tag(row=%d, col=%d, ..., binding=%d, begin=%d)\n", row, col, binding_mask, tag_begin_index));
|
||||
if (!mode_check_count)
|
||||
get_tag_mode(mode);
|
||||
|
||||
mode_check_count++;
|
||||
if (mode_check_count == MAX_MODE_CHECK_COUNT)
|
||||
mode_check_count = 0;
|
||||
for (*tag_index = tag_begin_index; *tag_index < num_tags; (*tag_index)++) {
|
||||
D_TAGS((" ==> tag: %d (sl=%d)\n", *tag_index, tag[*tag_index].search_lines));
|
||||
if (((binding_mask == 0) && (!tag[*tag_index].latent)) ||
|
||||
(binding_mask && (binding_mask == tag[*tag_index].binding_mask)))
|
||||
if (check_tag_mode(*tag_index, mode) && (check_tag_env(*tag_index))) {
|
||||
start_row = row - tag[*tag_index].search_lines / 2;
|
||||
end_row = row + tag[*tag_index].search_lines / 2;
|
||||
|
||||
if (start_row < tag_min_row())
|
||||
start_row = tag_min_row();
|
||||
|
||||
if (end_row > tag_max_row())
|
||||
end_row = tag_max_row();
|
||||
|
||||
compare_region_pointer_position = ((row - start_row) * row_width()) +
|
||||
col;
|
||||
|
||||
region_size = (row_width()) * (end_row - start_row + 1);
|
||||
|
||||
if (region_size > MAX_SEARCH_CHARS) {
|
||||
fprintf(stderr, "search region too large: reduce number of "
|
||||
"search lines.\n");
|
||||
fprintf(stderr, "row_width: %d end_row: %d start_row: %d\n",
|
||||
row_width(), end_row, start_row);
|
||||
break;
|
||||
}
|
||||
if (region_size != last_region_size) {
|
||||
D_TAGS((" ==> region_size == %d\tlast_region_size == %d\n", region_size, last_region_size));
|
||||
i = start_row;
|
||||
dest_offset = 0;
|
||||
while (i <= end_row) {
|
||||
tag_get_row(i, &curr_row);
|
||||
D_TAGS(("Memcpying row into place...\n"));
|
||||
memcpy(compare_region + dest_offset, curr_row, row_width());
|
||||
D_TAGS(("Done\n"));
|
||||
dest_offset += row_width();
|
||||
i++;
|
||||
}
|
||||
compare_region[dest_offset + 1] = '\0';
|
||||
}
|
||||
last_region_size = region_size;
|
||||
|
||||
|
||||
done = 0;
|
||||
compare_offset = 0;
|
||||
|
||||
while (!done) {
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
if (regexec(tag[*tag_index].rx, compare_region + compare_offset))
|
||||
#else
|
||||
if (!regexec(&tag[*tag_index].rx, compare_region + compare_offset,
|
||||
4, regmatch, REG_NOTBOL | REG_NOTEOL))
|
||||
#endif
|
||||
|
||||
{
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
start_match_p = tag[*tag_index].rx->startp[0];
|
||||
end_match_p = tag[*tag_index].rx->endp[0];
|
||||
#else
|
||||
start_match_p = compare_region + compare_offset +
|
||||
regmatch[0].rm_so;
|
||||
end_match_p = compare_region + compare_offset +
|
||||
regmatch[0].rm_eo;
|
||||
#endif
|
||||
|
||||
if ((start_match_p <=
|
||||
(compare_region + compare_region_pointer_position)) &&
|
||||
(end_match_p >
|
||||
(compare_region + compare_region_pointer_position))) {
|
||||
*tag_begin_row = ((start_match_p -
|
||||
compare_region) / row_width()) +
|
||||
start_row;
|
||||
*tag_begin_col = (start_match_p -
|
||||
compare_region) -
|
||||
((start_match_p - compare_region) /
|
||||
row_width()) * row_width();
|
||||
|
||||
*tag_end_row = ((end_match_p -
|
||||
compare_region) / row_width()) +
|
||||
start_row;
|
||||
*tag_end_col = (end_match_p -
|
||||
compare_region) -
|
||||
((end_match_p - compare_region) /
|
||||
row_width()) * row_width();
|
||||
D_TAGS(("Found tag: begin_row: %d begin_col: %d\nend_row : %d end_col : %d\n", *tag_begin_row, *tag_begin_col,
|
||||
*tag_end_row, *tag_end_col));
|
||||
return 1;
|
||||
|
||||
} else
|
||||
compare_offset = (end_match_p -
|
||||
compare_region);
|
||||
} else
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* tag_scroll -- This is to notify the tag functionality that the screen
|
||||
has scrolled nlines lines (positive means scrolled up, negative means
|
||||
scrolled down) from start_row to end_row (inclusive) */
|
||||
int
|
||||
tag_screen_scroll(int nlines, int start_row, int end_row)
|
||||
{
|
||||
|
||||
D_TAGS(("tag_scroll(%d, %d, %d)\n", nlines, start_row, end_row));
|
||||
D_TAGS(("\tlast_brow: %d last_erow: %d\n", last_h_tag_begin_row, last_h_tag_end_row));
|
||||
if (!nlines)
|
||||
return 0;
|
||||
|
||||
if (last_h_tag_index == -1)
|
||||
return 0;
|
||||
|
||||
/* If the last highlighted tag is not part of the region that scrolled,
|
||||
we don't need to do anything. */
|
||||
if (last_h_tag_begin_row > end_row)
|
||||
return 0;
|
||||
|
||||
if (last_h_tag_end_row < start_row)
|
||||
return 0;
|
||||
|
||||
/* Otherwise, update the position of the tag last highlighted */
|
||||
last_h_tag_begin_row += nlines;
|
||||
last_h_tag_end_row += nlines;
|
||||
|
||||
/* Erase the tag */
|
||||
(void) show_tag(last_h_tag_begin_row - nlines, last_h_tag_begin_col + 1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* This function restores the rendering information for the currently
|
||||
highlighted tag to its status before the tag was highlighted. */
|
||||
void
|
||||
erase_tag_highlighting(void)
|
||||
{
|
||||
int row, col;
|
||||
int final_highlight_col;
|
||||
int start_highlight_col;
|
||||
|
||||
if (last_h_tag_index != -1) {
|
||||
for (row = last_h_tag_begin_row; row <= last_h_tag_end_row; row++) {
|
||||
final_highlight_col = (row == last_h_tag_end_row) ?
|
||||
last_h_tag_end_col : row_width();
|
||||
start_highlight_col = (row == last_h_tag_begin_row) ?
|
||||
last_h_tag_begin_col : 0;
|
||||
for (col = start_highlight_col; col < final_highlight_col; col++) {
|
||||
set_tag_highlight(row, col,
|
||||
old_highlighting[row - last_h_tag_begin_row][col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* We don't need to keep erasing now that nothing is highlighted */
|
||||
last_h_tag_index = -1;
|
||||
}
|
||||
|
||||
/* Highlight a tag if one exists at the location specified in pixels.
|
||||
If no tag exists there and a tag is currently highlighted, we need
|
||||
to erase that tag's highlighting. */
|
||||
int
|
||||
show_tag(int row, int col)
|
||||
{
|
||||
unsigned int tag_begin_col, tag_end_col, tag_begin_row, tag_end_row, tag_index;
|
||||
int final_highlight_col;
|
||||
int start_highlight_col;
|
||||
tag_highlight_t highlight;
|
||||
|
||||
D_TAGS(("==> show_tag(%d,%d)\n", row, col));
|
||||
|
||||
/* If there's no tag there and a tag is currently highlighted, we need
|
||||
to erase its highlighting. */
|
||||
if (!find_tag(row, col, &tag_begin_row, &tag_begin_col, &tag_end_row,
|
||||
&tag_end_col, &tag_index, 0, 0)) {
|
||||
D_TAGS((" ==> no tag, erasing highlighting and leaving.\n"));
|
||||
/* Erase the old highlighting */
|
||||
tag_hide();
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* If we've come this far, then we are on a tag, and it needs to be
|
||||
highlighted. */
|
||||
|
||||
/* If we're on the same tag as last time, there's no need to do
|
||||
anything. */
|
||||
if ((tag_index == last_h_tag_index) &&
|
||||
(tag_begin_row == last_h_tag_begin_row) &&
|
||||
(tag_end_row == last_h_tag_end_row) &&
|
||||
(tag_begin_col == last_h_tag_begin_col) &&
|
||||
(tag_end_col == last_h_tag_end_col))
|
||||
return 1;
|
||||
|
||||
/* Erase the old highlighting */
|
||||
tag_hide();
|
||||
|
||||
/* Add the new highlighting */
|
||||
for (row = tag_begin_row; row <= tag_end_row; row++) {
|
||||
final_highlight_col = (row == tag_end_row) ? tag_end_col :
|
||||
row_width();
|
||||
start_highlight_col = (row == tag_begin_row) ? tag_begin_col : 0;
|
||||
for (col = start_highlight_col; col < final_highlight_col; col++) {
|
||||
get_tag_highlight(row, col, &highlight);
|
||||
memcpy((void *) &old_highlighting[row - tag_begin_row][col],
|
||||
(void *) &highlight, sizeof(tag_highlight_t));
|
||||
|
||||
set_tag_highlight(row, col, tag[tag_index].highlight);
|
||||
}
|
||||
}
|
||||
|
||||
/* Store the old values to erase later */
|
||||
last_h_tag_index = tag_index;
|
||||
last_h_tag_begin_row = tag_begin_row;
|
||||
last_h_tag_end_row = tag_end_row;
|
||||
last_h_tag_begin_col = tag_begin_col;
|
||||
last_h_tag_end_col = tag_end_col;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Check to see if there's a tag at the location specified by (x,y) (in
|
||||
pixels). If so, execute the corresponding action. Return 0 if there's
|
||||
no tag there, otherwise return 1. */
|
||||
int
|
||||
tag_activate(int row, int col, unsigned int binding_mask)
|
||||
{
|
||||
int tag_begin_row, tag_end_row, tag_index, tag_begin_col, tag_end_col;
|
||||
|
||||
D_TAGS(("tag_activate(row==%d, col==%d, ...)\n", row, col));
|
||||
|
||||
/* If there is no tag to be activated here, return. */
|
||||
if (!find_tag(row, col, &tag_begin_row, &tag_begin_col, &tag_end_row,
|
||||
&tag_end_col, &tag_index, binding_mask, 0))
|
||||
return 0;
|
||||
|
||||
/* Otherwise, activate the tag. */
|
||||
execute_tag(tag_begin_row, tag_begin_col, tag_end_row, tag_end_col,
|
||||
tag_index);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Execute the tag specified by tag_index and contained between the
|
||||
indices specified by tag_begin and tag_end. */
|
||||
|
||||
void
|
||||
execute_tag(int tag_begin_row, int tag_begin_col,
|
||||
int tag_end_row, int tag_end_col, int tag_index)
|
||||
{
|
||||
char tagstr[MAX_SEARCH_CHARS];
|
||||
char cmd[MAX_TAG_COMMAND_LENGTH];
|
||||
char *p, *q;
|
||||
pid_t pid;
|
||||
int dest_offset;
|
||||
int i, start_column, end_column;
|
||||
char *curr_row;
|
||||
|
||||
printf("==> Activating tag %d:\n ==> Action: [%s]\n Env: [%s] ==> Output: %s\n",
|
||||
tag_index, tag[tag_index].action, tag_env,
|
||||
(tag[tag_index].output_type == TAG_OUTPUT_NULL) ? "NULL" :
|
||||
((tag[tag_index].output_type == TAG_OUTPUT_POPUP) ? "POPUP" :
|
||||
((tag[tag_index].output_type == TAG_OUTPUT_LOOP) ? "LOOP" :
|
||||
((tag[tag_index].output_type == TAG_OUTPUT_REPL) ? "REPL" :
|
||||
"UNKNOWN"))));
|
||||
|
||||
/* If the tag's action is TAG_ACTION_RELOAD, then we simply
|
||||
relaod the tag config file. */
|
||||
if (!strcmp(tag[tag_index].action, TAG_ACTION_RELOAD)) {
|
||||
for (i = 0; i < num_tags; i++)
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
regfree(tag[i].rx);
|
||||
#else
|
||||
regfree(&tag[i].rx);
|
||||
#endif
|
||||
num_tags = 0;
|
||||
parse_tag_config(tag_config_file);
|
||||
return;
|
||||
}
|
||||
if (!strcmp(tag[tag_index].action, TAG_ACTION_DISABLE)) {
|
||||
disable_tags();
|
||||
return;
|
||||
}
|
||||
/* For debugging */
|
||||
if (!strcmp(tag[tag_index].action, TAG_ACTION_MODE)) {
|
||||
char mode[1024];
|
||||
|
||||
get_tag_mode(mode);
|
||||
fprintf(stderr, "Mode: %s\n", mode);
|
||||
return;
|
||||
}
|
||||
/* Fork off a separate process to execute the new tag. */
|
||||
pid = fork();
|
||||
|
||||
if (pid == 0) { /* child */
|
||||
|
||||
D_TAGS(("Child\n"));
|
||||
|
||||
i = tag_begin_row;
|
||||
dest_offset = 0;
|
||||
|
||||
while (i <= tag_end_row) {
|
||||
start_column = i == tag_begin_row ? tag_begin_col : 0;
|
||||
end_column = i == tag_end_row ? tag_end_col : row_width();
|
||||
D_TAGS(("row: %d Start col: %d end_col: %d\n", i, start_column, end_column));
|
||||
tag_get_row(i, &curr_row);
|
||||
memcpy(tagstr + dest_offset,
|
||||
curr_row + start_column,
|
||||
end_column - start_column);
|
||||
|
||||
dest_offset += end_column - start_column;
|
||||
i++;
|
||||
}
|
||||
|
||||
tagstr[dest_offset] = '\0';
|
||||
D_TAGS(("\t==> tag string: {%s}\n", tagstr));
|
||||
/* Initialize the command string */
|
||||
*cmd = '\0';
|
||||
|
||||
/* Build the command string from the action string by replacing
|
||||
all occurences of ${} in the action string with the tag string. */
|
||||
q = p = tag[tag_index].action;
|
||||
while ((p = strstr(q, "${}")) != NULL) {
|
||||
*p = '\0';
|
||||
strcat(cmd, q);
|
||||
|
||||
strcat(cmd, tagstr);
|
||||
|
||||
/* Step over the remaining characters of the ${} */
|
||||
q = p + 3;
|
||||
}
|
||||
|
||||
strcat(cmd + strlen(cmd), q);
|
||||
|
||||
if (!set_tag_pwd())
|
||||
fprintf(stderr, "Active Tags: couldn't set the pwd!\n");
|
||||
|
||||
|
||||
/* Set the UID appropriately so we don't act as the wrong user */
|
||||
if (!set_tag_uid()) {
|
||||
fprintf(stderr, "Active Tags: tag action: Couldn't set the uid!\n");
|
||||
exit(1);
|
||||
}
|
||||
/* For a loop action, we connect stdout on the tag process to stdin on
|
||||
the terminal's executing process */
|
||||
if (tag[tag_index].output_type == TAG_OUTPUT_LOOP)
|
||||
/* I wonder if screwing around with Eterm's stdin is a good idea >:)
|
||||
* -vendu
|
||||
*/
|
||||
if (!set_tag_stdout()) {
|
||||
fprintf(stderr, "Active Tags: tag action: Couldn't set stdout for "
|
||||
"a loop action!\n");
|
||||
exit(1);
|
||||
}
|
||||
system(cmd);
|
||||
#if 0
|
||||
exit(1); /* This might be a bad idea :) Makes Eterm exit, at
|
||||
* least if run from another Eterm. -vendu */
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* USE_ACTIVE_TAGS */
|
182
src/activetags.h
182
src/activetags.h
|
@ -1,182 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: activetags.h
|
||||
*
|
||||
* Copyright 1996,1997 Nat Friedman, Massachusetts Institute of Technology
|
||||
* <ndf@mit.edu>
|
||||
*
|
||||
* You can do what you like with this source code as long as
|
||||
* you don't try to make money out of it and you include an
|
||||
* unaltered copy of this message (including the copyright).
|
||||
*
|
||||
* The author accepts no responsibility for anything whatsoever, nor does he
|
||||
* guarantee anything, nor are any guarantees, promises, or covenants implicit
|
||||
* with the use of this software.
|
||||
*
|
||||
* For information regarding this particular module, please see
|
||||
* README.ActiveTags.
|
||||
*
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _ACTIVE_TAGS_H
|
||||
#define _ACTIVE_TAGS_H
|
||||
|
||||
#ifndef ACTIVE_TAGS
|
||||
#define ACTIVE_TAGS
|
||||
#endif
|
||||
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
#include "regexp/regexp.h"
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#define TAG_ACTION_RELOAD "*reload*"
|
||||
#define TAG_ACTION_DISABLE "*disable*"
|
||||
|
||||
/* Debugging actions */
|
||||
#define TAG_ACTION_MODE "*mode*"
|
||||
|
||||
|
||||
#define TAG_DRAG_THRESHHOLD 500
|
||||
|
||||
/* Maximums */
|
||||
#define MAX_TAGS 128
|
||||
#define MAX_SEARCH_CHARS 32767
|
||||
#define MAX_SEARCH_LINES 25
|
||||
#define MAX_SEARCH_COLS 300
|
||||
#define MAX_SCREEN_ROWS 128
|
||||
#define MAX_TAG_MODES 32
|
||||
#define MAX_TAG_MODE_LEN 32
|
||||
#define MAX_TAG_COMMAND_LENGTH 2048
|
||||
#define MAX_REGEXP_LEN 1024
|
||||
#define MAX_ACTION_LEN 1024
|
||||
#define MAX_CLUE_LENGTH 1024
|
||||
#define MAX_MODE_CHECK_COUNT 25
|
||||
#define MAX_TAG_ENVS 8
|
||||
#define MAX_TAG_ENV_LEN 16
|
||||
|
||||
/* Output Types */
|
||||
#define TAG_OUTPUT_POPUP 1
|
||||
#define TAG_OUTPUT_LOOP 2
|
||||
#define TAG_OUTPUT_NULL 3
|
||||
#define TAG_OUTPUT_REPL 4
|
||||
|
||||
/* Binding fields */
|
||||
#define TAG_BINDING_BUTTON1 (1<<0)
|
||||
#define TAG_BINDING_BUTTON2 (1<<1)
|
||||
#define TAG_BINDING_BUTTON3 (1<<2)
|
||||
#define TAG_BINDING_SHIFT (1<<3)
|
||||
#define TAG_BINDING_CONTROL (1<<4)
|
||||
#define TAG_BINDING_META (1<<5)
|
||||
|
||||
/* Highlight fields */
|
||||
#define TAG_HIGHLIGHT_RVID (1L<<0)
|
||||
#define TAG_HIGHLIGHT_BOLD (1L<<1)
|
||||
#define TAG_HIGHLIGHT_ULINE (1L<<2)
|
||||
#define TAG_HIGHLIGHT_BLINK (1L<<3)
|
||||
|
||||
#define TAG_HIGHLIGHT_BLACK (1L<<0)
|
||||
#define TAG_HIGHLIGHT_WHITE (1L<<1)
|
||||
#define TAG_HIGHLIGHT_RED (1L<<2)
|
||||
#define TAG_HIGHLIGHT_GREEN (1L<<3)
|
||||
#define TAG_HIGHLIGHT_YELLOW (1L<<4)
|
||||
#define TAG_HIGHLIGHT_BLUE (1L<<5)
|
||||
#define TAG_HIGHLIGHT_MAGENTA (1L<<6)
|
||||
#define TAG_HIGHLIGHT_CYAN (1L<<7)
|
||||
#define TAG_HIGHLIGHT_NORMAL -1
|
||||
|
||||
typedef struct tag_highlight {
|
||||
/* Underline, Reverse Video, Bold */
|
||||
int attributes;
|
||||
|
||||
/* Highlighting colors */
|
||||
int fg_color;
|
||||
int bg_color;
|
||||
|
||||
} tag_highlight_t;
|
||||
|
||||
struct active_tag {
|
||||
|
||||
/* rx is the compiled regular expression for the tag */
|
||||
#ifdef ACTIVE_TAGS_SPENCER_REGEXP
|
||||
regexp * rx;
|
||||
#else
|
||||
regex_t rx;
|
||||
#endif
|
||||
|
||||
/* The action is a program to be executed. The string ${} in the action
|
||||
will be replaced with the tag. */
|
||||
char action[MAX_ACTION_LEN];
|
||||
|
||||
tag_highlight_t highlight;
|
||||
|
||||
/* The button/key combo that activates this tag. */
|
||||
unsigned int binding_mask;
|
||||
|
||||
/* Number of lines to search for this tag */
|
||||
int search_lines;
|
||||
|
||||
char mode[MAX_TAG_MODES][MAX_TAG_MODE_LEN];
|
||||
int num_modes;
|
||||
|
||||
char env[MAX_TAG_ENVS][MAX_TAG_ENV_LEN];
|
||||
int num_envs;
|
||||
|
||||
/* See TAG_OUTPUT_* */
|
||||
int output_type;
|
||||
|
||||
/* Whether or not the tag is latent. */
|
||||
int latent;
|
||||
|
||||
char clue[MAX_CLUE_LENGTH];
|
||||
};
|
||||
|
||||
|
||||
/* Template prototypes */
|
||||
void get_tag_mode(char * mode);
|
||||
/* int row_width(void); */
|
||||
void tag_get_row(int row_num, char ** row);
|
||||
/* int tag_min_row(void); */
|
||||
/* int tag_max_row(void); */
|
||||
void set_tag_highlight(int row, int col, tag_highlight_t highlight);
|
||||
void get_tag_highlight(int row, int col, tag_highlight_t * highlight);
|
||||
int set_tag_stdout(void);
|
||||
int set_tag_pwd(void);
|
||||
int set_tag_uid(void);
|
||||
|
||||
/* Prototypes */
|
||||
void parse_tag_config(char * tag_config_file);
|
||||
int find_tag(int row, int col, int * tag_begin_row, int * tag_begin_col,
|
||||
int * tag_end_row, int * tag_end_col,
|
||||
int * tag_index, unsigned int binding_mask, int tag_begin_index);
|
||||
int show_tag(int x, int y);
|
||||
int tag_activate(int row, int col, unsigned int binding_mask);
|
||||
void execute_tag(int tag_begin_row, int tag_begin_col, int tag_end_row, int tag_end_col, int tag_index);
|
||||
void initialize_tags(void);
|
||||
int tag_screen_scroll(int nlines, int start_row, int end_row);
|
||||
void reap_tag_process(pid_t pid);
|
||||
void erase_tag_highlighting(void);
|
||||
void disable_tags(void);
|
||||
void tag_hide(void);
|
||||
|
||||
/* Externs */
|
||||
extern int active_tags_enabled;
|
||||
extern struct active_tag tag[MAX_TAGS];
|
||||
extern int num_tags;
|
||||
extern int last_h_tag_begin_row;
|
||||
extern int last_h_tag_begin_col;
|
||||
extern int last_h_tag_index;
|
||||
extern char * tag_env;
|
||||
|
||||
#endif /* _ACTIVE_TAGS_H */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
5234
src/command.c
5234
src/command.c
File diff suppressed because it is too large
Load Diff
318
src/command.h
318
src/command.h
|
@ -19,15 +19,39 @@
|
|||
*----------------------------------------------------------------------*/
|
||||
#ifndef _COMMAND_H_
|
||||
# define _COMMAND_H_
|
||||
# include <signal.h>
|
||||
# include <limits.h>
|
||||
# include <X11/X.h>
|
||||
# include <X11/Xfuncproto.h>
|
||||
# include <X11/Xproto.h>
|
||||
# include <stdio.h>
|
||||
# include <limits.h>
|
||||
# include <X11/keysym.h>
|
||||
|
||||
# ifdef USE_ACTIVE_TAGS
|
||||
# include "activetags.h"
|
||||
# ifdef NO_XLOCALE
|
||||
# include <locale.h>
|
||||
# else
|
||||
# ifndef X_LOCALE
|
||||
# define X_LOCALE
|
||||
# endif
|
||||
# include <X11/Xlocale.h>
|
||||
# endif
|
||||
|
||||
# include "options.h"
|
||||
# include "system.h" /* For RETSIGTYPE */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
#if !defined(SIGSYS)
|
||||
# if defined(SIGUNUSED)
|
||||
# define SIGSYS SIGUNUSED
|
||||
# else
|
||||
# define SIGSYS ((int) 0)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef OFFIX_DND
|
||||
# define DndFile 2
|
||||
# define DndDir 5
|
||||
# define DndLink 7
|
||||
#endif
|
||||
|
||||
# define menuBar_esc 10
|
||||
# define scrollBar_esc 30
|
||||
|
@ -37,7 +61,6 @@
|
|||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||
#define MWM_HINTS_INPUT_MODE (1L << 2)
|
||||
#define MWM_HINTS_STATUS (1L << 3)
|
||||
|
||||
/* bit definitions for MwmHints.functions */
|
||||
#define MWM_FUNC_ALL (1L << 0)
|
||||
#define MWM_FUNC_RESIZE (1L << 1)
|
||||
|
@ -45,7 +68,6 @@
|
|||
#define MWM_FUNC_MINIMIZE (1L << 3)
|
||||
#define MWM_FUNC_MAXIMIZE (1L << 4)
|
||||
#define MWM_FUNC_CLOSE (1L << 5)
|
||||
|
||||
/* bit definitions for MwmHints.decorations */
|
||||
#define MWM_DECOR_ALL (1L << 0)
|
||||
#define MWM_DECOR_BORDER (1L << 1)
|
||||
|
@ -54,24 +76,13 @@
|
|||
#define MWM_DECOR_MENU (1L << 4)
|
||||
#define MWM_DECOR_MINIMIZE (1L << 5)
|
||||
#define MWM_DECOR_MAXIMIZE (1L << 6)
|
||||
|
||||
/* bit definitions for MwmHints.inputMode */
|
||||
#define MWM_INPUT_MODELESS 0
|
||||
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
|
||||
#define MWM_INPUT_SYSTEM_MODAL 2
|
||||
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
|
||||
|
||||
#define PROP_MWM_HINTS_ELEMENTS 5
|
||||
|
||||
/* Motif window hints */
|
||||
typedef struct _mwmhints {
|
||||
CARD32 flags;
|
||||
CARD32 functions;
|
||||
CARD32 decorations;
|
||||
INT32 input_mode;
|
||||
CARD32 status;
|
||||
} MWMHints;
|
||||
|
||||
/* DEC private modes */
|
||||
# define PrivMode_132 (1LU<<0)
|
||||
# define PrivMode_132OK (1LU<<1)
|
||||
|
@ -97,26 +108,281 @@ if (test) PrivateModes |= (bit); else PrivateModes &= ~(bit);} while (0)
|
|||
|
||||
#define PrivMode_Default (PrivMode_Autowrap|PrivMode_ShiftKeys|PrivMode_VisibleCursor)
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# ifdef TCSANOW /* POSIX */
|
||||
# define GET_TERMIOS(fd,tios) tcgetattr(fd, tios)
|
||||
# define SET_TERMIOS(fd,tios) do {cfsetospeed(tios, BAUDRATE); cfsetispeed(tios, BAUDRATE); tcsetattr(fd, TCSANOW, tios); } while (0)
|
||||
# else
|
||||
# ifdef TIOCSETA
|
||||
# define GET_TERMIOS(fd,tios) ioctl (fd, TIOCGETA, tios)
|
||||
# define SET_TERMIOS(fd,tios) do {tios->c_cflag |= BAUDRATE; ioctl(fd, TIOCSETA, tios); } while (0)
|
||||
# else
|
||||
# define GET_TERMIOS(fd,tios) ioctl (fd, TCGETS, tios)
|
||||
# define SET_TERMIOS(fd,tios) do {tios->c_cflag |= BAUDRATE; ioctl(fd, TCSETS, tios); } while (0)
|
||||
# endif
|
||||
# endif
|
||||
# define SET_TTYMODE(fd,tios) SET_TERMIOS(fd, tios)
|
||||
#else
|
||||
# define SET_TTYMODE(fd,tt) do {tt->sg.sg_ispeed = tt->sg.sg_ospeed = BAUDRATE; ioctl(fd, TIOCSETP, &(tt->sg)); ioctl(fd, TIOCSETC, &(tt->tc)); \
|
||||
ioctl(fd, TIOCSLTC, &(tt->lc)); ioctl(fd, TIOCSETD, &(tt->line)); ioctl(fd, TIOCLSET, &(tt->local)); \
|
||||
} while (0)
|
||||
#endif /* HAVE_TERMIOS_H */
|
||||
|
||||
#ifdef B38400
|
||||
# define BAUDRATE B38400
|
||||
#else
|
||||
# ifdef B19200
|
||||
# define BAUDRATE B19200
|
||||
# else
|
||||
# define BAUDRATE B9600
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Disable special character functions */
|
||||
#ifdef _POSIX_VDISABLE
|
||||
# define VDISABLE _POSIX_VDISABLE
|
||||
#else
|
||||
# define VDISABLE 255
|
||||
#endif
|
||||
|
||||
/* system default characters if defined and reasonable */
|
||||
#ifndef CINTR
|
||||
# define CINTR '\003' /* ^C */
|
||||
#endif
|
||||
#ifndef CQUIT
|
||||
# define CQUIT '\034' /* ^\ */
|
||||
#endif
|
||||
#ifndef CERASE
|
||||
# ifdef linux
|
||||
# define CERASE '\177' /* ^? */
|
||||
# else
|
||||
# define CERASE '\010' /* ^H */
|
||||
# endif
|
||||
#endif
|
||||
#ifndef CKILL
|
||||
# define CKILL '\025' /* ^U */
|
||||
#endif
|
||||
#ifndef CEOF
|
||||
# define CEOF '\004' /* ^D */
|
||||
#endif
|
||||
#ifndef CSTART
|
||||
# define CSTART '\021' /* ^Q */
|
||||
#endif
|
||||
#ifndef CSTOP
|
||||
# define CSTOP '\023' /* ^S */
|
||||
#endif
|
||||
#ifndef CSUSP
|
||||
# define CSUSP '\032' /* ^Z */
|
||||
#endif
|
||||
#ifndef CDSUSP
|
||||
# define CDSUSP '\031' /* ^Y */
|
||||
#endif
|
||||
#ifndef CRPRNT
|
||||
# define CRPRNT '\022' /* ^R */
|
||||
#endif
|
||||
#ifndef CFLUSH
|
||||
# define CFLUSH '\017' /* ^O */
|
||||
#endif
|
||||
#ifndef CWERASE
|
||||
# define CWERASE '\027' /* ^W */
|
||||
#endif
|
||||
#ifndef CLNEXT
|
||||
# define CLNEXT '\026' /* ^V */
|
||||
#endif
|
||||
#ifndef VDISCRD
|
||||
# ifdef VDISCARD
|
||||
# define VDISCRD VDISCARD
|
||||
# endif
|
||||
#endif
|
||||
#ifndef VWERSE
|
||||
# ifdef VWERASE
|
||||
# define VWERSE VWERASE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define KBUFSZ 12 /* size of keyboard mapping buffer */
|
||||
#define STRING_MAX 512 /* max string size for process_xterm_seq() */
|
||||
#define ESC_ARGS 32 /* max # of args for esc sequences */
|
||||
|
||||
/* a large REFRESH_PERIOD causes problems with `cat' */
|
||||
#ifndef REFRESH_PERIOD
|
||||
# define REFRESH_PERIOD 3
|
||||
#endif
|
||||
|
||||
#ifndef MULTICLICK_TIME
|
||||
# define MULTICLICK_TIME 500
|
||||
#endif
|
||||
#ifndef SCROLLBAR_INITIAL_DELAY
|
||||
# define SCROLLBAR_INITIAL_DELAY 40
|
||||
#endif
|
||||
#ifndef SCROLLBAR_CONTINUOUS_DELAY
|
||||
# define SCROLLBAR_CONTINUOUS_DELAY 2
|
||||
#endif
|
||||
|
||||
/* time factor to slow down a `jumpy' mouse */
|
||||
#define MOUSE_THRESHOLD 50
|
||||
#define CONSOLE "/dev/console" /* console device */
|
||||
|
||||
/* key-strings: if only these keys were standardized <sigh> */
|
||||
#ifdef LINUX_KEYS
|
||||
# define KS_HOME "\033[1~" /* Home == Find */
|
||||
# define KS_END "\033[4~" /* End == Select */
|
||||
#else
|
||||
# define KS_HOME "\033[7~" /* Home */
|
||||
# define KS_END "\033[8~" /* End */
|
||||
#endif
|
||||
#ifdef NO_DELETE_KEY
|
||||
# undef KS_DELETE /* use X server definition */
|
||||
#else
|
||||
# ifndef KS_DELETE
|
||||
# define KS_DELETE "\033[3~" /* Delete = Execute */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define VT100_ANS "\033[?1;2c" /* vt100 answerback */
|
||||
#ifndef ESCZ_ANSWER
|
||||
# define ESCZ_ANSWER VT100_ANS /* obsolete ANSI ESC[c */
|
||||
#endif
|
||||
|
||||
#if defined(linux) && defined(N_TTY_BUF_SIZE)
|
||||
# define CMD_BUF_SIZE N_TTY_BUF_SIZE
|
||||
#else
|
||||
# ifndef CMD_BUF_SIZE
|
||||
# define CMD_BUF_SIZE 4096
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(EACCESS) && defined(EAGAIN)
|
||||
# define EACCESS EAGAIN
|
||||
#endif
|
||||
|
||||
#define PTYCHAR1 "pqrstuvwxyz"
|
||||
#define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||
|
||||
#ifdef BACKGROUND_CYCLING_SUPPORT
|
||||
# if RETSIGTYPE != void
|
||||
# define CPC_RETURN(x) return ((RETSIGTYPE) x)
|
||||
# else
|
||||
# define CPC_RETURN(x) return
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define CHARS_READ() (cmdbuf_ptr < cmdbuf_endp)
|
||||
#define CHARS_BUFFERED() (count != CMD_BUF_SIZE)
|
||||
#define RETURN_CHAR() do { refreshed = 0; return (*cmdbuf_ptr++); } while (0)
|
||||
|
||||
#ifdef REFRESH_DELAY
|
||||
# define REFRESH_DELAY_USEC (1000000/25)
|
||||
#endif
|
||||
|
||||
#if defined(linux)
|
||||
# ifdef PTY_BUF_SIZE /* From <linux/tty.h> */
|
||||
# define MAX_PTY_WRITE PTY_BUF_SIZE
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* NOTE: _POSIX_MAX_INPUT is defined _through_ <limits.h> at least for
|
||||
* the following systems: HP-UX 10.20, AIX (no idea about the version),
|
||||
* OSF1/alpha 4.0, Linux (probably any Linux system).
|
||||
*/
|
||||
#ifndef MAX_PTY_WRITE
|
||||
# ifdef _POSIX_VERSION
|
||||
# ifdef _POSIX_MAX_INPUT
|
||||
# define MAX_PTY_WRITE _POSIX_MAX_INPUT
|
||||
# else
|
||||
# define MAX_PTY_WRITE 255 /* POSIX minimum MAX_INPUT */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef MAX_PTY_WRITE
|
||||
# define MAX_PTY_WRITE 128 /* 1/2 POSIX minimum MAX_INPUT */
|
||||
#endif
|
||||
|
||||
/************ Structures ************/
|
||||
/* Motif window hints */
|
||||
typedef struct _mwmhints {
|
||||
CARD32 flags;
|
||||
CARD32 functions;
|
||||
CARD32 decorations;
|
||||
INT32 input_mode;
|
||||
CARD32 status;
|
||||
} MWMHints;
|
||||
# ifdef HAVE_TERMIOS_H
|
||||
typedef struct termios ttymode_t;
|
||||
# else
|
||||
typedef struct { /* sgtty interface */
|
||||
struct sgttyb sg;
|
||||
struct tchars tc;
|
||||
struct ltchars lc;
|
||||
int line;
|
||||
int local;
|
||||
} ttymode_t;
|
||||
# endif
|
||||
|
||||
/************ Variables ************/
|
||||
extern int my_ruid, my_rgid, my_euid, my_egid;
|
||||
extern char initial_dir[PATH_MAX+1];
|
||||
extern unsigned long PrivateModes;
|
||||
extern Atom wmDeleteWindow;
|
||||
extern int refresh_count, refresh_limit, refresh_type;
|
||||
#ifdef USE_POSIX_THREADS
|
||||
extern static void **retval;
|
||||
extern static int join_value;
|
||||
extern static pthread_t main_loop_thr;
|
||||
extern static pthread_attr_t main_loop_attr;
|
||||
# ifdef MUTEX_SYNCH
|
||||
extern pthread_mutex_t mutex;
|
||||
# endif
|
||||
#endif
|
||||
#ifdef USE_XIM
|
||||
extern XIC Input_Context; /* input context */
|
||||
#endif
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
# ifdef USE_ACTIVE_TAGS
|
||||
pid_t cmd_pid;
|
||||
int cmd_fd;
|
||||
# endif
|
||||
#ifdef HAVE_U_STACK_TRACE
|
||||
extern void U_STACK_TRACE(void);
|
||||
#endif
|
||||
extern char *ptsname();
|
||||
extern void privileges(int);
|
||||
extern char *sig_to_str(int);
|
||||
extern const char *event_type_to_name(int);
|
||||
extern const char *request_code_to_name(int);
|
||||
extern void dump_stack_trace(void);
|
||||
extern RETSIGTYPE Child_signal(int);
|
||||
extern RETSIGTYPE Exit_signal(int);
|
||||
extern void clean_exit(void);
|
||||
extern int get_pty(void);
|
||||
extern int get_tty(void);
|
||||
extern XFontSet create_fontset(const char *, const char *);
|
||||
#if defined(USE_XIM) || defined(MULTI_CHARSET)
|
||||
extern void xim_set_status_position(void);
|
||||
extern void xim_get_position(XPoint *pos);
|
||||
extern void xim_set_fontset(void);
|
||||
extern void init_locale(void);
|
||||
#else
|
||||
# define init_locale() ((void)0)
|
||||
#endif
|
||||
extern int run_command(char **);
|
||||
extern void init_command(char **);
|
||||
extern void tt_winsize(int);
|
||||
extern void tt_resize(void);
|
||||
extern unsigned int cmd_write(const unsigned char *, unsigned int);
|
||||
#ifdef BACKGROUND_CYCLING_SUPPORT
|
||||
extern RETSIGTYPE check_pixmap_change(int);
|
||||
#endif
|
||||
extern unsigned char cmd_getc(void);
|
||||
extern void tt_write(const unsigned char *, unsigned int);
|
||||
extern void tt_printf(const unsigned char *, ...);
|
||||
extern unsigned int cmd_write(const unsigned char *, unsigned int);
|
||||
extern void main_loop(void);
|
||||
extern FILE *popen_printer(void);
|
||||
extern int pclose_printer(FILE *);
|
||||
extern void color_aliases (int idx);
|
||||
extern int v_doPending(void);
|
||||
extern void v_writeBig(int, char *, int);
|
||||
#ifdef DISPLAY_IS_IP
|
||||
extern char *network_display(const char *);
|
||||
#endif
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _COMMAND_H_ */
|
||||
/*----------------------- end-of-file (C header) -----------------------*/
|
||||
|
|
103
src/debug.h
103
src/debug.h
|
@ -5,29 +5,43 @@
|
|||
#ifndef _DEBUG_H
|
||||
# define _DEBUG_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
extern unsigned int debug_level;
|
||||
|
||||
/* Assert macros stolen from my work on Ebar. If these macros break with your cpp, let me know -- mej@eterm.org */
|
||||
# define NOP ((void)0)
|
||||
|
||||
#if defined(__FILE__) && defined(__LINE__)
|
||||
# define ASSERT(x) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed at %s:%d: %s", __FILE__, __LINE__, #x);} \
|
||||
else {print_warning("ASSERT failed at %s:%d: %s", __FILE__, __LINE__, #x);}}} while (0);
|
||||
#else
|
||||
# define ASSERT(x) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed: %s", #x);} \
|
||||
else {print_warning("ASSERT failed: %s", #x);}}} while (0);
|
||||
# ifdef __FUNCTION__
|
||||
# define __DEBUG() fprintf(stderr, "[debug] %12s | %4d | %30s: ", __FILE__, __LINE__, __FUNCTION__)
|
||||
# else
|
||||
# define __DEBUG() fprintf(stderr, "[debug] %12s | %4d: ", __FILE__, __LINE__)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __FILE__
|
||||
#ifdef __LINE__
|
||||
#define __DEBUG() fprintf(stderr, "%s, line %d: ", __FILE__, __LINE__);
|
||||
#endif
|
||||
#if defined(__FILE__) && defined(__LINE__)
|
||||
# define ASSERT(x) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed at %s:%d: %s", __FILE__, __LINE__, #x);} \
|
||||
else {print_warning("ASSERT failed at %s:%d: %s", __FILE__, __LINE__, #x);}}} while (0)
|
||||
# define ASSERT_RVAL(x, val) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed at %s:%d: %s", __FILE__, __LINE__, #x);} \
|
||||
else {print_warning("ASSERT failed at %s:%d: %s", __FILE__, __LINE__, #x);} \
|
||||
return (val);}} while (0)
|
||||
# define ABORT() fatal_error("Aborting at %s:%d.", __FILE__, __LINE__)
|
||||
#else
|
||||
# define ASSERT(x) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed: %s", #x);} \
|
||||
else {print_warning("ASSERT failed: %s", #x);}}} while (0)
|
||||
# define ASSERT_RVAL(x, val) do {if (!(x)) {if (debug_level>=1) {fatal_error("ASSERT failed: %s", #x);} \
|
||||
else {print_warning("ASSERT failed: %s", #x);} return (val);}} while (0)
|
||||
# define ABORT() fatal_error("Aborting.")
|
||||
#endif
|
||||
|
||||
#ifndef __DEBUG
|
||||
#define __DEBUG() NOP
|
||||
# define __DEBUG() NOP
|
||||
#endif
|
||||
|
||||
#define REQUIRE(x) do {if (!(x)) {if (debug_level>=1) {__DEBUG(); real_dprintf("REQUIRE failed: %s\n", #x);} return;}} while (0)
|
||||
#define REQUIRE_RVAL(x, v) do {if (!(x)) {if (debug_level>=1) {__DEBUG(); real_dprintf("REQUIRE failed: %s\n", #x);} return (v);}} while (0)
|
||||
|
||||
/* Macros for printing debugging messages */
|
||||
# if DEBUG >= 1
|
||||
# ifndef DPRINTF
|
||||
|
@ -49,6 +63,9 @@ extern unsigned int debug_level;
|
|||
# define DPRINTF5(x) NOP
|
||||
# endif
|
||||
|
||||
/* Use this for stuff that you only want turned on in dire situations */
|
||||
# define D_NEVER(x) NOP
|
||||
|
||||
/* Debugging macros/defines which set the debugging levels for each output type.
|
||||
To change the debugging level at which something appears, change the number in
|
||||
both the DEBUG_ definition and the D_ macro (if there is one). -- mej */
|
||||
|
@ -71,20 +88,20 @@ extern unsigned int debug_level;
|
|||
# define D_PIXMAP(x) DPRINTF1(x)
|
||||
# define DEBUG_EVENTS 1
|
||||
# define D_EVENTS(x) DPRINTF1(x)
|
||||
# define DEBUG_STRINGS 1
|
||||
# define D_STRINGS(x) DPRINTF1(x)
|
||||
|
||||
# define DEBUG_X11 2
|
||||
# define D_X11(x) DPRINTF2(x)
|
||||
# define DEBUG_ENL 2
|
||||
# define D_ENL(x) DPRINTF2(x)
|
||||
# define DEBUG_SCROLLBAR 2
|
||||
# define D_SCROLLBAR(x) DPRINTF2(x)
|
||||
# define DEBUG_THREADS 2
|
||||
# define D_THREADS(x) DPRINTF2(x)
|
||||
# define DEBUG_TAGS 2
|
||||
# define D_TAGS(x) DPRINTF2(x)
|
||||
# define DEBUG_TIMER 2
|
||||
# define D_TIMER(x) DPRINTF2(x)
|
||||
|
||||
# define DEBUG_MENU 3
|
||||
# define D_MENUBAR(x) DPRINTF3(x)
|
||||
# define D_MENU(x) DPRINTF3(x)
|
||||
# define DEBUG_TTYMODE 3
|
||||
# define D_TTYMODE(x) DPRINTF3(x)
|
||||
# define DEBUG_COLORS 3
|
||||
|
@ -92,14 +109,58 @@ extern unsigned int debug_level;
|
|||
|
||||
# define DEBUG_MALLOC 4
|
||||
# define D_MALLOC(x) DPRINTF4(x)
|
||||
# define DEBUG_MENUARROWS 4
|
||||
# define D_MENUARROWS(x) DPRINTF4(x)
|
||||
# define DEBUG_MENU_LAYOUT 4
|
||||
# define D_MENU_LAYOUT(x) DPRINTF4(x)
|
||||
# define DEBUG_MENUBAR_STACKING 4
|
||||
# define D_MENUBAR_STACKING(x) DPRINTF4(x)
|
||||
# define DEBUG_ACTIONS 4
|
||||
# define D_ACTIONS(x) DPRINTF4(x)
|
||||
|
||||
# define DEBUG_X 5
|
||||
|
||||
# define DEBUG_PARSE 9999
|
||||
# define D_PARSE(x) D_NEVER(x)
|
||||
# define DEBUG_STRINGS 9999
|
||||
# define D_STRINGS(x) D_NEVER(x)
|
||||
|
||||
#if (SIZEOF_LONG == 8)
|
||||
# define MEMSET_LONG() l |= l<<32
|
||||
#else
|
||||
# define MEMSET_LONG() ((void)0)
|
||||
#endif
|
||||
|
||||
#define MEMSET(s, c, count) do { \
|
||||
char *end = (char *)(s) + (count); \
|
||||
long l; \
|
||||
long *l_dest = (long *)(s); \
|
||||
char *c_dest; \
|
||||
\
|
||||
/* areas of less than 4 * sizeof(long) are set in 1-byte chunks. */ \
|
||||
if ((count) >= 4 * sizeof(long)) { \
|
||||
/* fill l with c. */ \
|
||||
l = (c) | (c)<<8; \
|
||||
l |= l<<16; \
|
||||
MEMSET_LONG(); \
|
||||
\
|
||||
/* fill in 1-byte chunks until boundary of long is reached. */ \
|
||||
if ((unsigned long)l_dest & (unsigned long)(sizeof(long) -1)) { \
|
||||
c_dest = (char *)l_dest; \
|
||||
while ((unsigned long)c_dest & (unsigned long)(sizeof(long) -1)) { \
|
||||
*(c_dest++) = (c); \
|
||||
} \
|
||||
l_dest = (long *)c_dest; \
|
||||
} \
|
||||
\
|
||||
/* fill in long-size chunks as long as possible. */ \
|
||||
while (((unsigned long) (end - (char *)l_dest)) >= sizeof(long)) { \
|
||||
*(l_dest++) = l; \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
/* fill the tail in 1-byte chunks. */ \
|
||||
if ((char *)l_dest < end) { \
|
||||
c_dest = (char *)l_dest; \
|
||||
*(c_dest++) = (c); \
|
||||
while (c_dest < end) { \
|
||||
*(c_dest++) = (c); \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif /* _DEBUG_H */
|
||||
|
|
|
@ -0,0 +1,321 @@
|
|||
/* e.c -- Eterm Enlightenment support
|
||||
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
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 <X11/cursorfont.h>
|
||||
|
||||
#include "../libmej/debug.h"
|
||||
#include "../libmej/mem.h"
|
||||
#include "../libmej/strings.h"
|
||||
#include "debug.h"
|
||||
#include "e.h"
|
||||
#include "command.h"
|
||||
#include "main.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
|
||||
Window ipc_win = None;
|
||||
Atom ipc_atom = None;
|
||||
|
||||
/* Returns true if running under E, false otherwise */
|
||||
unsigned char
|
||||
check_for_enlightenment(void)
|
||||
{
|
||||
static char have_e = -1;
|
||||
|
||||
if (have_e == -1) {
|
||||
if (XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True) != None) {
|
||||
D_X11(("Enlightenment detected.\n"));
|
||||
have_e = 1;
|
||||
} else {
|
||||
D_X11(("Enlightenment not detected.\n"));
|
||||
have_e = 0;
|
||||
}
|
||||
}
|
||||
return (have_e);
|
||||
}
|
||||
|
||||
Window
|
||||
enl_ipc_get_win(void)
|
||||
{
|
||||
|
||||
unsigned char *str = NULL;
|
||||
Atom prop, prop2;
|
||||
unsigned long num, after;
|
||||
int format;
|
||||
Window dummy_win;
|
||||
int dummy_int;
|
||||
unsigned int dummy_uint;
|
||||
|
||||
prop = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True);
|
||||
if (prop == None) {
|
||||
return None;
|
||||
}
|
||||
XGetWindowProperty(Xdisplay, Xroot, prop, 0, 14, False, AnyPropertyType, &prop2, &format, &num, &after, &str);
|
||||
if (str) {
|
||||
sscanf((char *) str, "%*s %x", (unsigned int *) &ipc_win);
|
||||
XFree(str);
|
||||
}
|
||||
if (ipc_win != None) {
|
||||
if (!XGetGeometry(Xdisplay, ipc_win, &dummy_win, &dummy_int, &dummy_int, &dummy_uint, &dummy_uint, &dummy_uint, &dummy_uint)) {
|
||||
ipc_win = None;
|
||||
}
|
||||
str = NULL;
|
||||
if (ipc_win != None) {
|
||||
XGetWindowProperty(Xdisplay, ipc_win, prop, 0, 14, False, AnyPropertyType, &prop2, &format, &num, &after, &str);
|
||||
if (str) {
|
||||
XFree(str);
|
||||
} else {
|
||||
ipc_win = None;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ipc_win != None) {
|
||||
XSelectInput(Xdisplay, ipc_win, StructureNotifyMask | SubstructureNotifyMask);
|
||||
enl_ipc_send("set clientname " APL_NAME);
|
||||
enl_ipc_send("set version " VERSION);
|
||||
enl_ipc_send("set email mej@eterm.org");
|
||||
enl_ipc_send("set web http://www.eterm.org/");
|
||||
enl_ipc_send("set info Eterm Enlightened Terminal Emulator");
|
||||
}
|
||||
return (ipc_win);
|
||||
}
|
||||
|
||||
void
|
||||
enl_ipc_send(char *str)
|
||||
{
|
||||
|
||||
char buff[21];
|
||||
register unsigned short i;
|
||||
register unsigned char j;
|
||||
unsigned short len;
|
||||
XEvent ev;
|
||||
|
||||
ASSERT(str != NULL);
|
||||
|
||||
if (ipc_win == None) {
|
||||
if ((ipc_win = enl_ipc_get_win()) == None) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
len = strlen(str);
|
||||
ipc_atom = XInternAtom(Xdisplay, "ENL_MSG", True);
|
||||
if (ipc_atom == None) {
|
||||
D_ENL(("enl_ipc_send(): IPC error: ENL_MSG atom does not exist.\n"));
|
||||
return;
|
||||
}
|
||||
ev.xclient.type = ClientMessage;
|
||||
ev.xclient.serial = 0;
|
||||
ev.xclient.send_event = True;
|
||||
ev.xclient.window = ipc_win;
|
||||
ev.xclient.message_type = ipc_atom;
|
||||
ev.xclient.format = 8;
|
||||
|
||||
for (i = 0; i < len + 1; i += 12) {
|
||||
sprintf(buff, "%8x", (int) TermWin.parent);
|
||||
for (j = 0; j < 12; j++) {
|
||||
buff[8 + j] = str[i + j];
|
||||
if (!str[i + j]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
buff[20] = 0;
|
||||
for (j = 0; j < 20; j++) {
|
||||
ev.xclient.data.b[j] = buff[j];
|
||||
}
|
||||
XSendEvent(Xdisplay, ipc_win, False, 0, (XEvent *) & ev);
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
enl_wait_for_reply(void)
|
||||
{
|
||||
|
||||
XEvent ev;
|
||||
static char msg_buffer[20];
|
||||
register unsigned char i;
|
||||
|
||||
for (; !XCheckTypedWindowEvent(Xdisplay, TermWin.parent, ClientMessage, &ev););
|
||||
for (i = 0; i < 20; i++) {
|
||||
msg_buffer[i] = ev.xclient.data.b[i];
|
||||
}
|
||||
return (msg_buffer + 8);
|
||||
}
|
||||
|
||||
char *
|
||||
enl_ipc_get(const char *msg_data)
|
||||
{
|
||||
|
||||
static char *message = NULL;
|
||||
static unsigned short len = 0;
|
||||
char buff[13], *ret_msg = NULL;
|
||||
register unsigned char i;
|
||||
unsigned char blen;
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
buff[i] = msg_data[i];
|
||||
}
|
||||
buff[12] = 0;
|
||||
blen = strlen(buff);
|
||||
if (message != NULL) {
|
||||
len += blen;
|
||||
message = (char *) REALLOC(message, len + 1);
|
||||
strcat(message, buff);
|
||||
} else {
|
||||
len = blen;
|
||||
message = (char *) MALLOC(len + 1);
|
||||
strcpy(message, buff);
|
||||
}
|
||||
if (blen < 12) {
|
||||
ret_msg = message;
|
||||
message = NULL;
|
||||
D_ENL(("enl_ipc_get(): Received complete reply: \"%s\"\n", ret_msg));
|
||||
}
|
||||
return (ret_msg);
|
||||
}
|
||||
|
||||
void
|
||||
enl_query_for_image(unsigned char type)
|
||||
{
|
||||
|
||||
char query[255], *filename;
|
||||
|
||||
snprintf(query, sizeof(query), "insert correct IPC command here");
|
||||
enl_ipc_send("");
|
||||
for (; !(filename = enl_ipc_get(enl_wait_for_reply())););
|
||||
/* Extract filename */
|
||||
load_image(filename, type);
|
||||
}
|
||||
|
||||
void
|
||||
eterm_ipc_parse(char *str)
|
||||
{
|
||||
|
||||
char *params;
|
||||
|
||||
ASSERT(str != NULL);
|
||||
|
||||
params = strchr(str, ':');
|
||||
if (params) {
|
||||
*params++ = 0; /* Nuke the colon */
|
||||
}
|
||||
if (!strcasecmp(str, "echo") || !strcasecmp(str, "tty_write")) {
|
||||
if (params) {
|
||||
tt_write(params, strlen(params));
|
||||
} else {
|
||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||
}
|
||||
} else if (!strcasecmp(str, "parse")) {
|
||||
if (params) {
|
||||
cmd_write(params, strlen(params));
|
||||
} else {
|
||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||
}
|
||||
} else if (!strcasecmp(str, "enl_send")) {
|
||||
if (params) {
|
||||
enl_ipc_send(params);
|
||||
} else {
|
||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||
}
|
||||
} else if (!strcasecmp(str, "enl_query")) {
|
||||
if (params) {
|
||||
char *reply, header[512];
|
||||
|
||||
enl_ipc_send(params);
|
||||
for (; !(reply = enl_ipc_get(enl_wait_for_reply())););
|
||||
snprintf(header, sizeof(header), "Enlightenment IPC Reply to \"%s\":\n\n", params);
|
||||
tt_write(header, strlen(header));
|
||||
tt_write(reply, strlen(reply));
|
||||
tt_write("\n", 1);
|
||||
FREE(reply);
|
||||
} else {
|
||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||
}
|
||||
} else if (!strcasecmp(str, "winop")) {
|
||||
if (params) {
|
||||
eterm_handle_winop(params);
|
||||
} else {
|
||||
print_error("IPC Error: Invalid syntax in command \"%s\"", str);
|
||||
}
|
||||
} else if (!strcasecmp(str, "exit")) {
|
||||
exit(0);
|
||||
} else {
|
||||
print_error("IPC Error: Unrecognized command \"%s\"", str);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
eterm_ipc_send(char *str)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
char *
|
||||
eterm_ipc_get(void)
|
||||
{
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
void
|
||||
eterm_handle_winop(char *action)
|
||||
{
|
||||
|
||||
char *winid;
|
||||
Window win = 0;
|
||||
|
||||
ASSERT(action != NULL);
|
||||
|
||||
winid = strchr(action, ' ');
|
||||
if (winid) {
|
||||
win = (Window) strtoul(winid + 1, (char **) NULL, 0);
|
||||
}
|
||||
if (win == 0) { /* If no window ID was given, or if the strtoul() call failed */
|
||||
win = TermWin.parent;
|
||||
}
|
||||
if (!BEG_STRCASECMP(action, "raise")) {
|
||||
XRaiseWindow(Xdisplay, win);
|
||||
} else if (!BEG_STRCASECMP(action, "lower")) {
|
||||
XLowerWindow(Xdisplay, win);
|
||||
} else if (!BEG_STRCASECMP(action, "map")) {
|
||||
XMapWindow(Xdisplay, win);
|
||||
} else if (!BEG_STRCASECMP(action, "unmap")) {
|
||||
XUnmapWindow(Xdisplay, win);
|
||||
} else if (!BEG_STRCASECMP(action, "kill")) {
|
||||
XKillClient(Xdisplay, win);
|
||||
} else if (!BEG_STRCASECMP(action, "iconify")) {
|
||||
XIconifyWindow(Xdisplay, win, Xscreen);
|
||||
} else {
|
||||
print_error("IPC Error: Unrecognized window operation \"%s\"", action);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/* e.h -- Eterm Enlightenment support module header file
|
||||
* -- 6 June 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _E_H_
|
||||
#define _E_H_
|
||||
/* includes */
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
#include "pixmap.h" /* For simage_t */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
|
||||
/************ Variables ************/
|
||||
extern Window ipc_win;
|
||||
extern Atom ipc_atom;
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern unsigned char check_for_enlightenment(void);
|
||||
extern Window enl_ipc_get_win(void);
|
||||
extern void enl_ipc_send(char *);
|
||||
extern char *enl_wait_for_reply(void);
|
||||
extern char *enl_ipc_get(const char *);
|
||||
extern void enl_query_for_image(unsigned char);
|
||||
extern void eterm_ipc_parse(char *);
|
||||
extern void eterm_ipc_send(char *);
|
||||
extern char *eterm_ipc_get(void);
|
||||
extern void eterm_handle_winop(char *);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _E_H_ */
|
|
@ -1,26 +0,0 @@
|
|||
/* eterm_imlib.h - An include file for porting Eterm to use Imlib 1.0
|
||||
* in addition to Imlib 0.x.
|
||||
* Feb 15 1998, vendu
|
||||
*/
|
||||
|
||||
#ifndef _ETERM_IMLIB_H
|
||||
# define _ETERM_IMLIB_H
|
||||
|
||||
# ifdef NEW_IMLIB
|
||||
# include <Imlib.h>
|
||||
# else if defined(OLD_IMLIB)
|
||||
# include <X11/imlib.h>
|
||||
# endif
|
||||
|
||||
# ifdef NEW_IMLIB
|
||||
# define ImColor ImlibColor
|
||||
# define Image ImlibImage
|
||||
# define ImlibInit(d) Imlib_init(d)
|
||||
# define ImlibLoadImage(id,f,c) Imlib_load_image(id,f)
|
||||
# define ImlibFreePixmap(id,p) Imlib_free_pixmap(id,p)
|
||||
# define ImlibRender(id,i,w,h) Imlib_render(id,i,w,h)
|
||||
# define ImlibCopyImageToPixmap(id,i) Imlib_copy_image(id,i)
|
||||
# define ImlibDestroyImage(id,i) Imlib_destroy_image(id,i)
|
||||
# endif
|
||||
|
||||
#endif /* _ETERM_IMLIB_H */
|
|
@ -0,0 +1,86 @@
|
|||
/* eterm_utmp.h -- Eterm utmp module header file
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(ETERM_UTMP_H_) && defined(UTMP_SUPPORT)
|
||||
#define ETERM_UTMP_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
#ifndef UTMP_FILENAME
|
||||
# ifdef UTMP_FILE
|
||||
# define UTMP_FILENAME UTMP_FILE
|
||||
# elif defined(_PATH_UTMP)
|
||||
# define UTMP_FILENAME _PATH_UTMP
|
||||
# else
|
||||
# define UTMP_FILENAME "/etc/utmp"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef LASTLOG_FILENAME
|
||||
# ifdef _PATH_LASTLOG
|
||||
# define LASTLOG_FILENAME _PATH_LASTLOG
|
||||
# else
|
||||
# define LASTLOG_FILENAME "/usr/adm/lastlog" /* only on BSD systems */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef WTMP_FILENAME
|
||||
# ifdef WTMP_FILE
|
||||
# define WTMP_FILENAME WTMP_FILE
|
||||
# elif defined(_PATH_WTMP)
|
||||
# define WTMP_FILENAME _PATH_WTMP
|
||||
# elif defined(SYSV)
|
||||
# define WTMP_FILENAME "/etc/wtmp"
|
||||
# else
|
||||
# define WTMP_FILENAME "/usr/adm/wtmp"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TTYTAB_FILENAME
|
||||
# ifdef TTYTAB
|
||||
# define TTYTAB_FILENAME TTYTAB_FILENAME
|
||||
# else
|
||||
# define TTYTAB_FILENAME "/etc/ttytab"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef USER_PROCESS
|
||||
# define USER_PROCESS 7
|
||||
#endif
|
||||
#ifndef DEAD_PROCESS
|
||||
# define DEAD_PROCESS 8
|
||||
#endif
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void makeutent(const char *, const char *);
|
||||
extern void cleanutent(void);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* ETERM_UTMP_H_ */
|
|
@ -0,0 +1,669 @@
|
|||
/* events.c -- Eterm events module
|
||||
* -- 29 April 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
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/strings.h"
|
||||
#include "debug.h"
|
||||
#include "main.h"
|
||||
#include "mem.h"
|
||||
#include "strings.h"
|
||||
#include "actions.h"
|
||||
#include "command.h"
|
||||
#include "e.h"
|
||||
#include "events.h"
|
||||
#include "graphics.h"
|
||||
#include "menus.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
#include "screen.h"
|
||||
#include "scrollbar.h"
|
||||
#include "term.h"
|
||||
#include "windows.h"
|
||||
|
||||
unsigned char keypress_exit = 0;
|
||||
event_master_t event_master;
|
||||
event_dispatcher_data_t primary_data;
|
||||
mouse_button_state_t button_state =
|
||||
{0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
/********** The Event Handling Subsystem **********/
|
||||
void
|
||||
event_init_subsystem(event_dispatcher_t primary_dispatcher, event_dispatcher_init_t init)
|
||||
{
|
||||
|
||||
/* Initialize the subsystem with the main event dispatcher */
|
||||
event_master.num_dispatchers = 1;
|
||||
event_master.dispatchers = (event_dispatcher_t *) MALLOC(sizeof(event_dispatcher_t));
|
||||
event_master.dispatchers[0] = (event_dispatcher_t) primary_dispatcher;
|
||||
(init) (); /* Initialize the dispatcher's data */
|
||||
}
|
||||
|
||||
void
|
||||
event_register_dispatcher(event_dispatcher_t func, event_dispatcher_init_t init)
|
||||
{
|
||||
|
||||
/* Add a secondary event dispatcher */
|
||||
event_master.num_dispatchers++;
|
||||
event_master.dispatchers = (event_dispatcher_t *) REALLOC(event_master.dispatchers, sizeof(event_dispatcher_t) * event_master.num_dispatchers);
|
||||
event_master.dispatchers[event_master.num_dispatchers - 1] = (event_dispatcher_t) func;
|
||||
(init) (); /* Initialize the dispatcher's data */
|
||||
}
|
||||
|
||||
void
|
||||
event_dispatch(event_t * event)
|
||||
{
|
||||
|
||||
register unsigned char i;
|
||||
register unsigned char handled;
|
||||
|
||||
/* No debugging stuff here. If you need it, take it out when done. This should be ultra-fast. -- mej */
|
||||
for (i = 0; i < event_master.num_dispatchers; i++) {
|
||||
handled = (event_master.dispatchers[i]) (event);
|
||||
if (handled) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
event_data_add_mywin(event_dispatcher_data_t * data, Window win)
|
||||
{
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
if (data->num_my_windows > 0) {
|
||||
(data->num_my_windows)++;
|
||||
data->my_windows = (Window *) REALLOC(data->my_windows, sizeof(Window) * data->num_my_windows);
|
||||
data->my_windows[data->num_my_windows - 1] = win;
|
||||
} else {
|
||||
data->num_my_windows = 1;
|
||||
data->my_windows = (Window *) MALLOC(sizeof(Window));
|
||||
data->my_windows[0] = win;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
event_data_add_parent(event_dispatcher_data_t * data, Window win)
|
||||
{
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
if (data->num_my_parents > 0) {
|
||||
(data->num_my_parents)++;
|
||||
data->my_parents = (Window *) REALLOC(data->my_parents, sizeof(Window) * data->num_my_parents);
|
||||
data->my_parents[data->num_my_parents - 1] = win;
|
||||
} else {
|
||||
data->num_my_parents = 1;
|
||||
data->my_parents = (Window *) MALLOC(sizeof(Window));
|
||||
data->my_parents[0] = win;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
event_init_primary_dispatcher(void)
|
||||
{
|
||||
|
||||
MEMSET(&primary_data, 0, sizeof(event_dispatcher_data_t));
|
||||
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, KeyPress, handle_key_press);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, PropertyNotify, handle_property_notify);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, ClientMessage, handle_client_message);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, MappingNotify, handle_mapping_notify);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, VisibilityNotify, handle_visibility_notify);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, FocusIn, handle_focus_in);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, FocusOut, handle_focus_out);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, ConfigureNotify, handle_configure_notify);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, SelectionClear, handle_selection_clear);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, SelectionNotify, handle_selection_notify);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, SelectionRequest, handle_selection_request);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, GraphicsExpose, handle_expose);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, Expose, handle_expose);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, ButtonPress, handle_button_press);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, ButtonRelease, handle_button_release);
|
||||
EVENT_DATA_ADD_HANDLER(primary_data, MotionNotify, handle_motion_notify);
|
||||
|
||||
event_data_add_mywin(&primary_data, TermWin.parent);
|
||||
event_data_add_mywin(&primary_data, TermWin.vt);
|
||||
event_data_add_mywin(&primary_data, scrollBar.win);
|
||||
if (scrollbar_is_pixmapped()) {
|
||||
event_data_add_mywin(&primary_data, scrollBar.up_win);
|
||||
event_data_add_mywin(&primary_data, scrollBar.dn_win);
|
||||
event_data_add_mywin(&primary_data, scrollBar.sa_win);
|
||||
}
|
||||
if (desktop_window != None) {
|
||||
event_data_add_parent(&primary_data, desktop_window);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char
|
||||
event_win_is_mywin(register event_dispatcher_data_t * data, Window win)
|
||||
{
|
||||
|
||||
register unsigned short i;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
for (i = 0; i < data->num_my_windows; i++) {
|
||||
if (data->my_windows[i] == win) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
event_win_is_parent(register event_dispatcher_data_t * data, Window win)
|
||||
{
|
||||
|
||||
register unsigned short i;
|
||||
|
||||
ASSERT(data != NULL);
|
||||
|
||||
for (i = 0; i < data->num_my_parents; i++) {
|
||||
if (data->my_parents[i] == win) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_key_press(event_t * ev)
|
||||
{
|
||||
|
||||
#ifdef COUNT_X_EVENTS
|
||||
static long long keypress_cnt = 0;
|
||||
#endif
|
||||
#ifdef PROFILE_X_EVENTS
|
||||
struct timeval keypress_start, keypress_stop;
|
||||
#endif
|
||||
|
||||
P_SETTIMEVAL(keypress_start);
|
||||
D_EVENTS(("handle_key_press(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
COUNT_EVENT(keypress_cnt);
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
lookup_key(ev);
|
||||
P_SETTIMEVAL(keypress_stop);
|
||||
P_EVENT_TIME("KeyPress", keypress_start, keypress_stop);
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_property_notify(event_t * ev)
|
||||
{
|
||||
|
||||
Atom prop;
|
||||
|
||||
D_EVENTS(("handle_property_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
if (((Options & Opt_pixmapTrans) || (images[image_bg].mode & MODE_TRANS)) && (desktop_window != None)) {
|
||||
if (ev->xany.window == TermWin.parent) {
|
||||
prop = XInternAtom(Xdisplay, "_WIN_WORKSPACE", True);
|
||||
if ((prop == None) || (ev->xproperty.atom != prop)) {
|
||||
return 0;
|
||||
}
|
||||
XSelectInput(Xdisplay, desktop_window, None);
|
||||
desktop_window = get_desktop_window();
|
||||
XSelectInput(Xdisplay, desktop_window, PropertyChangeMask);
|
||||
if (desktop_pixmap != None) {
|
||||
free_desktop_pixmap();
|
||||
}
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
|
||||
scr_expose(0, 0, TermWin_TotalWidth(), TermWin_TotalHeight());
|
||||
scrollbar_show(0);
|
||||
|
||||
} else if (ev->xany.window == desktop_window) {
|
||||
prop = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
|
||||
if ((prop == None) || (ev->xproperty.atom != prop)) {
|
||||
return 0;
|
||||
}
|
||||
if (desktop_pixmap != None) {
|
||||
free_desktop_pixmap();
|
||||
}
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
|
||||
scr_expose(0, 0, TermWin_TotalWidth(), TermWin_TotalHeight());
|
||||
scrollbar_show(0);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_client_message(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_client_message(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
|
||||
if (ev->xclient.format == 32 && ev->xclient.data.l[0] == (signed) wmDeleteWindow)
|
||||
exit(EXIT_SUCCESS);
|
||||
if (ev->xclient.format == 8 && ev->xclient.message_type == ipc_atom) {
|
||||
char buff[13];
|
||||
unsigned char i;
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
buff[i] = ev->xclient.data.b[i + 8];
|
||||
}
|
||||
buff[12] = 0;
|
||||
D_ENL(("handle_client_message(): Discarding unexpected Enlightenment IPC message: \"%s\"\n", buff));
|
||||
return 1;
|
||||
}
|
||||
#ifdef OFFIX_DND
|
||||
/* OffiX Dnd (drag 'n' drop) protocol */
|
||||
if (ev->xclient.message_type == DndProtocol && ((ev->xclient.data.l[0] == DndFile)
|
||||
|| (ev->xclient.data.l[0] == DndDir) || (ev->xclient.data.l[0] == DndLink))) {
|
||||
/* Get DnD data */
|
||||
Atom ActualType;
|
||||
int ActualFormat;
|
||||
unsigned char *data;
|
||||
unsigned long Size, RemainingBytes;
|
||||
|
||||
XGetWindowProperty(Xdisplay, Xroot, DndSelection, 0L, 1000000L, False, AnyPropertyType, &ActualType, &ActualFormat, &Size, &RemainingBytes, &data);
|
||||
XChangeProperty(Xdisplay, Xroot, XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, data, strlen(data));
|
||||
selection_paste(Xroot, XA_CUT_BUFFER0, True);
|
||||
XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime);
|
||||
return 1;
|
||||
}
|
||||
#endif /* OFFIX_DND */
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_mapping_notify(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_mapping_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
XRefreshKeyboardMapping(&(ev->xmapping));
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_visibility_notify(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_visibility_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
switch (ev->xvisibility.state) {
|
||||
case VisibilityUnobscured:
|
||||
#ifdef USE_SMOOTH_REFRESH
|
||||
refresh_type = SMOOTH_REFRESH;
|
||||
#else
|
||||
refresh_type = FAST_REFRESH;
|
||||
#endif
|
||||
break;
|
||||
case VisibilityPartiallyObscured:
|
||||
refresh_type = SLOW_REFRESH;
|
||||
break;
|
||||
default:
|
||||
refresh_type = NO_REFRESH;
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_focus_in(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_focus_in(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
if (!TermWin.focus) {
|
||||
TermWin.focus = 1;
|
||||
if (background_is_pixmap() && (images[image_bg].norm != images[image_bg].selected)) {
|
||||
images[image_bg].current = images[image_bg].selected;
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
|
||||
scr_expose(0, 0, TermWin_TotalWidth(), TermWin_TotalHeight());
|
||||
}
|
||||
if (Options & Opt_scrollbar_popup) {
|
||||
map_scrollbar(Options & Opt_scrollBar);
|
||||
}
|
||||
#ifdef USE_XIM
|
||||
if (Input_Context != NULL)
|
||||
XSetICFocus(Input_Context);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_focus_out(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_focus_out(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
if (TermWin.focus) {
|
||||
TermWin.focus = 0;
|
||||
if (background_is_pixmap() && (images[image_bg].norm != images[image_bg].selected)) {
|
||||
images[image_bg].current = images[image_bg].norm;
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
|
||||
scr_expose(0, 0, TermWin_TotalWidth(), TermWin_TotalHeight());
|
||||
}
|
||||
if (Options & Opt_scrollbar_popup) {
|
||||
map_scrollbar(0);
|
||||
}
|
||||
#ifdef USE_XIM
|
||||
if (Input_Context != NULL)
|
||||
XUnsetICFocus(Input_Context);
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_configure_notify(event_t * ev)
|
||||
{
|
||||
XEvent unused_xevent;
|
||||
|
||||
D_EVENTS(("handle_configure_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
|
||||
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, ConfigureNotify, &unused_xevent));
|
||||
resize_window();
|
||||
#ifdef USE_XIM
|
||||
xim_set_status_position();
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_selection_clear(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_selection_clear(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
selection_clear();
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_selection_notify(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_selection_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
selection_paste(ev->xselection.requestor, ev->xselection.property, True);
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_selection_request(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_selection_request(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
selection_send(&(ev->xselectionrequest));
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_expose(event_t * ev)
|
||||
{
|
||||
|
||||
#ifdef COUNT_X_EVENTS
|
||||
static long long expose_cnt = 0;
|
||||
#endif
|
||||
#ifdef PROFILE_X_EVENTS
|
||||
struct timeval expose_start, expose_stop;
|
||||
#endif
|
||||
|
||||
P_SETTIMEVAL(expose_start);
|
||||
D_EVENTS(("handle_expose(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
if (ev->xany.window == TermWin.vt) {
|
||||
scr_expose(ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height);
|
||||
} else {
|
||||
|
||||
XEvent unused_xevent;
|
||||
|
||||
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, Expose, &unused_xevent));
|
||||
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, GraphicsExpose, &unused_xevent));
|
||||
Gr_expose(ev->xany.window);
|
||||
}
|
||||
if (desktop_window != None) {
|
||||
XSelectInput(Xdisplay, desktop_window, PropertyChangeMask);
|
||||
}
|
||||
P_SETTIMEVAL(expose_stop);
|
||||
P_EVENT_TIME("Expose", expose_start, expose_stop);
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_button_press(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_button_press(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
if (Options & Opt_borderless) {
|
||||
XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime);
|
||||
}
|
||||
if (action_dispatch(ev, 0)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
button_state.bypass_keystate = (ev->xbutton.state & (Mod1Mask | ShiftMask));
|
||||
button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0));
|
||||
|
||||
if (ev->xany.window == TermWin.vt) {
|
||||
if (ev->xbutton.subwindow != None) {
|
||||
Gr_ButtonPress(ev->xbutton.x, ev->xbutton.y);
|
||||
} else {
|
||||
if (button_state.report_mode) {
|
||||
if (PrivateModes & PrivMode_MouseX10) {
|
||||
/* no state info allowed */
|
||||
ev->xbutton.state = 0;
|
||||
}
|
||||
#ifdef MOUSE_REPORT_DOUBLECLICK
|
||||
if (ev->xbutton.button == Button1) {
|
||||
if (ev->xbutton.time - button_state.button_press < MULTICLICK_TIME)
|
||||
button_state.clicks++;
|
||||
else
|
||||
button_state.clicks = 1;
|
||||
}
|
||||
#else
|
||||
button_state.clicks = 1;
|
||||
#endif /* MOUSE_REPORT_DOUBLECLICK */
|
||||
mouse_report(&(ev->xbutton));
|
||||
} else {
|
||||
switch (ev->xbutton.button) {
|
||||
case Button1:
|
||||
if (button_state.last_button_press == 1
|
||||
&& (ev->xbutton.time - button_state.button_press < MULTICLICK_TIME))
|
||||
button_state.clicks++;
|
||||
else
|
||||
button_state.clicks = 1;
|
||||
selection_click(button_state.clicks, ev->xbutton.x, ev->xbutton.y);
|
||||
button_state.last_button_press = 1;
|
||||
break;
|
||||
|
||||
case Button3:
|
||||
if (button_state.last_button_press == 3
|
||||
&& (ev->xbutton.time - button_state.button_press < MULTICLICK_TIME))
|
||||
selection_rotate(ev->xbutton.x, ev->xbutton.y);
|
||||
else
|
||||
selection_extend(ev->xbutton.x, ev->xbutton.y, 1);
|
||||
button_state.last_button_press = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
button_state.button_press = ev->xbutton.time;
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_button_release(event_t * ev)
|
||||
{
|
||||
|
||||
D_EVENTS(("handle_button_release(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
button_state.mouse_offset = 0;
|
||||
button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0));
|
||||
|
||||
if (ev->xany.window == TermWin.vt) {
|
||||
if (ev->xbutton.subwindow != None)
|
||||
Gr_ButtonRelease(ev->xbutton.x, ev->xbutton.y);
|
||||
else {
|
||||
if (button_state.report_mode) {
|
||||
switch (PrivateModes & PrivMode_mouse_report) {
|
||||
case PrivMode_MouseX10:
|
||||
break;
|
||||
|
||||
case PrivMode_MouseX11:
|
||||
ev->xbutton.state = button_state.bypass_keystate;
|
||||
ev->xbutton.button = AnyButton;
|
||||
mouse_report(&(ev->xbutton));
|
||||
break;
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
/*
|
||||
* dumb hack to compensate for the failure of click-and-drag
|
||||
* when overriding mouse reporting
|
||||
*/
|
||||
if ((PrivateModes & PrivMode_mouse_report) && (button_state.bypass_keystate) && (ev->xbutton.button == Button1) && (clickOnce())) {
|
||||
selection_extend(ev->xbutton.x, ev->xbutton.y, 0);
|
||||
}
|
||||
switch (ev->xbutton.button) {
|
||||
case Button1:
|
||||
case Button3:
|
||||
#if defined(CTRL_CLICK_RAISE) || defined(CTRL_CLICK_MENU)
|
||||
if (!(ev->xbutton.state & ControlMask))
|
||||
#endif
|
||||
selection_make(ev->xbutton.time);
|
||||
break;
|
||||
|
||||
case Button2:
|
||||
#ifdef CTRL_CLICK_SCROLLBAR
|
||||
if (!(ev->xbutton.state & ControlMask))
|
||||
#endif
|
||||
selection_request(ev->xbutton.time, ev->xbutton.x, ev->xbutton.y);
|
||||
break;
|
||||
case Button4:
|
||||
scr_page(UP, (ev->xbutton.state & ShiftMask) ? 1 : 5);
|
||||
break;
|
||||
case Button5:
|
||||
scr_page(DN, (ev->xbutton.state & ShiftMask) ? 1 : 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
handle_motion_notify(event_t * ev)
|
||||
{
|
||||
|
||||
#ifdef COUNT_X_EVENTS
|
||||
static long long motion_cnt = 0;
|
||||
#endif
|
||||
#ifdef PROFILE_X_EVENTS
|
||||
struct timeval motion_start, motion_stop;
|
||||
#endif
|
||||
|
||||
D_EVENTS(("handle_motion_notify(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
|
||||
|
||||
COUNT_EVENT(motion_cnt);
|
||||
P_SETTIMEVAL(motion_start);
|
||||
|
||||
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
||||
if ((PrivateModes & PrivMode_mouse_report) && !(button_state.bypass_keystate))
|
||||
return 1;
|
||||
|
||||
if (ev->xany.window == TermWin.vt) {
|
||||
if (ev->xbutton.state & (Button1Mask | Button3Mask)) {
|
||||
Window unused_root, unused_child;
|
||||
int unused_root_x, unused_root_y;
|
||||
unsigned int unused_mask;
|
||||
|
||||
while (XCheckTypedWindowEvent(Xdisplay, TermWin.vt, MotionNotify, ev));
|
||||
XQueryPointer(Xdisplay, TermWin.vt, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x), &(ev->xbutton.y), &unused_mask);
|
||||
#ifdef MOUSE_THRESHOLD
|
||||
/* deal with a `jumpy' mouse */
|
||||
if ((ev->xmotion.time - button_state.button_press) > MOUSE_THRESHOLD)
|
||||
#endif
|
||||
selection_extend((ev->xbutton.x), (ev->xbutton.y), (ev->xbutton.state & Button3Mask));
|
||||
}
|
||||
P_SETTIMEVAL(motion_stop);
|
||||
P_EVENT_TIME("MotionNotify", motion_start, motion_stop);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
process_x_event(event_t * ev)
|
||||
{
|
||||
#ifdef COUNT_X_EVENTS
|
||||
static long long event_cnt = 0;
|
||||
#endif
|
||||
|
||||
COUNT_EVENT(event_cnt);
|
||||
if (primary_data.handlers[ev->type] != NULL) {
|
||||
return ((primary_data.handlers[ev->type]) (ev));
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
XErrorHandler
|
||||
xerror_handler(Display * display, XErrorEvent * event)
|
||||
{
|
||||
|
||||
char err_string[2048];
|
||||
|
||||
strcpy(err_string, "");
|
||||
XGetErrorText(display, event->error_code, err_string, sizeof(err_string));
|
||||
print_error("XError in function %s (request %d.%d): %s (error %d)", request_code_to_name(event->request_code),
|
||||
event->request_code, event->minor_code, err_string, event->error_code);
|
||||
#if DEBUG > DEBUG_X11
|
||||
if (debug_level >= DEBUG_X11) {
|
||||
dump_stack_trace();
|
||||
}
|
||||
#endif
|
||||
print_error("Attempting to continue...");
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
/* events.h -- Eterm events module header file
|
||||
* -- 29 April 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EVENTS_H_
|
||||
#define _EVENTS_H_
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
#if 0
|
||||
# define XEVENT_IS_MYWIN(ev) (((ev)->xany.window == TermWin.parent) \
|
||||
|| ((ev)->xany.window == TermWin.vt) \
|
||||
|| ((ev)->xany.window == menuBar.win) \
|
||||
|| (scrollbar_uparrow_is_pixmapped() && ((ev)->xany.window == scrollBar.up_win)) \
|
||||
|| (scrollbar_downarrow_is_pixmapped() && ((ev)->xany.window == scrollBar.dn_win)) \
|
||||
|| (scrollbar_anchor_is_pixmapped() && ((ev)->xany.window == scrollBar.sa_win)) \
|
||||
|| ((ev)->xany.window == scrollBar.win))
|
||||
# define XEVENT_IS_PARENT(ev) (((ev)->xany.window == TermWin.wm_parent) \
|
||||
|| ((ev)->xany.window == TermWin.wm_grandparent))
|
||||
#endif
|
||||
|
||||
#define XEVENT_IS_MYWIN(ev, data) event_win_is_mywin(data, (ev)->xany.window)
|
||||
#define XEVENT_IS_PARENT(ev, data) event_win_is_parent(data, (ev)->xany.window)
|
||||
|
||||
#define clickOnce() (button_state.clicks <= 1)
|
||||
#ifdef COUNT_X_EVENTS
|
||||
# define COUNT_EVENT(x) do {(x)++; D_EVENTS(("%s == %ld\n", #x, x));} while (0)
|
||||
#else
|
||||
# define COUNT_EVENT(x) NOP
|
||||
#endif
|
||||
#ifdef PROFILE_X_EVENTS
|
||||
# define P_EVENT_TIME(type, start, stop) real_dprintf(type ": %ld microseconds\n", P_CMPTIMEVALS_USEC((start), (stop)))
|
||||
#else
|
||||
# define P_EVENT_TIME(type, start, stop) NOP
|
||||
# define P_SETTIMEVAL(t) NOP
|
||||
#endif
|
||||
#define EVENT_DATA_ADD_HANDLER(data, type, handler) (data).handlers[(type)] = handler
|
||||
|
||||
/************ Structures ************/
|
||||
typedef XEvent event_t;
|
||||
typedef unsigned char (*event_dispatcher_t)(event_t *);
|
||||
typedef unsigned char (*event_handler_t)(event_t *);
|
||||
typedef void (*event_dispatcher_init_t)(void);
|
||||
typedef struct {
|
||||
event_dispatcher_t *dispatchers;
|
||||
unsigned char num_dispatchers;
|
||||
} event_master_t;
|
||||
typedef struct {
|
||||
event_handler_t handlers[LASTEvent];
|
||||
unsigned char num_my_windows;
|
||||
Window *my_windows;
|
||||
unsigned char num_my_parents;
|
||||
Window *my_parents;
|
||||
} event_dispatcher_data_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned short clicks, bypass_keystate, report_mode, mouse_offset;
|
||||
Time button_press, last_button_press, activate_time;
|
||||
} mouse_button_state_t;
|
||||
|
||||
/************ Variables ************/
|
||||
extern unsigned char keypress_exit;
|
||||
extern event_master_t event_master;
|
||||
extern mouse_button_state_t button_state;
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void event_init_subsystem(event_dispatcher_t, event_dispatcher_init_t);
|
||||
extern void event_register_dispatcher(event_dispatcher_t, event_dispatcher_init_t);
|
||||
extern void event_dispatch(event_t *);
|
||||
extern void event_data_add_mywin(event_dispatcher_data_t *, Window);
|
||||
extern void event_data_add_parent(event_dispatcher_data_t *, Window);
|
||||
extern void event_init_primary_dispatcher(void);
|
||||
extern unsigned char event_win_is_mywin(event_dispatcher_data_t *, Window);
|
||||
extern unsigned char event_win_is_parent(event_dispatcher_data_t *, Window);
|
||||
extern unsigned char handle_key_press(event_t *);
|
||||
extern unsigned char handle_property_notify(event_t *);
|
||||
extern unsigned char handle_reparent_notify(event_t *);
|
||||
extern unsigned char handle_client_message(event_t *);
|
||||
extern unsigned char handle_mapping_notify(event_t *);
|
||||
extern unsigned char handle_leave_notify(event_t *);
|
||||
extern unsigned char handle_visibility_notify(event_t *);
|
||||
extern unsigned char handle_focus_in(event_t *);
|
||||
extern unsigned char handle_focus_out(event_t *);
|
||||
extern unsigned char handle_configure_notify(event_t *);
|
||||
extern unsigned char handle_selection_clear(event_t *);
|
||||
extern unsigned char handle_selection_notify(event_t *);
|
||||
extern unsigned char handle_selection_request(event_t *);
|
||||
extern unsigned char handle_expose(event_t *);
|
||||
extern unsigned char handle_button_press(event_t *);
|
||||
extern unsigned char handle_button_release(event_t *);
|
||||
extern unsigned char handle_motion_notify(event_t *);
|
||||
extern unsigned char process_x_event(event_t *);
|
||||
extern XErrorHandler xerror_handler(Display *, XErrorEvent *);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _EVENTS_H_ */
|
527
src/feature.h.in
527
src/feature.h.in
|
@ -1,527 +0,0 @@
|
|||
/* feature.h -- Eterm feature defines header
|
||||
* -- 10 Sept 1997, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FEATURE_H_
|
||||
# define _FEATURE_H_
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
# include "config.h"
|
||||
# include "debug.h"
|
||||
|
||||
/********************* Miscellaneous OS fixings *********************/
|
||||
|
||||
# if defined(hpux) && !defined(_HPUX_SOURCE)
|
||||
# define _HPUX_SOURCE
|
||||
# endif
|
||||
|
||||
/*
|
||||
# if defined(_HPUX_SOURCE) && !defined(SVR4)
|
||||
# define SVR4
|
||||
# endif
|
||||
*/
|
||||
|
||||
# if defined(SVR4) && !defined(__svr4__)
|
||||
# define __svr4__
|
||||
# endif
|
||||
# if !defined(SVR4) && defined(__svr4__)
|
||||
# define SVR4
|
||||
# endif
|
||||
|
||||
# if defined(sun) && !defined(__sun__)
|
||||
# define __sun__
|
||||
# endif
|
||||
# if !defined(sun) && defined(__sun__)
|
||||
# define sun
|
||||
# endif
|
||||
|
||||
# if defined (sun)
|
||||
# undef HAVE_SYS_IOCTL_H
|
||||
# endif
|
||||
|
||||
# ifdef _SCO_DS /* SCO Osr5 */
|
||||
# define ALL_NUMERIC_PTYS /* Scos pty naming is /dev/[pt]typ0 - /dev/[pt]ty256 */
|
||||
# endif
|
||||
|
||||
/********************* Debugging stuff *********************/
|
||||
/* As Keith Bunge would say, don't crap with the debugging stuff below
|
||||
* unless you develop this mess. :^) -- mej
|
||||
*/
|
||||
|
||||
# ifndef DEBUG
|
||||
# define DEBUG 0
|
||||
# endif
|
||||
|
||||
/********************* Random development stuff ***************************/
|
||||
/* #define PROFILE */
|
||||
#ifdef PROFILE
|
||||
/* #define PROFILE_SCREEN */
|
||||
/* #define PROFILE_X_EVENTS */
|
||||
/* #define COUNT_X_EVENTS */
|
||||
#endif
|
||||
/* Active tags are disabled by default until we find a bug that crashes Eterm
|
||||
* on window resize :(
|
||||
*/
|
||||
/* #define USE_ACTIVE_TAGS */
|
||||
#define OPTIMIZE_HACKS
|
||||
|
||||
/********************* Color, screen, and image stuff *********************/
|
||||
|
||||
/* Allow pixmaps in the background of the window */
|
||||
# define PIXMAP_SUPPORT
|
||||
|
||||
/* I'm having problems with this... The call to XInitThreads() in main.c seems
|
||||
* to mess threads up on my system... They run "OK" for a while without that,
|
||||
* but will make Eterm hang eventually.
|
||||
*/
|
||||
/* #define USE_POSIX_THREADS */
|
||||
/* Use mutexes for thread synchronization. */
|
||||
/* #define MUTEX_SYNCH */
|
||||
|
||||
/* Support for pseudo-transparency and viewport mode */
|
||||
# define PIXMAP_OFFSET
|
||||
|
||||
/* Use Imlib for pseudo-transparency, shading, etc. Still experimental at
|
||||
this point. -- mej */
|
||||
/* # define IMLIB_TRANS */
|
||||
|
||||
/* Support for background pixmap cycling */
|
||||
#define BACKGROUND_CYCLING_SUPPORT
|
||||
|
||||
/* Pixmapped scrollbar.
|
||||
*/
|
||||
# define PIXMAP_SCROLLBAR
|
||||
|
||||
/* Pixmapped menubar.
|
||||
*/
|
||||
# define PIXMAP_MENUBAR
|
||||
|
||||
/* Enable use of backing store for the terminal window. */
|
||||
# define BACKING_STORE
|
||||
|
||||
/* Use Rasterman's Imlib image library for image manipulation
|
||||
* If you don't use Imlib, you won't be able to have background pixmaps */
|
||||
# define USE_IMLIB
|
||||
|
||||
/* Define this to use Eterm with Imlib 0.x. Otherwise, it will use Imlib 1.0's
|
||||
* API.
|
||||
*/
|
||||
/* #define OLD_IMLIB */
|
||||
|
||||
/* Define this to use Eterm with Imlib 1.x. This certainly is the Imlib you
|
||||
* want to use.
|
||||
*/
|
||||
|
||||
# if defined(USE_IMLIB) && !defined(OLD_IMLIB)
|
||||
# define NEW_IMLIB
|
||||
# endif
|
||||
|
||||
/* The environment variable in which Eterm looks for a search path for
|
||||
config files and pixmaps */
|
||||
# define PATH_ENV "ETERMPATH"
|
||||
|
||||
/* Enable support for themes. */
|
||||
# define USE_THEMES
|
||||
|
||||
/* These are for future use. Defining them won't help anything, and it may
|
||||
break stuff. */
|
||||
#define USE_EFFECTS
|
||||
|
||||
/* Option to watch the desktop pixmap for changes. If the desktop background changes
|
||||
a pseudo-transparent Eterm will find out about it and update to the new image */
|
||||
#define WATCH_DESKTOP_OPTION
|
||||
|
||||
/* Disable support for changing the cursor color (-c and -t options) */
|
||||
/* #define NO_CURSORCOLOR */
|
||||
|
||||
/* Disable use of high-intensity colors 8-15. They will be simulated using
|
||||
the "bold" font, colorBD, or overstrike */
|
||||
/* #define NO_BRIGHTCOLOR */
|
||||
|
||||
/* Disable separate colors for the bold and underline attributes */
|
||||
/* #define NO_BOLDUNDERLINE */
|
||||
|
||||
/* Disable simulation of bold font using an "overstrike" technique. This technique
|
||||
has been known to cause pixel droppings, and its use is not advised. See
|
||||
also FORCE_CLEAR_CHARS. */
|
||||
/* #define NO_BOLDOVERSTRIKE */
|
||||
|
||||
/* Disable the use of a separate "bold" font */
|
||||
/* #define NO_BOLDFONT */
|
||||
|
||||
/* Disable the secondary screen ("\E[?47h" / "\E[?47l") */
|
||||
/* #define NO_SECONDARY_SCREEN */
|
||||
|
||||
/* The number of screenfuls between refreshes.
|
||||
* If you define this, it will be set to 3.
|
||||
*/
|
||||
/*#define REFRESH_PERIOD 3 */
|
||||
# define REFRESH_PERIOD 5
|
||||
|
||||
/* This will force clearing of characters before writing new ones on top of
|
||||
* them. This is experimental - added in order to try and fix pixel dropping
|
||||
* problems some people have had. See also NO_BOLDOVERSTRIKE. */
|
||||
# define FORCE_CLEAR_CHARS
|
||||
|
||||
/* Rob Nation's graphics escape sequences */
|
||||
/* #define RXVT_GRAPHICS */
|
||||
|
||||
/* The command through which to pipe print-screen requests */
|
||||
#define PRINTPIPE "lp"
|
||||
|
||||
/* If the screen can handle 24-bit graphics, force them */
|
||||
/* #define PREFER_24BIT */
|
||||
|
||||
/* Offer some support for the Offix DND (Drag 'n' Drop) protocol (untested) */
|
||||
/* #define OFFIX_DND */
|
||||
|
||||
/* Allows the -w and --border-width options for specifying the width of the
|
||||
* border (in pixels) between the actual X client window and the program-useable
|
||||
* terminal window. -- mej
|
||||
*/
|
||||
# define BORDER_WIDTH_OPTION
|
||||
|
||||
/********************* Key and key-bindings options *********************/
|
||||
|
||||
/* Use the X server value for the Delete key, regardless */
|
||||
/* #define NO_DELETE_KEY */
|
||||
|
||||
/* Force the delete key to send ^? instead of ESC [ 3 ~ */
|
||||
/* #define KS_DELETE "\177" */
|
||||
#ifndef NO_DELETE_KEY
|
||||
# define KS_DELETE "\177"
|
||||
#endif
|
||||
|
||||
/* Force the Backspace key to send ^H instead of checking the stty setting */
|
||||
#define FORCE_BACKSPACE
|
||||
/* Force Backspace to send ^? */
|
||||
/* #define FORCE_DELETE */
|
||||
|
||||
/* Pick the hotkey for changing the font size */
|
||||
# define HOTKEY_CTRL
|
||||
/* #define HOTKEY_META */
|
||||
|
||||
/* Use Home = "\E[1~" and End = "\E[4~" instead of Home = "\E[7~" and End = "\E[8~" */
|
||||
/* #define LINUX_KEYS */
|
||||
#ifdef linux
|
||||
# define LINUX_KEYS
|
||||
#endif
|
||||
|
||||
/* Allow the "keysym" attribute in config files for remapping keysyms */
|
||||
#define KEYSYM_ATTRIBUTE
|
||||
|
||||
/* Disable X11R6 support for European languages */
|
||||
/* #define NO_XLOCALE */
|
||||
|
||||
/* Allow unshifted Next and Prior keys to scroll, in addition to their shifted
|
||||
* counterparts */
|
||||
/* #define UNSHIFTED_SCROLLKEYS */
|
||||
|
||||
/********************* Mouse, scrollbar, and menu bar options *********************/
|
||||
|
||||
/* Disable sending escape sequences from the scrollbar when mouse reporting
|
||||
* is enabled */
|
||||
/* #define NO_SCROLLBAR_REPORT */
|
||||
|
||||
/* Set the default number of lines in the scrollback buffer */
|
||||
/* #define SAVELINES 256 */
|
||||
|
||||
/* Set the default separator characters for double-click word selection */
|
||||
#define CUTCHARS "\"&'()*,;<=>?@[\\]^`{|}~ \t"
|
||||
|
||||
/* Make it an option */
|
||||
#define CUTCHAR_OPTION
|
||||
|
||||
/* To activate double-click reporting for button 1 */
|
||||
/* #define MOUSE_REPORT_DOUBLECLICK */
|
||||
|
||||
/* The delay in milliseconds between multiple clicks */
|
||||
/* #define MULTICLICK_TIME 500 */
|
||||
|
||||
/* Support for the old xterm-style scrollbar */
|
||||
#define XTERM_SCROLLBAR
|
||||
|
||||
/* Support for the traditional motif-style scrollbar */
|
||||
#define MOTIF_SCROLLBAR
|
||||
|
||||
/* Support for a NeXT-style scrollbar */
|
||||
#define NEXT_SCROLLBAR
|
||||
|
||||
/* Default scrollbar type */
|
||||
#define SCROLLBAR_DEFAULT_TYPE SCROLLBAR_MOTIF
|
||||
|
||||
/* Scrollbar Colors */
|
||||
#define KEEP_SCROLLCOLOR
|
||||
|
||||
/* The default width (in pixels) of the scrollbar. Should be an even number. */
|
||||
#define SB_WIDTH 10
|
||||
|
||||
/* Revert the scrollbar's color to the background color when the window loses focus */
|
||||
#define CHANGE_SCROLLCOLOR_ON_FOCUS
|
||||
|
||||
/* Continuous scrolling by pressing the scrollbar arrow buttons */
|
||||
#define SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
|
||||
|
||||
/* To allow smooth refresh when the terminal window is fully unobscured.
|
||||
* Didn't seem to cause a performance hit rolling a big amount of text
|
||||
* on my Pentium-100 system (Linux) :)... Recommended :)
|
||||
*/
|
||||
#define USE_SMOOTH_REFRESH
|
||||
|
||||
/* Delay periods for continuous scrolling */
|
||||
/* #define SCROLLBAR_INITIAL_DELAY 40 */
|
||||
/* #define SCROLLBAR_CONTINUOUS_DELAY 2 */
|
||||
|
||||
/* The maximum number of menubars that can be stacked. 1 disabled stacking, 0
|
||||
disables menubars altogether */
|
||||
#define MENUBAR_MAX 8
|
||||
|
||||
/* An alternative placement of the menubar shadow */
|
||||
/* #define MENUBAR_SHADOW_IN */
|
||||
|
||||
/* An alternative placement of the menu shadow */
|
||||
#define MENU_SHADOW_IN
|
||||
|
||||
/* Allow Ctrl+Button1 in a window to raise and steal focus */
|
||||
#define CTRL_CLICK_RAISE
|
||||
|
||||
/* Allow Ctrl+Button2 in a window to toggle the scrollbar */
|
||||
#define CTRL_CLICK_SCROLLBAR
|
||||
|
||||
/* Allow Ctrl+Button3 in a window to toggle the menubar */
|
||||
#define CTRL_CLICK_MENU
|
||||
|
||||
/********************* Multi-lingual support options *********************/
|
||||
|
||||
/* Allow option/attribute for Meta to set the 8th bit */
|
||||
#define META8_OPTION
|
||||
|
||||
/* To include support for Greek Elot-928 and IBM-437 keyboard modes */
|
||||
/* #define GREEK_SUPPORT */
|
||||
|
||||
/* To compile as a Kanji terminal. Executable should be renamed "Kterm". */
|
||||
/* #define KANJI */
|
||||
|
||||
/********************* Miscellaneous options *********************/
|
||||
|
||||
/* To have $DISPLAY and the "\E[7n" response be IP addresses rather than FQDN's */
|
||||
/* #define DISPLAY_IS_IP */
|
||||
|
||||
/* To have "\E[7n" reply with the display name. This is a potential security risk,
|
||||
* so its use is discouraged and unsupported. */
|
||||
/* #define ENABLE_DISPLAY_ANSWER */
|
||||
|
||||
/* To control what the Eterm detection sequence, ESC-Z, replies with */
|
||||
/* #define ESCZ_ANSWER "\033[?1;2C" */
|
||||
|
||||
/* Comment this out to allow printing of the VT100_ANS sequence. See
|
||||
* command.c. I have no idea what this is supposed to do, but disabling
|
||||
* it will prevent your terminal from getting garbage when ^E (ctrl-E)
|
||||
* is printed on it.
|
||||
*/
|
||||
#define NO_VT100_ANS
|
||||
|
||||
/* Checks the current value of the window title and icon name before setting them.
|
||||
Can save unnecessary screen refreshes */
|
||||
#define SMART_WINDOW_TITLE
|
||||
|
||||
/* Allow changing of the foreground and background colors with "\E]39;color^G" */
|
||||
/* #define XTERM_COLOR_CHANGE */
|
||||
|
||||
/* Exports TERM=xterm-color instead of just TERM=xterm */
|
||||
/* #define DEFINE_XTERM_COLOR */
|
||||
|
||||
/* Disable automatic de-iconify on bell altogether */
|
||||
/* #define NO_MAPALERT */
|
||||
|
||||
/* Make it an option */
|
||||
#define MAPALERT_OPTION
|
||||
|
||||
/* Enable core dumps from Eterm. Not recommended for use by anyone but developers. */
|
||||
/* #define ENABLE_CORE_DUMPS */
|
||||
|
||||
/********************* utmp logging support *********************/
|
||||
|
||||
/* Enable utmp support. This has been tested and verified to work on Linux,
|
||||
* FreeBSD, and HP-UX. Other operatings systems should work, but we have
|
||||
* not been able to verify for sure that they do. Eterm *must* be setuid
|
||||
* or setgid, usually setuid root, for this to work. Do it at your own risk.
|
||||
*/
|
||||
#define UTMP_SUPPORT
|
||||
|
||||
/* Added security for systems with saved uids and gids. If you don't define
|
||||
* this, and you're not on HP-UX with _HPUX_SOURCE defined, Eterm processes
|
||||
* may seem to be owned by root. But if you define this and don't have them,
|
||||
* the utmp and tty stuff could break. Do some testing. DO NOT get this one
|
||||
* wrong! */
|
||||
/* #define HAVE_SAVED_UIDS */
|
||||
|
||||
/* Use getgrnam() to determine the group id of TTY_GRP_NAME, and chgrp tty
|
||||
* device files to that group. This should be ok on SVR4 and Linux systems
|
||||
* with group "tty" and on BSD systems with group "wheel"
|
||||
*/
|
||||
#define USE_GETGRNAME
|
||||
#define TTY_GRP_NAME "tty"
|
||||
|
||||
/********************* Config file parser options *********************/
|
||||
|
||||
/* Allow evaluation of expressions like `echo hello` in config files. The
|
||||
* security-paranoid will not want to define this, but I have replaced the
|
||||
* OS system() call with a secure one that I have tested and verified, so
|
||||
* child processes run in this way will not run with any privileges, active
|
||||
* or attainable.
|
||||
*/
|
||||
#define ALLOW_BACKQUOTE_EXEC
|
||||
|
||||
/* This is the initial path that Eterm searches for its config file.
|
||||
* By convention, this should be ".", then "~/.Eterm", then a global
|
||||
* directory for all users like "/usr/local/lib/Eterm" */
|
||||
#define CONFIG_SEARCH_PATH "~/.Eterm/themes:~/.Eterm:@DATADIR@/Eterm/themes:@DATADIR@/Eterm"
|
||||
|
||||
/* The name of the config file. "MAIN" by default. Don't change this
|
||||
unless you have a darn good reason to. It's never been tested any other way. */
|
||||
#define CONFIG_FILE_NAME "MAIN"
|
||||
|
||||
/* This causes Eterm to warn you if a config file it's about to parse was
|
||||
* designed for an older version of Eterm. */
|
||||
/* #define WARN_OLDER */
|
||||
|
||||
/********************* Anti-cl00bie protection (sigh) *********************/
|
||||
/* EDITING THIS FILE BELOW THIS LINE IS UNSUPPORTED! YOU HAVE BEEN WARNED! */
|
||||
|
||||
#ifdef KANJI
|
||||
# undef GREEK_SUPPORT
|
||||
# undef XTERM_FONT_CHANGE
|
||||
# undef DEFINE_XTERM_COLOR
|
||||
# define KFONT0 "k14"
|
||||
# define KFONT1 "jiskan16"
|
||||
# define KFONT2 "jiskan18"
|
||||
# define KFONT3 "jiskan24"
|
||||
# define KFONT4 "jiskan26"
|
||||
/* sizes matched to kanji fonts */
|
||||
# define FONT0 "7x14"
|
||||
# define FONT1 "8x16"
|
||||
# define FONT2 "9x18"
|
||||
# define FONT3 "12x24"
|
||||
# define FONT4 "13x26"
|
||||
#else /* KANJI */
|
||||
# define FONT0 "7x14"
|
||||
# define FONT1 "6x10"
|
||||
# define FONT2 "6x13"
|
||||
# define FONT3 "8x13"
|
||||
# define FONT4 "9x15"
|
||||
#endif /* KANJI */
|
||||
#define FONT0_IDX 2
|
||||
|
||||
#ifndef PIXMAP_SUPPORT
|
||||
# undef USE_IMLIB
|
||||
# undef OLD_IMLIB
|
||||
# undef PIXMAP_SCROLLBAR
|
||||
# undef PIXMAP_MENUBAR
|
||||
# undef BACKING_STORE
|
||||
# undef PIXMAP_OFFSET
|
||||
# undef IMLIB_TRANS
|
||||
# undef PIXMAP_BUFFERING
|
||||
# undef BACKGROUND_CYCLING_SUPPORT
|
||||
# undef WATCH_PIXMAP_OPTION
|
||||
#endif
|
||||
|
||||
#ifndef PIXMAP_OFFSET
|
||||
# undef WATCH_DESKTOP_OPTION
|
||||
#endif
|
||||
|
||||
#if defined(XTERM_SCROLLBAR) && !defined(NO_MENUBAR)
|
||||
# define NO_MENUBAR
|
||||
#endif
|
||||
|
||||
#ifndef TTY_GRP_NAME
|
||||
# undef USE_GETGRNAME
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_MEMMOVE
|
||||
inline void *memmove(void *, const void *, size_t);
|
||||
#endif
|
||||
|
||||
#define APL_NAME "Eterm" /* The name of our beloved program */
|
||||
|
||||
/* COLORTERM, TERM environment variables */
|
||||
#ifdef KANJI
|
||||
# define TERMENV "kterm"
|
||||
# define COLORTERMENV "Kterm"
|
||||
#else
|
||||
# define TERMENV "xterm"
|
||||
# define COLORTERMENV "Eterm"
|
||||
#endif
|
||||
|
||||
#ifdef NO_MOUSE_REPORT
|
||||
# ifndef NO_MOUSE_REPORT_SCROLLBAR
|
||||
# define NO_MOUSE_REPORT_SCROLLBAR
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef DEFAULT_BORDER_WIDTH
|
||||
# define DEFAULT_BORDER_WIDTH 5
|
||||
#endif
|
||||
|
||||
#ifndef SB_WIDTH
|
||||
# define SB_WIDTH 10
|
||||
#endif
|
||||
|
||||
#ifndef KEEP_SCROLLCOLOR
|
||||
# undef CHANGE_SCROLLCOLOR_ON_FOCUS
|
||||
#endif
|
||||
|
||||
#ifndef MENUBAR_MAX
|
||||
# define MENUBAR_MAX 0
|
||||
#endif
|
||||
|
||||
#ifndef SAVELINES
|
||||
# define SAVELINES 256
|
||||
#endif
|
||||
|
||||
#ifdef NO_SECONDARY_SCREEN
|
||||
# define NSCREENS 0
|
||||
#else
|
||||
# define NSCREENS 1
|
||||
#endif
|
||||
|
||||
#ifndef CUTCHARS
|
||||
# define CUTCHARS "\"&'()*,;<=>?@[\\]^`{|}~"
|
||||
#endif
|
||||
|
||||
#if defined (__sun__) || defined (__svr4__)
|
||||
# define NO_DELETE_KEY /* These systems seem to be anal this way*/
|
||||
#endif
|
||||
|
||||
/* utmp doesn't work on CygWin32 */
|
||||
#ifdef __CYGWIN32__
|
||||
# undef UTMP_SUPPORT
|
||||
#endif
|
||||
|
||||
#endif /* _FEATURE_H_ */
|
|
@ -10,7 +10,8 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "main.h"
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
|
@ -20,6 +21,7 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include "command.h" /* for tt_printf() */
|
||||
#include "debug.h"
|
||||
#include "graphics.h"
|
||||
#include "main.h"
|
||||
#include "screen.h"
|
||||
|
||||
/* commands:
|
||||
|
@ -448,11 +450,6 @@ Gr_scroll(int count)
|
|||
for (grwin = gr_root; grwin != NULL; grwin = next) {
|
||||
next = grwin->next;
|
||||
grwin->y -= (count * TermWin.fheight);
|
||||
# ifdef USE_ACTIVE_TAGS
|
||||
fprintf(stderr, "FUCK YOU!\n");
|
||||
if (grwin == TermWin.vt)
|
||||
tag_hide();
|
||||
# endif
|
||||
if ((grwin->y + grwin->h) < -(TermWin.saveLines * TermWin.fheight))
|
||||
Gr_DestroyWindow(grwin);
|
||||
else
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
#include "grkelot.h"
|
||||
|
||||
#ifdef GREEK_SUPPORT
|
||||
# include "grkelot.h"
|
||||
|
@ -320,7 +320,6 @@ kstate_cxlat(unsigned int c)
|
|||
return (c);
|
||||
}
|
||||
|
||||
# ifdef RXVT
|
||||
void
|
||||
greek_init(void)
|
||||
{
|
||||
|
@ -384,6 +383,5 @@ main(void)
|
|||
return 0;
|
||||
}
|
||||
# endif
|
||||
# endif /* RXVT */
|
||||
|
||||
#endif /* GREEK_SUPPORT */
|
||||
|
|
316
src/main.c
316
src/main.c
|
@ -1,7 +1,7 @@
|
|||
/* main.c -- Eterm main() function
|
||||
* -- 22 August 1998, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com> and
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
|
@ -26,15 +26,12 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
/* includes */
|
||||
#include "main.h"
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
# include "activetags.h"
|
||||
# include "activeeterm.h"
|
||||
#endif
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
@ -46,30 +43,26 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include <X11/Xatom.h>
|
||||
#include <X11/Xos.h>
|
||||
|
||||
#include "command.h"
|
||||
#include "feature.h"
|
||||
#include "../libmej/debug.h" /* from libmej */
|
||||
#include "debug.h"
|
||||
#include "../libmej/mem.h"
|
||||
#include "../libmej/strings.h"
|
||||
/* For strsep(). -vendu */
|
||||
#if defined(linux)
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include "string.h"
|
||||
#include "main.h"
|
||||
#include "actions.h"
|
||||
#include "command.h"
|
||||
#include "eterm_utmp.h"
|
||||
#include "events.h"
|
||||
#include "graphics.h"
|
||||
#include "scrollbar.h"
|
||||
#include "menubar.h"
|
||||
#include "screen.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
#include "screen.h"
|
||||
#include "scrollbar.h"
|
||||
#include "term.h"
|
||||
#ifdef USE_POSIX_THREADS
|
||||
# include "threads.h"
|
||||
#endif
|
||||
#include "windows.h"
|
||||
|
||||
/* Global attributes */
|
||||
XWindowAttributes attr;
|
||||
XSetWindowAttributes Attributes;
|
||||
char *orig_argv0;
|
||||
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
|
@ -77,204 +70,32 @@ char *orig_argv0;
|
|||
that doesn't send the right events (*cough*
|
||||
Window Maker *cough*) -- mej */
|
||||
short bg_needs_update = 1;
|
||||
|
||||
#endif
|
||||
|
||||
/* extern functions referenced */
|
||||
#ifdef DISPLAY_IS_IP
|
||||
extern char *network_display(const char *display);
|
||||
|
||||
#endif
|
||||
|
||||
extern void get_initial_options(int, char **);
|
||||
extern void menubar_read(const char *filename);
|
||||
|
||||
#ifdef USE_POSIX_THREADS
|
||||
static void **retval;
|
||||
static int join_value;
|
||||
static pthread_t main_loop_thr;
|
||||
static pthread_attr_t main_loop_attr;
|
||||
|
||||
# ifdef MUTEX_SYNCH
|
||||
pthread_mutex_t mutex;
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
extern void render_pixmap(Window win, imlib_t image, pixmap_t pmap,
|
||||
int which, renderop_t renderop);
|
||||
|
||||
# ifdef BACKING_STORE
|
||||
extern const char *rs_saveUnder;
|
||||
|
||||
# endif
|
||||
|
||||
extern char *rs_noCursor;
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
extern ImlibData *imlib_id;
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* extern variables referenced */
|
||||
extern int my_ruid, my_rgid, my_euid, my_egid;
|
||||
extern unsigned int rs_shadePct;
|
||||
extern unsigned long rs_tintMask;
|
||||
|
||||
/* extern variables declared here */
|
||||
TermWin_t TermWin;
|
||||
Display *Xdisplay; /* display */
|
||||
|
||||
char *rs_color[NRS_COLORS];
|
||||
Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
|
||||
|
||||
unsigned long Options = (Opt_scrollBar);
|
||||
Colormap cmap;
|
||||
unsigned int debug_level = 0; /* Level of debugging information to display */
|
||||
|
||||
const char *display_name = NULL;
|
||||
char *rs_name = NULL; /* client instance (resource name) */
|
||||
|
||||
#ifndef NO_BOLDFONT
|
||||
const char *rs_boldFont = NULL;
|
||||
|
||||
#endif
|
||||
const char *rs_font[NFONTS];
|
||||
|
||||
#ifdef KANJI
|
||||
const char *rs_kfont[NFONTS];
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef PRINTPIPE
|
||||
char *rs_print_pipe = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
char *rs_cutchars = NULL;
|
||||
|
||||
/* local variables */
|
||||
Cursor TermWin_cursor; /* cursor for vt window */
|
||||
unsigned int colorfgbg;
|
||||
menuBar_t menuBar;
|
||||
|
||||
XSizeHints szHint =
|
||||
{
|
||||
PMinSize | PResizeInc | PBaseSize | PWinGravity,
|
||||
0, 0, 80, 24, /* x, y, width, height */
|
||||
1, 1, /* Min width, height */
|
||||
0, 0, /* Max width, height - unused */
|
||||
1, 1, /* increments: width, height */
|
||||
{1, 1}, /* increments: x, y */
|
||||
{0, 0}, /* Aspect ratio - unused */
|
||||
0, 0, /* base size: width, height */
|
||||
NorthWestGravity /* gravity */
|
||||
};
|
||||
|
||||
char *def_colorName[] =
|
||||
{
|
||||
"rgb:0/0/0", "rgb:ff/ff/ff", /* 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 */
|
||||
#ifdef KEEP_SCROLLCOLOR
|
||||
,"rgb:b2/b2/b2" /* scrollColor: match Netscape color */
|
||||
# ifdef CHANGE_SCROLLCOLOR_ON_FOCUS
|
||||
,NULL /* unfocusedscrollColor: somebody chose black? */
|
||||
# endif
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef KANJI
|
||||
/* Kanji font names, roman fonts sized to match */
|
||||
const char *def_kfontName[] =
|
||||
{
|
||||
KFONT0, KFONT1, KFONT2, KFONT3, KFONT4
|
||||
};
|
||||
|
||||
#endif /* KANJI */
|
||||
const char *def_fontName[] =
|
||||
{
|
||||
FONT0, FONT1, FONT2, FONT3, FONT4
|
||||
};
|
||||
|
||||
/* extern functions referenced */
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
/* the originally loaded pixmap and its scaling */
|
||||
extern pixmap_t bgPixmap;
|
||||
extern void set_bgPixmap(const char * /* file */ );
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
extern imlib_t imlib_bg;
|
||||
|
||||
# endif
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
extern pixmap_t sbPixmap;
|
||||
extern pixmap_t upPixmap, up_clkPixmap;
|
||||
extern pixmap_t dnPixmap, dn_clkPixmap;
|
||||
extern pixmap_t saPixmap, sa_clkPixmap;
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
extern imlib_t imlib_sb, imlib_sa, imlib_saclk;
|
||||
|
||||
# endif
|
||||
# endif
|
||||
# ifdef PIXMAP_MENUBAR
|
||||
extern pixmap_t mbPixmap, mb_selPixmap;
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
extern imlib_t imlib_mb, imlib_ms;
|
||||
|
||||
# endif
|
||||
# endif
|
||||
|
||||
extern int scale_pixmap(const char *geom, pixmap_t * pmap);
|
||||
|
||||
#endif /* PIXMAP_SUPPORT */
|
||||
|
||||
/* have we changed the font? Needed to avoid race conditions
|
||||
* while window resizing */
|
||||
int font_change_count = 0;
|
||||
|
||||
static void resize(void);
|
||||
|
||||
extern XErrorHandler xerror_handler(Display *, XErrorEvent *);
|
||||
extern void Create_Windows(int, char **);
|
||||
|
||||
/* main() */
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
||||
int i, count;
|
||||
int i;
|
||||
char *val;
|
||||
static char windowid_string[20], *display_string, *term_string; /* "WINDOWID=\0" = 10 chars, UINT_MAX = 10 chars */
|
||||
ImlibInitParams params;
|
||||
|
||||
orig_argv0 = argv[0];
|
||||
|
||||
|
@ -285,13 +106,14 @@ main(int argc, char *argv[])
|
|||
#endif
|
||||
|
||||
/* Security enhancements -- mej */
|
||||
putenv("IFS= \t");
|
||||
my_ruid = getuid();
|
||||
my_euid = geteuid();
|
||||
my_rgid = getgid();
|
||||
my_egid = getegid();
|
||||
privileges(REVERT);
|
||||
getcwd(initial_dir, PATH_MAX);
|
||||
|
||||
TermWin.wm_parent = None;
|
||||
init_defaults();
|
||||
|
||||
/* Open display, get options/resources and create the window */
|
||||
|
@ -308,25 +130,7 @@ main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_THEMES
|
||||
get_initial_options(argc, argv);
|
||||
#endif
|
||||
read_config();
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
if (rs_path) {
|
||||
rs_path = REALLOC(rs_path, strlen(rs_path) + strlen(initial_dir) + 2);
|
||||
strcat(rs_path, ":");
|
||||
strcat(rs_path, initial_dir);
|
||||
}
|
||||
#endif
|
||||
get_options(argc, argv);
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
tag_init();
|
||||
#endif
|
||||
D_UTMP(("Saved real uid/gid = [ %d, %d ] effective uid/gid = [ %d, %d ]\n", my_ruid, my_rgid, my_euid, my_egid));
|
||||
D_UTMP(("Now running with real uid/gid = [ %d, %d ] effective uid/gid = [ %d, %d ]\n", getuid(), getgid(), geteuid(),
|
||||
getegid()));
|
||||
|
||||
#ifdef NEED_LINUX_HACK
|
||||
privileges(INVOKE); /* xdm in new Linux versions requires ruid != root to open the display -- mej */
|
||||
#endif
|
||||
|
@ -334,12 +138,10 @@ main(int argc, char *argv[])
|
|||
#ifdef NEED_LINUX_HACK
|
||||
privileges(REVERT);
|
||||
#endif
|
||||
|
||||
if (!Xdisplay) {
|
||||
print_error("can't open display %s", display_name);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
#if DEBUG >= DEBUG_X
|
||||
if (debug_level >= DEBUG_X) {
|
||||
XSetErrorHandler((XErrorHandler) abort);
|
||||
|
@ -350,15 +152,68 @@ main(int argc, char *argv[])
|
|||
XSetErrorHandler((XErrorHandler) xerror_handler);
|
||||
#endif
|
||||
|
||||
if (Options & Opt_install) {
|
||||
cmap = XCreateColormap(Xdisplay, Xroot, Xvisual, AllocNone);
|
||||
XInstallColormap(Xdisplay, cmap);
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
params.cmap = cmap;
|
||||
params.flags = PARAMS_COLORMAP;
|
||||
#endif
|
||||
} else {
|
||||
cmap = Xcmap;
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
params.flags = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Since we always use Imlib now, let's initialize it here. */
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
if (params.flags) {
|
||||
imlib_id = Imlib_init_with_params(Xdisplay, ¶ms);
|
||||
} else {
|
||||
imlib_id = Imlib_init(Xdisplay);
|
||||
}
|
||||
if (!imlib_id) {
|
||||
fatal_error("Unable to initialize Imlib. Aborting.");
|
||||
}
|
||||
#endif
|
||||
|
||||
read_config(THEME_CFG);
|
||||
read_config((rs_config_file ? rs_config_file : USER_CFG));
|
||||
|
||||
#if defined(PIXMAP_SUPPORT)
|
||||
if (rs_path || theme_dir || user_dir) {
|
||||
register unsigned long len;
|
||||
register char *tmp;
|
||||
|
||||
len = strlen(initial_dir);
|
||||
if (rs_path) {
|
||||
len += strlen(rs_path) + 1; /* +1 for the colon */
|
||||
}
|
||||
if (theme_dir) {
|
||||
len += strlen(theme_dir) + 1;
|
||||
}
|
||||
if (user_dir) {
|
||||
len += strlen(user_dir) + 1;
|
||||
}
|
||||
tmp = MALLOC(len + 1); /* +1 here for the NUL */
|
||||
snprintf(tmp, len + 1, "%s%s%s%s%s%s%s", (rs_path ? rs_path : ""), (rs_path ? ":" : ""), initial_dir,
|
||||
(theme_dir ? ":" : ""), (theme_dir ? theme_dir : ""), (user_dir ? ":" : ""), (user_dir ? user_dir : ""));
|
||||
tmp[len] = '\0';
|
||||
FREE(rs_path);
|
||||
rs_path = tmp;
|
||||
D_OPTIONS(("New rs_path set to \"%s\"\n", rs_path));
|
||||
}
|
||||
#endif
|
||||
get_options(argc, argv);
|
||||
D_UTMP(("Saved real uid/gid = [ %d, %d ] effective uid/gid = [ %d, %d ]\n", my_ruid, my_rgid, my_euid, my_egid));
|
||||
D_UTMP(("Now running with real uid/gid = [ %d, %d ] effective uid/gid = [ %d, %d ]\n", getuid(), getgid(), geteuid(),
|
||||
getegid()));
|
||||
|
||||
post_parse();
|
||||
|
||||
#ifdef PREFER_24BIT
|
||||
Xdepth = DefaultDepth(Xdisplay, Xscreen);
|
||||
Xcmap = DefaultColormap(Xdisplay, Xscreen);
|
||||
Xvisual = DefaultVisual(Xdisplay, Xscreen);
|
||||
cmap = DefaultColormap(Xdisplay, Xscreen);
|
||||
|
||||
/*
|
||||
* If depth is not 24, look for a 24bit visual.
|
||||
|
@ -369,7 +224,7 @@ main(int argc, char *argv[])
|
|||
if (XMatchVisualInfo(Xdisplay, Xscreen, 24, TrueColor, &vinfo)) {
|
||||
Xdepth = 24;
|
||||
Xvisual = vinfo.visual;
|
||||
Xcmap = XCreateColormap(Xdisplay, RootWindow(Xdisplay, Xscreen),
|
||||
cmap = XCreateColormap(Xdisplay, RootWindow(Xdisplay, Xscreen),
|
||||
Xvisual, AllocNone);
|
||||
}
|
||||
}
|
||||
|
@ -381,13 +236,7 @@ main(int argc, char *argv[])
|
|||
|
||||
/* add scrollBar, do it directly to avoid resize() */
|
||||
scrollbar_mapping(Options & Opt_scrollBar);
|
||||
/* we can now add menuBar */
|
||||
if (delay_menu_drawing) {
|
||||
delay_menu_drawing = 0;
|
||||
menubar_mapping(1);
|
||||
} else if (rs_menubar == *false_vals) {
|
||||
menubar_mapping(0);
|
||||
}
|
||||
|
||||
#if DEBUG >= DEBUG_X
|
||||
if (debug_level >= DEBUG_X) {
|
||||
XSynchronize(Xdisplay, True);
|
||||
|
@ -420,10 +269,10 @@ main(int argc, char *argv[])
|
|||
sprintf(windowid_string, "WINDOWID=%u", (unsigned int) TermWin.parent);
|
||||
|
||||
/* add entries to the environment:
|
||||
* @ DISPLAY: in case we started with -display
|
||||
* @ WINDOWID: X window id number of the window
|
||||
* @ COLORTERM: terminal sub-name and also indicates its color
|
||||
* @ TERM: terminal name
|
||||
* DISPLAY: in case we started with -display
|
||||
* WINDOWID: X window id number of the window
|
||||
* COLORTERM: terminal sub-name and also indicates its color
|
||||
* TERM: terminal name
|
||||
*/
|
||||
putenv(display_string);
|
||||
putenv(windowid_string);
|
||||
|
@ -447,12 +296,9 @@ main(int argc, char *argv[])
|
|||
putenv("TERM=" TERMENV);
|
||||
#endif
|
||||
}
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
putenv("COLORTERM=" COLORTERMENV "-pixmap");
|
||||
#else
|
||||
putenv("COLORTERM=" COLORTERMENV);
|
||||
#endif
|
||||
}
|
||||
putenv("ETERM_VERSION=" VERSION);
|
||||
|
||||
D_CMD(("init_command()\n"));
|
||||
init_command(rs_execArgs);
|
||||
|
|
301
src/main.h
301
src/main.h
|
@ -1,90 +1,47 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: main.h
|
||||
/* main.h -- Eterm main program header file
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
/* notes: */
|
||||
/*----------------------------------------------------------------------*
|
||||
* Copyright 1992 John Bovey, University of Kent at Canterbury.
|
||||
*
|
||||
* You can do what you like with this source code as long as you don't try
|
||||
* to make money out of it and you include an unaltered copy of this
|
||||
* message (including the copyright).
|
||||
*
|
||||
* This module has been heavily modified by R. Nation
|
||||
* <nation@rocket.sanders.lockheed.com>
|
||||
* No additional restrictions are applied
|
||||
*
|
||||
* Additional modifications by mj olesen <olesen@me.QueensU.CA>
|
||||
* No additional restrictions are applied.
|
||||
*
|
||||
* As usual, the author accepts no responsibility for anything, nor does
|
||||
* he guarantee anything whatsoever.
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _MAIN_H
|
||||
# define _MAIN_H
|
||||
# include "config.h"
|
||||
# include "feature.h"
|
||||
# include <X11/Xfuncproto.h>
|
||||
# include <assert.h>
|
||||
# include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
# include <ctype.h>
|
||||
# include <stdio.h>
|
||||
|
||||
/* STDC_HEADERS
|
||||
* don't check for these using configure, since we need them regardless.
|
||||
* if you don't have them -- figure a workaround.
|
||||
*
|
||||
* Sun is often reported as not being STDC_HEADERS, but it's not true
|
||||
* for our purposes and only generates spurious bug reports.
|
||||
*/
|
||||
# include <stdarg.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include "misc.h"
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
# ifndef EXIT_SUCCESS /* missing from <stdlib.h> */
|
||||
# define EXIT_SUCCESS 0 /* exit function success */
|
||||
# define EXIT_FAILURE 1 /* exit function failure */
|
||||
# endif
|
||||
|
||||
# include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
# include "misc.h"
|
||||
|
||||
typedef struct {
|
||||
int internalBorder; /* Internal border size */
|
||||
short width, height; /* window size [pixels] */
|
||||
short fwidth, fheight; /* font width and height [pixels] */
|
||||
short fprop; /* font is proportional */
|
||||
short ncol, nrow; /* window size [characters] */
|
||||
short focus; /* window has focus */
|
||||
short saveLines; /* number of lines that fit in scrollback */
|
||||
short nscrolled; /* number of line actually scrolled */
|
||||
short view_start; /* scrollback view starts here */
|
||||
Window parent, vt; /* parent (main) and vt100 window */
|
||||
Window wm_parent, /* The parent assigned by the WM */
|
||||
wm_grandparent; /* The grandparent assigned by the WM */
|
||||
GC gc; /* GC for drawing text */
|
||||
XFontStruct * font; /* main font structure */
|
||||
# ifndef NO_BOLDFONT
|
||||
XFontStruct * boldFont; /* bold font */
|
||||
# endif
|
||||
# ifdef KANJI
|
||||
XFontStruct * kanji; /* Kanji font structure */
|
||||
# endif
|
||||
# ifdef PIXMAP_SUPPORT
|
||||
Pixmap pixmap;
|
||||
# ifdef PIXMAP_BUFFERING
|
||||
Pixmap buf_pixmap;
|
||||
# endif
|
||||
# endif
|
||||
} TermWin_t;
|
||||
|
||||
extern TermWin_t TermWin;
|
||||
extern Window root;
|
||||
extern Display * Xdisplay;
|
||||
extern char *def_colorName[];
|
||||
extern const char *def_fontName[];
|
||||
# ifdef KANJI
|
||||
extern const char *def_kfontName[];
|
||||
# endif
|
||||
# define THEME_CFG "theme.cfg"
|
||||
# define USER_CFG "user.cfg"
|
||||
|
||||
# define MAX_COLS 200
|
||||
# define MAX_ROWS 128
|
||||
|
@ -99,13 +56,9 @@ extern const char *def_kfontName[];
|
|||
# ifndef MAX
|
||||
# define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
# endif
|
||||
|
||||
# define MAX_IT(current, other) if ((other) > (current)) (current) = (other)
|
||||
# define MIN_IT(current, other) if ((other) < (current)) (current) = (other)
|
||||
# define SWAP_IT(one, two, tmp) \
|
||||
do { \
|
||||
(tmp) = (one); (one) = (two); (two) = (tmp); \
|
||||
} while (0)
|
||||
# define MAX_IT(current, other) do {if ((other) > (current)) (current) = (other);} while (0)
|
||||
# define MIN_IT(current, other) do {if ((other) < (current)) (current) = (other);} while (0)
|
||||
# define SWAP_IT(one, two, tmp) do {(tmp) = (one); (one) = (two); (two) = (tmp);} while (0)
|
||||
|
||||
/* width of scrollBar, menuBar shadow ... don't change! */
|
||||
# define SHADOW 2
|
||||
|
@ -115,7 +68,6 @@ do { \
|
|||
# define Pixel2Height(y) ((y) / TermWin.fheight)
|
||||
# define Pixel2Col(x) Pixel2Width((x) - TermWin.internalBorder)
|
||||
# define Pixel2Row(y) Pixel2Height((y) - TermWin.internalBorder)
|
||||
|
||||
# define Width2Pixel(n) ((n) * TermWin.fwidth)
|
||||
# define Height2Pixel(n) ((n) * TermWin.fheight)
|
||||
# define Col2Pixel(col) (Width2Pixel(col) + TermWin.internalBorder)
|
||||
|
@ -128,177 +80,44 @@ do { \
|
|||
# define Xcmap DefaultColormap(Xdisplay,Xscreen)
|
||||
# define Xdepth DefaultDepth(Xdisplay,Xscreen)
|
||||
# define Xroot DefaultRootWindow(Xdisplay)
|
||||
# define Xvisual DefaultVisual(Xdisplay, Xscreen)
|
||||
# ifdef DEBUG_DEPTH
|
||||
# undef Xdepth
|
||||
# define Xdepth DEBUG_DEPTH
|
||||
# endif
|
||||
|
||||
# define Opt_console (1LU << 0)
|
||||
# define Opt_loginShell (1LU << 1)
|
||||
# define Opt_iconic (1LU << 2)
|
||||
# define Opt_visualBell (1LU << 3)
|
||||
# define Opt_mapAlert (1LU << 4)
|
||||
# define Opt_reverseVideo (1LU << 5)
|
||||
# define Opt_utmpLogging (1LU << 6)
|
||||
# define Opt_scrollBar (1LU << 7)
|
||||
# define Opt_meta8 (1LU << 8)
|
||||
# define Opt_pixmapScale (1LU << 9)
|
||||
# define Opt_exec (1LU << 10)
|
||||
# define Opt_homeOnEcho (1LU << 11)
|
||||
# define Opt_homeOnRefresh (1LU << 12)
|
||||
# define Opt_scrollBar_floating (1LU << 13)
|
||||
# define Opt_scrollBar_right (1LU << 14)
|
||||
# define Opt_borderless (1LU << 15)
|
||||
# define Opt_pixmapTrans (1LU << 16)
|
||||
# define Opt_saveUnder (1LU << 17)
|
||||
# define Opt_noCursor (1LU << 18)
|
||||
# define Opt_pause (1LU << 19)
|
||||
# define Opt_watchDesktop (1LU << 20)
|
||||
# define Opt_homeOnInput (1LU << 21)
|
||||
# define Opt_menubar_move (1LU << 22)
|
||||
# define Opt_xterm_select (1LU << 23)
|
||||
# define Opt_select_whole_line (1LU << 24)
|
||||
# define Opt_viewport_mode (1LU << 25)
|
||||
# define Opt_scrollbar_popup (1LU << 26)
|
||||
# define Opt_select_trailing_spaces (1LU << 24)
|
||||
|
||||
/* place holder used for parsing command-line options */
|
||||
# define Opt_Boolean (1LU << 31)
|
||||
extern unsigned long Options;
|
||||
|
||||
extern const char *display_name;
|
||||
extern char *rs_name; /* client instance (resource name) */
|
||||
|
||||
/*
|
||||
* XTerm escape sequences: ESC ] Ps;Pt BEL
|
||||
*/
|
||||
# define XTerm_name 0
|
||||
# define XTerm_iconName 1
|
||||
# define XTerm_title 2
|
||||
# define XTerm_logfile 46 /* not implemented */
|
||||
# define XTerm_font 50
|
||||
|
||||
/*
|
||||
* rxvt/Eterm extensions of XTerm escape sequences: ESC ] Ps;Pt BEL
|
||||
*/
|
||||
# define XTerm_Takeover 5 /* Steal keyboard focus and raise window */
|
||||
# define XTerm_EtermSeq 6 /* Eterm proprietary escape sequences */
|
||||
# define XTerm_Menu 10 /* set menu item */
|
||||
# define XTerm_Pixmap 20 /* new bg pixmap */
|
||||
# define XTerm_restoreFG 39 /* change default fg color */
|
||||
# define XTerm_restoreBG 49 /* change default bg color */
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
# define restoreFG 39 /* restore default fg color */
|
||||
# define restoreBG 49 /* restore default bg color */
|
||||
|
||||
enum colour_list {
|
||||
fgColor,
|
||||
bgColor,
|
||||
minColor, /* 2 */
|
||||
BlackColor = minColor,
|
||||
Red3Color,
|
||||
Green3Color,
|
||||
Yellow3Color,
|
||||
Blue3Color,
|
||||
Magenta3Color,
|
||||
Cyan3Color,
|
||||
maxColor, /* minColor + 7 */
|
||||
# ifndef NO_BRIGHTCOLOR
|
||||
AntiqueWhiteColor = maxColor,
|
||||
minBright, /* maxColor + 1 */
|
||||
Grey25Color = minBright,
|
||||
RedColor,
|
||||
GreenColor,
|
||||
YellowColor,
|
||||
BlueColor,
|
||||
MagentaColor,
|
||||
CyanColor,
|
||||
maxBright, /* minBright + 7 */
|
||||
WhiteColor = maxBright,
|
||||
# else
|
||||
WhiteColor = maxColor,
|
||||
# endif
|
||||
# ifndef NO_CURSORCOLOR
|
||||
cursorColor,
|
||||
cursorColor2,
|
||||
# endif
|
||||
pointerColor,
|
||||
borderColor,
|
||||
# ifndef NO_BOLDUNDERLINE
|
||||
colorBD,
|
||||
colorUL,
|
||||
# endif
|
||||
menuTextColor,
|
||||
# if defined(KEEP_SCROLLCOLOR)
|
||||
scrollColor,
|
||||
# if defined(CHANGE_SCROLLCOLOR_ON_FOCUS)
|
||||
unfocusedScrollColor,
|
||||
# endif
|
||||
# endif
|
||||
NRS_COLORS, /* */
|
||||
# ifdef KEEP_SCROLLCOLOR
|
||||
topShadowColor = NRS_COLORS,
|
||||
bottomShadowColor,
|
||||
# ifdef CHANGE_SCROLLCOLOR_ON_FOCUS
|
||||
unfocusedTopShadowColor,
|
||||
unfocusedBottomShadowColor,
|
||||
# endif
|
||||
TOTAL_COLORS /* */
|
||||
# else
|
||||
TOTAL_COLORS = NRS_COLORS /* */
|
||||
# endif
|
||||
};
|
||||
|
||||
# define NSHADOWCOLORS (TOTAL_COLORS - NRS_COLORS)
|
||||
|
||||
# define DEFAULT_RSTYLE (RS_None | (fgColor<<8) | (bgColor<<16))
|
||||
|
||||
extern char * rs_color [NRS_COLORS];
|
||||
extern Pixel PixColors [NRS_COLORS + NSHADOWCOLORS];
|
||||
|
||||
# define NFONTS 5
|
||||
extern const char * rs_font [NFONTS];
|
||||
# ifdef KANJI
|
||||
extern const char * rs_kfont [NFONTS];
|
||||
# endif
|
||||
/************ Structures ************/
|
||||
typedef struct {
|
||||
int internalBorder; /* Internal border size */
|
||||
short width, height; /* window size [pixels] */
|
||||
short fwidth, fheight; /* font width and height [pixels] */
|
||||
short fprop; /* font is proportional */
|
||||
short ncol, nrow; /* window size [characters] */
|
||||
short focus; /* window has focus */
|
||||
short saveLines; /* number of lines that fit in scrollback */
|
||||
short nscrolled; /* number of line actually scrolled */
|
||||
short view_start; /* scrollback view starts here */
|
||||
Window parent, vt; /* parent (main) and vt100 window */
|
||||
GC gc; /* GC for drawing text */
|
||||
XFontStruct * font; /* main font structure */
|
||||
XFontSet fontset;
|
||||
# ifndef NO_BOLDFONT
|
||||
extern const char * rs_boldFont;
|
||||
XFontStruct * boldFont; /* bold font */
|
||||
# endif
|
||||
|
||||
# ifdef PRINTPIPE
|
||||
extern char *rs_print_pipe;
|
||||
# ifdef MULTI_CHARSET
|
||||
XFontStruct * mfont; /* multibyte font structure */
|
||||
# endif
|
||||
} TermWin_t;
|
||||
|
||||
# ifdef CUTCHAR_OPTION
|
||||
extern char * rs_cutchars;
|
||||
# endif
|
||||
|
||||
/* prototypes */
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
#ifndef GCC
|
||||
extern void map_menuBar(int);
|
||||
extern void map_scrollBar(int);
|
||||
#else
|
||||
extern inline void map_menuBar(int);
|
||||
extern inline void map_scrollBar(int);
|
||||
/************ Variables ************/
|
||||
extern TermWin_t TermWin;
|
||||
extern Window root;
|
||||
extern Display *Xdisplay;
|
||||
extern Colormap cmap;
|
||||
extern char *orig_argv0;
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
extern short bg_needs_update;
|
||||
#endif
|
||||
extern void xterm_seq(int, const char *);
|
||||
extern void change_font(int, const char *);
|
||||
extern void set_width(unsigned short);
|
||||
extern void resize_window(void);
|
||||
|
||||
/* special (internal) prefix for font commands */
|
||||
# define FONT_CMD '#'
|
||||
# define FONT_DN "#-"
|
||||
# define FONT_UP "#+"
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
Pixmap ReadFileToPixmapViaImlib(Display *, char *, int *, int *);
|
||||
# endif
|
||||
|
||||
_XFUNCPROTOEND
|
||||
extern const char *display_name;
|
||||
|
||||
#endif /* whole file */
|
||||
|
|
2567
src/menubar.c
2567
src/menubar.c
File diff suppressed because it is too large
Load Diff
126
src/menubar.h
126
src/menubar.h
|
@ -1,126 +0,0 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: menubar.h
|
||||
*
|
||||
* Copyright 1996,97
|
||||
* mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston
|
||||
*
|
||||
* You can do what you like with this source code provided you don't make
|
||||
* money from it and you include an unaltered copy of this message
|
||||
* (including the copyright). As usual, the author accepts no
|
||||
* responsibility for anything, nor does he guarantee anything whatsoever.
|
||||
*----------------------------------------------------------------------*/
|
||||
#ifndef _MENUBAR_H
|
||||
# define _MENUBAR_H
|
||||
# include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
# include <X11/Xfuncproto.h>
|
||||
|
||||
typedef struct {
|
||||
short state;
|
||||
Window win;
|
||||
} menuBar_t;
|
||||
|
||||
typedef struct {
|
||||
short type; /* must not be changed; first element */
|
||||
short len; /* strlen (str) */
|
||||
unsigned char *str; /* action to take */
|
||||
} action_t;
|
||||
|
||||
typedef struct {
|
||||
short type; /* must not be changed; first element */
|
||||
struct menu_t *menu; /* sub-menu */
|
||||
} submenu_t;
|
||||
|
||||
typedef struct menuitem_t {
|
||||
struct menuitem_t *prev; /* prev menu-item */
|
||||
struct menuitem_t *next; /* next menu-item */
|
||||
char *name; /* character string displayed */
|
||||
char *name2; /* character string displayed (right) */
|
||||
short len; /* strlen (name) */
|
||||
short len2; /* strlen (name) */
|
||||
union {
|
||||
short type; /* must not be changed; first element */
|
||||
action_t action;
|
||||
submenu_t submenu;
|
||||
} entry;
|
||||
} menuitem_t;
|
||||
|
||||
enum menuitem_t_action {
|
||||
MenuLabel,
|
||||
MenuAction,
|
||||
MenuTerminalAction,
|
||||
MenuSubMenu
|
||||
};
|
||||
|
||||
typedef struct menu_t {
|
||||
struct menu_t *parent; /* parent menu */
|
||||
struct menu_t *prev; /* prev menu */
|
||||
struct menu_t *next; /* next menu */
|
||||
menuitem_t *head; /* double-linked list */
|
||||
menuitem_t *tail; /* double-linked list */
|
||||
menuitem_t *item; /* current item */
|
||||
char *name; /* menu name */
|
||||
short len; /* strlen (name) */
|
||||
short width; /* maximum menu width [chars] */
|
||||
Window win; /* window of the menu */
|
||||
short x; /* x location [pixels] (chars if parent == NULL) */
|
||||
short y; /* y location [pixels] */
|
||||
short w, h; /* window width, height [pixels] */
|
||||
} menu_t;
|
||||
|
||||
typedef struct bar_t {
|
||||
menu_t *head, *tail; /* double-linked list of menus */
|
||||
char *title; /* title to put in the empty menuBar */
|
||||
# if (MENUBAR_MAX > 1)
|
||||
# define MAXNAME 16
|
||||
char name[MAXNAME]; /* name to use to refer to menubar */
|
||||
struct bar_t *next, *prev; /* circular linked-list */
|
||||
# endif /* (MENUBAR_MAX > 1) */
|
||||
# define NARROWS 4
|
||||
action_t arrows[NARROWS];
|
||||
} bar_t;
|
||||
|
||||
extern menuBar_t menuBar;
|
||||
extern int delay_menu_drawing;
|
||||
|
||||
# define menuBar_margin 2 /* margin below text */
|
||||
# ifdef PIXMAP_MENUBAR
|
||||
# define menubar_is_pixmapped() (0)
|
||||
# else
|
||||
# define menubar_is_pixmapped() (0)
|
||||
# endif
|
||||
/* macros */
|
||||
#define menubar_visible() (menuBar.state)
|
||||
#define menuBar_height() (TermWin.fheight + SHADOW)
|
||||
#define menuBar_TotalHeight() (menuBar_height() + SHADOW + menuBar_margin)
|
||||
#define menuBar_TotalWidth() (2 * TermWin.internalBorder + TermWin.width)
|
||||
#define isMenuBarWindow(w) ((w) == menuBar.win)
|
||||
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void
|
||||
menubar_control (XButtonEvent * /* ev */);
|
||||
|
||||
extern void
|
||||
menubar_dispatch (char * /* str */);
|
||||
|
||||
extern void
|
||||
menubar_expose (void);
|
||||
|
||||
extern int
|
||||
menubar_mapping (int /* map */);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#if !(MENUBAR_MAX)
|
||||
# define menubar_dispatch(str) ((void)0)
|
||||
# define menubar_expose() ((void)0)
|
||||
# define menubar_control(ev) ((void)0)
|
||||
# define menubar_mapping(map) (0)
|
||||
# undef menubar_visible
|
||||
# define menubar_visible() (0)
|
||||
# undef isMenuBarWindow
|
||||
# define isMenuBarWindow(w) (0)
|
||||
#endif
|
||||
|
||||
#endif /* _MENUBAR_H */
|
||||
/*----------------------- end-of-file (C header) -----------------------*/
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,134 @@
|
|||
/* menus.h -- Eterm popup menu module header file
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
#ifndef _MENUS_H
|
||||
# define _MENUS_H
|
||||
|
||||
# include <X11/Xfuncproto.h>
|
||||
# include <Imlib.h>
|
||||
# include "events.h"
|
||||
# include "pixmap.h"
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
#define MENUITEM_SEP (1UL << 0)
|
||||
#define MENUITEM_SUBMENU (1UL << 1)
|
||||
#define MENUITEM_STRING (1UL << 2)
|
||||
#define MENUITEM_ECHO (1UL << 3)
|
||||
|
||||
#define MENU_STATE_IS_MAPPED (1UL << 0)
|
||||
#define MENU_STATE_IS_CURRENT (1UL << 1)
|
||||
#define MENU_STATE_IS_DRAGGING (1UL << 2)
|
||||
#define MENU_STATE_IS_SUBMENU (1UL << 3)
|
||||
#define MENU_STATE_IS_FOCUSED (1UL << 4)
|
||||
|
||||
/* Constants */
|
||||
#define MENU_HGAP 4
|
||||
#define MENU_VGAP 4
|
||||
#define MENU_CLICK_TIME 20
|
||||
|
||||
#define menu_is_pixmapped() (images[image_menu].current->iml->im)
|
||||
|
||||
/************ Structures ************/
|
||||
typedef struct menu_t_struct menu_t;
|
||||
|
||||
typedef struct {
|
||||
image_t *icon;
|
||||
unsigned char type, state;
|
||||
union {
|
||||
menu_t *submenu;
|
||||
char *string;
|
||||
} action;
|
||||
char *text, *rtext;
|
||||
unsigned short len, rlen;
|
||||
unsigned short x, y, w, h;
|
||||
} menuitem_t;
|
||||
|
||||
struct menu_t_struct {
|
||||
char *title;
|
||||
Window win, swin;
|
||||
unsigned short x, y, w, h;
|
||||
GC gc;
|
||||
unsigned char state;
|
||||
XFontStruct *font;
|
||||
#ifdef MULTI_CHARSET
|
||||
XFontSet fontset;
|
||||
#endif
|
||||
unsigned short fwidth, fheight;
|
||||
unsigned short numitems, curitem;
|
||||
menuitem_t **items;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned char nummenus;
|
||||
menu_t **menus;
|
||||
} menulist_t;
|
||||
|
||||
/************ Variables ************/
|
||||
extern menulist_t *menu_list;
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void menu_init(void);
|
||||
extern void menu_event_init_dispatcher(void);
|
||||
extern unsigned char menu_handle_enter_notify(event_t *);
|
||||
extern unsigned char menu_handle_leave_notify(event_t *);
|
||||
extern unsigned char menu_handle_focus_in(event_t *);
|
||||
extern unsigned char menu_handle_focus_out(event_t *);
|
||||
extern unsigned char menu_handle_expose(event_t *);
|
||||
extern unsigned char menu_handle_button_press(event_t *);
|
||||
extern unsigned char menu_handle_button_release(event_t *);
|
||||
extern unsigned char menu_handle_motion_notify(event_t *);
|
||||
extern unsigned char menu_dispatch_event(event_t *);
|
||||
extern menulist_t *menulist_add_menu(menulist_t *, menu_t *);
|
||||
extern menu_t *menu_create(char *);
|
||||
extern unsigned char menu_set_font(menu_t *, const char *);
|
||||
extern unsigned char menu_add_item(menu_t *, menuitem_t *);
|
||||
extern unsigned char menu_is_child(menu_t *, menu_t *);
|
||||
extern menu_t *find_menu_by_title(menulist_t *, char *);
|
||||
extern menu_t *find_menu_by_window(menulist_t *, Window);
|
||||
extern menuitem_t *find_item_by_coords(menu_t *, int, int);
|
||||
extern unsigned short find_item_in_menu(menu_t *, menuitem_t *);
|
||||
extern void menuitem_change_current(menuitem_t *);
|
||||
extern menuitem_t *menuitem_create(char *);
|
||||
extern unsigned char menuitem_set_icon(menuitem_t *, image_t *);
|
||||
extern unsigned char menuitem_set_action(menuitem_t *, unsigned char, char *);
|
||||
extern unsigned char menuitem_set_rtext(menuitem_t *, char *);
|
||||
|
||||
extern void menu_reset(menu_t *);
|
||||
extern void menu_reset_all(menulist_t *);
|
||||
extern void menu_reset_tree(menu_t *);
|
||||
extern void menu_reset_submenus(menu_t *);
|
||||
extern void menuitem_select(menu_t *, menuitem_t *);
|
||||
extern void menuitem_deselect(menu_t *, menuitem_t *);
|
||||
extern void menu_display_submenu(menu_t *, menuitem_t *);
|
||||
extern void menu_draw(menu_t *);
|
||||
extern void menu_display(int, int, menu_t *);
|
||||
extern void menu_action(menuitem_t *);
|
||||
extern void menu_invoke(int, int, Window, menu_t *, Time);
|
||||
extern void menu_invoke_by_title(int, int, Window, char *, Time);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _MENUS_H */
|
80
src/misc.c
80
src/misc.c
|
@ -1,35 +1,48 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: misc.c
|
||||
/* misc.c -- Eterm toolkit routines
|
||||
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* miscellaneous service routines
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* Copyright 1996,97
|
||||
* mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* You can do what you like with this source code provided you don't make
|
||||
* money from it and you include an unaltered copy of this message
|
||||
* (including the copyright). As usual, the author accepts no
|
||||
* responsibility for anything, nor does he guarantee anything whatsoever.
|
||||
*----------------------------------------------------------------------*/
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "../libmej/debug.h"
|
||||
#include "debug.h"
|
||||
#include "../libmej/mem.h"
|
||||
#include "../libmej/strings.h"
|
||||
#include "command.h"
|
||||
#include "main.h"
|
||||
#include "misc.h"
|
||||
#include "debug.h"
|
||||
#include "../libmej/debug.h"
|
||||
#include "../libmej/strings.h"
|
||||
#include "mem.h"
|
||||
#include "options.h"
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
const char *
|
||||
my_basename(const char *str)
|
||||
{
|
||||
|
@ -155,8 +168,6 @@ str_trim(char *str)
|
|||
* returns the converted string length
|
||||
*/
|
||||
|
||||
#define MAKE_CTRL_CHAR(c) ((c) == '?' ? 127 : ((toupper(c)) - '@'))
|
||||
|
||||
int
|
||||
parse_escaped_string(char *str)
|
||||
{
|
||||
|
@ -164,20 +175,20 @@ parse_escaped_string(char *str)
|
|||
register char *pold, *pnew;
|
||||
unsigned char i;
|
||||
|
||||
D_MENUBAR(("parse_escaped_string(\"%s\")\n", str));
|
||||
D_STRINGS(("parse_escaped_string(\"%s\")\n", str));
|
||||
|
||||
for (pold = pnew = str; *pold; pold++, pnew++) {
|
||||
D_MENUBAR(("Looking at \"%s\"\n", pold));
|
||||
D_STRINGS(("Looking at \"%s\"\n", pold));
|
||||
if (!BEG_STRCASECMP(pold, "m-")) {
|
||||
*pold = '\\';
|
||||
*(pold + 1) = 'e';
|
||||
} else if (!BEG_STRCASECMP(pold, "c-")) {
|
||||
*(++pold) = '^';
|
||||
}
|
||||
D_MENUBAR(("Operating on \'%c\'\n", *pold));
|
||||
D_STRINGS(("Operating on \'%c\'\n", *pold));
|
||||
switch (*pold) {
|
||||
case '\\':
|
||||
D_MENUBAR(("Backslash + %c\n", *(pold + 1)));
|
||||
D_STRINGS(("Backslash + %c\n", *(pold + 1)));
|
||||
switch (tolower(*(++pold))) {
|
||||
case '0':
|
||||
case '1':
|
||||
|
@ -191,7 +202,7 @@ parse_escaped_string(char *str)
|
|||
i = (i * 8) + (*pold - '0');
|
||||
}
|
||||
pold--;
|
||||
D_MENUBAR(("Octal number evaluates to %d\n", i));
|
||||
D_STRINGS(("Octal number evaluates to %d\n", i));
|
||||
*pnew = i;
|
||||
break;
|
||||
case 'n':
|
||||
|
@ -228,7 +239,7 @@ parse_escaped_string(char *str)
|
|||
}
|
||||
break;
|
||||
case '^':
|
||||
D_MENUBAR(("Caret + %c\n", *(pold + 1)));
|
||||
D_STRINGS(("Caret + %c\n", *(pold + 1)));
|
||||
pold++;
|
||||
*pnew = MAKE_CTRL_CHAR(*pold);
|
||||
break;
|
||||
|
@ -238,17 +249,17 @@ parse_escaped_string(char *str)
|
|||
}
|
||||
|
||||
if (!BEG_STRCASECMP(str, "\033x") && *(pnew - 1) != '\r') {
|
||||
D_MENUBAR(("Adding carriage return\n"));
|
||||
D_STRINGS(("Adding carriage return\n"));
|
||||
*(pnew++) = '\r';
|
||||
} else if (!BEG_STRCASECMP(str, "\0\e]") && *(pnew - 1) != '\a') {
|
||||
D_MENUBAR(("Adding bell character\n"));
|
||||
} else if (!BEG_STRCASECMP(str, "\e]") && *(pnew - 1) != '\a') {
|
||||
D_STRINGS(("Adding bell character\n"));
|
||||
*(pnew++) = '\a';
|
||||
}
|
||||
*pnew = 0;
|
||||
|
||||
#if DEBUG >= DEBUG_MENU
|
||||
if (debug_level >= DEBUG_MENU) {
|
||||
D_MENUBAR(("New value is:\n\n"));
|
||||
#if DEBUG >= DEBUG_STRINGS
|
||||
if (debug_level >= DEBUG_STRINGS) {
|
||||
D_STRINGS(("New value is:\n\n"));
|
||||
HexDump(str, (size_t) (pnew - str));
|
||||
}
|
||||
#endif
|
||||
|
@ -262,16 +273,10 @@ find_file(const char *file, const char *ext)
|
|||
|
||||
const char *f;
|
||||
|
||||
#if defined(PIXMAP_SUPPORT) || (MENUBAR_MAX)
|
||||
#if defined(PIXMAP_SUPPORT)
|
||||
if ((f = search_path(rs_path, file, ext)) != NULL) {
|
||||
return (f);
|
||||
} else
|
||||
# ifdef PATH_ENV
|
||||
if ((f = search_path(getenv(PATH_ENV), file, ext)) != NULL) {
|
||||
return (f);
|
||||
} else
|
||||
# endif
|
||||
if ((f = search_path(getenv("PATH"), file, ext)) != NULL) {
|
||||
} else if ((f = search_path(getenv(PATH_ENV), file, ext)) != NULL) {
|
||||
return (f);
|
||||
} else {
|
||||
return (search_path(initial_dir, file, ext));
|
||||
|
@ -376,4 +381,3 @@ Draw_Triangle(Window win, GC topShadow, GC botShadow, int x, int y, int w, int t
|
|||
#endif
|
||||
}
|
||||
}
|
||||
/*----------------------- end-of-file (C source) -----------------------*/
|
||||
|
|
64
src/misc.h
64
src/misc.h
|
@ -1,37 +1,53 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: misc.h
|
||||
/* misc.h -- Eterm toolkit header file
|
||||
*
|
||||
* miscellaneous service routines
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright 1996,97
|
||||
* mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* You can do what you like with this source code provided you don't make
|
||||
* money from it and you include an unaltered copy of this message
|
||||
* (including the copyright). As usual, the author accepts no
|
||||
* responsibility for anything, nor does he guarantee anything whatsoever.
|
||||
*----------------------------------------------------------------------*/
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _MISC_H_
|
||||
#define _MISC_H_
|
||||
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
#include <X11/Xfuncproto.h>
|
||||
|
||||
/* prototypes */
|
||||
/************ Macros and Definitions ************/
|
||||
#define MAKE_CTRL_CHAR(c) ((c) == '?' ? 127 : ((toupper(c)) - '@'))
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
const char *my_basename(const char *str);
|
||||
void print_error(const char *fmt,...);
|
||||
void print_warning(const char *fmt,...);
|
||||
void fatal_error(const char *fmt,...);
|
||||
unsigned long str_leading_match(register const char *, register const char *);
|
||||
char *str_trim(char *str);
|
||||
int parse_escaped_string(char *str);
|
||||
const char *search_path(const char *pathlist, const char *file, const char *ext);
|
||||
const char *find_file(const char *file, const char *ext);
|
||||
void Draw_tl(Window win, GC gc, int x, int y, int w, int h);
|
||||
void Draw_br(Window win, GC gc, int x, int y, int w, int h);
|
||||
void Draw_Shadow(Window win, GC topShadow, GC botShadow, int x, int y, int w, int h);
|
||||
void Draw_Triangle(Window win, GC topShadow, GC botShadow, int x, int y, int w, int type);
|
||||
extern const char *my_basename(const char *str);
|
||||
extern void print_error(const char *fmt,...);
|
||||
extern void print_warning(const char *fmt,...);
|
||||
extern void fatal_error(const char *fmt,...);
|
||||
extern unsigned long str_leading_match(register const char *, register const char *);
|
||||
extern char *str_trim(char *str);
|
||||
extern int parse_escaped_string(char *str);
|
||||
extern const char *search_path(const char *pathlist, const char *file, const char *ext);
|
||||
extern const char *find_file(const char *file, const char *ext);
|
||||
extern void Draw_tl(Window win, GC gc, int x, int y, int w, int h);
|
||||
extern void Draw_br(Window win, GC gc, int x, int y, int w, int h);
|
||||
extern void Draw_Shadow(Window win, GC topShadow, GC botShadow, int x, int y, int w, int h);
|
||||
extern void Draw_Triangle(Window win, GC topShadow, GC botShadow, int x, int y, int w, int type);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: netdisp.c
|
||||
*/
|
||||
/*{{{ notes: */
|
||||
/*----------------------------------------------------------------------*
|
||||
* support for resolving the actual IP number of the host for remote
|
||||
* DISPLAYs. When the display is local (i.e. :0), we add support for
|
||||
|
@ -26,17 +22,7 @@ static const char cvs_ident[] = "$Id$";
|
|||
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
#include "main.h"
|
||||
|
||||
/* Put in a dummy routine if this is disabled, inline it if possible */
|
||||
#ifndef DISPLAY_IS_IP
|
||||
inline const char *
|
||||
network_display(const char *display)
|
||||
{
|
||||
return (display);
|
||||
}
|
||||
#else
|
||||
/*{{{ includes */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -48,19 +34,14 @@ network_display(const char *display)
|
|||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* On Solaris link with -lsocket and -lnsl */
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
/* these next two are probably only on Sun (not Solaris) */
|
||||
#ifdef HAVE_SYS_SOCKIO_H
|
||||
# include <sys/sockio.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_BYTEORDER_H
|
||||
# include <sys/byteorder.h>
|
||||
#endif
|
||||
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
|
@ -71,17 +52,24 @@ network_display(const char *display)
|
|||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_IOCTL_H
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
|
||||
/* Put in a dummy routine if this is disabled, inline it if possible */
|
||||
#ifndef DISPLAY_IS_IP
|
||||
inline const char *
|
||||
network_display(const char *display)
|
||||
{
|
||||
return (display);
|
||||
}
|
||||
#else
|
||||
/* return a pointer to a static buffer */
|
||||
char *
|
||||
network_display(const char *display)
|
||||
|
|
2295
src/options.c
2295
src/options.c
File diff suppressed because it is too large
Load Diff
242
src/options.h
242
src/options.h
|
@ -1,7 +1,7 @@
|
|||
/* options.h -- Eterm options module header file
|
||||
* -- 25 July 1997, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@tcserv.com> and
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
|
@ -26,15 +26,187 @@
|
|||
|
||||
#ifndef _OPTIONS_H_
|
||||
#define _OPTIONS_H_
|
||||
/* includes */
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
#include "feature.h"
|
||||
|
||||
/* prototypes */
|
||||
unsigned long NumWords(const char *str);
|
||||
/************ Macros and Definitions ************/
|
||||
#define OPT_BOOLEAN 0x0001
|
||||
#define OPT_INTEGER 0x0002
|
||||
#define OPT_STRING 0x0004
|
||||
#define OPT_ARGUMENT 0x0008
|
||||
|
||||
/* extern variables */
|
||||
#define OPT_STR(s, l, d, p) { s, l, "(str) " d, OPT_STRING, (const char **) p, 0, 0 }
|
||||
#define OPT_INT(s, l, d, p) { s, l, "(int) " d, OPT_INTEGER, (const int *) p, 0, 0 }
|
||||
#define OPT_BOOL(s, l, d, p, v, m) { s, l, "(bool) " d, OPT_BOOLEAN, (const int *) p, v, m }
|
||||
#define OPT_LONG(l, d, p) { 0, l, "(str) " d, OPT_STRING, (const char **) p, 0, 0 }
|
||||
#define OPT_ARGS(s, l, d, p) { s, l, "(str) " d, OPT_ARGUMENT, (const char ***) p, 0, 0 }
|
||||
#define OPT_BLONG(l, d, p, v, m) { 0, l, "(bool) " d, OPT_BOOLEAN, (const int *) p, v, m }
|
||||
#define OPT_ILONG(l, d, p) { 0, l, "(int) " d, OPT_INTEGER, (const int *) p, 0, 0 }
|
||||
#define optList_numoptions() (sizeof(optList)/sizeof(optList[0]))
|
||||
|
||||
#if PATH_MAX < 1024
|
||||
# undef PATH_MAX
|
||||
# define PATH_MAX 1024
|
||||
#endif
|
||||
|
||||
# define Opt_console (1LU << 0)
|
||||
# define Opt_loginShell (1LU << 1)
|
||||
# define Opt_iconic (1LU << 2)
|
||||
# define Opt_visualBell (1LU << 3)
|
||||
# define Opt_mapAlert (1LU << 4)
|
||||
# define Opt_reverseVideo (1LU << 5)
|
||||
# define Opt_utmpLogging (1LU << 6)
|
||||
# define Opt_scrollBar (1LU << 7)
|
||||
# define Opt_meta8 (1LU << 8)
|
||||
# define Opt_pixmapScale (1LU << 9)
|
||||
# define Opt_exec (1LU << 10)
|
||||
# define Opt_homeOnEcho (1LU << 11)
|
||||
# define Opt_homeOnRefresh (1LU << 12)
|
||||
# define Opt_scrollBar_floating (1LU << 13)
|
||||
# define Opt_scrollBar_right (1LU << 14)
|
||||
# define Opt_borderless (1LU << 15)
|
||||
# define Opt_pixmapTrans (1LU << 16)
|
||||
# define Opt_saveUnder (1LU << 17)
|
||||
# define Opt_noCursor (1LU << 18)
|
||||
# define Opt_pause (1LU << 19)
|
||||
# define Opt_homeOnInput (1LU << 20)
|
||||
# define Opt_report_as_keysyms (1LU << 21)
|
||||
# define Opt_xterm_select (1LU << 22)
|
||||
# define Opt_select_whole_line (1LU << 23)
|
||||
# define Opt_viewport_mode (1LU << 24)
|
||||
# define Opt_scrollbar_popup (1LU << 25)
|
||||
# define Opt_select_trailing_spaces (1LU << 26)
|
||||
# define Opt_install (1LU << 27)
|
||||
|
||||
#define BOOL_OPT_ISTRUE(s) (!strcasecmp((s), true_vals[0]) || !strcasecmp((s), true_vals[1]) \
|
||||
|| !strcasecmp((s), true_vals[2]) || !strcasecmp((s), true_vals[3]))
|
||||
#define BOOL_OPT_ISFALSE(s) (!strcasecmp((s), false_vals[0]) || !strcasecmp((s), false_vals[1]) \
|
||||
|| !strcasecmp((s), false_vals[2]) || !strcasecmp((s), false_vals[3]))
|
||||
|
||||
/* This defines how many mistakes to allow before giving up
|
||||
and printing the usage -- mej */
|
||||
#define BAD_THRESHOLD 3
|
||||
#define CHECK_BAD() do { \
|
||||
if (++bad_opts >= BAD_THRESHOLD) { \
|
||||
print_error("error threshold exceeded, giving up"); \
|
||||
usage(); \
|
||||
} else { \
|
||||
print_error("attempting to continue, but performance may be unpredictable"); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
/* Max length of a line in the config file */
|
||||
#define CONFIG_BUFF 20480
|
||||
|
||||
/* The context identifier. This tells us what section of the config file
|
||||
we're in, for syntax checking purposes and the like. -- mej */
|
||||
|
||||
enum {
|
||||
CTX_NULL,
|
||||
CTX_MAIN,
|
||||
CTX_COLOR,
|
||||
CTX_ATTRIBUTES,
|
||||
CTX_TOGGLES,
|
||||
CTX_KEYBOARD,
|
||||
CTX_MISC,
|
||||
CTX_IMAGECLASSES,
|
||||
CTX_IMAGE,
|
||||
CTX_ACTIONS,
|
||||
CTX_MENU,
|
||||
CTX_MENUITEM,
|
||||
CTX_XIM,
|
||||
CTX_MULTI_CHARSET,
|
||||
CTX_MAX = CTX_MULTI_CHARSET,
|
||||
CTX_UNDEF
|
||||
};
|
||||
|
||||
#define ctx_name_to_id(the_id, n, i) do { \
|
||||
for ((i)=0; (i) <= CTX_MAX; (i)++) { \
|
||||
if (!strcasecmp((n), contexts[(i)].description)) { \
|
||||
(the_id) = contexts[(i)].id; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
if ((i) > CTX_MAX) (the_id) = CTX_UNDEF; \
|
||||
} while (0)
|
||||
|
||||
#define ctx_id_to_name(id) (contexts[(id)].description)
|
||||
#define ctx_id_to_func(id) (contexts[(id)].ctx_handler)
|
||||
|
||||
/* The context stack. This keeps track of the current context and each
|
||||
previous one. You MUST define MAX_CTX_DEPTH to the absolute maximum
|
||||
number of context levels deep your contexts go, or the results can be
|
||||
Very Bad. I recommend erring on the side of caution. -- mej */
|
||||
|
||||
#define MAX_CTX_DEPTH 10
|
||||
#define ctx_push(ctx) id_stack[++cur_ctx] = (ctx)
|
||||
#define ctx_pop() (id_stack[cur_ctx--])
|
||||
#define ctx_peek() (id_stack[cur_ctx])
|
||||
#define ctx_poke(c) (id_stack[cur_ctx] = (c))
|
||||
#define ctx_peek_last() (id_stack[(cur_ctx?cur_ctx-1:0)])
|
||||
#define ctx_get_depth() (cur_ctx)
|
||||
#define MAX_FILE_DEPTH 10
|
||||
#define FILE_SKIP_TO_END (0x01)
|
||||
#define FILE_PREPROC (0x02)
|
||||
#define file_push(fs) do { \
|
||||
cur_file++; \
|
||||
file_stack[cur_file].fp = (fs).fp; \
|
||||
file_stack[cur_file].path = (fs).path; \
|
||||
file_stack[cur_file].line = (fs).line; \
|
||||
file_stack[cur_file].flags = (fs).flags; \
|
||||
} while (0)
|
||||
|
||||
#define file_pop() (cur_file--)
|
||||
#define file_peek(fs) do { \
|
||||
(fs).fp = file_stack[cur_file].fp; \
|
||||
(fs).path = file_stack[cur_file].path; \
|
||||
(fs).line = file_stack[cur_file].line; \
|
||||
(fs).flags = file_stack[cur_file].flags; \
|
||||
} while (0)
|
||||
#define file_peek_fp() (file_stack[cur_file].fp)
|
||||
#define file_peek_path() (file_stack[cur_file].path)
|
||||
#define file_peek_outfile() (file_stack[cur_file].outfile)
|
||||
#define file_peek_line() (file_stack[cur_file].line)
|
||||
#define file_peek_skip() (file_stack[cur_file].flags & FILE_SKIP_TO_END)
|
||||
#define file_peek_preproc() (file_stack[cur_file].flags & FILE_PREPROC)
|
||||
|
||||
#define file_poke_fp(f) ((file_stack[cur_file].fp) = (f))
|
||||
#define file_poke_path(p) ((file_stack[cur_file].path) = (p))
|
||||
#define file_poke_outfile(p) ((file_stack[cur_file].outfile) = (p))
|
||||
#define file_poke_line(l) ((file_stack[cur_file].line) = (l))
|
||||
#define file_poke_skip(s) do {if (s) {file_stack[cur_file].flags |= FILE_SKIP_TO_END;} else {file_stack[cur_file].flags &= ~(FILE_SKIP_TO_END);} } while (0)
|
||||
#define file_poke_preproc(s) do {if (s) {file_stack[cur_file].flags |= FILE_PREPROC;} else {file_stack[cur_file].flags &= ~(FILE_PREPROC);} } while (0)
|
||||
|
||||
#define file_inc_line() (file_stack[cur_file].line++)
|
||||
|
||||
#define to_keysym(p,s) do { KeySym sym; \
|
||||
if (s && ((sym = XStringToKeysym(s)) != 0)) *p = sym; \
|
||||
} while (0)
|
||||
|
||||
#define RESET_AND_ASSIGN(var, val) do {if ((var) != NULL) FREE(var); (var) = (val);} while (0)
|
||||
|
||||
/************ Structures ************/
|
||||
/* The file state stack. This keeps track of the file currently being
|
||||
parsed. This allows for %include directives. -- mej */
|
||||
typedef struct file_state_struct {
|
||||
FILE *fp;
|
||||
char *path, *outfile;
|
||||
unsigned long line;
|
||||
unsigned char flags;
|
||||
} file_state;
|
||||
typedef char *(*eterm_function_ptr) (char *);
|
||||
typedef struct eterm_function_struct {
|
||||
|
||||
char *name;
|
||||
eterm_function_ptr ptr;
|
||||
int params;
|
||||
|
||||
} eterm_func;
|
||||
|
||||
/************ Variables ************/
|
||||
extern unsigned long Options;
|
||||
extern char *theme_dir, *user_dir;
|
||||
extern char **rs_execArgs; /* Args to exec (-e or --exec) */
|
||||
extern char *rs_title; /* Window title */
|
||||
extern char *rs_iconName; /* Icon name */
|
||||
|
@ -46,7 +218,7 @@ extern const char *rs_scrollBar_right;
|
|||
extern const char *rs_scrollBar_floating;
|
||||
extern const char *rs_scrollbar_popup;
|
||||
extern char *rs_viewport_mode;
|
||||
extern const char *rs_term_name;
|
||||
extern char *rs_term_name;
|
||||
extern const char *rs_menubar;
|
||||
extern const char *rs_menu;
|
||||
extern const char *rs_menubar_move;
|
||||
|
@ -59,48 +231,50 @@ extern char *rs_anim_pixmap_list;
|
|||
extern char **rs_anim_pixmaps;
|
||||
extern time_t rs_anim_delay;
|
||||
extern char *rs_path;
|
||||
|
||||
extern const char *true_vals[];
|
||||
extern const char *false_vals[];
|
||||
#define BOOL_OPT_ISTRUE(s) (!strcasecmp((s), true_vals[0]) || !strcasecmp((s), true_vals[1]) \
|
||||
|| !strcasecmp((s), true_vals[2]) || !strcasecmp((s), true_vals[3]))
|
||||
#define BOOL_OPT_ISFALSE(s) (!strcasecmp((s), false_vals[0]) || !strcasecmp((s), false_vals[1]) \
|
||||
|| !strcasecmp((s), false_vals[2]) || !strcasecmp((s), false_vals[3]))
|
||||
|
||||
extern const char *rs_saveUnder;
|
||||
extern char *rs_noCursor;
|
||||
#ifdef USE_XIM
|
||||
extern char *rs_inputMethod;
|
||||
extern char *rs_preeditType;
|
||||
#endif
|
||||
extern char *rs_name;
|
||||
extern char *rs_pixmapScale;
|
||||
extern char *rs_config_file;
|
||||
extern unsigned int rs_line_space;
|
||||
#ifndef NO_BOLDFONT
|
||||
extern const char *rs_boldFont;
|
||||
#endif
|
||||
#ifdef PRINTPIPE
|
||||
extern char *rs_print_pipe;
|
||||
#endif
|
||||
extern char *rs_cutchars;
|
||||
#ifdef CUTCHAR_OPTION
|
||||
extern char *rs_cutchars;
|
||||
#endif
|
||||
|
||||
extern const char *true_vals[];
|
||||
extern const char *false_vals[];
|
||||
#ifdef KEYSYM_ATTRIBUTE
|
||||
extern unsigned char *KeySym_map[256];
|
||||
#endif
|
||||
|
||||
#if defined (HOTKEY_CTRL) || defined (HOTKEY_META)
|
||||
extern KeySym ks_bigfont;
|
||||
extern KeySym ks_smallfont;
|
||||
#endif
|
||||
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
extern char *rs_pixmaps[];
|
||||
|
||||
#define pixmap_bg 0
|
||||
#define pixmap_sb 1
|
||||
#define pixmap_up 2
|
||||
#define pixmap_upclk 3
|
||||
#define pixmap_dn 4
|
||||
#define pixmap_dnclk 5
|
||||
#define pixmap_sa 6
|
||||
#define pixmap_saclk 7
|
||||
#define pixmap_mb 8
|
||||
#define pixmap_ms 9
|
||||
#endif /* PIXMAP_SUPPORT */
|
||||
|
||||
/* prototypes */
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
unsigned long NumWords(const char *str);
|
||||
extern void get_initial_options(int, char **);
|
||||
extern void get_options(int, char **);
|
||||
extern char *chomp(char *);
|
||||
extern void read_config(void);
|
||||
extern char *shell_expand(char *);
|
||||
extern char *find_theme(char *, char *, char *);
|
||||
extern unsigned char open_config_file(char *);
|
||||
extern void read_config(char *);
|
||||
extern void init_defaults(void);
|
||||
extern void post_parse(void);
|
||||
unsigned char save_config(char *);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
|
|
1493
src/pixmap.c
1493
src/pixmap.c
File diff suppressed because it is too large
Load Diff
223
src/pixmap.h
223
src/pixmap.h
|
@ -1,89 +1,172 @@
|
|||
/* pixmap.h for Eterm.
|
||||
* 17 Feb 1998 vendu
|
||||
/* pixmap.h -- Eterm pixmap module header file
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PIXMAP_H
|
||||
# define _PIXMAP_H
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#include <Imlib.h>
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
# include "eterm_imlib.h"
|
||||
# endif
|
||||
|
||||
typedef struct {
|
||||
short w, h, x, y;
|
||||
Pixmap pixmap;
|
||||
} pixmap_t;
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
typedef struct {
|
||||
Image *im;
|
||||
int last_w,last_h;
|
||||
} imlib_t;
|
||||
|
||||
# define background_is_pixmap() ((imlib_id != NULL) || Options & Opt_pixmapTrans)
|
||||
# define background_is_image() (imlib_bg.im != NULL)
|
||||
|
||||
# else
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
# define background_is_image() (images[image_bg].current && images[image_bg].current->iml && images[image_bg].current->iml->im)
|
||||
# define background_is_pixmap() (background_is_image() || Options & Opt_pixmapTrans)
|
||||
# define delete_simage(simg) do { \
|
||||
Imlib_free_pixmap(imlib_id, (simg)->pmap->pixmap); \
|
||||
Imlib_destroy_image(imlib_id, (simg)->iml->im); \
|
||||
(simg)->pmap->pixmap = None; (simg)->iml->im = NULL; \
|
||||
} while (0)
|
||||
# define CONVERT_SHADE(s) (0xff - (((s) * 0xff) / 100))
|
||||
# define CONVERT_TINT_RED(t) (((t) & 0xff0000) >> 16)
|
||||
# define CONVERT_TINT_GREEN(t) (((t) & 0x00ff00) >> 8)
|
||||
# define CONVERT_TINT_BLUE(t) ((t) & 0x0000ff)
|
||||
#else
|
||||
# define background_is_pixmap() ((int)0)
|
||||
# define background_is_image() ((int)0)
|
||||
# define delete_simage(simg) ((void)0)
|
||||
#endif
|
||||
#define PIXMAP_EXT NULL
|
||||
/* '[', 2*4 + 2*3 digits + 3 delimiters, ']'. -vendu */
|
||||
#define GEOM_LEN 19
|
||||
|
||||
# endif
|
||||
enum {
|
||||
image_bg,
|
||||
image_up,
|
||||
image_down,
|
||||
image_left,
|
||||
image_right,
|
||||
#ifdef PIXMAP_SCROLLBAR
|
||||
image_sb,
|
||||
image_sa,
|
||||
#endif
|
||||
#ifdef PIXMAP_MENUBAR
|
||||
image_menu,
|
||||
image_submenu,
|
||||
#endif
|
||||
image_max
|
||||
};
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
extern imlib_t imlib_bg;
|
||||
extern ImlibData *imlib_id;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
imlib_t imlib_sb, imlib_sa, imlib_saclk;
|
||||
# endif
|
||||
# endif
|
||||
pixmap_t bgPixmap;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
pixmap_t sbPixmap;
|
||||
pixmap_t upPixmap, up_clkPixmap;
|
||||
pixmap_t dnPixmap, dn_clkPixmap;
|
||||
pixmap_t saPixmap, sa_clkPixmap;
|
||||
# endif
|
||||
/* Image manipulation operations */
|
||||
#define OP_NONE 0x00
|
||||
#define OP_TILE 0x01
|
||||
#define OP_HSCALE 0x02
|
||||
#define OP_VSCALE 0x04
|
||||
#define OP_PROPSCALE 0x08
|
||||
#define OP_SCALE (OP_HSCALE | OP_VSCALE)
|
||||
|
||||
/* Image modes */
|
||||
#define MODE_IMAGE 0x00
|
||||
#define MODE_TRANS 0x01
|
||||
#define MODE_VIEWPORT 0x02
|
||||
#define MODE_AUTO 0x04
|
||||
#define MODE_MASK 0x07
|
||||
#define ALLOW_IMAGE 0x00
|
||||
#define ALLOW_TRANS 0x10
|
||||
#define ALLOW_VIEWPORT 0x20
|
||||
#define ALLOW_AUTO 0x40
|
||||
#define ALLOW_MASK 0x70
|
||||
|
||||
/* Elements of an simage to be reset */
|
||||
#define RESET_NONE (0UL)
|
||||
#define RESET_IMLIB_MOD (1UL << 0)
|
||||
#define RESET_IMLIB_RMOD (1UL << 1)
|
||||
#define RESET_IMLIB_GMOD (1UL << 2)
|
||||
#define RESET_IMLIB_BMOD (1UL << 3)
|
||||
#define RESET_ALL_TINT (RESET_IMLIB_RMOD | RESET_IMLIB_GMOD | RESET_IMLIB_BMOD)
|
||||
#define RESET_ALL_MOD (RESET_IMLIB_MOD | RESET_IMLIB_RMOD | RESET_IMLIB_GMOD | RESET_IMLIB_BMOD)
|
||||
#define RESET_IMLIB_BORDER (1UL << 4)
|
||||
#define RESET_IMLIB_IM (1UL << 5)
|
||||
#define RESET_ALL_IMLIB (RESET_ALL_MOD | RESET_IMLIB_BORDER | RESET_IMLIB_IM)
|
||||
#define RESET_PMAP_GEOM (1UL << 6)
|
||||
#define RESET_PMAP_PIXMAP (1UL << 7)
|
||||
#define RESET_PMAP_MASK (1UL << 8)
|
||||
#define RESET_ALL_PMAP (RESET_PMAP_GEOM | RESET_PMAP_PIXMAP | RESET_PMAP_MASK)
|
||||
#define RESET_ALL (RESET_ALL_IMLIB | RESET_ALL_PMAP)
|
||||
|
||||
/************ Structures ************/
|
||||
typedef struct {
|
||||
unsigned short op;
|
||||
short w, h, x, y;
|
||||
Pixmap pixmap;
|
||||
Pixmap mask;
|
||||
} pixmap_t;
|
||||
typedef struct {
|
||||
ImlibBorder *edges;
|
||||
unsigned char up;
|
||||
} bevel_t;
|
||||
typedef struct {
|
||||
ImlibImage *im;
|
||||
ImlibBorder *border, *pad;
|
||||
bevel_t *bevel;
|
||||
ImlibColorModifier *mod, *rmod, *gmod, *bmod;
|
||||
short last_w, last_h;
|
||||
} imlib_t;
|
||||
typedef struct {
|
||||
pixmap_t *pmap;
|
||||
imlib_t *iml;
|
||||
} simage_t;
|
||||
typedef struct {
|
||||
Window win;
|
||||
unsigned char mode;
|
||||
simage_t *norm, *selected, *clicked, *current;
|
||||
} image_t;
|
||||
typedef short renderop_t;
|
||||
|
||||
# ifdef PIXMAP_OFFSET
|
||||
enum { FAKE_TRANSPARENCY };
|
||||
enum { tint_none, tint_red, tint_green, tint_blue,
|
||||
tint_cyan, tint_magenta, tint_yellow };
|
||||
|
||||
# ifdef USE_IMLIB
|
||||
void render_pixmap(Window win, imlib_t image, pixmap_t pmap,
|
||||
int which, renderop_t renderop);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# ifdef USE_POSIX_THREADS
|
||||
void init_bg_pixmap_thread(void *file);
|
||||
# endif
|
||||
void set_bgPixmap(const char *file);
|
||||
void set_Pixmap(const char *file, Pixmap dest_pmap, int type);
|
||||
int scale_pixmap(const char *geom, pixmap_t *pmap);
|
||||
# ifdef USE_IMLIB
|
||||
void colormod_pixmap(imlib_t, GC, int, int);
|
||||
# endif
|
||||
|
||||
# ifdef PIXMAP_OFFSET
|
||||
# ifdef IMLIB_TRANS
|
||||
void colormod_trans(imlib_t, GC, int, int);
|
||||
# else
|
||||
void colormod_trans(Pixmap, GC, int, int);
|
||||
# endif
|
||||
Window get_desktop_window(void);
|
||||
Pixmap get_desktop_pixmap(void);
|
||||
/************ Variables ************/
|
||||
extern image_t images[image_max];
|
||||
extern ImlibData *imlib_id;
|
||||
extern Pixmap desktop_pixmap, viewport_pixmap;
|
||||
extern Window desktop_window;
|
||||
# endif
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern unsigned short parse_pixmap_ops(char *);
|
||||
extern unsigned short set_pixmap_scale(const char *, pixmap_t *);
|
||||
extern void reset_simage(simage_t *, unsigned long);
|
||||
extern void paste_simage(simage_t *, Window, unsigned short, unsigned short, unsigned short, unsigned short);
|
||||
extern void render_simage(simage_t *, Window, unsigned short, unsigned short, int, renderop_t);
|
||||
#ifdef USE_POSIX_THREADS
|
||||
extern void init_bg_pixmap_thread(void *);
|
||||
#endif
|
||||
extern const char *search_path(const char *, const char *, const char *);
|
||||
extern unsigned short load_image(const char *, short);
|
||||
extern void free_desktop_pixmap(void);
|
||||
#ifdef PIXMAP_OFFSET
|
||||
extern unsigned char need_colormod(void);
|
||||
extern void colormod_trans(Pixmap, GC, unsigned short, unsigned short);
|
||||
extern Window get_desktop_window(void);
|
||||
extern Pixmap get_desktop_pixmap(void);
|
||||
#endif
|
||||
extern void shaped_window_apply_mask(Window, Pixmap);
|
||||
extern void set_icon_pixmap(char *, XWMHints *);
|
||||
# ifdef USE_IMLIB
|
||||
extern ImlibImage *ReadImageViaImlib(Display *, const char *);
|
||||
# endif
|
||||
#ifdef USE_EFFECTS
|
||||
extern int fade_in(ImlibImage *, int);
|
||||
extern int fade_out(ImlibImage *, int);
|
||||
#endif
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _PIXMAP_H */
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
# define _PROFILE_H
|
||||
|
||||
/* included for a possible #define PROFILE */
|
||||
/* # include "feature.h" */
|
||||
# include <stdio.h>
|
||||
# include <sys/time.h>
|
||||
# include <unistd.h>
|
||||
|
|
301
src/screen.c
301
src/screen.c
|
@ -5,20 +5,13 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
/* includes */
|
||||
#include "main.h"
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
# include "activetags.h"
|
||||
# include "activeeterm.h"
|
||||
#endif
|
||||
#ifdef USE_POSIX_THREADS
|
||||
# include "threads.h"
|
||||
#endif
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
|
||||
/* includes */
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
|
@ -29,108 +22,39 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include <X11/Xatom.h>
|
||||
#include <X11/Xmd.h> /* CARD32 */
|
||||
|
||||
#include "../libmej/debug.h"
|
||||
#include "command.h"
|
||||
#include "debug.h"
|
||||
#include "main.h"
|
||||
#include "mem.h"
|
||||
#include "graphics.h"
|
||||
#include "screen.h"
|
||||
#include "options.h"
|
||||
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/Xmd.h> /* get the typedef for CARD32 */
|
||||
|
||||
#if defined(PIXMAP_SUPPORT) && defined(USE_IMLIB)
|
||||
# include "eterm_imlib.h"
|
||||
extern ImlibData *imlib_id;
|
||||
|
||||
#endif
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
# include "pixmap.h"
|
||||
#endif
|
||||
#ifdef PROFILE_SCREEN
|
||||
# include "profile.h"
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#define WRAP_CHAR (MAX_COLS + 1)
|
||||
#define PROP_SIZE 4096
|
||||
#define TABSIZE 8 /* default tab size */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* GENERAL SCREEN AND SELECTION UPDATE ROUTINES *
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
#define ZERO_SCROLLBACK do { \
|
||||
D_SCREEN(("ZERO_SCROLLBACK()\n")); \
|
||||
if (Options & Opt_homeOnEcho) TermWin.view_start = 0; \
|
||||
} while (0)
|
||||
#define REFRESH_ZERO_SCROLLBACK do { \
|
||||
D_SCREEN(("REFRESH_ZERO_SCROLLBACK()\n")); \
|
||||
if (Options & Opt_homeOnRefresh) TermWin.view_start = 0; \
|
||||
} while (0)
|
||||
#define CHECK_SELECTION do { \
|
||||
if (selection.op) selection_check(); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* CLEAR_ROWS : clear <num> rows starting from row <row>
|
||||
* CLEAR_CHARS: clear <num> chars starting from pixel position <x,y>
|
||||
* ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour
|
||||
*/
|
||||
#define drawBuffer (TermWin.vt)
|
||||
#define CLEAR_ROWS(row, num) do { \
|
||||
XClearArea(Xdisplay, drawBuffer, Col2Pixel(0), Row2Pixel(row), \
|
||||
TermWin.width, Height2Pixel(num), 0); \
|
||||
} while (0)
|
||||
#define CLEAR_CHARS(x, y, num) do { \
|
||||
D_SCREEN(("CLEAR_CHARS(%d, %d, %d)\n", x, y, num)); \
|
||||
XClearArea(Xdisplay, drawBuffer, x, y, Width2Pixel(num), Height2Pixel(1), 0); \
|
||||
} while (0)
|
||||
#define FAST_CLEAR_CHARS(x, y, num) do { \
|
||||
clear_area(Xdisplay, drawBuffer, x, y, Width2Pixel(num), Height2Pixel(1), 0); \
|
||||
} while (0)
|
||||
#define ERASE_ROWS(row, num) do { \
|
||||
XFillRectangle(Xdisplay, drawBuffer, TermWin.gc, Col2Pixel(0), Row2Pixel(row), \
|
||||
TermWin.width, Height2Pixel(num)); \
|
||||
} while (0)
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* MODULE VARIABLES *
|
||||
* ------------------------------------------------------------------------- */
|
||||
#include "term.h"
|
||||
#ifdef USE_POSIX_THREADS
|
||||
# include "threads.h"
|
||||
#endif
|
||||
|
||||
/* This tells what's actually on the screen */
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
text_t **drawn_text = NULL;
|
||||
rend_t **drawn_rend = NULL;
|
||||
extern void tag_scroll(int nlines, int row1, int row2);
|
||||
|
||||
#else
|
||||
static text_t **drawn_text = NULL;
|
||||
static rend_t **drawn_rend = NULL;
|
||||
|
||||
#endif
|
||||
|
||||
static text_t **buf_text = NULL;
|
||||
static rend_t **buf_rend = NULL;
|
||||
|
||||
static char *tabs = NULL; /* a 1 for a location with a tab-stop */
|
||||
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
screen_t screen =
|
||||
{
|
||||
NULL, NULL, 0, 0, 0, 0, 0, Screen_DefaultFlags
|
||||
};
|
||||
|
||||
#else
|
||||
static screen_t screen =
|
||||
{
|
||||
NULL, NULL, 0, 0, 0, 0, 0, Screen_DefaultFlags
|
||||
};
|
||||
|
||||
#endif
|
||||
static screen_t swap =
|
||||
{
|
||||
NULL, NULL, 0, 0, 0, 0, 0, Screen_DefaultFlags
|
||||
|
@ -159,10 +83,10 @@ static rend_t rstyle = DEFAULT_RSTYLE;
|
|||
static short rvideo = 0; /* reverse video */
|
||||
int prev_nrow = -1, prev_ncol = -1; /* moved from scr_reset() to squash seg fault in scroll_text() */
|
||||
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
static short multi_byte = 0;
|
||||
static enum {
|
||||
EUCJ, SJIS
|
||||
EUCJ, EUCKR = EUCJ, GB = EUCJ, SJIS, BIG5
|
||||
} encoding_method = EUCJ;
|
||||
static enum {
|
||||
SBYTE, WBYTE
|
||||
|
@ -185,7 +109,7 @@ blank_line(text_t * et, rend_t * er, int width, rend_t efs)
|
|||
register int i = width;
|
||||
rend_t *r = er, fs = efs;
|
||||
|
||||
memset(et, ' ', i);
|
||||
MEMSET(et, ' ', i);
|
||||
for (; i--;)
|
||||
*r++ = fs;
|
||||
}
|
||||
|
@ -404,6 +328,9 @@ scr_reset(void)
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
tabs = MALLOC(TermWin.ncol * sizeof(char));
|
||||
|
||||
for (i = 0; i < TermWin.ncol; i++)
|
||||
|
@ -462,7 +389,7 @@ scr_poweron(void)
|
|||
|
||||
last_col = TermWin.ncol - 1;
|
||||
|
||||
memset(charsets, 'B', sizeof(charsets));
|
||||
MEMSET(charsets, 'B', sizeof(charsets));
|
||||
rvideo = 0;
|
||||
scr_rendition(0, ~RS_None);
|
||||
#if NSCREENS
|
||||
|
@ -580,7 +507,7 @@ scr_change_screen(int scrn)
|
|||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/*
|
||||
* Change the colour for following text
|
||||
* Change the color for following text
|
||||
*/
|
||||
void
|
||||
scr_color(unsigned int color, unsigned int Intensity)
|
||||
|
@ -592,7 +519,7 @@ scr_color(unsigned int color, unsigned int Intensity)
|
|||
else if (color == restoreBG)
|
||||
color = bgColor;
|
||||
else {
|
||||
if (Xdepth <= 2) { /* Monochrome - ignore colour changes */
|
||||
if (Xdepth <= 2) { /* Monochrome - ignore color changes */
|
||||
switch (Intensity) {
|
||||
case RS_Bold:
|
||||
color = fgColor;
|
||||
|
@ -659,7 +586,7 @@ scr_rendition(int set, int style)
|
|||
rstyle &= ~style;
|
||||
|
||||
switch (style) {
|
||||
case ~RS_None: /* default fg/bg colours */
|
||||
case ~RS_None: /* default fg/bg colors */
|
||||
rstyle = DEFAULT_RSTYLE;
|
||||
/* FALLTHROUGH */
|
||||
case RS_RVid:
|
||||
|
@ -713,10 +640,6 @@ scroll_text(int row1, int row2, int count, int spec)
|
|||
if (count == 0 || (row1 > row2))
|
||||
return 0;
|
||||
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
tag_hide();
|
||||
#endif
|
||||
|
||||
if (selection.op) { /* move selected region too */
|
||||
selection.beg.row -= count;
|
||||
selection.end.row -= count;
|
||||
|
@ -789,9 +712,6 @@ scroll_text(int row1, int row2, int count, int spec)
|
|||
count = -count;
|
||||
}
|
||||
GR_DISPLAY(Gr_scroll(count));
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
tag_scroll(count, row1, row2);
|
||||
#endif
|
||||
#ifdef PROFILE_SCREEN
|
||||
P_SETTIMEVAL(cnt.stop);
|
||||
total_time += P_CMPTIMEVALS_USEC(cnt.start, cnt.stop);
|
||||
|
@ -852,13 +772,12 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
if (screen.text[row] == NULL) {
|
||||
make_screen_mem(screen.text, screen.rend, row);
|
||||
} /* avoid segfault -- added by Sebastien van K */
|
||||
|
||||
beg.row = screen.row;
|
||||
beg.col = screen.col;
|
||||
stp = screen.text[row];
|
||||
srp = screen.rend[row];
|
||||
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
if (lost_multi && screen.col > 0
|
||||
&& ((srp[screen.col - 1] & RS_multiMask) == RS_multi1)
|
||||
&& *str != '\n' && *str != '\r' && *str != '\t')
|
||||
|
@ -867,7 +786,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
|
||||
for (i = 0; i < len;) {
|
||||
c = str[i++];
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
if (chstat == WBYTE) {
|
||||
rstyle |= RS_multiMask; /* multibyte 2nd byte */
|
||||
chstat = SBYTE;
|
||||
|
@ -912,7 +831,7 @@ scr_add_lines(const unsigned char *str, int nlines, int len)
|
|||
screen.col = 0;
|
||||
continue;
|
||||
default:
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
rstyle &= ~RS_multiMask;
|
||||
#endif
|
||||
break;
|
||||
|
@ -1338,7 +1257,7 @@ scr_insdel_chars(int count, int insdel)
|
|||
screen.text[row][TermWin.ncol] = 0;
|
||||
break;
|
||||
}
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
if ((screen.rend[row][0] & RS_multiMask) == RS_multi2) {
|
||||
screen.rend[row][0] &= ~RS_multiMask;
|
||||
screen.text[row][0] = ' ';
|
||||
|
@ -1443,7 +1362,7 @@ void
|
|||
scr_set_tab(int mode)
|
||||
{
|
||||
if (mode < 0)
|
||||
memset(tabs, 0, TermWin.ncol * sizeof(char));
|
||||
MEMSET(tabs, 0, TermWin.ncol);
|
||||
|
||||
else if (screen.col < TermWin.ncol)
|
||||
tabs[screen.col] = (mode ? 1 : 0);
|
||||
|
@ -1541,7 +1460,7 @@ scr_charset_choose(int set)
|
|||
void
|
||||
scr_charset_set(int set, unsigned int ch)
|
||||
{
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
multi_byte = (set < 0);
|
||||
set = abs(set);
|
||||
#endif
|
||||
|
@ -1550,29 +1469,28 @@ scr_charset_set(int set, unsigned int ch)
|
|||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* JAPANESE CHARACTER SET MANIPULATION FUNCTIONS *
|
||||
* MULTIPLE-CHARACTER SET MANIPULATION FUNCTIONS *
|
||||
* ------------------------------------------------------------------------- */
|
||||
#ifdef KANJI
|
||||
static void (*kanji_decode) (unsigned char *str, int len) = eucj2jis;
|
||||
#ifdef MULTI_CHARSET
|
||||
|
||||
#endif
|
||||
static void eucj2jis(unsigned char *str, int len);
|
||||
static void sjis2jis(unsigned char *str, int len);
|
||||
static void big5dummy(unsigned char *str, int len);
|
||||
|
||||
void
|
||||
static void (*multichar_decode) (unsigned char *str, int len) = eucj2jis;
|
||||
|
||||
static void
|
||||
eucj2jis(unsigned char *str, int len)
|
||||
{
|
||||
#ifdef KANJI
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
str[i] &= 0x7F;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
void
|
||||
static void
|
||||
sjis2jis(unsigned char *str, int len)
|
||||
{
|
||||
#ifdef KANJI
|
||||
register int i;
|
||||
unsigned char *high, *low;
|
||||
|
||||
|
@ -1590,28 +1508,39 @@ sjis2jis(unsigned char *str, int len)
|
|||
*low -= 0x1F;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
big5dummy(unsigned char *str, int len)
|
||||
{
|
||||
str = NULL;
|
||||
len = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
void
|
||||
set_kanji_encoding(const char *str)
|
||||
set_multichar_encoding(const char *str)
|
||||
{
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
if (str && *str) {
|
||||
if (!strcmp(str, "sjis")) {
|
||||
encoding_method = SJIS;
|
||||
kanji_decode = sjis2jis;
|
||||
} else if (!strcmp(str, "eucj")) {
|
||||
multichar_decode = sjis2jis;
|
||||
} else if (!strcmp(str, "eucj") || !strcmp(str, "euckr")
|
||||
|| !strcmp(str, "gb")) {
|
||||
encoding_method = EUCJ;
|
||||
kanji_decode = eucj2jis;
|
||||
multichar_decode = eucj2jis;
|
||||
} else if (!strcmp(str, "big5")) {
|
||||
encoding_method = BIG5;
|
||||
multichar_decode = big5dummy;
|
||||
}
|
||||
}
|
||||
#endif /* KANJI */
|
||||
#endif /* MULTI_CHARSET */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- *
|
||||
* GRAPHICS COLOURS *
|
||||
* GRAPHICS COLORS *
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef RXVT_GRAPHICS
|
||||
|
@ -1686,20 +1615,6 @@ scr_expose(int x, int y, int width, int height)
|
|||
&(drawn_rend[i][full_beg.col]),
|
||||
full_end.col - full_beg.col + 1, DEFAULT_RSTYLE);
|
||||
|
||||
/* FIXME: If PIXMAP_BUFFERING will be implemented, I'll have to do something
|
||||
* here ;) -vendu
|
||||
*/
|
||||
|
||||
#if defined(PIXMAP_SUPPORT) && defined(PIXMAP_BUFFERING)
|
||||
/* supposedly we're exposed - so `clear' the fully exposed clear areas */
|
||||
x = Col2Pixel(full_beg.col);
|
||||
y = Row2Pixel(full_beg.row);
|
||||
width = Width2Pixel(full_end.col - full_beg.col + 1);
|
||||
height = Height2Pixel(full_end.row - full_beg.row + 1);
|
||||
XCopyArea(Xdisplay, TermWin.pixmap, drawBuffer, TermWin.gc,
|
||||
x, y, width, height, x, y);
|
||||
#endif
|
||||
|
||||
/* force an update for partially exposed characters */
|
||||
if (part_beg.row != full_beg.row) {
|
||||
r = &(drawn_rend[part_beg.row][part_beg.col]);
|
||||
|
@ -1723,7 +1638,11 @@ scr_expose(int x, int y, int width, int height)
|
|||
/*
|
||||
* Refresh the entire screen
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
inline void
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
scr_touch(void)
|
||||
{
|
||||
scr_expose(0, 0, TermWin.width, TermWin.height);
|
||||
|
@ -1760,17 +1679,8 @@ scr_page(int direction, int nlines)
|
|||
{
|
||||
int start, dirn;
|
||||
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
int retval;
|
||||
|
||||
#endif
|
||||
|
||||
D_SCREEN(("scr_page(%s, %d) view_start:%d\n", ((direction == UP) ? "UP" : "DN"), nlines, TermWin.view_start));
|
||||
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
tag_hide();
|
||||
#endif
|
||||
|
||||
dirn = (direction == UP) ? 1 : -1;
|
||||
start = TermWin.view_start;
|
||||
MAX_IT(nlines, 1);
|
||||
|
@ -1780,15 +1690,7 @@ scr_page(int direction, int nlines)
|
|||
MIN_IT(TermWin.view_start, TermWin.nscrolled);
|
||||
|
||||
GR_DISPLAY(Gr_scroll(0));
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
tag_scroll((retval = TermWin.view_start - start),
|
||||
tag_min_row(), tag_max_row());
|
||||
#endif
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
return retval;
|
||||
#else
|
||||
return (TermWin.view_start - start);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@ -1815,7 +1717,6 @@ scr_printscreen(int fullhist)
|
|||
#ifdef PRINTPIPE
|
||||
int i, r, nrows, row_offset;
|
||||
text_t *t;
|
||||
char title[256];
|
||||
FILE *fd;
|
||||
|
||||
if ((fd = popen_printer()) == NULL)
|
||||
|
@ -1956,12 +1857,13 @@ scr_refresh(int type)
|
|||
col = screen.col;
|
||||
if (screen.flags & Screen_VisibleCursor) {
|
||||
screen.rend[row][col] |= RS_Cursor;
|
||||
#ifdef KANJI
|
||||
if ((col < ncols - 1) && ((screen.rend[row][col] & RS_multiMask) == RS_multi1)
|
||||
&& ((screen.rend[row][col + 1] & RS_multiMask) == RS_multi2)) {
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = &screen.rend[row][col];
|
||||
if ((col < ncols - 1) && ((srp[0] & RS_multiMask) == RS_multi1)
|
||||
&& ((srp[1] & RS_multiMask) == RS_multi2)) {
|
||||
screen.rend[row][col + 1] |= RS_Cursor;
|
||||
} else if ((col > 0) && ((screen.rend[row][col] & RS_multiMask) == RS_multi2)
|
||||
&& ((screen.rend[row][col - 1] & RS_multiMask) == RS_multi1)) {
|
||||
} else if ((col > 0) && ((srp[0] & RS_multiMask) == RS_multi2)
|
||||
&& ((srp[-1] & RS_multiMask) == RS_multi1)) {
|
||||
screen.rend[row][col - 1] |= RS_Cursor;
|
||||
}
|
||||
#endif
|
||||
|
@ -1969,10 +1871,10 @@ scr_refresh(int type)
|
|||
focus = TermWin.focus;
|
||||
if ((i = screen.row - TermWin.view_start) >= 0) {
|
||||
drawn_rend[i][col] = RS_attrMask;
|
||||
#ifdef KANJI
|
||||
if ((col < ncols - 1) && ((screen.rend[row][col + 1] & RS_multiMask) == RS_multi2)) {
|
||||
#ifdef MULTI_CHARSET
|
||||
if ((col < ncols - 1) && ((srp[1] & RS_multiMask) == RS_multi2)) {
|
||||
drawn_rend[i][col + 1] = RS_attrMask;
|
||||
} else if ((col > 0) && ((screen.rend[row][col - 1] & RS_multiMask) == RS_multi1)) {
|
||||
} else if ((col > 0) && ((srp[-1] & RS_multiMask) == RS_multi1)) {
|
||||
drawn_rend[i][col - 1] = RS_attrMask;
|
||||
}
|
||||
#endif
|
||||
|
@ -1995,12 +1897,12 @@ scr_refresh(int type)
|
|||
rt1 = srp[col]; /* screen rendition */
|
||||
rt2 = drp[col]; /* drawn rendition */
|
||||
if ((stp[col] == dtp[col]) /* must match characters to skip */
|
||||
&&((rt1 == rt2) /* either rendition the same or */
|
||||
||((stp[col] == ' ') /* space w/ no bg change */
|
||||
&& ((rt1 == rt2) /* either rendition the same or */
|
||||
|| ((stp[col] == ' ') /* space w/ no bg change */
|
||||
&&(GET_BGATTR(rt1) == GET_BGATTR(rt2))
|
||||
&& !(rt2 & RS_Dirty))))
|
||||
#ifdef KANJI
|
||||
/* if first byte is Kanji then compare second bytes */
|
||||
&& !(rt2 & RS_Dirty)))) {
|
||||
#ifdef MULTI_CHARSET
|
||||
/* if first byte is multibyte then compare second bytes */
|
||||
if ((rt1 & RS_multiMask) != RS_multi1)
|
||||
continue;
|
||||
else if (stp[col + 1] == dtp[col + 1]) {
|
||||
|
@ -2011,6 +1913,7 @@ scr_refresh(int type)
|
|||
#else
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
lasttext = dtp[col];
|
||||
lastrend = drp[col];
|
||||
/* redraw one or more characters */
|
||||
|
@ -2027,16 +1930,16 @@ scr_refresh(int type)
|
|||
* Find out the longest string we can write out at once
|
||||
*/
|
||||
if (fprop == 0) { /* Fixed width font */
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
if (((rend & RS_multiMask) == RS_multi1) && (col < ncols - 1)
|
||||
&& ((srp[col + 1]) & RS_multiMask) == RS_multi2) {
|
||||
if (!wbyte) {
|
||||
wbyte = 1;
|
||||
XSetFont(Xdisplay, TermWin.gc, TermWin.kanji->fid);
|
||||
XSetFont(Xdisplay, TermWin.gc, TermWin.mfont->fid);
|
||||
draw_string = XDrawString16;
|
||||
draw_image_string = XDrawImageString16;
|
||||
}
|
||||
/* double stepping - we're in Kanji mode */
|
||||
/* double stepping - we're in Multibyte mode */
|
||||
for (; ++col < ncols;) {
|
||||
/* XXX: could check sanity on 2nd byte */
|
||||
dtp[col] = stp[col];
|
||||
|
@ -2052,13 +1955,12 @@ scr_refresh(int type)
|
|||
if (len == MAX_COLS)
|
||||
break;
|
||||
dtp[col] = stp[col];
|
||||
/* lastchar = drp[col]; */
|
||||
drp[col] = srp[col];
|
||||
buffer[len++] = stp[col];
|
||||
} /* for (; ++col < TermWin.ncol;) */
|
||||
}
|
||||
col--;
|
||||
if (buffer[0] & 0x80)
|
||||
kanji_decode(buffer, len);
|
||||
multichar_decode(buffer, len);
|
||||
wlen = len / 2;
|
||||
} else {
|
||||
if ((rend & RS_multiMask) == RS_multi1) {
|
||||
|
@ -2092,7 +1994,7 @@ scr_refresh(int type)
|
|||
} /* for (; ++col < TermWin.ncol - 1;) */
|
||||
col--;
|
||||
wlen = len;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -2249,7 +2151,7 @@ scr_refresh(int type)
|
|||
xpixel, ypixel - TermWin.font->ascent,
|
||||
Width2Pixel(1 + wbyte) - 1, Height2Pixel(1) - 1);
|
||||
}
|
||||
if (gcmask) { /* restore normal colours */
|
||||
if (gcmask) { /* restore normal colors */
|
||||
gcvalue.foreground = PixColors[fgColor];
|
||||
gcvalue.background = PixColors[bgColor];
|
||||
XChangeGC(Xdisplay, TermWin.gc, gcmask, &gcvalue);
|
||||
|
@ -2269,7 +2171,7 @@ scr_refresh(int type)
|
|||
col = screen.col;
|
||||
if (screen.flags & Screen_VisibleCursor) {
|
||||
screen.rend[row][col] &= ~RS_Cursor;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
/* very low overhead so don't check properly, just wipe it all out */
|
||||
if (screen.col < ncols - 1)
|
||||
screen.rend[row][col + 1] &= ~RS_Cursor;
|
||||
|
@ -2626,7 +2528,7 @@ selection_make(Time tm)
|
|||
col = 0;
|
||||
if (screen.text[row][TermWin.ncol] != WRAP_CHAR) {
|
||||
if (!(Options & Opt_select_trailing_spaces)) {
|
||||
for (; isspace(*--str););
|
||||
for (str--; *str == ' ' || *str == '\t'; str--);
|
||||
str++;
|
||||
}
|
||||
*str++ = '\n';
|
||||
|
@ -2645,6 +2547,10 @@ selection_make(Time tm)
|
|||
MIN_IT(end_col, TermWin.ncol);
|
||||
for (; col < end_col; col++)
|
||||
*str++ = *t++;
|
||||
if (!(Options & Opt_select_trailing_spaces)) {
|
||||
for (str--; *str == ' ' || *str == '\t'; str--);
|
||||
str++;
|
||||
}
|
||||
if (i)
|
||||
*str++ = '\n';
|
||||
*str = '\0';
|
||||
|
@ -2704,7 +2610,7 @@ selection_click(int clicks, int x, int y)
|
|||
#else
|
||||
# define DELIMIT_TEXT(x) (strchr(CUTCHARS, (x)) != NULL)
|
||||
#endif
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
#define DELIMIT_REND(x) (((x) & RS_multiMask) ? 1 : 0)
|
||||
#endif
|
||||
|
||||
|
@ -2715,7 +2621,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
int row_offset, w1;
|
||||
text_t *stp, *stp1, t;
|
||||
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
int w2;
|
||||
rend_t *srp, r;
|
||||
|
||||
|
@ -2758,7 +2664,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
w1 = DELIMIT_TEXT(*stp);
|
||||
if (w1 == 2)
|
||||
w1 = 0;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = &(screen.rend[beg_row + row_offset][beg_col]);
|
||||
w2 = DELIMIT_REND(*srp);
|
||||
#endif
|
||||
|
@ -2768,7 +2674,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
t = *--stp;
|
||||
if (DELIMIT_TEXT(t) != w1 || (w1 && *stp1 != t && Options & Opt_xterm_select))
|
||||
break;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
r = *--srp;
|
||||
if (DELIMIT_REND(r) != w2)
|
||||
break;
|
||||
|
@ -2778,14 +2684,14 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
if (beg_col == col && beg_col > 0) {
|
||||
if (DELIMIT_TEXT(*stp)) /* space or tab or cutchar */
|
||||
break;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = &(screen.rend[beg_row + row_offset][beg_col - 1]);
|
||||
#endif
|
||||
for (; --beg_col > 0;) {
|
||||
t = *--stp;
|
||||
if (DELIMIT_TEXT(t))
|
||||
break;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
r = *--srp;
|
||||
if (DELIMIT_REND(r) != w2)
|
||||
break;
|
||||
|
@ -2797,7 +2703,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
stp = &(screen.text[beg_row + row_offset - 1][last_col + 1]);
|
||||
if (*stp == WRAP_CHAR) {
|
||||
t = *(stp - 1);
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = &(screen.rend[beg_row + row_offset - 1][last_col + 1]);
|
||||
r = *(srp - 1);
|
||||
if (DELIMIT_TEXT(t) == w1 && (!w1 || *stp == t || !(Options & Opt_xterm_select)) && DELIMIT_REND(r) == w2) {
|
||||
|
@ -2823,7 +2729,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
stp1 = stp = &(screen.text[end_row + row_offset][end_col]);
|
||||
# endif
|
||||
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = &(screen.rend[end_row + row_offset][end_col]);
|
||||
#endif
|
||||
for (;;) {
|
||||
|
@ -2831,7 +2737,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
t = *++stp;
|
||||
if (DELIMIT_TEXT(t) != w1 || (w1 && *stp1 != t && Options & Opt_xterm_select))
|
||||
break;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
r = *++srp;
|
||||
if (DELIMIT_REND(r) != w2)
|
||||
break;
|
||||
|
@ -2841,14 +2747,14 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
if (end_col == col && end_col < last_col) {
|
||||
if (DELIMIT_TEXT(*stp)) /* space or tab or cutchar */
|
||||
break;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = &(screen.rend[end_row + row_offset][end_col + 1]);
|
||||
#endif
|
||||
for (; ++end_col < last_col;) {
|
||||
t = *++stp;
|
||||
if (DELIMIT_TEXT(t))
|
||||
break;
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
r = *++srp;
|
||||
if (DELIMIT_REND(r) != w2)
|
||||
break;
|
||||
|
@ -2860,7 +2766,7 @@ selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end)
|
|||
&& (end_row < (TermWin.nrow - 1))) {
|
||||
if (*++stp == WRAP_CHAR) {
|
||||
stp = screen.text[end_row + row_offset + 1];
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
srp = screen.rend[end_row + row_offset + 1];
|
||||
if (DELIMIT_TEXT(*stp) == w1 && (!w1 || *stp1 == *stp || !(Options & Opt_xterm_select)) && DELIMIT_REND(*srp) == w2) {
|
||||
#else
|
||||
|
@ -2934,7 +2840,7 @@ selection_extend_colrow(int col, int row, int flag, int cont)
|
|||
LEFT, RIGHT
|
||||
} closeto = RIGHT;
|
||||
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
int r;
|
||||
|
||||
#endif
|
||||
|
@ -3048,7 +2954,7 @@ selection_extend_colrow(int col, int row, int flag, int cont)
|
|||
selection.end.col = TermWin.ncol - 1;
|
||||
}
|
||||
}
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
if (selection.beg.col > 0) {
|
||||
r = selection.beg.row + TermWin.saveLines;
|
||||
if (((screen.rend[r][selection.beg.col] & RS_multiMask) == RS_multi2)
|
||||
|
@ -3292,3 +3198,12 @@ debug_colors(void)
|
|||
#endif
|
||||
fprintf(stderr, "%s\n", name[color]);
|
||||
}
|
||||
|
||||
#ifdef USE_XIM
|
||||
void xim_get_position(XPoint *pos)
|
||||
{
|
||||
pos->x = Col2Pixel(screen.col);
|
||||
pos->y = Height2Pixel(screen.row) + TermWin.font->ascent
|
||||
+ TermWin.internalBorder;
|
||||
}
|
||||
#endif
|
||||
|
|
210
src/screen.h
210
src/screen.h
|
@ -12,11 +12,49 @@
|
|||
*----------------------------------------------------------------------*/
|
||||
#ifndef _SCREEN_H
|
||||
#define _SCREEN_H
|
||||
/* includes */
|
||||
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include "main.h"
|
||||
|
||||
/* defines */
|
||||
/************ Macros and Definitions ************/
|
||||
#define WRAP_CHAR (MAX_COLS + 1)
|
||||
#define PROP_SIZE 4096
|
||||
#define TABSIZE 8 /* default tab size */
|
||||
|
||||
#define ZERO_SCROLLBACK do { \
|
||||
D_SCREEN(("ZERO_SCROLLBACK()\n")); \
|
||||
if (Options & Opt_homeOnEcho) TermWin.view_start = 0; \
|
||||
} while (0)
|
||||
#define REFRESH_ZERO_SCROLLBACK do { \
|
||||
D_SCREEN(("REFRESH_ZERO_SCROLLBACK()\n")); \
|
||||
if (Options & Opt_homeOnRefresh) TermWin.view_start = 0; \
|
||||
} while (0)
|
||||
#define CHECK_SELECTION do { \
|
||||
if (selection.op) selection_check(); \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* CLEAR_ROWS : clear <num> rows starting from row <row>
|
||||
* CLEAR_CHARS: clear <num> chars starting from pixel position <x,y>
|
||||
* ERASE_ROWS : set <num> rows starting from row <row> to the foreground color
|
||||
*/
|
||||
#define drawBuffer (TermWin.vt)
|
||||
#define CLEAR_ROWS(row, num) do { \
|
||||
XClearArea(Xdisplay, drawBuffer, Col2Pixel(0), Row2Pixel(row), \
|
||||
TermWin.width, Height2Pixel(num), 0); \
|
||||
} while (0)
|
||||
#define CLEAR_CHARS(x, y, num) do { \
|
||||
D_SCREEN(("CLEAR_CHARS(%d, %d, %d)\n", x, y, num)); \
|
||||
XClearArea(Xdisplay, drawBuffer, x, y, Width2Pixel(num), Height2Pixel(1), 0); \
|
||||
} while (0)
|
||||
#define FAST_CLEAR_CHARS(x, y, num) do { \
|
||||
clear_area(Xdisplay, drawBuffer, x, y, Width2Pixel(num), Height2Pixel(1), 0); \
|
||||
} while (0)
|
||||
#define ERASE_ROWS(row, num) do { \
|
||||
XFillRectangle(Xdisplay, drawBuffer, TermWin.gc, Col2Pixel(0), Row2Pixel(row), \
|
||||
TermWin.width, Height2Pixel(num)); \
|
||||
} while (0)
|
||||
|
||||
/* Screen refresh methods */
|
||||
#define NO_REFRESH 0 /* Window not visible at all! */
|
||||
#define FAST_REFRESH (1<<1) /* Fully exposed window */
|
||||
|
@ -28,7 +66,6 @@
|
|||
#define RESTORE 'r'
|
||||
#define REVERT IGNORE
|
||||
#define INVOKE RESTORE
|
||||
extern void privileges(int);
|
||||
|
||||
/* flags for scr_gotorc() */
|
||||
#define C_RELATIVE 1 /* col movement is relative */
|
||||
|
@ -61,7 +98,7 @@ enum {
|
|||
#define RS_acsFont 0x10000000u /* ACS graphics character set */
|
||||
#define RS_ukFont 0x20000000u /* UK character set */
|
||||
#define RS_fontMask (RS_acsFont|RS_ukFont)
|
||||
#ifdef KANJI
|
||||
#ifdef MULTI_CHARSET
|
||||
#define RS_multi0 0x40000000u /* only multibyte characters */
|
||||
#define RS_multi1 0x80000000u /* multibyte 1st byte */
|
||||
#define RS_multi2 (RS_multi0|RS_multi1) /* multibyte 2nd byte */
|
||||
|
@ -75,7 +112,6 @@ enum {
|
|||
|
||||
#define RS_attrMask (0xFF000000u|RS_Bold|RS_Blink)
|
||||
|
||||
/* macros */
|
||||
/* how to build & extract colors and attributes */
|
||||
#define GET_FGCOLOR(r) (((r) & RS_fgMask)>>8)
|
||||
#define GET_BGCOLOR(r) (((r) & RS_bgMask)>>16)
|
||||
|
@ -87,18 +123,6 @@ enum {
|
|||
#define SET_ATTR(r,a) (((r) & ~RS_attrMask)| (a))
|
||||
#define DEFAULT_RSTYLE (RS_None | (fgColor<<8) | (bgColor<<16))
|
||||
|
||||
/* extern variables */
|
||||
#ifndef NO_BRIGHTCOLOR
|
||||
extern unsigned int colorfgbg;
|
||||
#endif
|
||||
|
||||
/* types */
|
||||
typedef unsigned char text_t;
|
||||
typedef unsigned int rend_t;
|
||||
typedef struct {
|
||||
int row, col;
|
||||
} row_col_t;
|
||||
|
||||
/* screen_t flags */
|
||||
#define Screen_Relative (1<<0) /* relative origin mode flag */
|
||||
#define Screen_VisibleCursor (1<<1) /* cursor visible? */
|
||||
|
@ -107,6 +131,12 @@ typedef struct {
|
|||
#define Screen_WrapNext (1<<4) /* need to wrap for next char? */
|
||||
#define Screen_DefaultFlags (Screen_VisibleCursor|Screen_Autowrap)
|
||||
|
||||
/************ Structures ************/
|
||||
typedef unsigned char text_t;
|
||||
typedef unsigned int rend_t;
|
||||
typedef struct {
|
||||
int row, col;
|
||||
} row_col_t;
|
||||
/*
|
||||
* screen accounting:
|
||||
* screen_t elements
|
||||
|
@ -114,7 +144,7 @@ typedef struct {
|
|||
* buffer. Each line is length (TermWin.ncol + 1)
|
||||
* The final character is either the _length_ of the line or
|
||||
* for wrapped lines: (MAX_COLS + 1)
|
||||
* rend: Contains rendition information: font, bold, colour, etc.
|
||||
* rend: Contains rendition information: font, bold, color, etc.
|
||||
* * Note: Each line for both text and rend are only allocated on demand, and
|
||||
* text[x] is allocated <=> rend[x] is allocated for all x.
|
||||
* row: Cursor row position : 0 <= row < TermWin.nrow
|
||||
|
@ -147,7 +177,6 @@ typedef struct {
|
|||
* Rows [TermWin.saveLines] ... [TermWin.saveLines + TermWin.nrow - 1]
|
||||
* normal `unscrolled' screen region
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
text_t **text; /* _all_ the text */
|
||||
rend_t **rend; /* rendition, uses RS_ flags */
|
||||
|
@ -158,7 +187,6 @@ typedef struct {
|
|||
short charset; /* character set number [0..3] */
|
||||
unsigned int flags;
|
||||
} screen_t;
|
||||
|
||||
typedef struct {
|
||||
short row, /* cursor row */
|
||||
col, /* cursor column */
|
||||
|
@ -166,7 +194,6 @@ typedef struct {
|
|||
char charset_char;
|
||||
rend_t rstyle; /* rendition style */
|
||||
} save_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned char *text; /* selected text */
|
||||
int len; /* length of selected text */
|
||||
|
@ -175,87 +202,86 @@ typedef struct {
|
|||
SELECTION_INIT, /* marked a point */
|
||||
SELECTION_BEGIN, /* started a selection */
|
||||
SELECTION_CONT, /* continued selection */
|
||||
SELECTION_DONE, /* selection put in CUT_BUFFER0 */
|
||||
SELECTION_DONE /* selection put in CUT_BUFFER0 */
|
||||
} op; /* current operation */
|
||||
short screen; /* screen being used */
|
||||
short clicks; /* number of clicks */
|
||||
row_col_t beg, mark, end;
|
||||
} selection_t;
|
||||
|
||||
#ifdef USE_ACTIVE_TAGS
|
||||
extern screen_t screen;
|
||||
/************ Variables ************/
|
||||
#ifndef NO_BRIGHTCOLOR
|
||||
extern unsigned int colorfgbg;
|
||||
#endif
|
||||
|
||||
/* prototypes: */
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
void blank_dline(text_t * et, rend_t * er, int width, rend_t efs);
|
||||
void blank_sline(text_t * et, rend_t * er, int width);
|
||||
void make_screen_mem(text_t ** tp, rend_t ** rp, int row);
|
||||
void scr_reset(void);
|
||||
void scr_release(void);
|
||||
void scr_poweron(void);
|
||||
void scr_cursor(int mode);
|
||||
int scr_change_screen(int scrn);
|
||||
void scr_color(unsigned int color, unsigned int Intensity);
|
||||
void scr_rendition(int set, int style);
|
||||
int scroll_text(int row1, int row2, int count, int spec);
|
||||
void scr_add_lines(const unsigned char *str, int nlines, int len);
|
||||
void scr_backspace(void);
|
||||
void scr_tab(int count);
|
||||
void scr_gotorc(int row, int col, int relative);
|
||||
void scr_index(int direction);
|
||||
void scr_erase_line(int mode);
|
||||
void scr_erase_screen(int mode);
|
||||
void scr_E(void);
|
||||
void scr_insdel_lines(int count, int insdel);
|
||||
void scr_insdel_chars(int count, int insdel);
|
||||
void scr_scroll_region(int top, int bot);
|
||||
void scr_cursor_visible(int mode);
|
||||
void scr_autowrap(int mode);
|
||||
void scr_relative_origin(int mode);
|
||||
void scr_insert_mode(int mode);
|
||||
void scr_set_tab(int mode);
|
||||
void scr_rvideo_mode(int mode);
|
||||
void scr_report_position(void);
|
||||
void set_font_style(void);
|
||||
void scr_charset_choose(int set);
|
||||
void scr_charset_set(int set, unsigned int ch);
|
||||
void eucj2jis(unsigned char *str, int len);
|
||||
void sjis2jis(unsigned char *str, int len);
|
||||
void set_kanji_encoding(const char *str);
|
||||
int scr_get_fgcolor(void);
|
||||
int scr_get_bgcolor(void);
|
||||
void scr_expose(int x, int y, int width, int height);
|
||||
void scr_touch(void);
|
||||
int scr_move_to(int y, int len);
|
||||
int scr_page(int direction, int nlines);
|
||||
void scr_bell(void);
|
||||
void scr_printscreen(int fullhist);
|
||||
void scr_refresh(int type);
|
||||
void selection_check(void);
|
||||
void PasteIt(unsigned char *data, unsigned int nitems);
|
||||
void selection_paste(Window win, unsigned prop, int Delete);
|
||||
void selection_request(Time tm, int x, int y);
|
||||
void selection_reset(void);
|
||||
void selection_clear(void);
|
||||
void selection_setclr(int set, int startr, int startc, int endr, int endc);
|
||||
void selection_start(int x, int y);
|
||||
void selection_start_colrow(int col, int row);
|
||||
void selection_make(Time tm);
|
||||
void selection_click(int clicks, int x, int y);
|
||||
void selection_delimit_word(int col, int row, row_col_t * beg, row_col_t * end);
|
||||
void selection_extend(int x, int y, int flag);
|
||||
void selection_extend_colrow(int col, int row, int flag, int cont);
|
||||
void selection_rotate(int x, int y);
|
||||
void selection_send(XSelectionRequestEvent * rq);
|
||||
void mouse_report(XButtonEvent * ev);
|
||||
void mouse_tracking(int report, int x, int y, int firstrow, int lastrow);
|
||||
void debug_PasteIt(unsigned char *data, int nitems);
|
||||
int debug_selection(void);
|
||||
void debug_colors(void);
|
||||
extern void blank_line(text_t *, rend_t *, int, rend_t);
|
||||
extern void blank_dline(text_t *, rend_t *, int, rend_t);
|
||||
extern void blank_sline(text_t *, rend_t *, int);
|
||||
extern void make_screen_mem(text_t **, rend_t **, int);
|
||||
extern void scr_reset(void);
|
||||
extern void scr_release(void);
|
||||
extern void scr_poweron(void);
|
||||
extern void scr_cursor(int);
|
||||
extern int scr_change_screen(int);
|
||||
extern void scr_color(unsigned int, unsigned int);
|
||||
extern void scr_rendition(int, int);
|
||||
extern int scroll_text(int, int, int, int);
|
||||
extern void scr_add_lines(const unsigned char *, int, int);
|
||||
extern void scr_backspace(void);
|
||||
extern void scr_tab(int);
|
||||
extern void scr_gotorc(int, int, int);
|
||||
extern void scr_index(int);
|
||||
extern void scr_erase_line(int);
|
||||
extern void scr_erase_screen(int);
|
||||
extern void scr_E(void);
|
||||
extern void scr_insdel_lines(int, int);
|
||||
extern void scr_insdel_chars(int, int);
|
||||
extern void scr_scroll_region(int, int);
|
||||
extern void scr_cursor_visible(int);
|
||||
extern void scr_autowrap(int);
|
||||
extern void scr_relative_origin(int);
|
||||
extern void scr_insert_mode(int);
|
||||
extern void scr_set_tab(int);
|
||||
extern void scr_rvideo_mode(int);
|
||||
extern void scr_report_position(void);
|
||||
extern void set_font_style(void);
|
||||
extern void scr_charset_choose(int);
|
||||
extern void scr_charset_set(int, unsigned int);
|
||||
extern void set_multichar_encoding(const char *);
|
||||
extern int scr_get_fgcolor(void);
|
||||
extern int scr_get_bgcolor(void);
|
||||
extern void scr_expose(int, int, int, int);
|
||||
extern void scr_touch(void);
|
||||
extern int scr_move_to(int, int);
|
||||
extern int scr_page(int, int);
|
||||
extern void scr_bell(void);
|
||||
extern void scr_printscreen(int);
|
||||
extern void scr_refresh(int);
|
||||
extern void selection_check(void);
|
||||
extern void PasteIt(unsigned char *, unsigned int);
|
||||
extern void selection_paste(Window, unsigned, int);
|
||||
extern void selection_request(Time, int, int);
|
||||
extern void selection_reset(void);
|
||||
extern void selection_clear(void);
|
||||
extern void selection_setclr(int, int, int, int, int);
|
||||
extern void selection_start(int, int);
|
||||
extern void selection_start_colrow(int, int);
|
||||
extern void selection_make(Time);
|
||||
extern void selection_click(int, int, int);
|
||||
extern void selection_delimit_word(int, int, row_col_t *, row_col_t *);
|
||||
extern void selection_extend(int, int, int);
|
||||
extern void selection_extend_colrow(int, int, int, int);
|
||||
extern void selection_rotate(int, int);
|
||||
extern void selection_send(XSelectionRequestEvent *);
|
||||
extern void mouse_report(XButtonEvent *);
|
||||
extern void mouse_tracking(int, int, int, int, int);
|
||||
extern void debug_PasteIt(unsigned char *, int);
|
||||
extern int debug_selection(void);
|
||||
extern void debug_colors(void);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* whole file */
|
||||
/*----------------------- end-of-file (C header) -----------------------*/
|
||||
#endif
|
||||
|
|
762
src/scrollbar.c
762
src/scrollbar.c
File diff suppressed because it is too large
Load Diff
193
src/scrollbar.h
193
src/scrollbar.h
|
@ -1,91 +1,160 @@
|
|||
/*--------------------------------*-C-*---------------------------------*
|
||||
* File: scrollbar.h
|
||||
/* scrollbar.h -- Eterm scrollbar module header file
|
||||
*
|
||||
* Copyright 1996,97
|
||||
* mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* You can do what you like with this source code provided you don't make
|
||||
* money from it and you include an unaltered copy of this message
|
||||
* (including the copyright). As usual, the author accepts no
|
||||
* responsibility for anything, nor does he guarantee anything whatsoever.
|
||||
*----------------------------------------------------------------------*/
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
#ifndef _SCROLLBAR_H
|
||||
# define _SCROLLBAR_H
|
||||
|
||||
# include <X11/Xfuncproto.h>
|
||||
# include <ctype.h>
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
# include "eterm_imlib.h"
|
||||
# include <Imlib.h>
|
||||
# endif
|
||||
# include "events.h"
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
/* Scrollbar types we support */
|
||||
# define SCROLLBAR_MOTIF 1
|
||||
# define SCROLLBAR_XTERM 2
|
||||
# define SCROLLBAR_NEXT 3
|
||||
|
||||
/* Scrollbar state macros */
|
||||
#define scrollbar_visible() (scrollBar.state)
|
||||
#define scrollbar_isMotion() (scrollBar.state == 'm')
|
||||
#define scrollbar_isUp() (scrollBar.state == 'U')
|
||||
#define scrollbar_isDn() (scrollBar.state == 'D')
|
||||
#define scrollbar_isUpDn() isupper (scrollBar.state)
|
||||
#define scrollbar_setNone() do { D_SCROLLBAR(("scrollbar_setNone(): Cancelling motion.\n")); scrollBar.state = 1; } while (0)
|
||||
#define scrollbar_setMotion() do { D_SCROLLBAR(("scrollbar_setMotion()\n")); scrollBar.state = 'm'; } while (0)
|
||||
#define scrollbar_setUp() do { D_SCROLLBAR(("scrollbar_setUp()\n")); scrollBar.state = 'U'; } while (0)
|
||||
#define scrollbar_setDn() do { D_SCROLLBAR(("scrollbar_setNone()\n")); scrollBar.state = 'D'; } while (0)
|
||||
|
||||
/* The various scrollbar elements */
|
||||
#ifdef PIXMAP_SCROLLBAR
|
||||
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
|
||||
# define scrollbar_win_is_uparrow(w) ((w) == scrollBar.up_win)
|
||||
# define scrollbar_win_is_downarrow(w) ((w) == scrollBar.dn_win)
|
||||
# define scrollbar_win_is_anchor(w) ((w) == scrollBar.sa_win)
|
||||
# define scrollbar_is_pixmapped() (images[image_sb].current->iml->im)
|
||||
# define scrollbar_uparrow_is_pixmapped() (images[image_up].current->iml->im)
|
||||
# define scrollbar_downarrow_is_pixmapped() (images[image_down].current->iml->im)
|
||||
# define scrollbar_anchor_is_pixmapped() (images[image_sa].current->iml->im)
|
||||
# define scrollbar_upButton(w, y) ( scrollbar_uparrow_is_pixmapped() ? scrollbar_win_is_uparrow(w) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg)))
|
||||
# define scrollbar_dnButton(w, y) ( scrollbar_downarrow_is_pixmapped() ? scrollbar_win_is_downarrow(w) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end)))
|
||||
#else
|
||||
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
|
||||
# define scrollbar_win_is_uparrow(w) (0)
|
||||
# define scrollbar_win_is_downarrow(w) (0)
|
||||
# define scrollbar_win_is_anchor(w) (0)
|
||||
# define scrollbar_is_pixmapped() (0)
|
||||
# define scrollbar_uparrow_is_pixmapped() (0)
|
||||
# define scrollbar_downarrow_is_pixmapped() (0)
|
||||
# define scrollbar_anchor_is_pixmapped() (0)
|
||||
# define scrollbar_upButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg))
|
||||
# define scrollbar_dnButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end))
|
||||
#endif
|
||||
|
||||
/* Scrollbar dimensions */
|
||||
#define scrollbar_scrollarea_height() (scrollBar.end - scrollBar.beg)
|
||||
#define scrollbar_anchor_width() (scrollBar.width)
|
||||
#define scrollbar_anchor_height() (scrollBar.bot - scrollBar.top)
|
||||
#define scrollbar_trough_width() (scrollBar.width + 2 * scrollBar.shadow)
|
||||
#define scrollbar_trough_height() (scrollBar.end + ((scrollBar.type == SCROLLBAR_NEXT) ? (2 * (scrollBar.width + 1) + scrollBar.shadow) \
|
||||
: ((scrollBar.width + 1) + scrollBar.shadow)))
|
||||
#define scrollbar_arrow_width() (scrollBar.width)
|
||||
#define scrollbar_arrow_height() (scrollBar.width)
|
||||
#define scrollbar_anchor_max_height() ((menubar_visible()) ? (TermWin.height) : (TermWin.height - ((scrollBar.width + 1) + scrollBar.shadow)))
|
||||
|
||||
/* Scrollbar positions */
|
||||
#define scrollbar_is_above_anchor(w, y) ((y) < scrollBar.top && !scrollbar_win_is_anchor(w))
|
||||
#define scrollbar_is_below_anchor(w, y) ((y) > scrollBar.bot && !scrollbar_win_is_anchor(w))
|
||||
#define scrollbar_position(y) ((y) - scrollBar.beg)
|
||||
#define scrollbar_up_loc() (scrollbar_uparrow_is_pixmapped() ? ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + 1) : (scrollBar.shadow)) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + 1) : (scrollBar.shadow)))
|
||||
#define scrollbar_dn_loc() (scrollbar_downarrow_is_pixmapped() \
|
||||
? ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + scrollBar.width + 2) : (scrollBar.end + 1)) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + scrollBar.width + 2) : (scrollBar.end + 1)))
|
||||
|
||||
/* Scrollbar operations */
|
||||
#define map_scrollbar(show) do {if (scrollbar_mapping(show)) {scr_touch(); resize();} PrivMode(show, PrivMode_scrollBar); } while (0)
|
||||
#define scrollbar_get_shadow() (scrollBar.shadow)
|
||||
#define scrollbar_set_shadow(s) do { scrollBar.shadow = (s); } while (0)
|
||||
#define scrollbar_get_win() (scrollBar.win)
|
||||
#define scrollbar_get_uparrow_win() (scrollBar.up_win)
|
||||
#define scrollbar_get_downarrow_win() (scrollBar.dn_win)
|
||||
#define scrollbar_get_anchor_win() (scrollBar.sa_win)
|
||||
|
||||
/************ Structures ************/
|
||||
typedef struct {
|
||||
short beg, end; /* beg/end of slider sub-window */
|
||||
short top, bot; /* top/bot of slider */
|
||||
short state; /* scrollbar state */
|
||||
unsigned char state; /* scrollbar state */
|
||||
unsigned char type; /* scrollbar type (see above) */
|
||||
short width; /* scrollbar width */
|
||||
unsigned short width, height; /* scrollbar width and height, without the shadow */
|
||||
unsigned short win_width, win_height; /* scrollbar window dimensions */
|
||||
short up_arrow_loc, down_arrow_loc; /* y coordinates for arrows */
|
||||
unsigned short arrow_width, arrow_height; /* scrollbar arrow dimensions */
|
||||
unsigned char shadow; /* shadow width */
|
||||
Window win;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
Window up_win;
|
||||
Window dn_win;
|
||||
Window sa_win;
|
||||
# endif
|
||||
} scrollBar_t;
|
||||
extern scrollBar_t scrollBar;
|
||||
extern int sb_shadow;
|
||||
} scrollbar_t;
|
||||
|
||||
/* prototypes */
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern int scrollbar_mapping(int);
|
||||
extern void scrollbar_reset(void);
|
||||
extern int scrollbar_show(int);
|
||||
_XFUNCPROTOEND
|
||||
|
||||
/* macros */
|
||||
#define scrollbar_visible() (scrollBar.state)
|
||||
#define scrollbar_isMotion() (scrollBar.state == 'm')
|
||||
#define scrollbar_isUp() (scrollBar.state == 'U')
|
||||
#define scrollbar_isDn() (scrollBar.state == 'D')
|
||||
#define scrollbar_isUpDn() isupper (scrollBar.state)
|
||||
#define scrollbar_setNone() do { scrollBar.state = 1; } while (0)
|
||||
#define scrollbar_setMotion() do { scrollBar.state = 'm'; } while (0)
|
||||
#define scrollbar_setUp() do { scrollBar.state = 'U'; } while (0)
|
||||
#define scrollbar_setDn() do { scrollBar.state = 'D'; } while (0)
|
||||
|
||||
#define scrollbar_above_slider(y) ((y) < scrollBar.top)
|
||||
#define scrollbar_below_slider(y) ((y) > scrollBar.bot)
|
||||
#define scrollbar_position(y) ((y) - scrollBar.beg)
|
||||
#define scrollbar_size() (scrollBar.end - scrollBar.beg)
|
||||
|
||||
#define scrollbar_total_width() (scrollBar.width + 2 * sb_shadow)
|
||||
#define scrollbar_arrow_height() ((scrollBar.width + 1) + sb_shadow)
|
||||
#define scrollbar_anchor_max_height() ((menubar_visible()) ? (TermWin.height) : (TermWin.height - ((scrollBar.width + 1) + sb_shadow)))
|
||||
|
||||
#define scrollbar_up_loc() ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + 1) : (sb_shadow))
|
||||
#define scrollbar_dn_loc() ((scrollBar.type == SCROLLBAR_NEXT) \
|
||||
? (scrollBar.end + scrollBar.width + 2) \
|
||||
: (scrollBar.end + 1))
|
||||
#define scrollbar_upButton(y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg))
|
||||
#define scrollbar_dnButton(y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end))
|
||||
|
||||
#ifdef PIXMAP_SCROLLBAR
|
||||
# define isScrollbarWindow(w) ((scrollbar_is_pixmapped() && scrollbar_visible() && (w) == scrollBar.sa_win) \
|
||||
|| (!scrollbar_is_pixmapped() && scrollbar_visible() && (w) == scrollBar.win))
|
||||
# define scrollbar_upButtonWin(w) ((w) == scrollBar.up_win)
|
||||
# define scrollbar_dnButtonWin(w) ((w) == scrollBar.dn_win)
|
||||
# define scrollbar_is_pixmapped() (0)
|
||||
#else
|
||||
# define isScrollbarWindow(w) (scrollbar_visible() && (w) == scrollBar.win)
|
||||
# define scrollbar_is_pixmapped() (0)
|
||||
/************ Variables ************/
|
||||
extern scrollbar_t scrollBar;
|
||||
#ifdef SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
|
||||
extern short scroll_arrow_delay;
|
||||
#endif
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void Draw_up_button(int, int, int);
|
||||
extern void Draw_dn_button(int, int, int);
|
||||
extern void scrollbar_init(void);
|
||||
extern void scrollbar_event_init_dispatcher(void);
|
||||
extern unsigned char sb_handle_enter_notify(event_t *);
|
||||
extern unsigned char sb_handle_leave_notify(event_t *);
|
||||
extern unsigned char sb_handle_focus_in(event_t *);
|
||||
extern unsigned char sb_handle_focus_out(event_t *);
|
||||
extern unsigned char sb_handle_expose(event_t *);
|
||||
extern unsigned char sb_handle_button_press(event_t *);
|
||||
extern unsigned char sb_handle_button_release(event_t *);
|
||||
extern unsigned char sb_handle_motion_notify(event_t *);
|
||||
extern unsigned char scrollbar_dispatch_event(event_t *);
|
||||
extern unsigned char scrollbar_mapping(unsigned char);
|
||||
extern void scrollbar_reset(void);
|
||||
extern unsigned char scrollbar_show(short);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _SCROLLBAR_H */
|
||||
/*----------------------- end-of-file (C header) -----------------------*/
|
||||
|
|
22
src/system.c
22
src/system.c
|
@ -11,20 +11,17 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#include "strings.h"
|
||||
#include "options.h"
|
||||
#include "screen.h"
|
||||
#include "system.h"
|
||||
#include "../libmej/debug.h"
|
||||
#include "debug.h"
|
||||
|
||||
int system_wait(char *command);
|
||||
int system_no_wait(char *command);
|
||||
#include "command.h"
|
||||
#include "misc.h"
|
||||
#include "system.h"
|
||||
|
||||
int
|
||||
wait_for_chld(int system_pid)
|
||||
|
@ -37,8 +34,7 @@ wait_for_chld(int system_pid)
|
|||
while (1) {
|
||||
do {
|
||||
errno = 0;
|
||||
} while (((pid = waitpid(system_pid, &status, WNOHANG)) == -1) &&
|
||||
(errno == EINTR) || !pid);
|
||||
} while ((((pid = waitpid(system_pid, &status, WNOHANG)) == -1) && (errno == EINTR)) || !pid);
|
||||
/* If the child that exited is the command we spawned, or if the
|
||||
child exited before fork() returned in the parent, it must be
|
||||
our immediate child that exited. We exit gracefully. */
|
||||
|
@ -50,12 +46,14 @@ wait_for_chld(int system_pid)
|
|||
} else if (WIFSIGNALED(status)) {
|
||||
code = WTERMSIG(status);
|
||||
D_OPTIONS(("wait_for_chld(): Child process was terminated by unhandled signal %lu\n", code));
|
||||
} else {
|
||||
code = 0;
|
||||
}
|
||||
return (code);
|
||||
}
|
||||
errno = save_errno;
|
||||
}
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Replace the system() call with a fork-and-exec that unprivs the child process */
|
||||
|
@ -70,7 +68,7 @@ system_wait(char *command)
|
|||
|
||||
if (!(pid = fork())) {
|
||||
setreuid(my_ruid, my_ruid);
|
||||
setreuid(my_rgid, my_rgid);
|
||||
setregid(my_rgid, my_rgid);
|
||||
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
|
||||
print_error("system_wait(): execl(%s) failed -- %s", command, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
|
@ -90,7 +88,7 @@ system_no_wait(char *command)
|
|||
|
||||
if (!(pid = fork())) {
|
||||
setreuid(my_ruid, my_ruid);
|
||||
setreuid(my_rgid, my_rgid);
|
||||
setregid(my_rgid, my_rgid);
|
||||
execl("/bin/sh", "sh", "-c", command, (char *) NULL);
|
||||
print_error("system_no_wait(): execl(%s) failed -- %s", command, strerror(errno));
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
@ -13,9 +13,8 @@
|
|||
|
||||
typedef RETSIGTYPE (*sighandler_t)(int);
|
||||
|
||||
extern int my_ruid, my_rgid, my_euid, my_egid;
|
||||
|
||||
extern int system_wait(char *command);
|
||||
extern int system_no_wait(char *command);
|
||||
extern int wait_for_chld(int);
|
||||
extern int system_wait(char *);
|
||||
extern int system_no_wait(char *);
|
||||
|
||||
#endif /* _SYSTEM_H_ */
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,186 @@
|
|||
/* term.h -- Eterm terminal emulation module header file
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TERM_H_
|
||||
#define _TERM_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
/* Macros to make parsing escape sequences slightly more readable.... <G> */
|
||||
#define OPT_SET_OR_TOGGLE(s, mask, bit) do { \
|
||||
if (!(s) || !(*(s))) { \
|
||||
if ((mask) & (bit)) { \
|
||||
(mask) &= ~(bit); \
|
||||
} else { \
|
||||
(mask) |= (bit); \
|
||||
} \
|
||||
} else if (BOOL_OPT_ISTRUE(s)) { \
|
||||
if ((mask) & (bit)) return; \
|
||||
(mask) |= (bit); \
|
||||
} else if (BOOL_OPT_ISFALSE(s)) { \
|
||||
if (!((mask) & (bit))) return; \
|
||||
(mask) &= ~(bit); \
|
||||
} \
|
||||
} while (0)
|
||||
/* The macro below forces bit to the opposite state from what we want, so that the
|
||||
code that follows will set it right. Hackish, but saves space. :) Use this
|
||||
if you need to do some processing other than just setting the flag right. */
|
||||
#define OPT_SET_OR_TOGGLE_NEG(s, mask, bit) do { if (s) { \
|
||||
if (BOOL_OPT_ISTRUE(s)) { \
|
||||
if ((mask) & (bit)) return; \
|
||||
(mask) &= ~(bit); \
|
||||
} else if (BOOL_OPT_ISFALSE(s)) { \
|
||||
if (!((mask) & (bit))) return; \
|
||||
(mask) |= (bit); \
|
||||
} \
|
||||
} } while (0)
|
||||
|
||||
/* XTerm escape sequences: ESC ] Ps;Pt BEL */
|
||||
# define XTerm_name 0
|
||||
# define XTerm_iconName 1
|
||||
# define XTerm_title 2
|
||||
# define XTerm_logfile 46
|
||||
# define XTerm_font 50
|
||||
|
||||
/* rxvt/Eterm extensions of XTerm escape sequences: ESC ] Ps;Pt BEL */
|
||||
# define XTerm_Takeover 5 /* Steal keyboard focus and raise window */
|
||||
# define XTerm_EtermSeq 6 /* Eterm proprietary escape sequences */
|
||||
# define XTerm_EtermIPC 7 /* Eterm escape code/text IPC interface */
|
||||
# define XTerm_Pixmap 20 /* new bg pixmap */
|
||||
# define XTerm_restoreFG 39 /* change default fg color */
|
||||
# define XTerm_restoreBG 49 /* change default bg color */
|
||||
|
||||
# define restoreFG 39 /* restore default fg color */
|
||||
# define restoreBG 49 /* restore default bg color */
|
||||
|
||||
enum color_list {
|
||||
fgColor,
|
||||
bgColor,
|
||||
minColor, /* 2 */
|
||||
BlackColor = minColor,
|
||||
Red3Color,
|
||||
Green3Color,
|
||||
Yellow3Color,
|
||||
Blue3Color,
|
||||
Magenta3Color,
|
||||
Cyan3Color,
|
||||
maxColor, /* minColor + 7 */
|
||||
# ifndef NO_BRIGHTCOLOR
|
||||
AntiqueWhiteColor = maxColor,
|
||||
minBright, /* maxColor + 1 */
|
||||
Grey25Color = minBright,
|
||||
RedColor,
|
||||
GreenColor,
|
||||
YellowColor,
|
||||
BlueColor,
|
||||
MagentaColor,
|
||||
CyanColor,
|
||||
maxBright, /* minBright + 7 */
|
||||
WhiteColor = maxBright,
|
||||
# else
|
||||
WhiteColor = maxColor,
|
||||
# endif
|
||||
# ifndef NO_CURSORCOLOR
|
||||
cursorColor,
|
||||
cursorColor2,
|
||||
# endif
|
||||
pointerColor,
|
||||
borderColor,
|
||||
# ifndef NO_BOLDUNDERLINE
|
||||
colorBD,
|
||||
colorUL,
|
||||
# endif
|
||||
menuTextColor,
|
||||
scrollColor,
|
||||
menuColor,
|
||||
unfocusedScrollColor,
|
||||
unfocusedMenuColor,
|
||||
NRS_COLORS, /* */
|
||||
topShadowColor = NRS_COLORS,
|
||||
bottomShadowColor,
|
||||
unfocusedTopShadowColor,
|
||||
unfocusedBottomShadowColor,
|
||||
menuTopShadowColor,
|
||||
menuBottomShadowColor,
|
||||
unfocusedMenuTopShadowColor,
|
||||
unfocusedMenuBottomShadowColor,
|
||||
TOTAL_COLORS /* */
|
||||
};
|
||||
|
||||
# define NSHADOWCOLORS (TOTAL_COLORS - NRS_COLORS)
|
||||
|
||||
#ifdef HOTKEY_CTRL
|
||||
# define HOTKEY ctrl
|
||||
#elif defined(HOTKEY_META)
|
||||
# define HOTKEY meta
|
||||
#endif
|
||||
|
||||
#define PrivCases(bit) do {if (mode == 't') state = !(PrivateModes & bit); else state = mode; \
|
||||
switch (state) { \
|
||||
case 's': SavedModes |= (PrivateModes & bit); continue; break; \
|
||||
case 'r': state = (SavedModes & bit) ? 1 : 0; \
|
||||
default: PrivMode(state, bit); break; \
|
||||
}} while (0)
|
||||
|
||||
/************ Variables ************/
|
||||
#ifdef META8_OPTION
|
||||
extern unsigned char meta_char; /* Alt-key prefix */
|
||||
#endif
|
||||
extern unsigned long PrivateModes;
|
||||
extern unsigned long SavedModes;
|
||||
extern char *def_colorName[];
|
||||
extern char *rs_color[NRS_COLORS];
|
||||
extern Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void lookup_key(XEvent *);
|
||||
#ifdef PRINTPIPE
|
||||
extern FILE *popen_printer(void);
|
||||
extern int pclose_printer(FILE *);
|
||||
extern void process_print_pipe(void);
|
||||
#endif
|
||||
extern void process_escape_seq(void);
|
||||
extern void process_csi_seq(void);
|
||||
extern void process_xterm_seq(void);
|
||||
extern void process_window_mode(unsigned int, int []);
|
||||
extern void process_terminal_mode(int, int, unsigned int, int []);
|
||||
extern void process_sgr_mode(unsigned int, int []);
|
||||
extern void process_graphics(void);
|
||||
extern void color_aliases(int);
|
||||
#ifndef NO_BRIGHTCOLOR
|
||||
extern void set_colorfgbg(void);
|
||||
#else
|
||||
# define set_colorfgbg() ((void)0)
|
||||
#endif /* NO_BRIGHTCOLOR */
|
||||
extern void xterm_seq(int, const char *);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _TERM_H_ */
|
|
@ -4,9 +4,11 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "feature.h"
|
||||
#ifdef USE_POSIX_THREADS
|
||||
# include "main.h"
|
||||
# include "debug.h"
|
||||
|
|
|
@ -0,0 +1,132 @@
|
|||
/* timer.c -- Eterm timer module
|
||||
* -- 16 August 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1999-1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
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/strings.h"
|
||||
#include "debug.h"
|
||||
#include "main.h"
|
||||
#include "mem.h"
|
||||
#include "command.h"
|
||||
#include "events.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
#include "timer.h"
|
||||
|
||||
static timer_t *timers = NULL;
|
||||
|
||||
timerhdl_t
|
||||
timer_add(unsigned long msec, timer_handler_t handler, void *data) {
|
||||
|
||||
static timer_t *timer;
|
||||
struct timeval tv;
|
||||
static struct timezone tz;
|
||||
|
||||
if (!timers) {
|
||||
timers = (timer_t *) MALLOC(sizeof(timer_t));
|
||||
timer = timers;
|
||||
} else {
|
||||
timer->next = (timer_t *) MALLOC(sizeof(timer_t));
|
||||
timer = timer->next;
|
||||
}
|
||||
timer->msec = msec;
|
||||
gettimeofday(&tv, &tz);
|
||||
timer->time.tv_sec = (msec / 1000) + tv.tv_sec;
|
||||
timer->time.tv_usec = ((msec % 1000) * 1000) + tv.tv_usec;
|
||||
timer->handler = handler;
|
||||
timer->data = data;
|
||||
timer->next = NULL;
|
||||
D_TIMER(("Added timer. Timer set to %lu/%lu with handler 0x%08x and data 0x%08x\n", timer->time.tv_sec, timer->time.tv_usec, timer->handler, timer->data));
|
||||
return ((timerhdl_t) timer);
|
||||
}
|
||||
|
||||
unsigned char
|
||||
timer_del(timerhdl_t handle) {
|
||||
|
||||
register timer_t *current;
|
||||
timer_t *temp;
|
||||
|
||||
if (timers == handle) {
|
||||
timers = handle->next;
|
||||
FREE(handle);
|
||||
return 1;
|
||||
}
|
||||
for (current = timers; current->next; current = current->next) {
|
||||
if (current->next == handle) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!(current->next)) {
|
||||
return 0;
|
||||
}
|
||||
temp = current->next;
|
||||
current->next = temp->next;
|
||||
FREE(temp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char
|
||||
timer_change_delay(timerhdl_t handle, unsigned long msec) {
|
||||
|
||||
struct timeval tv;
|
||||
static struct timezone tz;
|
||||
|
||||
handle->msec = msec;
|
||||
gettimeofday(&tv, &tz);
|
||||
handle->time.tv_sec = (msec / 1000) + tv.tv_sec;
|
||||
handle->time.tv_usec = ((msec % 1000) * 1000) + tv.tv_usec;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
timer_check(void) {
|
||||
|
||||
register timer_t *current;
|
||||
struct timeval tv;
|
||||
static struct timezone tz;
|
||||
|
||||
if (!timers) return;
|
||||
|
||||
gettimeofday(&tv, &tz);
|
||||
for (current = timers; current; current = current->next) {
|
||||
if ((current->time.tv_sec > tv.tv_sec) || ((current->time.tv_sec == tv.tv_sec) && (current->time.tv_usec >= tv.tv_usec))) {
|
||||
if (!((current->handler)(current->data))) {
|
||||
timer_del(current);
|
||||
} else {
|
||||
timer_change_delay(current, current->msec);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/* actions.h -- Eterm action class module header file
|
||||
* -- 3 August 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1999-1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TIMER_H_
|
||||
#define _TIMER_H_
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
#define find_timer_by_handle(handle) (handle)
|
||||
#define timer_change_data(handle, data) ((handle)->data = (data))
|
||||
#define timer_change_handler(handle, handler) ((handle)->handler = (handler))
|
||||
|
||||
/************ Structures ************/
|
||||
typedef unsigned char (*timer_handler_t)(void *);
|
||||
typedef struct timer_struct timer_t;
|
||||
typedef timer_t *timerhdl_t; /* The timer handles are actually pointers to a timer_t struct, but clients shouldn't use them as such. */
|
||||
struct timer_struct {
|
||||
unsigned long msec;
|
||||
struct timeval time;
|
||||
timer_handler_t handler;
|
||||
void *data;
|
||||
struct timer_struct *next;
|
||||
};
|
||||
|
||||
/************ Variables ************/
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern timerhdl_t timer_add(unsigned long msec, timer_handler_t handler, void *data);
|
||||
extern unsigned char timer_del(timerhdl_t handle);
|
||||
extern unsigned char timer_change_delay(timerhdl_t handle, unsigned long msec);
|
||||
extern void timer_check(void);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _TIMER_H_ */
|
90
src/utmp.c
90
src/utmp.c
|
@ -23,28 +23,21 @@
|
|||
|
||||
static const char cvs_ident[] = "$Id$";
|
||||
|
||||
/* includes, defines */
|
||||
#include "config.h"
|
||||
#include "feature.h"
|
||||
#include "screen.h"
|
||||
|
||||
int my_ruid, my_euid, my_rgid, my_egid; /* These are needed regardless of utmp support -- mej */
|
||||
|
||||
#ifdef UTMP_SUPPORT
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* For some systems (HP-UX in particular), sys/types.h must be included
|
||||
before utmp*.h -- mej */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* Unsupported/broken utmpx.h on HP-UX, AIX, and glibc 2.1 */
|
||||
#if defined(_HPUX_SOURCE) || defined(_AIX) || (defined(__GLIBC__) && __GLIBC__ >= 2)
|
||||
#if defined(_HPUX_SOURCE) || defined(_AIX) || ((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1))
|
||||
# undef HAVE_UTMPX_H
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UTMPX_H
|
||||
# include <utmpx.h>
|
||||
# define USE_SYSV_UTMP
|
||||
|
@ -54,7 +47,6 @@ int my_ruid, my_euid, my_rgid, my_egid; /* These are needed regardless of utmp
|
|||
# define USE_SYSV_UTMP
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
|
@ -65,72 +57,37 @@ int my_ruid, my_euid, my_rgid, my_egid; /* These are needed regardless of utmp
|
|||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_LASTLOG_H
|
||||
# include <lastlog.h>
|
||||
#endif
|
||||
#include <pwd.h>
|
||||
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifndef UTMP_FILENAME
|
||||
# ifdef UTMP_FILE
|
||||
# define UTMP_FILENAME UTMP_FILE
|
||||
# elif defined(_PATH_UTMP)
|
||||
# define UTMP_FILENAME _PATH_UTMP
|
||||
# else
|
||||
# define UTMP_FILENAME "/etc/utmp"
|
||||
# endif
|
||||
#ifdef HAVE_LASTLOG_H
|
||||
# include <lastlog.h>
|
||||
#endif
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
|
||||
# include <ttyent.h>
|
||||
#endif
|
||||
|
||||
#ifndef LASTLOG_FILENAME
|
||||
# ifdef _PATH_LASTLOG
|
||||
# define LASTLOG_FILENAME _PATH_LASTLOG
|
||||
# else
|
||||
# define LASTLOG_FILENAME "/usr/adm/lastlog" /* only on BSD systems */
|
||||
# endif
|
||||
#endif
|
||||
#include "eterm_utmp.h"
|
||||
#include "debug.h"
|
||||
#include "../libmej/debug.h"
|
||||
#include "command.h"
|
||||
#include "screen.h"
|
||||
|
||||
#ifndef WTMP_FILENAME
|
||||
# ifdef WTMP_FILE
|
||||
# define WTMP_FILENAME WTMP_FILE
|
||||
# elif defined(_PATH_WTMP)
|
||||
# define WTMP_FILENAME _PATH_WTMP
|
||||
# elif defined(SYSV)
|
||||
# define WTMP_FILENAME "/etc/wtmp"
|
||||
# else
|
||||
# define WTMP_FILENAME "/usr/adm/wtmp"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef TTYTAB_FILENAME
|
||||
# ifdef TTYTAB
|
||||
# define TTYTAB_FILENAME TTYTAB_FILENAME
|
||||
# else
|
||||
# define TTYTAB_FILENAME "/etc/ttytab"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef USER_PROCESS
|
||||
# define USER_PROCESS 7
|
||||
#endif
|
||||
#ifndef DEAD_PROCESS
|
||||
# define DEAD_PROCESS 8
|
||||
/* screen.h includes config.h again, so re-fix these. Pointed out by Sung-Hyun Nam <namsh@lgic.co.kr> */
|
||||
#if defined(_HPUX_SOURCE) || defined(_AIX) || ((__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1))
|
||||
# undef HAVE_UTMPX_H
|
||||
#endif
|
||||
|
||||
/* don't go off end of ut_id & remember if an entry has been made */
|
||||
#if defined(USE_SYSV_UTMP) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__)
|
||||
static char ut_id[5]; /* remember if entry to utmp made */
|
||||
|
||||
#else
|
||||
static int utmp_pos; /* BSD position of utmp-stamp */
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USE_SYSV_UTMP
|
||||
|
@ -157,10 +114,6 @@ update_wtmp(char *fname, struct utmp *putmp)
|
|||
lck.l_start = 0;
|
||||
lck.l_type = F_WRLCK; /* we want a write lock */
|
||||
|
||||
# if !defined(EACCESS) && defined(EAGAIN)
|
||||
# define EACCESS EAGAIN
|
||||
# endif
|
||||
|
||||
/* attempt lock with F_SETLK - F_SETLKW would cause a deadlock! */
|
||||
while (retry--) {
|
||||
if ((fcntl(fd, F_SETLK, &lck) < 0) && errno != EACCESS) {
|
||||
|
@ -187,16 +140,16 @@ update_wtmp(char *fname, struct utmp *putmp)
|
|||
void
|
||||
makeutent(const char *pty, const char *hostname)
|
||||
{
|
||||
struct passwd *pwent = getpwuid(getuid());
|
||||
struct passwd *pwent = getpwuid(my_ruid);
|
||||
|
||||
#ifdef HAVE_UTMPX_H
|
||||
struct utmpx utmp;
|
||||
struct utmp utmp2;
|
||||
memset(&utmp, 0, sizeof(struct utmpx));
|
||||
MEMSET(&utmp, 0, sizeof(struct utmpx));
|
||||
|
||||
#else
|
||||
struct utmp utmp;
|
||||
memset(&utmp, 0, sizeof(struct utmp));
|
||||
MEMSET(&utmp, 0, sizeof(struct utmp));
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -255,7 +208,6 @@ makeutent(const char *pty, const char *hostname)
|
|||
pututline(&utmp2);
|
||||
pututxline(&utmp);
|
||||
#else
|
||||
/* if (!utmpInhibit) */
|
||||
pututline(&utmp);
|
||||
#endif
|
||||
update_wtmp(WTMP_FILENAME, &utmp);
|
||||
|
@ -322,8 +274,6 @@ cleanutent(void)
|
|||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
|
||||
|
||||
#include <ttyent.h>
|
||||
|
||||
/* used to hold the line we are using */
|
||||
static char ut_line[32];
|
||||
|
||||
|
@ -436,10 +386,10 @@ write_utmp(struct utmp *putmp)
|
|||
void
|
||||
makeutent(const char *pty, const char *hostname)
|
||||
{
|
||||
struct passwd *pwent = getpwuid(getuid());
|
||||
struct passwd *pwent = getpwuid(my_ruid);
|
||||
struct utmp utmp;
|
||||
|
||||
memset(&utmp, 0, sizeof(struct utmp));
|
||||
MEMSET(&utmp, 0, sizeof(struct utmp));
|
||||
|
||||
if (!strncmp(pty, "/dev/", 5))
|
||||
pty += 5; /* skip /dev/ prefix */
|
||||
|
@ -486,7 +436,7 @@ cleanutent(void)
|
|||
privileges(INVOKE);
|
||||
if (!ut_id[0] && (fd = fopen(UTMP_FILENAME, "r+")) != NULL) {
|
||||
struct utmp utmp;
|
||||
memset(&utmp, 0, sizeof(struct utmp));
|
||||
MEMSET(&utmp, 0, sizeof(struct utmp));
|
||||
|
||||
fseek(fd, utmp_pos, 0);
|
||||
fwrite(&utmp, sizeof(struct utmp), 1, fd);
|
||||
|
|
|
@ -0,0 +1,980 @@
|
|||
/* windows.c -- Eterm window handling module
|
||||
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
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 <X11/cursorfont.h>
|
||||
|
||||
#include "../libmej/debug.h"
|
||||
#include "../libmej/mem.h"
|
||||
#include "../libmej/strings.h"
|
||||
#include "debug.h"
|
||||
#include "command.h"
|
||||
#include "e.h"
|
||||
#include "events.h"
|
||||
#include "main.h"
|
||||
#include "menus.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
#include "screen.h"
|
||||
#include "scrollbar.h"
|
||||
#include "term.h"
|
||||
#include "windows.h"
|
||||
|
||||
XWindowAttributes attr;
|
||||
XSetWindowAttributes Attributes;
|
||||
XSizeHints szHint =
|
||||
{
|
||||
PMinSize | PResizeInc | PBaseSize | PWinGravity,
|
||||
0, 0, 80, 24, /* x, y, width, height */
|
||||
1, 1, /* Min width, height */
|
||||
0, 0, /* Max width, height - unused */
|
||||
1, 1, /* increments: width, height */
|
||||
{1, 1}, /* increments: x, y */
|
||||
{0, 0}, /* Aspect ratio - unused */
|
||||
0, 0, /* base size: width, height */
|
||||
NorthWestGravity /* gravity */
|
||||
};
|
||||
int font_change_count = 0;
|
||||
#ifdef MULTI_CHARSET
|
||||
/* Kanji font names, roman fonts sized to match */
|
||||
const char *def_kfontName[] =
|
||||
{
|
||||
KFONT0, KFONT1, KFONT2, KFONT3, KFONT4
|
||||
};
|
||||
#endif /* MULTI_CHARSET */
|
||||
const char *def_fontName[] =
|
||||
{
|
||||
FONT0, FONT1, FONT2, FONT3, FONT4
|
||||
};
|
||||
Cursor TermWin_cursor; /* cursor for vt window */
|
||||
|
||||
Pixel
|
||||
get_bottom_shadow_color(Pixel norm_color, const char *type)
|
||||
{
|
||||
|
||||
XColor xcol;
|
||||
unsigned int r, g, b;
|
||||
|
||||
xcol.pixel = norm_color;
|
||||
XQueryColor(Xdisplay, cmap, &xcol);
|
||||
|
||||
xcol.red /= 2;
|
||||
xcol.green /= 2;
|
||||
xcol.blue /= 2;
|
||||
r = xcol.red;
|
||||
g = xcol.green;
|
||||
b = xcol.blue;
|
||||
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
|
||||
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.", type, xcol.pixel, r, g, b);
|
||||
xcol.pixel = PixColors[minColor];
|
||||
}
|
||||
return (xcol.pixel);
|
||||
}
|
||||
|
||||
Pixel
|
||||
get_top_shadow_color(Pixel norm_color, const char *type)
|
||||
{
|
||||
|
||||
XColor xcol, white;
|
||||
unsigned int r, g, b;
|
||||
|
||||
# ifdef PREFER_24BIT
|
||||
white.red = white.green = white.blue = r = g = b = ~0;
|
||||
white.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
|
||||
XAllocColor(Xdisplay, cmap, &white);
|
||||
# else
|
||||
white.pixel = WhitePixel(Xdisplay, Xscreen);
|
||||
XQueryColor(Xdisplay, cmap, &white);
|
||||
# endif
|
||||
|
||||
xcol.pixel = norm_color;
|
||||
XQueryColor(Xdisplay, cmap, &xcol);
|
||||
|
||||
xcol.red = max((white.red / 5), xcol.red);
|
||||
xcol.green = max((white.green / 5), xcol.green);
|
||||
xcol.blue = max((white.blue / 5), xcol.blue);
|
||||
|
||||
xcol.red = min(white.red, (xcol.red * 7) / 5);
|
||||
xcol.green = min(white.green, (xcol.green * 7) / 5);
|
||||
xcol.blue = min(white.blue, (xcol.blue * 7) / 5);
|
||||
r = xcol.red;
|
||||
g = xcol.green;
|
||||
b = xcol.blue;
|
||||
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
|
||||
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_error("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.", type, xcol.pixel, r, g, b);
|
||||
xcol.pixel = PixColors[WhiteColor];
|
||||
}
|
||||
return (xcol.pixel);
|
||||
}
|
||||
|
||||
/* Create_Windows() - Open and map the window */
|
||||
void
|
||||
Create_Windows(int argc, char *argv[])
|
||||
{
|
||||
|
||||
Cursor cursor;
|
||||
XClassHint classHint;
|
||||
XWMHints wmHint;
|
||||
Atom prop = None;
|
||||
CARD32 val;
|
||||
int i, x, y, flags;
|
||||
unsigned int width, height;
|
||||
unsigned int r, g, b;
|
||||
MWMHints mwmhints;
|
||||
|
||||
if (Options & Opt_borderless) {
|
||||
prop = XInternAtom(Xdisplay, "_MOTIF_WM_HINTS", True);
|
||||
if (prop == None) {
|
||||
print_warning("Window Manager does not support MWM hints. Bypassing window manager control for borderless window.");
|
||||
Attributes.override_redirect = TRUE;
|
||||
mwmhints.flags = 0;
|
||||
} else {
|
||||
mwmhints.flags = MWM_HINTS_DECORATIONS;
|
||||
mwmhints.decorations = 0;
|
||||
}
|
||||
} else {
|
||||
mwmhints.flags = 0;
|
||||
}
|
||||
Attributes.save_under = TRUE;
|
||||
Attributes.backing_store = WhenMapped;
|
||||
Attributes.colormap = cmap;
|
||||
|
||||
/*
|
||||
* grab colors before netscape does
|
||||
*/
|
||||
for (i = 0; i < (Xdepth <= 2 ? 2 : NRS_COLORS); i++) {
|
||||
|
||||
XColor xcol;
|
||||
unsigned char found_color = 0;
|
||||
|
||||
if (rs_color[i]) {
|
||||
if (!XParseColor(Xdisplay, cmap, rs_color[i], &xcol)) {
|
||||
print_warning("Unable to resolve \"%s\" as a color name. Falling back on \"%s\".",
|
||||
rs_color[i], def_colorName[i] ? def_colorName[i] : "(nil)");
|
||||
rs_color[i] = def_colorName[i];
|
||||
if (rs_color[i]) {
|
||||
if (!XParseColor(Xdisplay, cmap, rs_color[i], &xcol)) {
|
||||
print_warning("Unable to resolve \"%s\" as a color name. This should never fail. Please repair/restore your RGB database.", rs_color[i]);
|
||||
found_color = 0;
|
||||
} else {
|
||||
found_color = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
found_color = 1;
|
||||
}
|
||||
if (found_color) {
|
||||
r = xcol.red;
|
||||
g = xcol.green;
|
||||
b = xcol.blue;
|
||||
xcol.pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map. "
|
||||
"Falling back on \"%s\".",
|
||||
rs_color[i], xcol.pixel, r, g, b, def_colorName[i] ? def_colorName[i] : "(nil)");
|
||||
rs_color[i] = def_colorName[i];
|
||||
if (rs_color[i]) {
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate \"%s\" (0x%08x: 0x%04x, 0x%04x, 0x%04x) in the color map.",
|
||||
rs_color[i], xcol.pixel, r, g, b);
|
||||
found_color = 0;
|
||||
} else {
|
||||
found_color = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
found_color = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
found_color = 0;
|
||||
}
|
||||
if (!found_color) {
|
||||
switch (i) {
|
||||
case fgColor:
|
||||
case bgColor:
|
||||
/* fatal: need bg/fg color */
|
||||
fatal_error("Unable to get foreground/background colors!");
|
||||
break;
|
||||
#ifndef NO_CURSORCOLOR
|
||||
case cursorColor:
|
||||
xcol.pixel = PixColors[bgColor];
|
||||
break;
|
||||
case cursorColor2:
|
||||
xcol.pixel = PixColors[fgColor];
|
||||
break;
|
||||
#endif /* NO_CURSORCOLOR */
|
||||
case unfocusedMenuColor:
|
||||
xcol.pixel = PixColors[menuColor];
|
||||
break;
|
||||
case unfocusedScrollColor:
|
||||
case menuColor:
|
||||
xcol.pixel = PixColors[scrollColor];
|
||||
break;
|
||||
default:
|
||||
xcol.pixel = PixColors[bgColor]; /* None */
|
||||
break;
|
||||
}
|
||||
}
|
||||
PixColors[i] = xcol.pixel;
|
||||
}
|
||||
|
||||
#ifndef NO_CURSORCOLOR
|
||||
if (Xdepth <= 2 || !rs_color[cursorColor])
|
||||
PixColors[cursorColor] = PixColors[bgColor];
|
||||
if (Xdepth <= 2 || !rs_color[cursorColor2])
|
||||
PixColors[cursorColor2] = PixColors[fgColor];
|
||||
#endif /* NO_CURSORCOLOR */
|
||||
if (Xdepth <= 2 || !rs_color[pointerColor])
|
||||
PixColors[pointerColor] = PixColors[fgColor];
|
||||
if (Xdepth <= 2 || !rs_color[borderColor])
|
||||
PixColors[borderColor] = PixColors[bgColor];
|
||||
|
||||
#ifndef NO_BOLDUNDERLINE
|
||||
if (Xdepth <= 2 || !rs_color[colorBD])
|
||||
PixColors[colorBD] = PixColors[fgColor];
|
||||
if (Xdepth <= 2 || !rs_color[colorUL])
|
||||
PixColors[colorUL] = PixColors[fgColor];
|
||||
#endif /* NO_BOLDUNDERLINE */
|
||||
|
||||
/*
|
||||
* get scrollBar/menu shadow colors
|
||||
*
|
||||
* The calculations of topShadow/bottomShadow values are adapted
|
||||
* from the fvwm window manager.
|
||||
*/
|
||||
if (Xdepth <= 2) { /* Monochrome */
|
||||
PixColors[scrollColor] = PixColors[bgColor];
|
||||
PixColors[topShadowColor] = PixColors[fgColor];
|
||||
PixColors[bottomShadowColor] = PixColors[fgColor];
|
||||
|
||||
PixColors[unfocusedScrollColor] = PixColors[bgColor];
|
||||
PixColors[unfocusedTopShadowColor] = PixColors[fgColor];
|
||||
PixColors[unfocusedBottomShadowColor] = PixColors[fgColor];
|
||||
|
||||
PixColors[menuColor] = PixColors[bgColor];
|
||||
PixColors[menuTopShadowColor] = PixColors[fgColor];
|
||||
PixColors[menuBottomShadowColor] = PixColors[fgColor];
|
||||
|
||||
PixColors[unfocusedMenuColor] = PixColors[bgColor];
|
||||
PixColors[unfocusedMenuTopShadowColor] = PixColors[fgColor];
|
||||
PixColors[unfocusedMenuBottomShadowColor] = PixColors[fgColor];
|
||||
} else {
|
||||
PixColors[bottomShadowColor] = get_bottom_shadow_color(PixColors[scrollColor], "bottomShadowColor");
|
||||
PixColors[unfocusedBottomShadowColor] = get_bottom_shadow_color(PixColors[unfocusedScrollColor], "unfocusedBottomShadowColor");
|
||||
PixColors[topShadowColor] = get_top_shadow_color(PixColors[scrollColor], "topShadowColor");
|
||||
PixColors[unfocusedTopShadowColor] = get_top_shadow_color(PixColors[unfocusedScrollColor], "unfocusedTopShadowColor");
|
||||
|
||||
PixColors[menuBottomShadowColor] = get_bottom_shadow_color(PixColors[menuColor], "menuBottomShadowColor");
|
||||
PixColors[unfocusedMenuBottomShadowColor] = get_bottom_shadow_color(PixColors[unfocusedMenuColor], "unfocusedMenuBottomShadowColor");
|
||||
PixColors[menuTopShadowColor] = get_top_shadow_color(PixColors[menuColor], "menuTopShadowColor");
|
||||
PixColors[unfocusedMenuTopShadowColor] = get_top_shadow_color(PixColors[unfocusedMenuColor], "unfocusedMenuTopShadowColor");
|
||||
}
|
||||
|
||||
szHint.base_width = (2 * TermWin.internalBorder + (Options & Opt_scrollBar ? scrollbar_trough_width() : 0));
|
||||
szHint.base_height = (2 * TermWin.internalBorder);
|
||||
|
||||
flags = (rs_geometry ? XParseGeometry(rs_geometry, &x, &y, &width, &height) : 0);
|
||||
D_X11(("XParseGeometry(geom, %d, %d, %d, %d)\n", x, y, width, height));
|
||||
|
||||
if (flags & WidthValue) {
|
||||
szHint.width = width;
|
||||
szHint.flags |= USSize;
|
||||
}
|
||||
if (flags & HeightValue) {
|
||||
szHint.height = height;
|
||||
szHint.flags |= USSize;
|
||||
}
|
||||
TermWin.ncol = szHint.width;
|
||||
TermWin.nrow = szHint.height;
|
||||
|
||||
change_font(1, NULL);
|
||||
|
||||
if (flags & XValue) {
|
||||
if (flags & XNegative) {
|
||||
if (check_for_enlightenment()) {
|
||||
x += (DisplayWidth(Xdisplay, Xscreen));
|
||||
} else {
|
||||
x += (DisplayWidth(Xdisplay, Xscreen) - (szHint.width + TermWin.internalBorder));
|
||||
}
|
||||
szHint.win_gravity = NorthEastGravity;
|
||||
}
|
||||
szHint.x = x;
|
||||
szHint.flags |= USPosition;
|
||||
}
|
||||
if (flags & YValue) {
|
||||
if (flags & YNegative) {
|
||||
if (check_for_enlightenment()) {
|
||||
y += (DisplayHeight(Xdisplay, Xscreen) - (2 * TermWin.internalBorder));
|
||||
} else {
|
||||
y += (DisplayHeight(Xdisplay, Xscreen) - (szHint.height + TermWin.internalBorder));
|
||||
}
|
||||
szHint.win_gravity = (szHint.win_gravity == NorthEastGravity ?
|
||||
SouthEastGravity : SouthWestGravity);
|
||||
}
|
||||
szHint.y = y;
|
||||
szHint.flags |= USPosition;
|
||||
}
|
||||
D_X11(("Geometry values after parsing: %dx%d%+d%+d\n", width, height, x, y));
|
||||
|
||||
/* parent window - reverse video so we can see placement errors
|
||||
* sub-window placement & size in resize_subwindows()
|
||||
*/
|
||||
|
||||
Attributes.background_pixel = PixColors[bgColor];
|
||||
Attributes.border_pixel = PixColors[bgColor];
|
||||
TermWin.parent = XCreateWindow(Xdisplay, Xroot, szHint.x, szHint.y, szHint.width, szHint.height, 0, Xdepth, InputOutput,
|
||||
#ifdef PREFER_24BIT
|
||||
Xvisual,
|
||||
#else
|
||||
CopyFromParent,
|
||||
#endif
|
||||
CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect, &Attributes);
|
||||
|
||||
xterm_seq(XTerm_title, rs_title);
|
||||
xterm_seq(XTerm_iconName, rs_iconName);
|
||||
classHint.res_name = (char *) rs_name;
|
||||
classHint.res_class = APL_NAME;
|
||||
wmHint.window_group = TermWin.parent;
|
||||
wmHint.input = True;
|
||||
wmHint.initial_state = (Options & Opt_iconic ? IconicState : NormalState);
|
||||
wmHint.window_group = TermWin.parent;
|
||||
wmHint.flags = (InputHint | StateHint | WindowGroupHint);
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
set_icon_pixmap(rs_icon, &wmHint);
|
||||
#endif
|
||||
|
||||
XSetWMProperties(Xdisplay, TermWin.parent, NULL, NULL, argv, argc, &szHint, &wmHint, &classHint);
|
||||
XSelectInput(Xdisplay, TermWin.parent, (KeyPressMask | FocusChangeMask | StructureNotifyMask | VisibilityChangeMask | PropertyChangeMask));
|
||||
if (mwmhints.flags) {
|
||||
XChangeProperty(Xdisplay, TermWin.parent, prop, prop, 32, PropModeReplace, (unsigned char *) &mwmhints, PROP_MWM_HINTS_ELEMENTS);
|
||||
}
|
||||
/* vt cursor: Black-on-White is standard, but this is more popular */
|
||||
TermWin_cursor = XCreateFontCursor(Xdisplay, XC_xterm);
|
||||
{
|
||||
|
||||
XColor fg, bg;
|
||||
|
||||
fg.pixel = PixColors[pointerColor];
|
||||
XQueryColor(Xdisplay, cmap, &fg);
|
||||
bg.pixel = PixColors[bgColor];
|
||||
XQueryColor(Xdisplay, cmap, &bg);
|
||||
XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg);
|
||||
}
|
||||
|
||||
/* cursor (menu/scrollbar): Black-on-White */
|
||||
cursor = XCreateFontCursor(Xdisplay, XC_left_ptr);
|
||||
|
||||
/* the vt window */
|
||||
|
||||
#ifdef BACKING_STORE
|
||||
if ((!(Options & Opt_borderless)) && (Options & Opt_saveUnder)) {
|
||||
D_X11(("Creating term window with save_under = TRUE\n"));
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, 0, 0, szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder | CWBackingStore | CWColormap, &Attributes);
|
||||
if (!(background_is_pixmap()) && !(Options & Opt_borderless)) {
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, TermWin.vt);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
D_X11(("Creating term window with no backing store\n"));
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, 0, 0, szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWColormap, &Attributes);
|
||||
if (!(background_is_pixmap()) && !(Options & Opt_borderless)) {
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, TermWin.vt);
|
||||
}
|
||||
}
|
||||
|
||||
XDefineCursor(Xdisplay, TermWin.vt, TermWin_cursor);
|
||||
XSelectInput(Xdisplay, TermWin.vt, (ExposureMask | ButtonPressMask | ButtonReleaseMask | Button1MotionMask | Button3MotionMask));
|
||||
|
||||
/* If the user wants a specific desktop, tell the WM that */
|
||||
if (rs_desktop != -1) {
|
||||
prop = XInternAtom(Xdisplay, "_WIN_WORKSPACE", False);
|
||||
val = rs_desktop;
|
||||
XChangeProperty(Xdisplay, TermWin.parent, prop, XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &val, 1);
|
||||
}
|
||||
XMapWindow(Xdisplay, TermWin.vt);
|
||||
XMapWindow(Xdisplay, TermWin.parent);
|
||||
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
XClearWindow(Xdisplay, TermWin.vt);
|
||||
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
if (background_is_image()) {
|
||||
render_simage(images[image_bg].norm, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 0);
|
||||
}
|
||||
#endif /* PIXMAP_SUPPORT */
|
||||
|
||||
/* graphics context for the vt window */
|
||||
{
|
||||
XGCValues gcvalue;
|
||||
|
||||
gcvalue.font = TermWin.font->fid;
|
||||
gcvalue.foreground = PixColors[fgColor];
|
||||
gcvalue.background = PixColors[bgColor];
|
||||
gcvalue.graphics_exposures = 0;
|
||||
TermWin.gc = XCreateGC(Xdisplay, TermWin.vt, GCForeground | GCBackground | GCFont | GCGraphicsExposures, &gcvalue);
|
||||
}
|
||||
|
||||
if (Options & Opt_noCursor)
|
||||
scr_cursor_visible(0);
|
||||
|
||||
/* We're done creating our windows. Now let's initialize the event subsystem to handle them. */
|
||||
event_init_subsystem((event_dispatcher_t) process_x_event, (event_dispatcher_init_t) event_init_primary_dispatcher);
|
||||
|
||||
/* Time for the scrollbar to create its windows and add itself to the event subsystem. */
|
||||
scrollbar_init();
|
||||
|
||||
/* Same for the menu subsystem. */
|
||||
menu_init();
|
||||
|
||||
}
|
||||
|
||||
/* window resizing - assuming the parent window is the correct size */
|
||||
void
|
||||
resize_subwindows(int width, int height)
|
||||
{
|
||||
|
||||
int x = 0, y = 0;
|
||||
|
||||
#ifdef RXVT_GRAPHICS
|
||||
int old_width = TermWin.width;
|
||||
int old_height = TermWin.height;
|
||||
|
||||
#endif
|
||||
|
||||
D_SCREEN(("resize_subwindows(%d, %d)\n", width, height));
|
||||
TermWin.width = TermWin.ncol * TermWin.fwidth;
|
||||
TermWin.height = TermWin.nrow * TermWin.fheight;
|
||||
|
||||
/* size and placement */
|
||||
if (scrollbar_visible()) {
|
||||
scrollBar.beg = 0;
|
||||
scrollBar.end = height;
|
||||
#ifdef MOTIF_SCROLLBAR
|
||||
if (scrollBar.type == SCROLLBAR_MOTIF) {
|
||||
/* arrows are as high as wide - leave 1 pixel gap */
|
||||
scrollBar.beg += scrollbar_arrow_height() + scrollbar_get_shadow() + 1;
|
||||
scrollBar.end -= scrollbar_arrow_height() + scrollbar_get_shadow() + 1;
|
||||
}
|
||||
#endif
|
||||
#ifdef NEXT_SCROLLBAR
|
||||
if (scrollBar.type == SCROLLBAR_NEXT) {
|
||||
scrollBar.beg = scrollbar_get_shadow();
|
||||
scrollBar.end -= (scrollBar.width * 2 + (scrollbar_get_shadow()? scrollbar_get_shadow() : 1) + 2);
|
||||
}
|
||||
#endif
|
||||
width -= scrollbar_trough_width();
|
||||
XMoveResizeWindow(Xdisplay, scrollBar.win,
|
||||
((Options & Opt_scrollBar_right) ? (width) : (x)),
|
||||
0, scrollbar_trough_width(), height);
|
||||
if (scrollbar_is_pixmapped()) {
|
||||
render_simage(images[image_sb].current, scrollBar.win, scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
|
||||
}
|
||||
if (!(Options & Opt_scrollBar_right)) {
|
||||
x = scrollbar_trough_width();
|
||||
}
|
||||
}
|
||||
XMoveResizeWindow(Xdisplay, TermWin.vt, x, y, width, height + 1);
|
||||
|
||||
#ifdef RXVT_GRAPHICS
|
||||
if (old_width)
|
||||
Gr_Resize(old_width, old_height);
|
||||
#endif
|
||||
XClearWindow(Xdisplay, TermWin.vt);
|
||||
if (!(background_is_pixmap()))
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
# ifdef USE_POSIX_THREADS
|
||||
|
||||
D_PIXMAP(("resize_subwindows(): start_bg_thread()\n"));
|
||||
pthread_attr_init(&resize_sub_thr_attr);
|
||||
|
||||
# ifdef MUTEX_SYNCH
|
||||
if (pthread_mutex_trylock(&mutex) == EBUSY) {
|
||||
D_THREADS(("resize_subwindows(): mutex locked, bbl\n"));
|
||||
} else {
|
||||
D_THREADS(("pthread_mutex_trylock(&mutex): "));
|
||||
pthread_mutex_unlock(&mutex);
|
||||
D_THREADS(("pthread_mutex_unlock(&mutex)\n"));
|
||||
}
|
||||
# endif
|
||||
|
||||
if (!(pthread_create(&resize_sub_thr, &resize_sub_thr_attr,
|
||||
(void *) &render_bg_thread, NULL))) {
|
||||
/* bg_set = 0; */
|
||||
D_THREADS(("thread created\n"));
|
||||
} else {
|
||||
D_THREADS(("pthread_create() failed!\n"));
|
||||
}
|
||||
|
||||
# else
|
||||
D_PIXMAP(("resize_subwindows(): render_pixmap(TermWin.vt)\n"));
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
|
||||
XSync(Xdisplay, 0);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
resize(void)
|
||||
{
|
||||
szHint.base_width = (2 * TermWin.internalBorder);
|
||||
szHint.base_height = (2 * TermWin.internalBorder);
|
||||
|
||||
szHint.base_width += (scrollbar_visible()? scrollbar_trough_width() : 0);
|
||||
|
||||
szHint.min_width = szHint.base_width + szHint.width_inc;
|
||||
szHint.min_height = szHint.base_height + szHint.height_inc;
|
||||
|
||||
szHint.width = szHint.base_width + TermWin.width;
|
||||
szHint.height = szHint.base_height + TermWin.height;
|
||||
|
||||
szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity;
|
||||
|
||||
XSetWMNormalHints(Xdisplay, TermWin.parent, &szHint);
|
||||
XResizeWindow(Xdisplay, TermWin.parent, szHint.width, szHint.height);
|
||||
|
||||
resize_subwindows(szHint.width, szHint.height);
|
||||
}
|
||||
|
||||
/*
|
||||
* Redraw window after exposure or size change
|
||||
*/
|
||||
void
|
||||
resize_window1(unsigned int width, unsigned int height)
|
||||
{
|
||||
static short first_time = 1;
|
||||
int new_ncol = (width - szHint.base_width) / TermWin.fwidth;
|
||||
int new_nrow = (height - szHint.base_height) / TermWin.fheight;
|
||||
|
||||
if (first_time ||
|
||||
(new_ncol != TermWin.ncol) ||
|
||||
(new_nrow != TermWin.nrow)) {
|
||||
int curr_screen = -1;
|
||||
|
||||
/* scr_reset only works on the primary screen */
|
||||
if (!first_time) { /* this is not the first time thru */
|
||||
selection_clear();
|
||||
curr_screen = scr_change_screen(PRIMARY);
|
||||
}
|
||||
TermWin.ncol = new_ncol;
|
||||
TermWin.nrow = new_nrow;
|
||||
|
||||
resize_subwindows(width, height);
|
||||
scr_reset();
|
||||
|
||||
if (curr_screen >= 0) /* this is not the first time thru */
|
||||
scr_change_screen(curr_screen);
|
||||
first_time = 0;
|
||||
} else if (Options & Opt_pixmapTrans || Options & Opt_viewport_mode) {
|
||||
resize_subwindows(width, height);
|
||||
scrollbar_show(0);
|
||||
scr_expose(0, 0, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* good for toggling 80/132 columns
|
||||
*/
|
||||
void
|
||||
set_width(unsigned short width)
|
||||
{
|
||||
unsigned short height = TermWin.nrow;
|
||||
|
||||
if (width != TermWin.ncol) {
|
||||
width = szHint.base_width + width * TermWin.fwidth;
|
||||
height = szHint.base_height + height * TermWin.fheight;
|
||||
|
||||
XResizeWindow(Xdisplay, TermWin.parent, width, height);
|
||||
resize_window1(width, height);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Redraw window after exposure or size change
|
||||
*/
|
||||
void
|
||||
resize_window(void)
|
||||
{
|
||||
Window root;
|
||||
XEvent dummy;
|
||||
int x, y;
|
||||
unsigned int border, depth, width, height;
|
||||
|
||||
while (XCheckTypedWindowEvent(Xdisplay, TermWin.parent,
|
||||
ConfigureNotify, &dummy));
|
||||
|
||||
/* do we come from an fontchange? */
|
||||
if (font_change_count > 0) {
|
||||
font_change_count--;
|
||||
return;
|
||||
}
|
||||
XGetGeometry(Xdisplay, TermWin.parent, &root, &x, &y, &width, &height, &border, &depth);
|
||||
|
||||
/* parent already resized */
|
||||
|
||||
resize_window1(width, height);
|
||||
}
|
||||
|
||||
#ifdef XTERM_COLOR_CHANGE
|
||||
void
|
||||
set_window_color(int idx, const char *color)
|
||||
{
|
||||
|
||||
XColor xcol;
|
||||
int i;
|
||||
unsigned int pixel, r, g, b;
|
||||
|
||||
if (color == NULL || *color == '\0')
|
||||
return;
|
||||
|
||||
/* handle color aliases */
|
||||
if (isdigit(*color)) {
|
||||
i = atoi(color);
|
||||
if (i >= 8 && i <= 15) { /* bright colors */
|
||||
i -= 8;
|
||||
# ifndef NO_BRIGHTCOLOR
|
||||
PixColors[idx] = PixColors[minBright + i];
|
||||
goto Done;
|
||||
# endif
|
||||
}
|
||||
if (i >= 0 && i <= 7) { /* normal colors */
|
||||
PixColors[idx] = PixColors[minColor + i];
|
||||
goto Done;
|
||||
}
|
||||
}
|
||||
if (XParseColor(Xdisplay, cmap, color, &xcol)) {
|
||||
r = xcol.red;
|
||||
g = xcol.green;
|
||||
b = xcol.blue;
|
||||
pixel = Imlib_best_color_match(imlib_id, &r, &g, &b);
|
||||
xcol.pixel = pixel;
|
||||
if (!XAllocColor(Xdisplay, cmap, &xcol)) {
|
||||
print_warning("Unable to allocate \"%s\" in the color map.\n", color);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
print_warning("Unable to resolve \"%s\" as a color name.\n", color);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: should free colors here, but no idea how to do it so instead,
|
||||
* so just keep gobbling up the colormap
|
||||
*/
|
||||
# if 0
|
||||
for (i = BlackColor; i <= WhiteColor; i++)
|
||||
if (PixColors[idx] == PixColors[i])
|
||||
break;
|
||||
if (i > WhiteColor) {
|
||||
/* fprintf (stderr, "XFreeColors: PixColors[%d] = %lu\n", idx, PixColors[idx]); */
|
||||
XFreeColors(Xdisplay, cmap, (PixColors + idx), 1,
|
||||
DisplayPlanes(Xdisplay, Xscreen));
|
||||
}
|
||||
# endif
|
||||
|
||||
PixColors[idx] = xcol.pixel;
|
||||
|
||||
/* XSetWindowAttributes attr; */
|
||||
/* Cursor cursor; */
|
||||
Done:
|
||||
if (idx == bgColor)
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
|
||||
/* handle colorBD, scrollbar background, etc. */
|
||||
|
||||
set_colorfgbg();
|
||||
{
|
||||
|
||||
XColor fg, bg;
|
||||
|
||||
fg.pixel = PixColors[fgColor];
|
||||
XQueryColor(Xdisplay, cmap, &fg);
|
||||
bg.pixel = PixColors[bgColor];
|
||||
XQueryColor(Xdisplay, cmap, &bg);
|
||||
|
||||
XRecolorCursor(Xdisplay, TermWin_cursor, &fg, &bg);
|
||||
}
|
||||
/* the only reasonable way to enforce a clean update */
|
||||
scr_poweron();
|
||||
}
|
||||
#else
|
||||
# define set_window_color(idx,color) ((void)0)
|
||||
#endif /* XTERM_COLOR_CHANGE */
|
||||
|
||||
/* load_font(): Load a new font and return a pointer to it. */
|
||||
XFontStruct *
|
||||
load_font(const char *fontname)
|
||||
{
|
||||
|
||||
XFontStruct *xfont;
|
||||
const char *fallback = "fixed";
|
||||
|
||||
ASSERT_RVAL(fontname != NULL, NULL);
|
||||
|
||||
xfont = XLoadQueryFont(Xdisplay, fontname);
|
||||
if (!xfont) {
|
||||
print_error("Unable to load font \"%s\". Falling back on \"%s\"\n", fontname, fallback);
|
||||
xfont = XLoadQueryFont(Xdisplay, fallback);
|
||||
if (!xfont) {
|
||||
fatal_error("Unable to load font \"%s\". Unable to continue.\n", fallback);
|
||||
}
|
||||
}
|
||||
return (xfont);
|
||||
}
|
||||
|
||||
/* change_font() - Switch to a new font */
|
||||
/*
|
||||
* init = 1 - initialize
|
||||
*
|
||||
* fontname == FONT_UP - switch to bigger font
|
||||
* fontname == FONT_DN - switch to smaller font
|
||||
*/
|
||||
void
|
||||
change_font(int init, const char *fontname)
|
||||
{
|
||||
const char *const msg = "can't load font \"%s\"";
|
||||
XFontStruct *xfont;
|
||||
static char *newfont[NFONTS];
|
||||
#ifndef NO_BOLDFONT
|
||||
static XFontStruct *boldFont = NULL;
|
||||
#endif
|
||||
static int fnum = FONT0_IDX; /* logical font number */
|
||||
int idx = 0; /* index into rs_font[] */
|
||||
|
||||
if (!init) {
|
||||
switch (fontname[0]) {
|
||||
case '\0':
|
||||
fnum = FONT0_IDX;
|
||||
fontname = NULL;
|
||||
break;
|
||||
|
||||
/* special (internal) prefix for font commands */
|
||||
case FONT_CMD:
|
||||
idx = atoi(fontname + 1);
|
||||
switch (fontname[1]) {
|
||||
case '+': /* corresponds to FONT_UP */
|
||||
fnum += (idx ? idx : 1);
|
||||
fnum = FNUM_RANGE(fnum);
|
||||
break;
|
||||
|
||||
case '-': /* corresponds to FONT_DN */
|
||||
fnum += (idx ? idx : -1);
|
||||
fnum = FNUM_RANGE(fnum);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (fontname[1] != '\0' && !isdigit(fontname[1]))
|
||||
return;
|
||||
if (idx < 0 || idx >= (NFONTS))
|
||||
return;
|
||||
fnum = IDX2FNUM(idx);
|
||||
break;
|
||||
}
|
||||
fontname = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (fontname != NULL) {
|
||||
/* search for existing fontname */
|
||||
for (idx = 0; idx < NFONTS; idx++) {
|
||||
if (!strcmp(rs_font[idx], fontname)) {
|
||||
fnum = IDX2FNUM(idx);
|
||||
fontname = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
return;
|
||||
break;
|
||||
}
|
||||
/* re-position around the normal font */
|
||||
idx = FNUM2IDX(fnum);
|
||||
|
||||
if (fontname != NULL) {
|
||||
char *name;
|
||||
|
||||
xfont = XLoadQueryFont(Xdisplay, fontname);
|
||||
if (!xfont)
|
||||
return;
|
||||
|
||||
name = MALLOC(strlen(fontname + 1) * sizeof(char));
|
||||
|
||||
if (name == NULL) {
|
||||
XFreeFont(Xdisplay, xfont);
|
||||
return;
|
||||
}
|
||||
strcpy(name, fontname);
|
||||
if (newfont[idx] != NULL)
|
||||
FREE(newfont[idx]);
|
||||
newfont[idx] = name;
|
||||
rs_font[idx] = newfont[idx];
|
||||
}
|
||||
}
|
||||
if (TermWin.font)
|
||||
XFreeFont(Xdisplay, TermWin.font);
|
||||
|
||||
/* load font or substitute */
|
||||
xfont = XLoadQueryFont(Xdisplay, rs_font[idx]);
|
||||
if (!xfont) {
|
||||
print_error(msg, rs_font[idx]);
|
||||
rs_font[idx] = "fixed";
|
||||
xfont = XLoadQueryFont(Xdisplay, rs_font[idx]);
|
||||
if (!xfont) {
|
||||
print_error(msg, rs_font[idx]);
|
||||
ABORT();
|
||||
}
|
||||
}
|
||||
TermWin.font = xfont;
|
||||
|
||||
#ifndef NO_BOLDFONT
|
||||
/* fail silently */
|
||||
if (init && rs_boldFont != NULL)
|
||||
boldFont = XLoadQueryFont(Xdisplay, rs_boldFont);
|
||||
#endif
|
||||
|
||||
#ifdef MULTI_CHARSET
|
||||
if (TermWin.mfont)
|
||||
XFreeFont(Xdisplay, TermWin.mfont);
|
||||
|
||||
/* load font or substitute */
|
||||
xfont = XLoadQueryFont(Xdisplay, rs_mfont[idx]);
|
||||
if (!xfont) {
|
||||
print_error(msg, rs_mfont[idx]);
|
||||
rs_mfont[idx] = "k14";
|
||||
xfont = XLoadQueryFont(Xdisplay, rs_mfont[idx]);
|
||||
if (!xfont) {
|
||||
print_error(msg, rs_mfont[idx]);
|
||||
ABORT();
|
||||
}
|
||||
}
|
||||
TermWin.mfont = xfont;
|
||||
# ifdef USE_XIM
|
||||
if (Input_Context) {
|
||||
if (TermWin.fontset)
|
||||
XFreeFontSet(Xdisplay, TermWin.fontset);
|
||||
TermWin.fontset = create_fontset(rs_font[idx], rs_mfont[idx]);
|
||||
xim_set_fontset();
|
||||
}
|
||||
# endif
|
||||
#endif /* MULTI_CHARSET */
|
||||
|
||||
/* alter existing GC */
|
||||
if (!init) {
|
||||
XSetFont(Xdisplay, TermWin.gc, TermWin.font->fid);
|
||||
}
|
||||
/* set the sizes */
|
||||
{
|
||||
|
||||
int cw, fh, fw = 0;
|
||||
unsigned long i;
|
||||
|
||||
fw = TermWin.font->min_bounds.width;
|
||||
fh = TermWin.font->ascent + TermWin.font->descent + rs_line_space;
|
||||
|
||||
D_X11(("Font information: Ascent == %hd, Descent == %hd\n", TermWin.font->ascent, TermWin.font->descent));
|
||||
if (TermWin.font->min_bounds.width == TermWin.font->max_bounds.width)
|
||||
TermWin.fprop = 0; /* Mono-spaced (fixed width) font */
|
||||
else
|
||||
TermWin.fprop = 1; /* Proportional font */
|
||||
if (TermWin.fprop == 1)
|
||||
for (i = TermWin.font->min_char_or_byte2;
|
||||
i <= TermWin.font->max_char_or_byte2; i++) {
|
||||
cw = TermWin.font->per_char[i].width;
|
||||
MAX_IT(fw, cw);
|
||||
}
|
||||
/* not the first time thru and sizes haven't changed */
|
||||
if (fw == TermWin.fwidth && fh == TermWin.fheight)
|
||||
return; /* TODO: not return; check MULTI_CHARSET if needed */
|
||||
|
||||
TermWin.fwidth = fw;
|
||||
TermWin.fheight = fh;
|
||||
}
|
||||
|
||||
/* check that size of boldFont is okay */
|
||||
#ifndef NO_BOLDFONT
|
||||
TermWin.boldFont = NULL;
|
||||
if (boldFont != NULL) {
|
||||
int i, cw, fh, fw = 0;
|
||||
|
||||
fw = boldFont->min_bounds.width;
|
||||
fh = boldFont->ascent + boldFont->descent + rs_line_space;
|
||||
if (TermWin.fprop == 0) { /* bold font must also be monospaced */
|
||||
if (fw != boldFont->max_bounds.width)
|
||||
fw = -1;
|
||||
} else {
|
||||
for (i = 0; i < 256; i++) {
|
||||
if (!isprint(i))
|
||||
continue;
|
||||
cw = boldFont->per_char[i].width;
|
||||
MAX_IT(fw, cw);
|
||||
}
|
||||
}
|
||||
|
||||
if (fw == TermWin.fwidth && fh == TermWin.fheight)
|
||||
TermWin.boldFont = boldFont;
|
||||
}
|
||||
#endif /* NO_BOLDFONT */
|
||||
|
||||
set_colorfgbg();
|
||||
|
||||
TermWin.width = TermWin.ncol * TermWin.fwidth;
|
||||
TermWin.height = TermWin.nrow * TermWin.fheight;
|
||||
|
||||
szHint.width_inc = TermWin.fwidth;
|
||||
szHint.height_inc = TermWin.fheight;
|
||||
|
||||
szHint.min_width = szHint.base_width + szHint.width_inc;
|
||||
szHint.min_height = szHint.base_height + szHint.height_inc;
|
||||
|
||||
szHint.width = szHint.base_width + TermWin.width;
|
||||
szHint.height = szHint.base_height + TermWin.height;
|
||||
|
||||
szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity;
|
||||
|
||||
if (!init) {
|
||||
font_change_count++;
|
||||
resize();
|
||||
}
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
/* windows.h -- Eterm window handling module header file
|
||||
* -- 29 April 1999, mej
|
||||
*
|
||||
* This file is original work by Michael Jennings <mej@eterm.org> and
|
||||
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
|
||||
* bearing this same message or a similar one, is distributed under
|
||||
* the GNU Public License (GPL) as outlined in the COPYING file.
|
||||
*
|
||||
* Copyright (C) 1997, Michael Jennings and Tuomo Venalainen
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _WINDOWS_H_
|
||||
#define _WINDOWS_H_
|
||||
/* includes */
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
# define NFONTS 5
|
||||
/* special (internal) prefix for font commands */
|
||||
# define FONT_CMD '#'
|
||||
# define FONT_DN "#-"
|
||||
# define FONT_UP "#+"
|
||||
#if (FONT0_IDX == 0)
|
||||
# define IDX2FNUM(i) (i)
|
||||
# define FNUM2IDX(f) (f)
|
||||
#else
|
||||
# define IDX2FNUM(i) (i == 0? FONT0_IDX : (i <= FONT0_IDX? (i-1) : i))
|
||||
# define FNUM2IDX(f) (f == FONT0_IDX ? 0 : (f < FONT0_IDX ? (f+1) : f))
|
||||
#endif
|
||||
#define FNUM_RANGE(i) (i <= 0 ? 0 : (i >= NFONTS ? (NFONTS-1) : i))
|
||||
|
||||
/************ Variables ************/
|
||||
extern char *rs_color[NRS_COLORS];
|
||||
extern Pixel PixColors[NRS_COLORS + NSHADOWCOLORS];
|
||||
extern XSetWindowAttributes Attributes;
|
||||
extern XWindowAttributes attr;
|
||||
extern XSizeHints szHint;
|
||||
extern int font_change_count;
|
||||
extern const char *def_fontName[];
|
||||
extern const char *rs_font[NFONTS];
|
||||
# ifdef MULTI_CHARSET
|
||||
extern const char *def_kfontName[];
|
||||
extern const char *rs_mfont[NFONTS];
|
||||
# endif
|
||||
|
||||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern Pixel get_bottom_shadow_color(Pixel, const char *);
|
||||
extern Pixel get_top_shadow_color(Pixel, const char *);
|
||||
extern void Create_Windows(int, char * []);
|
||||
extern void resize_subwindows(int, int);
|
||||
extern void resize(void);
|
||||
extern void resize_window1(unsigned int, unsigned int);
|
||||
extern void set_width(unsigned short);
|
||||
extern void resize_window(void);
|
||||
#ifdef XTERM_COLOR_CHANGE
|
||||
extern void set_window_color(int, const char *);
|
||||
#else
|
||||
# define set_window_color(idx,color) ((void)0)
|
||||
#endif /* XTERM_COLOR_CHANGE */
|
||||
extern XFontStruct *load_font(const char *);
|
||||
extern void change_font(int, const char *);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
||||
#endif /* _WINDOWS_H_ */
|
|
@ -1 +1 @@
|
|||
MAIN
|
||||
theme.cfg
|
||||
|
|
|
@ -0,0 +1,891 @@
|
|||
<Eterm-0.8.10>
|
||||
begin menu
|
||||
title Font
|
||||
font -*-times-bold-r-normal--14-*-*-*-*-*-iso8859-1
|
||||
begin menuitem
|
||||
text "Normal"
|
||||
action string "\e]50;#"
|
||||
end
|
||||
begin menuitem
|
||||
text "Larger"
|
||||
action string "\e]50;#+"
|
||||
end
|
||||
begin menuitem
|
||||
text "Smaller"
|
||||
action string "\e]50;#-"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Font 1"
|
||||
action string "\e]50;#1"
|
||||
end
|
||||
begin menuitem
|
||||
text "Font 2"
|
||||
action string "\e]50;#2"
|
||||
end
|
||||
begin menuitem
|
||||
text "Font 3"
|
||||
action string "\e]50;#3"
|
||||
end
|
||||
begin menuitem
|
||||
text "Font 4"
|
||||
action string "\e]50;#4"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Toggles
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Cursor Visible"
|
||||
action string "\e[?25t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Home on Echo"
|
||||
action string "\e[?1010t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Home on Refresh"
|
||||
action string "\e[?1011t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Home on Input"
|
||||
action string "\e[?1012t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Map Alert"
|
||||
action string "\e]6;21\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Primary/Secondary Screen"
|
||||
action string "\e[?47t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Reverse Video"
|
||||
action string "\e[?5t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Select Trailing Spaces"
|
||||
action string "\e]6;25\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Select Whole Line on Triple-click"
|
||||
action string "\e]6;23\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Visual Bell"
|
||||
action string "\e]6;20\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "X11 Mouse Reporting"
|
||||
action string "\e[?1000t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Xterm Selection Behavior"
|
||||
action string "\e]6;22\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Keys
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Application Arrow Keys"
|
||||
action string "\e[?1t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Application Keypad"
|
||||
action string "\e[?66t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Backspace/Delete"
|
||||
action string "\e[?67t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Xterm Shift-Keys"
|
||||
action string "\e[?35t"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Scrollbar
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Toggle Visibility"
|
||||
rtext "Ctrl-Button2"
|
||||
action string "\e[?30t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Swap Sides"
|
||||
action string "\e]6;11\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Floating"
|
||||
action string "\e]6;12\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Popup Mode"
|
||||
action string "\e]6;13\a"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Motif (Traditional) Style"
|
||||
action string "\e]6;10;motif;;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "NeXT Style"
|
||||
action string "\e]6;10;next;;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Xterm Style"
|
||||
action string "\e]6;10;xterm;;\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Width
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "5"
|
||||
action string "\e]6;10;;5;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "6"
|
||||
action string "\e]6;10;;6;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "7"
|
||||
action string "\e]6;10;;7;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "8"
|
||||
action string "\e]6;10;;8;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "9"
|
||||
action string "\e]6;10;;9;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "10"
|
||||
action string "\e]6;10;;10;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "11"
|
||||
action string "\e]6;10;;11;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "12"
|
||||
action string "\e]6;10;;12;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "13"
|
||||
action string "\e]6;10;;13;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "14"
|
||||
action string "\e]6;10;;14;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "15"
|
||||
action string "\e]6;10;;15;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "16"
|
||||
action string "\e]6;10;;16;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "17"
|
||||
action string "\e]6;10;;17;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "18"
|
||||
action string "\e]6;10;;18;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "19"
|
||||
action string "\e]6;10;;19;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "20"
|
||||
action string "\e]6;10;;20;\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title "Move to Desktop"
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "0"
|
||||
action string "\e]6;50;0;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "1"
|
||||
action string "\e]6;50;1;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "2"
|
||||
action string "\e]6;50;2;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "3"
|
||||
action string "\e]6;50;3;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "4"
|
||||
action string "\e]6;50;4;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "5"
|
||||
action string "\e]6;50;5;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "6"
|
||||
action string "\e]6;50;6;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "7"
|
||||
action string "\e]6;50;7;\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Terminal
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Toggles"
|
||||
action submenu "Toggles"
|
||||
end
|
||||
begin menuitem
|
||||
text "Keys"
|
||||
action submenu "Keys"
|
||||
end
|
||||
begin menuitem
|
||||
text "Scrollbar"
|
||||
action submenu "Scrollbar"
|
||||
end
|
||||
begin menuitem
|
||||
text "Move to Desktop..."
|
||||
action submenu "Move to Desktop"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Steal Focus"
|
||||
rtext "Ctrl-Button1"
|
||||
action string "\e]5;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Full Reset"
|
||||
action string "\ec"
|
||||
end
|
||||
end
|
||||
|
||||
begin menu
|
||||
title Transparency
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Force Update"
|
||||
action string "\e]6;3\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Desktop Watching"
|
||||
action string "\e]6;4\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Transparency"
|
||||
action string "\e]6;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Tiled
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "70's Marble"
|
||||
action string "\e]20;70s_marble.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "7m"
|
||||
action string "\e]20;7m.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Alabama Clay"
|
||||
action string "\e]20;dirt.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Anomaly"
|
||||
action string "\e]20;a8.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Black Stone"
|
||||
action string "\e]20;blackstone.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Ether"
|
||||
action string "\e]20;ether_blue.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Marble"
|
||||
action string "\e]20;blue_marble.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Maze"
|
||||
action string "\e]20;blue_maze.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Puzzle"
|
||||
action string "\e]20;026.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Circuit"
|
||||
action string "\e]20;circuit.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Cyber Playground"
|
||||
action string "\e]20;cyber_bg.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Dark Marble"
|
||||
action string "\e]20;dark_marble.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Dimples"
|
||||
action string "\e]20;014.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Ether"
|
||||
action string "\e]20;ether.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Giger 1"
|
||||
action string "\e]20;giger1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Giger 2"
|
||||
action string "\e]20;giger2.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Gray Matter"
|
||||
action string "\e]20;22.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Gray Waves"
|
||||
action string "\e]20;gray_waves.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Jungle"
|
||||
action string "\e]20;43.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Lava"
|
||||
action string "\e]20;4.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Light B1"
|
||||
action string "\e]20;lightb1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Maple Leaves"
|
||||
action string "\e]20;maple1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Marble"
|
||||
action string "\e]20;marbled.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Pebbles"
|
||||
action string "\e]20;pebble1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Purple Rain"
|
||||
action string "\e]20;024.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Purple Clouds"
|
||||
action string "\e]20;7.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Rainstorm"
|
||||
action string "\e]20;15.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Red Whisper"
|
||||
action string "\e]20;40.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Soft Marble"
|
||||
action string "\e]20;soft.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Space 1"
|
||||
action string "\e]20;space.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Space 2"
|
||||
action string "\e]20;starry.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Whirlpool"
|
||||
action string "\e]20;015.png;0x0+0+0:tile\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Scaled
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Alien Spheres"
|
||||
action string "\e]20;alien_spheres.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Atlantis"
|
||||
action string "\e]20;atlantis.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Before the Storm"
|
||||
action string "\e]20;before_the_storm.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Bladerunner"
|
||||
action string "\e]20;Bladerunner-bg.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Canyon"
|
||||
action string "\e]20;Canyon.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "CaveFire"
|
||||
action string "\e]20;Cavefire-bg.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Crater Lake"
|
||||
action string "\e]20;crater_lake.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Daughter"
|
||||
action string "\e]20;Daughter.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Dragon"
|
||||
action string "\e]20;Dragon.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "DVXVB"
|
||||
action string "\e]20;dvxvb.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Elysium"
|
||||
action string "\e]20;elysium.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Evocation"
|
||||
action string "\e]20;Evocation.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Hourglass"
|
||||
action string "\e]20;hour.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Ice Moon"
|
||||
action string "\e]20;icemoon.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Iron Temple"
|
||||
action string "\e]20;iron_temple.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Lake of Fire"
|
||||
action string "\e]20;lake_of_fire.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Lighthouse"
|
||||
action string "\e]20;lighthouse.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Monolith"
|
||||
action string "\e]20;monolith.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Nebula"
|
||||
action string "\e]20;nebula.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Neopolis"
|
||||
action string "\e]20;neopolis.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Neopolis Horizon"
|
||||
action string "\e]20;Neopolis-horizon.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Planet A"
|
||||
action string "\e]20;planeta.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Pond"
|
||||
action string "\e]20;pond.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Poseidon"
|
||||
action string "\e]20;poseidon.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Return to Giza"
|
||||
action string "\e]20;return_to_giza.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Ripple"
|
||||
action string "\e]20;ripple.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "River of Lead"
|
||||
action string "\e]20;river_of_lead.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Silence"
|
||||
action string "\e]20;silence.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Sun"
|
||||
action string "\e]20;sun.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Tunnel"
|
||||
action string "\e]20;tunnel.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Wasteland"
|
||||
action string "\e]20;wasteland.jpg;100x100+50+50\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Attrib
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Full Size"
|
||||
action string "\e]20;;100x100"
|
||||
end
|
||||
begin menuitem
|
||||
text "Normal Size"
|
||||
action string "\e]20;;0x0"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Tiled"
|
||||
action string "\e]20;;:tile"
|
||||
end
|
||||
begin menuitem
|
||||
text "Scaled"
|
||||
action string "\e]20;;:scale"
|
||||
end
|
||||
begin menuitem
|
||||
text "Proportional Scale"
|
||||
action string "\e]20;;:propscale"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Center"
|
||||
action string "\e]20;;=+50+50"
|
||||
end
|
||||
begin menuitem
|
||||
text "Top Left Corner"
|
||||
action string "\e]20;;=+0+0"
|
||||
end
|
||||
begin menuitem
|
||||
text "Bottom Right Corner"
|
||||
action string "\e]20;;=+100+100"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Pixmap
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "None"
|
||||
action string "\e[m\e]20;;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Viewport Mode"
|
||||
action string "\e]6;24\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Tiled"
|
||||
action submenu "Tiled"
|
||||
end
|
||||
begin menuitem
|
||||
text "Scaled"
|
||||
action submenu "Scaled"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Attrib"
|
||||
action submenu "Attrib"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Brightness
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "512 (200%)"
|
||||
action string "\e]6;1;image;brightness;512\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "480 (188%)"
|
||||
action string "\e]6;1;image;brightness;480\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "448 (175%)"
|
||||
action string "\e]6;1;image;brightness;448\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "416 (163%)"
|
||||
action string "\e]6;1;image;brightness;416\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "384 (150%)"
|
||||
action string "\e]6;1;image;brightness;384\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "352 (138%)"
|
||||
action string "\e]6;1;image;brightness;352\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "320 (125%)"
|
||||
action string "\e]6;1;image;brightness;320\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "288 (113%)"
|
||||
action string "\e]6;1;image;brightness;288\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "256 (100%)"
|
||||
action string "\e]6;1;image;brightness;256\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "224 (88%)"
|
||||
action string "\e]6;1;image;brightness;224\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "192 (75%)"
|
||||
action string "\e]6;1;image;brightness;192\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "160 (63%)"
|
||||
action string "\e]6;1;image;brightness;160\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "128 (50%)"
|
||||
action string "\e]6;1;image;brightness;128\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "96 (38%)"
|
||||
action string "\e]6;1;image;brightness;96\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "64 (25%)"
|
||||
action string "\e]6;1;image;brightness;64\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "32 (13%)"
|
||||
action string "\e]6;1;image;brightness;32\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "0 (0%)"
|
||||
action string "\e]6;1;image;brightness;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Contrast
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "512 (200%)"
|
||||
action string "\e]6;1;image;contrast;512\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "480 (188%)"
|
||||
action string "\e]6;1;image;contrast;480\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "448 (175%)"
|
||||
action string "\e]6;1;image;contrast;448\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "416 (163%)"
|
||||
action string "\e]6;1;image;contrast;416\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "384 (150%)"
|
||||
action string "\e]6;1;image;contrast;384\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "352 (138%)"
|
||||
action string "\e]6;1;image;contrast;352\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "320 (125%)"
|
||||
action string "\e]6;1;image;contrast;320\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "288 (113%)"
|
||||
action string "\e]6;1;image;contrast;288\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "256 (100%)"
|
||||
action string "\e]6;1;image;contrast;256\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "224 (88%)"
|
||||
action string "\e]6;1;image;contrast;224\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "192 (75%)"
|
||||
action string "\e]6;1;image;contrast;192\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "160 (63%)"
|
||||
action string "\e]6;1;image;contrast;160\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "128 (50%)"
|
||||
action string "\e]6;1;image;contrast;128\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "96 (38%)"
|
||||
action string "\e]6;1;image;contrast;96\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "64 (25%)"
|
||||
action string "\e]6;1;image;contrast;64\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "32 (13%)"
|
||||
action string "\e]6;1;image;contrast;32\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "0 (0%)"
|
||||
action string "\e]6;1;image;contrast;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Gamma
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "512 (200%)"
|
||||
action string "\e]6;1;image;gamma;512\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "480 (188%)"
|
||||
action string "\e]6;1;image;gamma;480\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "448 (175%)"
|
||||
action string "\e]6;1;image;gamma;448\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "416 (163%)"
|
||||
action string "\e]6;1;image;gamma;416\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "384 (150%)"
|
||||
action string "\e]6;1;image;gamma;384\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "352 (138%)"
|
||||
action string "\e]6;1;image;gamma;352\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "320 (125%)"
|
||||
action string "\e]6;1;image;gamma;320\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "288 (113%)"
|
||||
action string "\e]6;1;image;gamma;288\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "256 (100%)"
|
||||
action string "\e]6;1;image;gamma;256\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "224 (88%)"
|
||||
action string "\e]6;1;image;gamma;224\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "192 (75%)"
|
||||
action string "\e]6;1;image;gamma;192\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "160 (63%)"
|
||||
action string "\e]6;1;image;gamma;160\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "128 (50%)"
|
||||
action string "\e]6;1;image;gamma;128\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "96 (38%)"
|
||||
action string "\e]6;1;image;gamma;96\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "64 (25%)"
|
||||
action string "\e]6;1;image;gamma;64\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "32 (13%)"
|
||||
action string "\e]6;1;image;gamma;32\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "0 (0%)"
|
||||
action string "\e]6;1;image;gamma;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Background
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Transparency"
|
||||
action submenu "Transparency"
|
||||
end
|
||||
begin menuitem
|
||||
text "Pixmap"
|
||||
action submenu "Pixmap"
|
||||
end
|
||||
begin menuitem
|
||||
text "Brightness"
|
||||
action submenu "Brightness"
|
||||
end
|
||||
begin menuitem
|
||||
text "Contrast"
|
||||
action submenu "Contrast"
|
||||
end
|
||||
begin menuitem
|
||||
text "Gamma"
|
||||
action submenu "Gamma"
|
||||
end
|
||||
end
|
||||
|
||||
# This is the menu that gets called by Ctrl-Button3
|
||||
begin menu
|
||||
title Eterm
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Font"
|
||||
action submenu Font
|
||||
end
|
||||
begin menuitem
|
||||
text "Background"
|
||||
action submenu Background
|
||||
end
|
||||
begin menuitem
|
||||
text "Terminal"
|
||||
action submenu Terminal
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Version"
|
||||
action string "\e[8n"
|
||||
end
|
||||
begin menuitem
|
||||
text "Status"
|
||||
action string "\e[9n"
|
||||
end
|
||||
separator
|
||||
begin menuitem
|
||||
text "Save Settings..."
|
||||
action string "\e]6;71\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Exit"
|
||||
action string "\e]6;70\a"
|
||||
end
|
||||
end
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
# standard settings for an Eterm control menu
|
||||
[menu:Eterm]
|
||||
|
||||
/Eterm/*
|
||||
|
||||
./Font/*
|
||||
{Normal} ^@\e]50;#
|
||||
{Larger} ^@\e]50;#+
|
||||
{Smaller} ^@\e]50;#-
|
||||
{-}
|
||||
{Font 1} ^@\e]50;#1
|
||||
{Font 2} ^@\e]50;#2
|
||||
{Font 3} ^@\e]50;#3
|
||||
{Font 4} ^@\e]50;#4
|
||||
|
||||
../Terminal/*
|
||||
./Toggles/*
|
||||
{Cursor Visible} ^@\e[?25t
|
||||
{Home on Echo} ^@\e[?1010t
|
||||
{Home on Refresh} ^@\e[?1011t
|
||||
{Home on Input} ^@\e[?1012t
|
||||
{Map Alert} ^@\e]6;21\a
|
||||
{Primary/Secondary Screen} ^@\e[?47t
|
||||
{Reverse Video} ^@\e[?5t
|
||||
{Select Trailing Spaces} ^@\e]6;25\a
|
||||
{Select Whole Line on Triple-click} ^@\e]6;23\a
|
||||
{Visual Bell} ^@\e]6;20\a
|
||||
{X11 Mouse Reporting} ^@\e[?1000t
|
||||
{Xterm Selection Behavior} ^@\e]6;22\a
|
||||
../Keys/*
|
||||
{Application Arrow Keys} ^@\e[?1t
|
||||
{Application Keypad} ^@\e[?66t
|
||||
{Backspace/Delete} ^@\e[?67t
|
||||
{Xterm Shift-Keys} ^@\e[?35t
|
||||
../Menubar/*
|
||||
{Toggle Visibility}{Ctrl-Button3} ^@\e[?10t
|
||||
{Refresh Menubar} ^@\e[?10h
|
||||
{Toggle Window Move by Menubar} ^@\e]6;15\a
|
||||
../Scrollbar/*
|
||||
{Toggle Visibility}{Ctrl-Button2} ^@\e[?30t
|
||||
{Swap Sides} ^@\e]6;11\a
|
||||
{Toggle Floating} ^@\e]6;12\a
|
||||
{Toggle Popup Mode} ^@\e]6;13\a
|
||||
{-}
|
||||
{Motif (Traditional) Style} ^@\e]6;10;motif;;\a
|
||||
{NeXT Style} ^@\e]6;10;next;;\a
|
||||
{Xterm Style} ^@\e]6;10;xterm;;\a
|
||||
./Width/*
|
||||
{5} ^@\e]6;10;;5;\a
|
||||
{6} ^@\e]6;10;;6;\a
|
||||
{7} ^@\e]6;10;;7;\a
|
||||
{8} ^@\e]6;10;;8;\a
|
||||
{9} ^@\e]6;10;;9;\a
|
||||
{10} ^@\e]6;10;;10;\a
|
||||
{11} ^@\e]6;10;;11;\a
|
||||
{12} ^@\e]6;10;;12;\a
|
||||
{13} ^@\e]6;10;;13;\a
|
||||
{14} ^@\e]6;10;;14;\a
|
||||
{15} ^@\e]6;10;;15;\a
|
||||
{16} ^@\e]6;10;;16;\a
|
||||
{17} ^@\e]6;10;;17;\a
|
||||
{18} ^@\e]6;10;;18;\a
|
||||
{19} ^@\e]6;10;;19;\a
|
||||
{20} ^@\e]6;10;;20;\a
|
||||
../
|
||||
../Move to Desktop/*
|
||||
{0} ^@\e]6;50;0;\a
|
||||
{1} ^@\e]6;50;1;\a
|
||||
{2} ^@\e]6;50;2;\a
|
||||
{3} ^@\e]6;50;3;\a
|
||||
{4} ^@\e]6;50;4;\a
|
||||
{5} ^@\e]6;50;5;\a
|
||||
{6} ^@\e]6;50;6;\a
|
||||
{7} ^@\e]6;50;7;\a
|
||||
../
|
||||
{-}
|
||||
{Steal Focus}{Ctrl-Button1} ^@\e]5;\a
|
||||
{Full Reset} ^@\ec
|
||||
|
||||
../Background/*
|
||||
./Transparency/*
|
||||
{Force Update} ^@\e]6;3\a
|
||||
{Toggle Desktop Watching} ^@\e]6;4\a
|
||||
{Toggle Transparency} ^@\e]6;0\a
|
||||
../Pixmap/*
|
||||
{None} ^@\e[m\e]20;;\a
|
||||
{Toggle Viewport Mode} ^@\e]6;24\a
|
||||
./Tiled/*
|
||||
{70's Marble} ^@\e]20;70s_marble.png;0x0+50+50\a
|
||||
{7m} ^@\e]10;[pixmap:7m.png;0x0+50+50]
|
||||
{Alabama Clay} ^@\e]10;[pixmap:dirt.png;0x0+50+50]
|
||||
{Anomaly} ^@\e]20;a8.png;0x0+50+50\a
|
||||
{Black Stone} ^@\e]20;blackstone.png;0x0+50+50\a
|
||||
{Blue Ether} ^@\e]10;[pixmap:ether_blue.png;0x0+50+50]
|
||||
{Blue Marble} ^@\e]10;[pixmap:blue_marble.png;0x0+50+50]
|
||||
{Blue Maze} ^@\e]10;[pixmap:blue_maze.png;0x0+50+50]
|
||||
{Blue Puzzle} ^@\e]10;[pixmap:026.png;0x0+50+50]
|
||||
{Circuit} ^@\e]10;[pixmap:circuit.png;0x0+50+50]
|
||||
{Cyber Playground} ^@\e]10;[pixmap:cyber_bg.png;0x0+50+50]
|
||||
{Dark Marble} ^@\e]10;[pixmap:dark_marble.png;0x0+50+50]
|
||||
{Dimples} ^@\e]20;014.png;0x0+50+50\a
|
||||
{Ether} ^@\e]10;[pixmap:ether.png;0x0+50+50]
|
||||
{Giger 1} ^@\e]10;[pixmap:giger1.png;0x0+50+50]
|
||||
{Giger 2} ^@\e]10;[pixmap:giger2.png;0x0+50+50]
|
||||
{Gray Matter} ^@\e]10;[pixmap:22.png;0x0+50+50]
|
||||
{Gray Waves} ^@\e]10;[pixmap:gray_waves.png;0x0+50+50]
|
||||
{Jungle} ^@\e]20;43.png;0x0+50+50\a
|
||||
{Lava} ^@\e]20;4.png;0x0+50+50\a
|
||||
{Light B1} ^@\e]10;[pixmap:lightb1.png;0x0+50+50]
|
||||
{Maple Leaves} ^@\e]10;[pixmap:maple1.png;0x0+50+50]
|
||||
{Marble} ^@\e]10;[pixmap:marbled.png;0x0+50+50]
|
||||
{Pebbles} ^@\e]10;[pixmap:pebble1.png;0x0+50+50]
|
||||
{Purple Rain} ^@\e]20;024.png;0x0+50+50\a
|
||||
{Purple Clouds} ^@\e]10;[pixmap:7.png;0x0+50+50]
|
||||
{Rainstorm} ^@\e]20;15.png;0x0+50+50\a
|
||||
{Red Whisper} ^@\e]10;[pixmap:40.png;0x0+50+50]
|
||||
{Soft Marble} ^@\e]10;[pixmap:soft.png;0x0+50+50]
|
||||
{Space 1} ^@\e]10;[pixmap:space.png;0x0+50+50]
|
||||
{Space 2} ^@\e]10;[pixmap:starry.png;0x0+50+50]
|
||||
{Whirlpool} ^@\e]20;015.png;0x0+50+50\a
|
||||
|
||||
../Scaled/*
|
||||
{Alien Spheres} ^@\e]20;alien_spheres.jpg;100x100+50+50\a
|
||||
{Atlantis} ^@\e]20;atlantis.jpg;100x100+50+50\a
|
||||
{Before the Storm} ^@\e]20;before_the_storm.jpg;100x100+50+50\a
|
||||
{Bladerunner} ^@\e]20;Bladerunner-bg.png;100x100+50+50\a
|
||||
{Canyon} ^@\e]20;Canyon.jpg;100x100+50+50\a
|
||||
{CaveFire} ^@\e]20;Cavefire-bg.png;100x100+50+50\a
|
||||
{Crater Lake} ^@\e]20;crater_lake.jpg;100x100+50+50\a
|
||||
{Daughter} ^@\e]20;Daughter.jpg;100x100+50+50\a
|
||||
{Dragon} ^@\e]20;Dragon.jpg;100x100+50+50\a
|
||||
{DVXVB} ^@\e]20;dvxvb.jpg;100x100+50+50\a
|
||||
{Elysium} ^@\e]20;elysium.jpg;100x100+50+50\a
|
||||
{Evocation} ^@\e]20;Evocation.jpg;100x100+50+50\a
|
||||
{Hourglass} ^@\e]20;hour.jpg;100x100+50+50\a
|
||||
{Ice Moon} ^@\e]20;icemoon.jpg;100x100+50+50\a
|
||||
{Iron Temple} ^@\e]20;iron_temple.jpg;100x100+50+50\a
|
||||
{Lake of Fire} ^@\e]20;lake_of_fire.jpg;100x100+50+50\a
|
||||
{Lighthouse} ^@\e]20;lighthouse.jpg;100x100+50+50\a
|
||||
{Monolith} ^@\e]20;monolith.jpg;100x100+50+50\a
|
||||
{Nebula} ^@\e]20;nebula.jpg;100x100+50+50\a
|
||||
{Neopolis} ^@\e]20;neopolis.jpg;100x100+50+50\a
|
||||
{Neopolis Horizon} ^@\e]20;Neopolis-horizon.png;100x100+50+50\a
|
||||
{Planet A} ^@\e]20;planeta.png;100x100+50+50\a
|
||||
{Pond} ^@\e]20;pond.png;100x100+50+50\a
|
||||
{Poseidon} ^@\e]20;poseidon.png;100x100+50+50\a
|
||||
{Return to Giza} ^@\e]20;return_to_giza.jpg;100x100+50+50\a
|
||||
{Ripple} ^@\e]20;ripple.png;100x100+50+50\a
|
||||
{River of Lead} ^@\e]20;river_of_lead.jpg;100x100+50+50\a
|
||||
{Silence} ^@\e]20;silence.jpg;100x100+50+50\a
|
||||
{Sun} ^@\e]20;sun.png;100x100+50+50\a
|
||||
{Tunnel} ^@\e]20;tunnel.jpg;100x100+50+50\a
|
||||
{Wasteland} ^@\e]20;wasteland.jpg;100x100+50+50\a
|
||||
../
|
||||
{-}
|
||||
./Attrib/*
|
||||
{Full} ^@\e]20;;100x100+50+50;
|
||||
{Tiled} ^@\e]20;;0
|
||||
{Center} ^@\e]20;;=+50+50;
|
||||
../
|
||||
../Shade/*
|
||||
{0%} ^@\e]6;1;0%\a
|
||||
{10%} ^@\e]6;1;10%\a
|
||||
{20%} ^@\e]6;1;20%\a
|
||||
{30%} ^@\e]6;1;30%\a
|
||||
{40%} ^@\e]6;1;40%\a
|
||||
{50%} ^@\e]6;1;50%\a
|
||||
{60%} ^@\e]6;1;60%\a
|
||||
{70%} ^@\e]6;1;70%\a
|
||||
{80%} ^@\e]6;1;80%\a
|
||||
{90%} ^@\e]6;1;90%\a
|
||||
{100%} ^@\e]6;1;100%\a
|
||||
../Tint/*
|
||||
{No Tint} ^@\e]6;2;0xffffff\a
|
||||
{Red Tint} ^@\e]6;2;0xff8080\a
|
||||
{Green Tint} ^@\e]6;2;0x80ff80\a
|
||||
{Blue Tint} ^@\e]6;2;0x8080ff\a
|
||||
{Cyan Tint} ^@\e]6;2;0x80ffff\a
|
||||
{Magenta Tint} ^@\e]6;2;0xff80ff\a
|
||||
{Yellow Tint} ^@\e]6;2;0xffff80\a
|
||||
../
|
||||
|
||||
../
|
||||
{-}
|
||||
{Version} ^@\e[8n
|
||||
{Status} ^@\e[9n
|
||||
{-}
|
||||
{Save Current Settings} ^@\e]6;71\a
|
||||
{Exit Eterm} ^@\e]6;70\a
|
||||
/
|
||||
[show]
|
||||
[done]
|
|
@ -24,9 +24,11 @@ begin main
|
|||
background black
|
||||
cursor #ffff00
|
||||
cursor_text #880000
|
||||
menu_text white
|
||||
scrollbar #3f1c00
|
||||
unfocusedscrollbar #777777
|
||||
menu #777777
|
||||
unfocusedmenu #777777
|
||||
menu_text black
|
||||
pointer white
|
||||
|
||||
# video attribute can either be "normal" or "reverse"
|
||||
|
@ -88,31 +90,161 @@ begin main
|
|||
# font bold 7x14
|
||||
end attributes
|
||||
|
||||
# This section is for pixmap definitions. The only one used currently
|
||||
# is "background". The supplied numbers work just like they do for
|
||||
# Enlightenment: first is X (width), second is Y (height). -1 to
|
||||
# scale 100%, 0 to tile, any other number specifies W/H in pixels
|
||||
begin pixmaps
|
||||
background %random(`cat pixmaps.list 2>/dev/null`)
|
||||
path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:@DATADIR@/Eterm/pix/"
|
||||
# Define the imageclasses.
|
||||
begin imageclasses
|
||||
|
||||
# Support for these is forthcoming
|
||||
# scroll_up -1 -1 ~/.Eterm/up_arrow.ppm
|
||||
# scroll_down -1 -1 ~/.Eterm/down_arrow.ppm
|
||||
# scroll_background 0 0 ~/.Eterm/scroll.ppm
|
||||
# scroll_anchor -1 -1 ~/.Eterm/anchor.ppm
|
||||
# You must define this before setting any images that use it. This is the $PATH-style variable
|
||||
# that determines where Eterm looks for image files.
|
||||
path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:@PKGDATADIR@/pix/"
|
||||
|
||||
# If you want a different icon than the standard Eterm one, set this.
|
||||
# icon Eterm.xpm
|
||||
|
||||
# This is the background animator. See the man page for the syntax.
|
||||
# anim 3 foo1 foo2 foo3
|
||||
|
||||
# Here we define an image.
|
||||
begin image
|
||||
|
||||
# The first thing you set when defining an image MUST be the type. No type, no dice. The type
|
||||
# should be one of the following: background, up_arrow, down_arrow, left_arrow, right_arrow,
|
||||
# trough, anchor, menu, or submenu
|
||||
type background
|
||||
|
||||
# Next you should set the state. This is either normal, selected, or clicked.
|
||||
state normal
|
||||
|
||||
# Here you set the file. You can also set the geometry string here if you follow the filename with
|
||||
# an @ sign. That way, you can include the geometries in your pixmaps.list file.
|
||||
file %random(`cat pixmaps.list`)
|
||||
|
||||
# The mode line. This defines the startup mode for the image, as well as what modes are allowed.
|
||||
# Valid modes are "image" (to display the image file), "trans" (to be transparent), or "viewport"
|
||||
# (for viewport mode). Syntax is "mode <startup_mode> allow <allowed_modes>".
|
||||
mode image allow trans viewport
|
||||
|
||||
# Set the image border. This is a portion of the image which will be kept at its actual size when
|
||||
# scaling. Use this for beveled images (buttons, etc.).
|
||||
border 0 0 0 0
|
||||
|
||||
# Th-th-th-th-that's all folks.
|
||||
end image
|
||||
|
||||
# The rest of the images.
|
||||
begin image
|
||||
type trough
|
||||
mode image allow trans viewport
|
||||
state normal
|
||||
file bar_vertical_3.png
|
||||
# Here is how you specify the geometry string separately. See the man page for its syntax.
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type anchor
|
||||
state normal
|
||||
file bar_vertical_1.png
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
state selected
|
||||
file bar_vertical_2.png
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type up_arrow
|
||||
state normal
|
||||
file button_arrow_up_1.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state selected
|
||||
file button_arrow_up_2.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state clicked
|
||||
file button_arrow_up_3.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
end image
|
||||
begin image
|
||||
type down_arrow
|
||||
state normal
|
||||
file button_arrow_down_1.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state selected
|
||||
file button_arrow_down_2.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state clicked
|
||||
file button_arrow_down_3.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
end image
|
||||
begin image
|
||||
type menu
|
||||
state normal
|
||||
file bar_horizontal_1.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 3 2 2
|
||||
state selected
|
||||
file bar_horizontal_2.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type submenu
|
||||
state normal
|
||||
file menu1.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
state selected
|
||||
file menu2.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
state clicked
|
||||
file menu3.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
end image
|
||||
end
|
||||
|
||||
# The Kanji support options. Same goes for these fonts as for the normal
|
||||
# ones. The "encoding" attribute can be either "eucj" or "sjis".
|
||||
# begin kanji
|
||||
%include "Eterm-menu.cfg"
|
||||
|
||||
# This section *must* come after the menu definitions if you want
|
||||
# menu actions to work. C'est la vie. :-)
|
||||
#
|
||||
# Syntax: bind [ { <modifiers> | anymod } ] { <key> | <keysym> | <button> } to { string | echo | menu } <parameter>
|
||||
#
|
||||
begin actions
|
||||
bind ctrl button1 to string "\e]5;\a"
|
||||
bind ctrl button2 to string "\e[?30t"
|
||||
bind ctrl button3 to menu Eterm
|
||||
bind anymod f1 to menu Eterm
|
||||
end actions
|
||||
|
||||
# The Multichar support options. Same goes for these fonts as for the normal
|
||||
# ones. The "encoding" attribute can be either "eucj" or "sjis" or "euckr"
|
||||
# or big5 or gb
|
||||
# begin multichar
|
||||
# font 0 k14
|
||||
# font 1 jiskan16
|
||||
# font 2 jiskan18
|
||||
# font 3 jiskan24
|
||||
# font 4 jiskan26
|
||||
# encoding eucj
|
||||
# end kanji
|
||||
# end multichar
|
||||
|
||||
# The XIM support options.
|
||||
# input_method: set the name of your favorate input method program
|
||||
# preedit_type: OverTheSpot or OffTheSpot or Root
|
||||
# begin xim
|
||||
# input_method Ami
|
||||
# preedit_type OverTheSpot
|
||||
# end xim
|
||||
|
||||
# Boolean variables. The values can be "1", "on", or "true" for TRUE, or "0",
|
||||
# "off", or "false" for FALSE.
|
||||
|
@ -189,9 +321,6 @@ begin main
|
|||
# (Default is 5).
|
||||
border_width 5
|
||||
|
||||
# File to read for menubar
|
||||
menu Eterm.menu
|
||||
|
||||
# Value to use for $TERM
|
||||
term_name xterm
|
||||
|
|
@ -2,11 +2,13 @@
|
|||
|
||||
THEMES = Eterm chooser emacs irc mutt tn3270 trans
|
||||
|
||||
EXTRA_DIST = Eterm/Eterm.menu Eterm/MAIN.in irc/MAIN.in irc/irc.menu active.tags chooser/chooser.menu chooser/MAIN.in emacs/MAIN.in emacs/emacs.menu mutt/MAIN.in mutt/mutt.menu tn3270/MAIN.in trans/MAIN.in trans/trans.menu
|
||||
EXTRA_DIST = Eterm/theme.cfg.in irc/theme.cfg.in chooser/theme.cfg.in emacs/theme.cfg.in mutt/theme.cfg.in tn3270/theme.cfg.in \
|
||||
trans/theme.cfg.in Eterm/Eterm-menu.cfg irc/irc-menu.cfg chooser/chooser-menu.cfg emacs/emacs-menu.cfg \
|
||||
mutt/mutt-menu.cfg trans/trans-menu.cfg
|
||||
|
||||
install-data-hook:
|
||||
-@for i in $(THEMES) ; do \
|
||||
$(SED) -e 's%@''PREFIX''@%${prefix}%g' -e 's%@''DATADIR''@%${datadir}%g' -e 's%@''THEME''@%'$$i'%g' $$i/MAIN.in > $$i/MAIN ; \
|
||||
$(SED) -e 's%@''PREFIX''@%${prefix}%g' -e 's%@''PKGDATADIR''@%${DESTDIR}${pkgdatadir}%g' -e 's%@''THEME''@%'$$i'%g' $$i/theme.cfg.in > $$i/theme.cfg ; \
|
||||
done
|
||||
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/themes
|
||||
-@for i in $(THEMES) ; do \
|
||||
|
@ -16,10 +18,8 @@ install-data-hook:
|
|||
$(CP) $$i/???* $(DESTDIR)$(pkgdatadir)/themes/$$i ; \
|
||||
$(CHMOD) 755 $(DESTDIR)$(pkgdatadir)/themes/$$i ; \
|
||||
$(CHMOD) 644 $(DESTDIR)$(pkgdatadir)/themes/$$i/???* ; \
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/themes/$$i/MAIN.in ; \
|
||||
rm -f $(DESTDIR)$(pkgdatadir)/themes/$$i/theme.cfg.in ; \
|
||||
else \
|
||||
echo "ALERT! Not overwriting theme $$i in $(DESTDIR)$(pkgdatadir)/themes. You will need to update this theme manually." ; \
|
||||
fi ; \
|
||||
done
|
||||
@if test ! -f $(HOME)/.active.tags ; then $(CP) active.tags $(HOME)/.active.tags ; \
|
||||
else echo "Not installing $(HOME)/.active.tags -- File exists." ; fi
|
||||
|
|
|
@ -1 +1 @@
|
|||
MAIN
|
||||
theme.cfg
|
||||
|
|
|
@ -0,0 +1,993 @@
|
|||
<Eterm-0.8.10>
|
||||
%preproc m4
|
||||
define(STRING_ITEM, `begin menuitem
|
||||
text "$1"
|
||||
action string "$2"
|
||||
end')
|
||||
define(ECHO_ITEM, `begin menuitem
|
||||
text "$1"
|
||||
action echo "$2"
|
||||
end')
|
||||
define(SUBMENU_ITEM, `begin menuitem
|
||||
text "$1"
|
||||
action submenu "$1"
|
||||
end')
|
||||
define(FONT_ITEM, `begin menuitem
|
||||
text "$1"
|
||||
action string "\e]50;#$2"
|
||||
end')
|
||||
begin menu
|
||||
title Font
|
||||
font -*-times-bold-r-normal--14-*-*-*-*-*-iso8859-1
|
||||
STRING_ITEM(`Normal', `\e]50;#')
|
||||
STRING_ITEM(`Larger', `\e]50;#+')
|
||||
STRING_ITEM(`Smaller', `\e]50;#-')
|
||||
-
|
||||
STRING_ITEM(`Font 1', `\e]50;#1')
|
||||
STRING_ITEM(`Font 2', `\e]50;#2')
|
||||
STRING_ITEM(`Font 3', `\e]50;#3')
|
||||
STRING_ITEM(`Font 4', `\e]50;#4')
|
||||
end
|
||||
begin menu
|
||||
title Toggles
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Cursor Visible"
|
||||
action string "\e[?25t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Home on Echo"
|
||||
action string "\e[?1010t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Home on Refresh"
|
||||
action string "\e[?1011t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Home on Input"
|
||||
action string "\e[?1012t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Map Alert"
|
||||
action string "\e]6;21\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Primary/Secondary Screen"
|
||||
action string "\e[?47t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Reverse Video"
|
||||
action string "\e[?5t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Select Trailing Spaces"
|
||||
action string "\e]6;25\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Select Whole Line on Triple-click"
|
||||
action string "\e]6;23\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Visual Bell"
|
||||
action string "\e]6;20\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "X11 Mouse Reporting"
|
||||
action string "\e[?1000t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Xterm Selection Behavior"
|
||||
action string "\e]6;22\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Keys
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Application Arrow Keys"
|
||||
action string "\e[?1t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Application Keypad"
|
||||
action string "\e[?66t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Backspace/Delete"
|
||||
action string "\e[?67t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Xterm Shift-Keys"
|
||||
action string "\e[?35t"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Scrollbar
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Toggle Visibility"
|
||||
rtext "Ctrl-Button2"
|
||||
action string "\e[?30t"
|
||||
end
|
||||
begin menuitem
|
||||
text "Swap Sides"
|
||||
action string "\e]6;11\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Floating"
|
||||
action string "\e]6;12\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Popup Mode"
|
||||
action string "\e]6;13\a"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Motif (Traditional) Style"
|
||||
action string "\e]6;10;motif;;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "NeXT Style"
|
||||
action string "\e]6;10;next;;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Xterm Style"
|
||||
action string "\e]6;10;xterm;;\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Width
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "5"
|
||||
action string "\e]6;10;;5;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "6"
|
||||
action string "\e]6;10;;6;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "7"
|
||||
action string "\e]6;10;;7;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "8"
|
||||
action string "\e]6;10;;8;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "9"
|
||||
action string "\e]6;10;;9;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "10"
|
||||
action string "\e]6;10;;10;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "11"
|
||||
action string "\e]6;10;;11;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "12"
|
||||
action string "\e]6;10;;12;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "13"
|
||||
action string "\e]6;10;;13;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "14"
|
||||
action string "\e]6;10;;14;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "15"
|
||||
action string "\e]6;10;;15;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "16"
|
||||
action string "\e]6;10;;16;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "17"
|
||||
action string "\e]6;10;;17;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "18"
|
||||
action string "\e]6;10;;18;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "19"
|
||||
action string "\e]6;10;;19;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "20"
|
||||
action string "\e]6;10;;20;\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title "Move to Desktop"
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "0"
|
||||
action string "\e]6;50;0;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "1"
|
||||
action string "\e]6;50;1;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "2"
|
||||
action string "\e]6;50;2;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "3"
|
||||
action string "\e]6;50;3;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "4"
|
||||
action string "\e]6;50;4;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "5"
|
||||
action string "\e]6;50;5;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "6"
|
||||
action string "\e]6;50;6;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "7"
|
||||
action string "\e]6;50;7;\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Terminal
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Toggles"
|
||||
action submenu "Toggles"
|
||||
end
|
||||
begin menuitem
|
||||
text "Keys"
|
||||
action submenu "Keys"
|
||||
end
|
||||
begin menuitem
|
||||
text "Scrollbar"
|
||||
action submenu "Scrollbar"
|
||||
end
|
||||
begin menuitem
|
||||
text "Move to Desktop..."
|
||||
action submenu "Move to Desktop"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Steal Focus"
|
||||
rtext "Ctrl-Button1"
|
||||
action string "\e]5;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Full Reset"
|
||||
action string "\ec"
|
||||
end
|
||||
end
|
||||
|
||||
begin menu
|
||||
title Transparency
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Force Update"
|
||||
action string "\e]6;3\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Desktop Watching"
|
||||
action string "\e]6;4\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Transparency"
|
||||
action string "\e]6;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Tiled
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "70's Marble"
|
||||
action string "\e]20;70s_marble.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "7m"
|
||||
action string "\e]20;7m.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Alabama Clay"
|
||||
action string "\e]20;dirt.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Anomaly"
|
||||
action string "\e]20;a8.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Black Stone"
|
||||
action string "\e]20;blackstone.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Ether"
|
||||
action string "\e]20;ether_blue.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Marble"
|
||||
action string "\e]20;blue_marble.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Maze"
|
||||
action string "\e]20;blue_maze.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Blue Puzzle"
|
||||
action string "\e]20;026.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Circuit"
|
||||
action string "\e]20;circuit.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Cyber Playground"
|
||||
action string "\e]20;cyber_bg.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Dark Marble"
|
||||
action string "\e]20;dark_marble.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Dimples"
|
||||
action string "\e]20;014.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Ether"
|
||||
action string "\e]20;ether.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Giger 1"
|
||||
action string "\e]20;giger1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Giger 2"
|
||||
action string "\e]20;giger2.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Gray Matter"
|
||||
action string "\e]20;22.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Gray Waves"
|
||||
action string "\e]20;gray_waves.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Jungle"
|
||||
action string "\e]20;43.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Lava"
|
||||
action string "\e]20;4.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Light B1"
|
||||
action string "\e]20;lightb1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Maple Leaves"
|
||||
action string "\e]20;maple1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Marble"
|
||||
action string "\e]20;marbled.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Pebbles"
|
||||
action string "\e]20;pebble1.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Purple Rain"
|
||||
action string "\e]20;024.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Purple Clouds"
|
||||
action string "\e]20;7.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Rainstorm"
|
||||
action string "\e]20;15.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Red Whisper"
|
||||
action string "\e]20;40.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Soft Marble"
|
||||
action string "\e]20;soft.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Space 1"
|
||||
action string "\e]20;space.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Space 2"
|
||||
action string "\e]20;starry.png;0x0+0+0:tile\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Whirlpool"
|
||||
action string "\e]20;015.png;0x0+0+0:tile\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Scaled
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Alien Spheres"
|
||||
action string "\e]20;alien_spheres.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Atlantis"
|
||||
action string "\e]20;atlantis.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Before the Storm"
|
||||
action string "\e]20;before_the_storm.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Bladerunner"
|
||||
action string "\e]20;Bladerunner-bg.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Canyon"
|
||||
action string "\e]20;Canyon.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "CaveFire"
|
||||
action string "\e]20;Cavefire-bg.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Crater Lake"
|
||||
action string "\e]20;crater_lake.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Daughter"
|
||||
action string "\e]20;Daughter.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Dragon"
|
||||
action string "\e]20;Dragon.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "DVXVB"
|
||||
action string "\e]20;dvxvb.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Elysium"
|
||||
action string "\e]20;elysium.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Evocation"
|
||||
action string "\e]20;Evocation.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Hourglass"
|
||||
action string "\e]20;hour.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Ice Moon"
|
||||
action string "\e]20;icemoon.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Iron Temple"
|
||||
action string "\e]20;iron_temple.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Lake of Fire"
|
||||
action string "\e]20;lake_of_fire.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Lighthouse"
|
||||
action string "\e]20;lighthouse.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Monolith"
|
||||
action string "\e]20;monolith.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Nebula"
|
||||
action string "\e]20;nebula.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Neopolis"
|
||||
action string "\e]20;neopolis.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Neopolis Horizon"
|
||||
action string "\e]20;Neopolis-horizon.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Planet A"
|
||||
action string "\e]20;planeta.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Pond"
|
||||
action string "\e]20;pond.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Poseidon"
|
||||
action string "\e]20;poseidon.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Return to Giza"
|
||||
action string "\e]20;return_to_giza.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Ripple"
|
||||
action string "\e]20;ripple.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "River of Lead"
|
||||
action string "\e]20;river_of_lead.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Silence"
|
||||
action string "\e]20;silence.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Sun"
|
||||
action string "\e]20;sun.png;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Tunnel"
|
||||
action string "\e]20;tunnel.jpg;100x100+50+50\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Wasteland"
|
||||
action string "\e]20;wasteland.jpg;100x100+50+50\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Attrib
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Full Size"
|
||||
action string "\e]20;;100x100"
|
||||
end
|
||||
begin menuitem
|
||||
text "Normal Size"
|
||||
action string "\e]20;;0x0"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Tiled"
|
||||
action string "\e]20;;:tile"
|
||||
end
|
||||
begin menuitem
|
||||
text "Scaled"
|
||||
action string "\e]20;;:scale"
|
||||
end
|
||||
begin menuitem
|
||||
text "Proportional Scale"
|
||||
action string "\e]20;;:propscale"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Center"
|
||||
action string "\e]20;;=+50+50"
|
||||
end
|
||||
begin menuitem
|
||||
text "Top Left Corner"
|
||||
action string "\e]20;;=+0+0"
|
||||
end
|
||||
begin menuitem
|
||||
text "Bottom Right Corner"
|
||||
action string "\e]20;;=+100+100"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Pixmap
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "None"
|
||||
action string "\e[m\e]20;;\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Toggle Viewport Mode"
|
||||
action string "\e]6;24\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "Tiled"
|
||||
action submenu "Tiled"
|
||||
end
|
||||
begin menuitem
|
||||
text "Scaled"
|
||||
action submenu "Scaled"
|
||||
end
|
||||
-
|
||||
begin menuitem
|
||||
text "Attrib"
|
||||
action submenu "Attrib"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Brightness
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "512 (200%)"
|
||||
action string "\e]6;1;image;brightness;512\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "480 (188%)"
|
||||
action string "\e]6;1;image;brightness;480\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "448 (175%)"
|
||||
action string "\e]6;1;image;brightness;448\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "416 (163%)"
|
||||
action string "\e]6;1;image;brightness;416\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "384 (150%)"
|
||||
action string "\e]6;1;image;brightness;384\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "352 (138%)"
|
||||
action string "\e]6;1;image;brightness;352\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "320 (125%)"
|
||||
action string "\e]6;1;image;brightness;320\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "288 (113%)"
|
||||
action string "\e]6;1;image;brightness;288\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "256 (100%)"
|
||||
action string "\e]6;1;image;brightness;256\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "224 (88%)"
|
||||
action string "\e]6;1;image;brightness;224\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "192 (75%)"
|
||||
action string "\e]6;1;image;brightness;192\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "160 (63%)"
|
||||
action string "\e]6;1;image;brightness;160\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "128 (50%)"
|
||||
action string "\e]6;1;image;brightness;128\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "96 (38%)"
|
||||
action string "\e]6;1;image;brightness;96\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "64 (25%)"
|
||||
action string "\e]6;1;image;brightness;64\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "32 (13%)"
|
||||
action string "\e]6;1;image;brightness;32\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "0 (0%)"
|
||||
action string "\e]6;1;image;brightness;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Contrast
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "512 (200%)"
|
||||
action string "\e]6;1;image;contrast;512\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "480 (188%)"
|
||||
action string "\e]6;1;image;contrast;480\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "448 (175%)"
|
||||
action string "\e]6;1;image;contrast;448\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "416 (163%)"
|
||||
action string "\e]6;1;image;contrast;416\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "384 (150%)"
|
||||
action string "\e]6;1;image;contrast;384\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "352 (138%)"
|
||||
action string "\e]6;1;image;contrast;352\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "320 (125%)"
|
||||
action string "\e]6;1;image;contrast;320\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "288 (113%)"
|
||||
action string "\e]6;1;image;contrast;288\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "256 (100%)"
|
||||
action string "\e]6;1;image;contrast;256\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "224 (88%)"
|
||||
action string "\e]6;1;image;contrast;224\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "192 (75%)"
|
||||
action string "\e]6;1;image;contrast;192\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "160 (63%)"
|
||||
action string "\e]6;1;image;contrast;160\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "128 (50%)"
|
||||
action string "\e]6;1;image;contrast;128\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "96 (38%)"
|
||||
action string "\e]6;1;image;contrast;96\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "64 (25%)"
|
||||
action string "\e]6;1;image;contrast;64\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "32 (13%)"
|
||||
action string "\e]6;1;image;contrast;32\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "0 (0%)"
|
||||
action string "\e]6;1;image;contrast;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Gamma
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "512 (200%)"
|
||||
action string "\e]6;1;image;gamma;512\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "480 (188%)"
|
||||
action string "\e]6;1;image;gamma;480\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "448 (175%)"
|
||||
action string "\e]6;1;image;gamma;448\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "416 (163%)"
|
||||
action string "\e]6;1;image;gamma;416\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "384 (150%)"
|
||||
action string "\e]6;1;image;gamma;384\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "352 (138%)"
|
||||
action string "\e]6;1;image;gamma;352\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "320 (125%)"
|
||||
action string "\e]6;1;image;gamma;320\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "288 (113%)"
|
||||
action string "\e]6;1;image;gamma;288\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "256 (100%)"
|
||||
action string "\e]6;1;image;gamma;256\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "224 (88%)"
|
||||
action string "\e]6;1;image;gamma;224\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "192 (75%)"
|
||||
action string "\e]6;1;image;gamma;192\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "160 (63%)"
|
||||
action string "\e]6;1;image;gamma;160\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "128 (50%)"
|
||||
action string "\e]6;1;image;gamma;128\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "96 (38%)"
|
||||
action string "\e]6;1;image;gamma;96\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "64 (25%)"
|
||||
action string "\e]6;1;image;gamma;64\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "32 (13%)"
|
||||
action string "\e]6;1;image;gamma;32\a"
|
||||
end
|
||||
begin menuitem
|
||||
text "0 (0%)"
|
||||
action string "\e]6;1;image;gamma;0\a"
|
||||
end
|
||||
end
|
||||
begin menu
|
||||
title Background
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Transparency"
|
||||
action submenu "Transparency"
|
||||
end
|
||||
begin menuitem
|
||||
text "Pixmap"
|
||||
action submenu "Pixmap"
|
||||
end
|
||||
begin menuitem
|
||||
text "Brightness"
|
||||
action submenu "Brightness"
|
||||
end
|
||||
begin menuitem
|
||||
text "Contrast"
|
||||
action submenu "Contrast"
|
||||
end
|
||||
begin menuitem
|
||||
text "Gamma"
|
||||
action submenu "Gamma"
|
||||
end
|
||||
end
|
||||
|
||||
# HOST_ITEM(protocol, hostname [, ip])
|
||||
define(HOST_ITEM, `begin menuitem
|
||||
text "$2"
|
||||
action string "\e]0;$2 $1\a\e]7;echo:$1 '`ifelse($3, `', `$2', `$3')'`\r\a"
|
||||
end')
|
||||
# ALIEN_MENU(protocol)
|
||||
define(ALIEN_MENU, `begin menu
|
||||
title "Alien Cluster $1"
|
||||
font fixed
|
||||
HOST_ITEM(`$1', `apone')
|
||||
HOST_ITEM(`$1', `ash')
|
||||
HOST_ITEM(`$1', `bishop')
|
||||
HOST_ITEM(`$1', `burke')
|
||||
HOST_ITEM(`$1', `dallas')
|
||||
HOST_ITEM(`$1', `drake')
|
||||
HOST_ITEM(`$1', `ripley')
|
||||
HOST_ITEM(`$1', `view1-mp')
|
||||
HOST_ITEM(`$1', `vob1-mp')
|
||||
HOST_ITEM(`$1', `vob2-mp')
|
||||
end')
|
||||
define(IT_MENU, `begin menu
|
||||
title "IT Hosts $1"
|
||||
font fixed
|
||||
HOST_ITEM(`$1', `allen')
|
||||
HOST_ITEM(`$1', `babylon4')
|
||||
HOST_ITEM(`$1', `icarus')
|
||||
HOST_ITEM(`$1', `orwell')
|
||||
HOST_ITEM(`$1', `phantom')
|
||||
HOST_ITEM(`$1', `starfury')
|
||||
HOST_ITEM(`$1', `viper')
|
||||
HOST_ITEM(`$1', `whitestar')
|
||||
end')
|
||||
define(COM_MENU, `begin menu
|
||||
title "3Com $1"
|
||||
font fixed
|
||||
HOST_ITEM(`$1', `bkup-u2')
|
||||
HOST_ITEM(`$1', `bkup-us')
|
||||
HOST_ITEM(`$1', `corsys1')
|
||||
HOST_ITEM(`$1', `dmc-mp')
|
||||
HOST_ITEM(`$1', `dw-dev')
|
||||
HOST_ITEM(`$1', `dw1-uw')
|
||||
HOST_ITEM(`$1', `dw2-mp')
|
||||
HOST_ITEM(`$1', `firegate')
|
||||
HOST_ITEM(`$1', `hicks')
|
||||
HOST_ITEM(`$1', `hp-carp')
|
||||
HOST_ITEM(`$1', `hp-sales')
|
||||
HOST_ITEM(`$1', `hp9000')
|
||||
HOST_ITEM(`$1', `hprpc1', `149.112.166.42')
|
||||
HOST_ITEM(`$1', `hprpc2', `149.112.166.43')
|
||||
HOST_ITEM(`$1', `intergate')
|
||||
HOST_ITEM(`$1', `lnnsdintra1')
|
||||
HOST_ITEM(`$1', `mailgate')
|
||||
HOST_ITEM(`$1', `mwdev1')
|
||||
HOST_ITEM(`$1', `mwdev2')
|
||||
HOST_ITEM(`$1', `mwdev3')
|
||||
HOST_ITEM(`$1', `mwdocs1')
|
||||
HOST_ITEM(`$1', `mwprod1')
|
||||
HOST_ITEM(`$1', `mwprod2')
|
||||
HOST_ITEM(`$1', `mwprod3')
|
||||
HOST_ITEM(`$1', `netscop')
|
||||
HOST_ITEM(`$1', `notes-mp')
|
||||
HOST_ITEM(`$1', `oraweb1')
|
||||
HOST_ITEM(`$1', `pcdprod')
|
||||
HOST_ITEM(`$1', `prod-mp')
|
||||
HOST_ITEM(`$1', `rdpvcs')
|
||||
HOST_ITEM(`$1', `rdsgi1-mp')
|
||||
HOST_ITEM(`$1', `recov-mp')
|
||||
HOST_ITEM(`$1', `ren')
|
||||
HOST_ITEM(`$1', `scop-us')
|
||||
HOST_ITEM(`$1', `ship-eg')
|
||||
HOST_ITEM(`$1', `ship-mp')
|
||||
HOST_ITEM(`$1', `stimpy')
|
||||
HOST_ITEM(`$1', `test-mp')
|
||||
HOST_ITEM(`$1', `townesquare')
|
||||
HOST_ITEM(`$1', `ussk1rdu1')
|
||||
HOST_ITEM(`$1', `uw-inet')
|
||||
HOST_ITEM(`$1', `webmw')
|
||||
end')
|
||||
define(EXT_MENU, `begin menu
|
||||
title "External $1"
|
||||
font fixed
|
||||
HOST_ITEM(`$1', `foobar.com')
|
||||
end')
|
||||
|
||||
define(PROTOCOL_MENU, `begin menu
|
||||
title "$1"
|
||||
font fixed
|
||||
begin menuitem
|
||||
text "Alien Cluster"
|
||||
action submenu "Alien Cluster $1"
|
||||
end
|
||||
begin menuitem
|
||||
text "IT Hosts"
|
||||
action submenu "IT Hosts $1"
|
||||
end
|
||||
begin menuitem
|
||||
text "3Com"
|
||||
action submenu "3Com $1"
|
||||
end
|
||||
begin menuitem
|
||||
text "External"
|
||||
action submenu "External $1"
|
||||
end
|
||||
end')
|
||||
define(DO_PROTOCOL, `ALIEN_MENU($1)
|
||||
IT_MENU($1)
|
||||
COM_MENU($1)
|
||||
EXT_MENU($1)
|
||||
PROTOCOL_MENU($1)')
|
||||
|
||||
DO_PROTOCOL(ssh)
|
||||
DO_PROTOCOL(rlogin)
|
||||
DO_PROTOCOL(telnet)
|
||||
DO_PROTOCOL(ftp)
|
||||
|
||||
begin menu
|
||||
title Chooser
|
||||
font fixed
|
||||
ECHO_ITEM(`New Eterm Window', `Eterm &\r')
|
||||
-
|
||||
SUBMENU_ITEM(`ssh')
|
||||
SUBMENU_ITEM(`rlogin')
|
||||
SUBMENU_ITEM(`telnet')
|
||||
SUBMENU_ITEM(`ftp')
|
||||
end
|
||||
|
||||
# This is the menu that gets called by Ctrl-Button3
|
||||
begin menu
|
||||
title Eterm
|
||||
font fixed
|
||||
SUBMENU_ITEM(Chooser)
|
||||
-
|
||||
SUBMENU_ITEM(Font)
|
||||
SUBMENU_ITEM(Background)
|
||||
SUBMENU_ITEM(Terminal)
|
||||
-
|
||||
STRING_ITEM(`Version', `\e[8n')
|
||||
STRING_ITEM(`Status', `\e[9n')
|
||||
separator
|
||||
STRING_ITEM(`Save Settings...', `\e]6;71\a')
|
||||
STRING_ITEM(`Exit', `\e]6;70\a')
|
||||
end
|
|
@ -1,502 +0,0 @@
|
|||
# THIS MENU IS NOT MEANT FOR USE AS-IS! It is an example, a demonstration
|
||||
# of a concept that others might find useful. It is command-for-command,
|
||||
# word-for-word the chooser menu file that I use, so it has all my hostnames
|
||||
# and settings. You are encouraged to change it to suit your needs. You
|
||||
# must have Eterm 0.8+PL3 or later to use it, though.
|
||||
#
|
||||
# The purpose of this theme is to show how Eterm menubars can be used to
|
||||
# create a host chooser...an Eterm that's sole purpose for existence is to
|
||||
# make it easier to spawn telnet, rlogin, ssh, or ftp sessions to remote
|
||||
# hosts from a pull-down menu.
|
||||
|
||||
# standard settings for an Eterm control menu
|
||||
[menu:Eterm]
|
||||
|
||||
/Eterm/*
|
||||
|
||||
./Font/*
|
||||
{Normal} ^@\e]50;#
|
||||
{Larger} ^@\e]50;#+
|
||||
{Smaller} ^@\e]50;#-
|
||||
{-}
|
||||
{Font 1} ^@\e]50;#1
|
||||
{Font 2} ^@\e]50;#2
|
||||
{Font 3} ^@\e]50;#3
|
||||
{Font 4} ^@\e]50;#4
|
||||
|
||||
../Terminal/*
|
||||
./Toggles/*
|
||||
{Cursor Visible} ^@\e[?25t
|
||||
{Home on Echo} ^@\e[?1010t
|
||||
{Home on Refresh} ^@\e[?1011t
|
||||
{Home on Input} ^@\e[?1012t
|
||||
{Map Alert} ^@\e]6;21\a
|
||||
{Primary/Secondary Screen} ^@\e[?47t
|
||||
{Reverse Video} ^@\e[?5t
|
||||
{Select Trailing Spaces} ^@\e]6;25\a
|
||||
{Select Whole Line on Triple-click} ^@\e]6;23\a
|
||||
{Visual Bell} ^@\e]6;20\a
|
||||
{X11 Mouse Reporting} ^@\e[?1000t
|
||||
{Xterm Selection Behavior} ^@\e]6;22\a
|
||||
../Keys/*
|
||||
{Application Arrow Keys} ^@\e[?1t
|
||||
{Application Keypad} ^@\e[?66t
|
||||
{Backspace/Delete} ^@\e[?67t
|
||||
{Xterm Shift-Keys} ^@\e[?35t
|
||||
../Menubar/*
|
||||
{Toggle Visibility}{Ctrl-Button3} ^@\e[?10t
|
||||
{Refresh Menubar} ^@\e[?10h
|
||||
{Toggle Window Move by Menubar} ^@\e]6;15\a
|
||||
../Scrollbar/*
|
||||
{Toggle Visibility}{Ctrl-Button2} ^@\e[?30t
|
||||
{Swap Sides} ^@\e]6;11\a
|
||||
{Toggle Floating} ^@\e]6;12\a
|
||||
{Toggle Popup Mode} ^@\e]6;13\a
|
||||
{-}
|
||||
{Motif (Traditional) Style} ^@\e]6;10;motif;;\a
|
||||
{NeXT Style} ^@\e]6;10;next;;\a
|
||||
{Xterm Style} ^@\e]6;10;xterm;;\a
|
||||
./Width/*
|
||||
{5} ^@\e]6;10;;5;\a
|
||||
{6} ^@\e]6;10;;6;\a
|
||||
{7} ^@\e]6;10;;7;\a
|
||||
{8} ^@\e]6;10;;8;\a
|
||||
{9} ^@\e]6;10;;9;\a
|
||||
{10} ^@\e]6;10;;10;\a
|
||||
{11} ^@\e]6;10;;11;\a
|
||||
{12} ^@\e]6;10;;12;\a
|
||||
{13} ^@\e]6;10;;13;\a
|
||||
{14} ^@\e]6;10;;14;\a
|
||||
{15} ^@\e]6;10;;15;\a
|
||||
{16} ^@\e]6;10;;16;\a
|
||||
{17} ^@\e]6;10;;17;\a
|
||||
{18} ^@\e]6;10;;18;\a
|
||||
{19} ^@\e]6;10;;19;\a
|
||||
{20} ^@\e]6;10;;20;\a
|
||||
../
|
||||
../Move to Desktop/*
|
||||
{0} ^@\e]6;50;0;\a
|
||||
{1} ^@\e]6;50;1;\a
|
||||
{2} ^@\e]6;50;2;\a
|
||||
{3} ^@\e]6;50;3;\a
|
||||
{4} ^@\e]6;50;4;\a
|
||||
{5} ^@\e]6;50;5;\a
|
||||
{6} ^@\e]6;50;6;\a
|
||||
{7} ^@\e]6;50;7;\a
|
||||
../
|
||||
{-}
|
||||
{Steal Focus}{Ctrl-Button1} ^@\e]5;\a
|
||||
{Full Reset} ^@\ec
|
||||
|
||||
../Background/*
|
||||
./Transparency/*
|
||||
{Force Update} ^@\e]6;3\a
|
||||
{Toggle Desktop Watching} ^@\e]6;4\a
|
||||
{Toggle Transparency} ^@\e]6;0\a
|
||||
../Pixmap/*
|
||||
{None} ^@\e[m\e]20;;\a
|
||||
{Toggle Viewport Mode} ^@\e]6;24\a
|
||||
./Tiled/*
|
||||
{70's Marble} ^@\e]20;70s_marble.png;0x0+50+50\a
|
||||
{7m} ^@\e]10;[pixmap:7m.png;0x0+50+50]
|
||||
{Alabama Clay} ^@\e]10;[pixmap:dirt.png;0x0+50+50]
|
||||
{Anomaly} ^@\e]20;a8.png;0x0+50+50\a
|
||||
{Black Stone} ^@\e]20;blackstone.png;0x0+50+50\a
|
||||
{Blue Ether} ^@\e]10;[pixmap:ether_blue.png;0x0+50+50]
|
||||
{Blue Marble} ^@\e]10;[pixmap:blue_marble.png;0x0+50+50]
|
||||
{Blue Maze} ^@\e]10;[pixmap:blue_maze.png;0x0+50+50]
|
||||
{Blue Puzzle} ^@\e]10;[pixmap:026.png;0x0+50+50]
|
||||
{Circuit} ^@\e]10;[pixmap:circuit.png;0x0+50+50]
|
||||
{Cyber Playground} ^@\e]10;[pixmap:cyber_bg.png;0x0+50+50]
|
||||
{Dark Marble} ^@\e]10;[pixmap:dark_marble.png;0x0+50+50]
|
||||
{Dimples} ^@\e]20;014.png;0x0+50+50\a
|
||||
{Ether} ^@\e]10;[pixmap:ether.png;0x0+50+50]
|
||||
{Giger 1} ^@\e]10;[pixmap:giger1.png;0x0+50+50]
|
||||
{Giger 2} ^@\e]10;[pixmap:giger2.png;0x0+50+50]
|
||||
{Gray Matter} ^@\e]10;[pixmap:22.png;0x0+50+50]
|
||||
{Gray Waves} ^@\e]10;[pixmap:gray_waves.png;0x0+50+50]
|
||||
{Jungle} ^@\e]20;43.png;0x0+50+50\a
|
||||
{Lava} ^@\e]20;4.png;0x0+50+50\a
|
||||
{Light B1} ^@\e]10;[pixmap:lightb1.png;0x0+50+50]
|
||||
{Maple Leaves} ^@\e]10;[pixmap:maple1.png;0x0+50+50]
|
||||
{Marble} ^@\e]10;[pixmap:marbled.png;0x0+50+50]
|
||||
{Pebbles} ^@\e]10;[pixmap:pebble1.png;0x0+50+50]
|
||||
{Purple Rain} ^@\e]20;024.png;0x0+50+50\a
|
||||
{Purple Clouds} ^@\e]10;[pixmap:7.png;0x0+50+50]
|
||||
{Rainstorm} ^@\e]20;15.png;0x0+50+50\a
|
||||
{Red Whisper} ^@\e]10;[pixmap:40.png;0x0+50+50]
|
||||
{Soft Marble} ^@\e]10;[pixmap:soft.png;0x0+50+50]
|
||||
{Space 1} ^@\e]10;[pixmap:space.png;0x0+50+50]
|
||||
{Space 2} ^@\e]10;[pixmap:starry.png;0x0+50+50]
|
||||
{Whirlpool} ^@\e]20;015.png;0x0+50+50\a
|
||||
|
||||
../Scaled/*
|
||||
{Alien Spheres} ^@\e]20;alien_spheres.jpg;100x100+50+50\a
|
||||
{Atlantis} ^@\e]20;atlantis.jpg;100x100+50+50\a
|
||||
{Before the Storm} ^@\e]20;before_the_storm.jpg;100x100+50+50\a
|
||||
{Bladerunner} ^@\e]20;Bladerunner-bg.png;100x100+50+50\a
|
||||
{Canyon} ^@\e]20;Canyon.jpg;100x100+50+50\a
|
||||
{CaveFire} ^@\e]20;Cavefire-bg.png;100x100+50+50\a
|
||||
{Crater Lake} ^@\e]20;crater_lake.jpg;100x100+50+50\a
|
||||
{Daughter} ^@\e]20;Daughter.jpg;100x100+50+50\a
|
||||
{Dragon} ^@\e]20;Dragon.jpg;100x100+50+50\a
|
||||
{DVXVB} ^@\e]20;dvxvb.jpg;100x100+50+50\a
|
||||
{Elysium} ^@\e]20;elysium.jpg;100x100+50+50\a
|
||||
{Evocation} ^@\e]20;Evocation.jpg;100x100+50+50\a
|
||||
{Hourglass} ^@\e]20;hour.jpg;100x100+50+50\a
|
||||
{Ice Moon} ^@\e]20;icemoon.jpg;100x100+50+50\a
|
||||
{Iron Temple} ^@\e]20;iron_temple.jpg;100x100+50+50\a
|
||||
{Lake of Fire} ^@\e]20;lake_of_fire.jpg;100x100+50+50\a
|
||||
{Lighthouse} ^@\e]20;lighthouse.jpg;100x100+50+50\a
|
||||
{Monolith} ^@\e]20;monolith.jpg;100x100+50+50\a
|
||||
{Nebula} ^@\e]20;nebula.jpg;100x100+50+50\a
|
||||
{Neopolis} ^@\e]20;neopolis.jpg;100x100+50+50\a
|
||||
{Neopolis Horizon} ^@\e]20;Neopolis-horizon.png;100x100+50+50\a
|
||||
{Planet A} ^@\e]20;planeta.png;100x100+50+50\a
|
||||
{Pond} ^@\e]20;pond.png;100x100+50+50\a
|
||||
{Poseidon} ^@\e]20;poseidon.png;100x100+50+50\a
|
||||
{Return to Giza} ^@\e]20;return_to_giza.jpg;100x100+50+50\a
|
||||
{Ripple} ^@\e]20;ripple.png;100x100+50+50\a
|
||||
{River of Lead} ^@\e]20;river_of_lead.jpg;100x100+50+50\a
|
||||
{Silence} ^@\e]20;silence.jpg;100x100+50+50\a
|
||||
{Sun} ^@\e]20;sun.png;100x100+50+50\a
|
||||
{Tunnel} ^@\e]20;tunnel.jpg;100x100+50+50\a
|
||||
{Wasteland} ^@\e]20;wasteland.jpg;100x100+50+50\a
|
||||
../
|
||||
{-}
|
||||
./Attrib/*
|
||||
{Full} ^@\e]20;;100x100+50+50;
|
||||
{Tiled} ^@\e]20;;0
|
||||
{Center} ^@\e]20;;=+50+50;
|
||||
../
|
||||
../Shade/*
|
||||
{0%} ^@\e]6;1;0%\a
|
||||
{10%} ^@\e]6;1;10%\a
|
||||
{20%} ^@\e]6;1;20%\a
|
||||
{30%} ^@\e]6;1;30%\a
|
||||
{40%} ^@\e]6;1;40%\a
|
||||
{50%} ^@\e]6;1;50%\a
|
||||
{60%} ^@\e]6;1;60%\a
|
||||
{70%} ^@\e]6;1;70%\a
|
||||
{80%} ^@\e]6;1;80%\a
|
||||
{90%} ^@\e]6;1;90%\a
|
||||
{100%} ^@\e]6;1;100%\a
|
||||
../Tint/*
|
||||
{No Tint} ^@\e]6;2;0xffffff\a
|
||||
{Red Tint} ^@\e]6;2;0xff8080\a
|
||||
{Green Tint} ^@\e]6;2;0x80ff80\a
|
||||
{Blue Tint} ^@\e]6;2;0x8080ff\a
|
||||
{Cyan Tint} ^@\e]6;2;0x80ffff\a
|
||||
{Magenta Tint} ^@\e]6;2;0xff80ff\a
|
||||
{Yellow Tint} ^@\e]6;2;0xffff80\a
|
||||
../
|
||||
|
||||
../
|
||||
{-}
|
||||
{Version} ^@\e[8n
|
||||
{Status} ^@\e[9n
|
||||
{-}
|
||||
{Save Current Settings} ^@\e]6;71\a
|
||||
{Exit Eterm} ^@\e]6;70\a
|
||||
/
|
||||
|
||||
# Host/Protocol Chooser menu
|
||||
/Chooser/*
|
||||
{New Window} Eterm &\r
|
||||
{-}
|
||||
|
||||
./ssh/*
|
||||
|
||||
./Alien Cluster/*
|
||||
{apone} ^@\e]10;[echo:slogin apone]\a^@\e]10;[:[apptitle:apone secure login]:]\a
|
||||
{ash} ^@\e]10;[echo:slogin ash]\a^@\e]10;[:[apptitle:ash secure login]:]\a
|
||||
{bishop} ^@\e]10;[echo:slogin bishop]\a^@\e]10;[:[apptitle:bishop secure login]:]\a
|
||||
{burke} ^@\e]10;[echo:slogin burke]\a^@\e]10;[:[apptitle:burke secure login]:]\a
|
||||
{dallas} ^@\e]10;[echo:slogin dallas]\a^@\e]10;[:[apptitle:dallas secure login]:]\a
|
||||
{drake} ^@\e]10;[echo:slogin drake]\a^@\e]10;[:[apptitle:drake secure login]:]\a
|
||||
{ripley} ^@\e]10;[echo:slogin ripley]\a^@\e]10;[:[apptitle:ripley secure login]:]\a
|
||||
{view1-mp} ^@\e]10;[echo:slogin view1-mp]\a^@\e]10;[:[apptitle:view1-mp secure login]:]\a
|
||||
{vob1-mp} ^@\e]10;[echo:slogin vob1-mp]\a^@\e]10;[:[apptitle:vob1-mp secure login]:]\a
|
||||
{vob2-mp} ^@\e]10;[echo:slogin vob2-mp]\a^@\e]10;[:[apptitle:vob2-mp secure login]:]\a
|
||||
|
||||
../IT Hosts/*
|
||||
{allen} ^@\e]10;[echo:slogin allen]\a^@\e]10;[:[apptitle:allen secure login]:]\a
|
||||
{babylon4} ^@\e]10;[echo:slogin babylon4]\a^@\e]10;[:[apptitle:babylon4 secure login]:]\a
|
||||
{icarus} ^@\e]10;[echo:slogin icarus]\a^@\e]10;[:[apptitle:icarus secure login]:]\a
|
||||
{orwell} ^@\e]10;[echo:slogin orwell]\a^@\e]10;[:[apptitle:orwell secure login]:]\a
|
||||
{starfury} ^@\e]10;[echo:slogin starfury]\a^@\e]10;[:[apptitle:starfury secure login]:]\a
|
||||
{phantom} ^@\e]10;[echo:slogin phantom]\a^@\e]10;[:[apptitle:phantom secure login]:]\a
|
||||
{viper} ^@\e]10;[echo:slogin viper]\a^@\e]10;[:[apptitle:viper secure login]:]\a
|
||||
{whitestar} ^@\e]10;[echo:slogin whitestar]\a^@\e]10;[:[apptitle:whitestar secure login]:]\a
|
||||
|
||||
../3Com/*
|
||||
{bkup-u2} ^@\e]10;[echo:slogin bkup-u2]\a^@\e]10;[:[apptitle:bkup-u2 secure login]:]\a
|
||||
{bkup-us} ^@\e]10;[echo:slogin bkup-us]\a^@\e]10;[:[apptitle:bkup-us secure login]:]\a
|
||||
{corsys1} ^@\e]10;[echo:slogin corsys1]\a^@\e]10;[:[apptitle:corsys1 secure login]:]\a
|
||||
{dmc-mp} ^@\e]10;[echo:slogin dmc-mp]\a^@\e]10;[:[apptitle:dmc-mp secure login]:]\a
|
||||
{dw-dev} ^@\e]10;[echo:slogin dw-dev]\a^@\e]10;[:[apptitle:dw-dev secure login]:]\a
|
||||
{dw1-uw} ^@\e]10;[echo:slogin dw1-uw]\a^@\e]10;[:[apptitle:dw1-uw secure login]:]\a
|
||||
{dw2-mp} ^@\e]10;[echo:slogin dw2-mp]\a^@\e]10;[:[apptitle:dw2-mp secure login]:]\a
|
||||
{firegate} ^@\e]10;[echo:slogin firegate]\a^@\e]10;[:[apptitle:firegate secure login]:]\a
|
||||
{hicks} ^@\e]10;[echo:slogin hicks]\a^@\e]10;[:[apptitle:hicks secure login]:]\a
|
||||
{hp-carp} ^@\e]10;[echo:slogin hp-carp]\a^@\e]10;[:[apptitle:hp-carp secure login]:]\a
|
||||
{hp-sales} ^@\e]10;[echo:slogin hp-sales]\a^@\e]10;[:[apptitle:hp-sales secure login]:]\a
|
||||
{hp9000} ^@\e]10;[echo:slogin hp9000]\a^@\e]10;[:[apptitle:hp9000 secure login]:]\a
|
||||
{hprpc1} ^@\e]10;[echo:slogin 149.112.166.42]\a^@\e]10;[:[apptitle:hprpc1 secure login]:]\a
|
||||
{hprpc2} ^@\e]10;[echo:slogin 149.112.166.43]\a^@\e]10;[:[apptitle:hprpc2 secure login]:]\a
|
||||
{intergate} ^@\e]10;[echo:slogin intergate]\a^@\e]10;[:[apptitle:intergate secure login]:]\a
|
||||
{lnnsdintra1} ^@\e]10;[echo:slogin lnnsdintra1]\a^@\e]10;[:[apptitle:lnnsdintra1 secure login]:]\a
|
||||
{mailgate} ^@\e]10;[echo:slogin mailgate]\a^@\e]10;[:[apptitle:mailgate secure login]:]\a
|
||||
{mwdev1} ^@\e]10;[echo:slogin mwdev1]\a^@\e]10;[:[apptitle:mwdev1 secure login]:]\a
|
||||
{mwdev2} ^@\e]10;[echo:slogin mwdev2]\a^@\e]10;[:[apptitle:mwdev2 secure login]:]\a
|
||||
{mwdev3} ^@\e]10;[echo:slogin mwdev3]\a^@\e]10;[:[apptitle:mwdev3 secure login]:]\a
|
||||
{mwdocs1} ^@\e]10;[echo:slogin mwdocs1]\a^@\e]10;[:[apptitle:mwdocs1 secure login]:]\a
|
||||
{mwprod1} ^@\e]10;[echo:slogin mwprod1]\a^@\e]10;[:[apptitle:mwprod1 secure login]:]\a
|
||||
{mwprod2} ^@\e]10;[echo:slogin mwprod2]\a^@\e]10;[:[apptitle:mwprod2 secure login]:]\a
|
||||
{mwprod3} ^@\e]10;[echo:slogin mwprod3]\a^@\e]10;[:[apptitle:mwprod3 secure login]:]\a
|
||||
{netscop} ^@\e]10;[echo:slogin netscop]\a^@\e]10;[:[apptitle:netscop secure login]:]\a
|
||||
{notes-mp} ^@\e]10;[echo:slogin notes-mp]\a^@\e]10;[:[apptitle:notes-mp secure login]:]\a
|
||||
{oraweb1} ^@\e]10;[echo:slogin oraweb1]\a^@\e]10;[:[apptitle:oraweb1 secure login]:]\a
|
||||
{pcdprod} ^@\e]10;[echo:slogin pcdprod]\a^@\e]10;[:[apptitle:pcdprod secure login]:]\a
|
||||
{prod-mp} ^@\e]10;[echo:slogin prod-mp]\a^@\e]10;[:[apptitle:prod-mp secure login]:]\a
|
||||
{rdpvcs} ^@\e]10;[echo:slogin rdpvcs]\a^@\e]10;[:[apptitle:rdpvcs secure login]:]\a
|
||||
{rdsgi1-mp} ^@\e]10;[echo:slogin rdsgi1-mp]\a^@\e]10;[:[apptitle:rdsgi1-mp secure login]:]\a
|
||||
{recov-mp} ^@\e]10;[echo:slogin recov-mp]\a^@\e]10;[:[apptitle:recov-mp secure login]:]\a
|
||||
{ren} ^@\e]10;[echo:slogin ren]\a^@\e]10;[:[apptitle:ren secure login]:]\a
|
||||
{scop-us} ^@\e]10;[echo:slogin scop-us]\a^@\e]10;[:[apptitle:scop-us secure login]:]\a
|
||||
{ship-eg} ^@\e]10;[echo:slogin ship-eg]\a^@\e]10;[:[apptitle:ship-eg secure login]:]\a
|
||||
{ship-mp} ^@\e]10;[echo:slogin ship-mp]\a^@\e]10;[:[apptitle:ship-mp secure login]:]\a
|
||||
{stimpy} ^@\e]10;[echo:slogin stimpy]\a^@\e]10;[:[apptitle:stimpy secure login]:]\a
|
||||
{test-mp} ^@\e]10;[echo:slogin test-mp]\a^@\e]10;[:[apptitle:test-mp secure login]:]\a
|
||||
{townesquare} ^@\e]10;[echo:slogin townesquare]\a^@\e]10;[:[apptitle:townesquare secure login]:]\a
|
||||
{ussk1rdu1} ^@\e]10;[echo:slogin ussk1rdu1]\a^@\e]10;[:[apptitle:ussk1rdu1 secure login]:]\a
|
||||
{uw-inet} ^@\e]10;[echo:slogin uw-inet]\a^@\e]10;[:[apptitle:uw-inet secure login]:]\a
|
||||
{webmw} ^@\e]10;[echo:slogin webmw]\a^@\e]10;[:[apptitle:webmw secure login]:]\a
|
||||
|
||||
../External/*
|
||||
{ftp.mandrake.net} ^@\e]10;[echo:slogin kainx@ftp.mandrake.net]\a^@\e]10;[:[apptitle:ftp.mandrake.net secure login]:]\a
|
||||
{ganja.tky.hut.fi} ^@\e]10;[echo:slogin kainx@ganja.tky.hut.fi]\a^@\e]10;[:[apptitle:ganja.tky.hut.fi secure login]:]\a
|
||||
{tcserv.com} ^@\e]10;[echo:slogin mej@tcserv.com]\a^@\e]10;[:[apptitle:tcserv.com secure login]:]\a
|
||||
{terminus} ^@\e]10;[echo:slogin terminus.lwc.edu]\a^@\e]10;[:[apptitle:terminus secure login]:]\a
|
||||
{razor} ^@\e]10;[echo:slogin razor.optera.net]\a^@\e]10;[:[apptitle:razor secure login]:]\a
|
||||
|
||||
../../rlogin/*
|
||||
|
||||
./Alien Cluster/*
|
||||
{apone} ^@\e]10;[echo:rlogin apone]\a^@\e]10;[:[apptitle:apone rlogin]:]\a
|
||||
{ash} ^@\e]10;[echo:rlogin ash]\a^@\e]10;[:[apptitle:ash rlogin]:]\a
|
||||
{bishop} ^@\e]10;[echo:rlogin bishop]\a^@\e]10;[:[apptitle:bishop rlogin]:]\a
|
||||
{burke} ^@\e]10;[echo:rlogin burke]\a^@\e]10;[:[apptitle:burke rlogin]:]\a
|
||||
{dallas} ^@\e]10;[echo:rlogin dallas]\a^@\e]10;[:[apptitle:dallas rlogin]:]\a
|
||||
{drake} ^@\e]10;[echo:rlogin drake]\a^@\e]10;[:[apptitle:drake rlogin]:]\a
|
||||
{ripley} ^@\e]10;[echo:rlogin ripley]\a^@\e]10;[:[apptitle:ripley rlogin]:]\a
|
||||
{view1-mp} ^@\e]10;[echo:rlogin view1-mp]\a^@\e]10;[:[apptitle:view1-mp rlogin]:]\a
|
||||
{vob1-mp} ^@\e]10;[echo:rlogin vob1-mp]\a^@\e]10;[:[apptitle:vob1-mp rlogin]:]\a
|
||||
{vob2-mp} ^@\e]10;[echo:rlogin vob2-mp]\a^@\e]10;[:[apptitle:vob2-mp rlogin]:]\a
|
||||
|
||||
../IT Hosts/*
|
||||
{allen} ^@\e]10;[echo:rlogin allen]\a^@\e]10;[:[apptitle:allen rlogin]:]\a
|
||||
{babylon4} ^@\e]10;[echo:rlogin babylon4]\a^@\e]10;[:[apptitle:babylon4 rlogin]:]\a
|
||||
{icarus} ^@\e]10;[echo:rlogin icarus]\a^@\e]10;[:[apptitle:icarus rlogin]:]\a
|
||||
{orwell} ^@\e]10;[echo:rlogin orwell]\a^@\e]10;[:[apptitle:orwell rlogin]:]\a
|
||||
{phantom} ^@\e]10;[echo:rlogin phantom]\a^@\e]10;[:[apptitle:phantom rlogin]:]\a
|
||||
{viper} ^@\e]10;[echo:rlogin viper]\a^@\e]10;[:[apptitle:viper rlogin]:]\a
|
||||
{whitestar} ^@\e]10;[echo:rlogin whitestar]\a^@\e]10;[:[apptitle:whitestar rlogin]:]\a
|
||||
|
||||
../3Com/*
|
||||
{bkup-u2} ^@\e]10;[echo:rlogin bkup-u2]\a^@\e]10;[:[apptitle:bkup-u2 rlogin]:]\a
|
||||
{bkup-us} ^@\e]10;[echo:rlogin bkup-us]\a^@\e]10;[:[apptitle:bkup-us rlogin]:]\a
|
||||
{corsys1} ^@\e]10;[echo:rlogin corsys1]\a^@\e]10;[:[apptitle:corsys1 rlogin]:]\a
|
||||
{dmc-mp} ^@\e]10;[echo:rlogin dmc-mp]\a^@\e]10;[:[apptitle:dmc-mp rlogin]:]\a
|
||||
{dw-dev} ^@\e]10;[echo:rlogin dw-dev]\a^@\e]10;[:[apptitle:dw-dev rlogin]:]\a
|
||||
{dw1-uw} ^@\e]10;[echo:rlogin dw1-uw]\a^@\e]10;[:[apptitle:dw1-uw rlogin]:]\a
|
||||
{dw2-mp} ^@\e]10;[echo:rlogin dw2-mp]\a^@\e]10;[:[apptitle:dw2-mp rlogin]:]\a
|
||||
{firegate} ^@\e]10;[echo:rlogin firegate]\a^@\e]10;[:[apptitle:firegate rlogin]:]\a
|
||||
{hicks} ^@\e]10;[echo:rlogin hicks]\a^@\e]10;[:[apptitle:hicks rlogin]:]\a
|
||||
{hp-carp} ^@\e]10;[echo:rlogin hp-carp]\a^@\e]10;[:[apptitle:hp-carp rlogin]:]\a
|
||||
{hp-sales} ^@\e]10;[echo:rlogin hp-sales]\a^@\e]10;[:[apptitle:hp-sales rlogin]:]\a
|
||||
{hp9000} ^@\e]10;[echo:rlogin hp9000]\a^@\e]10;[:[apptitle:hp9000 rlogin]:]\a
|
||||
{hprpc1} ^@\e]10;[echo:rlogin 149.112.166.42]\a^@\e]10;[:[apptitle:hprpc1 rlogin]:]\a
|
||||
{hprpc2} ^@\e]10;[echo:rlogin 149.112.166.43]\a^@\e]10;[:[apptitle:hprpc2 rlogin]:]\a
|
||||
{intergate} ^@\e]10;[echo:rlogin intergate]\a^@\e]10;[:[apptitle:intergate rlogin]:]\a
|
||||
{lnnsdintra1} ^@\e]10;[echo:rlogin lnnsdintra1]\a^@\e]10;[:[apptitle:lnnsdintra1 rlogin]:]\a
|
||||
{mailgate} ^@\e]10;[echo:rlogin mailgate]\a^@\e]10;[:[apptitle:mailgate rlogin]:]\a
|
||||
{mwdev1} ^@\e]10;[echo:rlogin mwdev1]\a^@\e]10;[:[apptitle:mwdev1 rlogin]:]\a
|
||||
{mwdev2} ^@\e]10;[echo:rlogin mwdev2]\a^@\e]10;[:[apptitle:mwdev2 rlogin]:]\a
|
||||
{mwdev3} ^@\e]10;[echo:rlogin mwdev3]\a^@\e]10;[:[apptitle:mwdev3 rlogin]:]\a
|
||||
{mwdocs1} ^@\e]10;[echo:rlogin mwdocs1]\a^@\e]10;[:[apptitle:mwdocs1 rlogin]:]\a
|
||||
{mwprod1} ^@\e]10;[echo:rlogin mwprod1]\a^@\e]10;[:[apptitle:mwprod1 rlogin]:]\a
|
||||
{mwprod2} ^@\e]10;[echo:rlogin mwprod2]\a^@\e]10;[:[apptitle:mwprod2 rlogin]:]\a
|
||||
{mwprod3} ^@\e]10;[echo:rlogin mwprod3]\a^@\e]10;[:[apptitle:mwprod3 rlogin]:]\a
|
||||
{netscop} ^@\e]10;[echo:rlogin netscop]\a^@\e]10;[:[apptitle:netscop rlogin]:]\a
|
||||
{notes-mp} ^@\e]10;[echo:rlogin notes-mp]\a^@\e]10;[:[apptitle:notes-mp rlogin]:]\a
|
||||
{oraweb1} ^@\e]10;[echo:rlogin oraweb1]\a^@\e]10;[:[apptitle:oraweb1 rlogin]:]\a
|
||||
{pcdprod} ^@\e]10;[echo:rlogin pcdprod]\a^@\e]10;[:[apptitle:pcdprod rlogin]:]\a
|
||||
{prod-mp} ^@\e]10;[echo:rlogin prod-mp]\a^@\e]10;[:[apptitle:prod-mp rlogin]:]\a
|
||||
{rdpvcs} ^@\e]10;[echo:rlogin rdpvcs]\a^@\e]10;[:[apptitle:rdpvcs rlogin]:]\a
|
||||
{rdsgi1-mp} ^@\e]10;[echo:rlogin rdsgi1-mp]\a^@\e]10;[:[apptitle:rdsgi1-mp rlogin]:]\a
|
||||
{recov-mp} ^@\e]10;[echo:rlogin recov-mp]\a^@\e]10;[:[apptitle:recov-mp rlogin]:]\a
|
||||
{ren} ^@\e]10;[echo:rlogin ren]\a^@\e]10;[:[apptitle:ren rlogin]:]\a
|
||||
{scop-us} ^@\e]10;[echo:rlogin scop-us]\a^@\e]10;[:[apptitle:scop-us rlogin]:]\a
|
||||
{ship-eg} ^@\e]10;[echo:rlogin ship-eg]\a^@\e]10;[:[apptitle:ship-eg rlogin]:]\a
|
||||
{ship-mp} ^@\e]10;[echo:rlogin ship-mp]\a^@\e]10;[:[apptitle:ship-mp rlogin]:]\a
|
||||
{stimpy} ^@\e]10;[echo:rlogin stimpy]\a^@\e]10;[:[apptitle:stimpy rlogin]:]\a
|
||||
{test-mp} ^@\e]10;[echo:rlogin test-mp]\a^@\e]10;[:[apptitle:test-mp rlogin]:]\a
|
||||
{townesquare} ^@\e]10;[echo:rlogin townesquare]\a^@\e]10;[:[apptitle:townesquare rlogin]:]\a
|
||||
{ussk1rdu1} ^@\e]10;[echo:rlogin ussk1rdu1]\a^@\e]10;[:[apptitle:ussk1rdu1 rlogin]:]\a
|
||||
{uw-inet} ^@\e]10;[echo:rlogin uw-inet]\a^@\e]10;[:[apptitle:uw-inet rlogin]:]\a
|
||||
{webmw} ^@\e]10;[echo:rlogin webmw]\a^@\e]10;[:[apptitle:webmw rlogin]:]\a
|
||||
|
||||
../External/*
|
||||
{ftp.mandrake.net} ^@\e]10;[echo:rlogin ftp.mandrake.net]\a^@\e]10;[:[apptitle:ftp.mandrake.net rlogin]:]\a
|
||||
{ganja.tky.hut.fi} ^@\e]10;[echo:rlogin ganja.tky.hut.fi]\a^@\e]10;[:[apptitle:ganja.tky.hut.fi rlogin]:]\a
|
||||
{tcserv.com} ^@\e]10;[echo:rlogin tcserv.com]\a^@\e]10;[:[apptitle:tcserv.com rlogin]:]\a
|
||||
|
||||
../../telnet/*
|
||||
|
||||
./Alien Cluster/*
|
||||
{apone} ^@\e]10;[echo:telnet apone]\a^@\e]10;[:[apptitle:apone telnet]:]\a
|
||||
{ash} ^@\e]10;[echo:telnet ash]\a^@\e]10;[:[apptitle:ash telnet]:]\a
|
||||
{bishop} ^@\e]10;[echo:telnet bishop]\a^@\e]10;[:[apptitle:bishop telnet]:]\a
|
||||
{burke} ^@\e]10;[echo:telnet burke]\a^@\e]10;[:[apptitle:burke telnet]:]\a
|
||||
{dallas} ^@\e]10;[echo:telnet dallas]\a^@\e]10;[:[apptitle:dallas telnet]:]\a
|
||||
{drake} ^@\e]10;[echo:telnet drake]\a^@\e]10;[:[apptitle:drake telnet]:]\a
|
||||
{ripley} ^@\e]10;[echo:telnet ripley]\a^@\e]10;[:[apptitle:ripley telnet]:]\a
|
||||
{view1-mp} ^@\e]10;[echo:telnet view1-mp]\a^@\e]10;[:[apptitle:view1-mp telnet]:]\a
|
||||
{vob1-mp} ^@\e]10;[echo:telnet vob1-mp]\a^@\e]10;[:[apptitle:vob1-mp telnet]:]\a
|
||||
{vob2-mp} ^@\e]10;[echo:telnet vob2-mp]\a^@\e]10;[:[apptitle:vob2-mp telnet]:]\a
|
||||
|
||||
../IT Hosts/*
|
||||
{allen} ^@\e]10;[echo:telnet allen]\a^@\e]10;[:[apptitle:allen telnet]:]\a
|
||||
{babylon4} ^@\e]10;[echo:telnet babylon4]\a^@\e]10;[:[apptitle:babylon4 telnet]:]\a
|
||||
{icarus} ^@\e]10;[echo:telnet icarus]\a^@\e]10;[:[apptitle:icarus telnet]:]\a
|
||||
{orwell} ^@\e]10;[echo:telnet orwell]\a^@\e]10;[:[apptitle:orwell telnet]:]\a
|
||||
{phantom} ^@\e]10;[echo:telnet phantom]\a^@\e]10;[:[apptitle:phantom telnet]:]\a
|
||||
{viper} ^@\e]10;[echo:telnet viper]\a^@\e]10;[:[apptitle:viper telnet]:]\a
|
||||
{whitestar} ^@\e]10;[echo:telnet whitestar]\a^@\e]10;[:[apptitle:whitestar telnet]:]\a
|
||||
|
||||
../3Com/*
|
||||
{bkup-u2} ^@\e]10;[echo:telnet bkup-u2]\a^@\e]10;[:[apptitle:bkup-u2 telnet]:]\a
|
||||
{bkup-us} ^@\e]10;[echo:telnet bkup-us]\a^@\e]10;[:[apptitle:bkup-us telnet]:]\a
|
||||
{corsys1} ^@\e]10;[echo:telnet corsys1]\a^@\e]10;[:[apptitle:corsys1 telnet]:]\a
|
||||
{dmc-mp} ^@\e]10;[echo:telnet dmc-mp]\a^@\e]10;[:[apptitle:dmc-mp telnet]:]\a
|
||||
{dw-dev} ^@\e]10;[echo:telnet dw-dev]\a^@\e]10;[:[apptitle:dw-dev telnet]:]\a
|
||||
{dw1-uw} ^@\e]10;[echo:telnet dw1-uw]\a^@\e]10;[:[apptitle:dw1-uw telnet]:]\a
|
||||
{dw2-mp} ^@\e]10;[echo:telnet dw2-mp]\a^@\e]10;[:[apptitle:dw2-mp telnet]:]\a
|
||||
{firegate} ^@\e]10;[echo:telnet firegate]\a^@\e]10;[:[apptitle:firegate telnet]:]\a
|
||||
{hicks} ^@\e]10;[echo:telnet hicks]\a^@\e]10;[:[apptitle:hicks telnet]:]\a
|
||||
{hp-carp} ^@\e]10;[echo:telnet hp-carp]\a^@\e]10;[:[apptitle:hp-carp telnet]:]\a
|
||||
{hp-sales} ^@\e]10;[echo:telnet hp-sales]\a^@\e]10;[:[apptitle:hp-sales telnet]:]\a
|
||||
{hp9000} ^@\e]10;[echo:telnet hp9000]\a^@\e]10;[:[apptitle:hp9000 telnet]:]\a
|
||||
{hprpc1} ^@\e]10;[echo:telnet 149.112.166.42]\a^@\e]10;[:[apptitle:hprpc1 telnet]:]\a
|
||||
{hprpc2} ^@\e]10;[echo:telnet 149.112.166.43]\a^@\e]10;[:[apptitle:hprpc2 telnet]:]\a
|
||||
{intergate} ^@\e]10;[echo:telnet intergate]\a^@\e]10;[:[apptitle:intergate telnet]:]\a
|
||||
{lnnsdintra1} ^@\e]10;[echo:telnet lnnsdintra1]\a^@\e]10;[:[apptitle:lnnsdintra1 telnet]:]\a
|
||||
{mailgate} ^@\e]10;[echo:telnet mailgate]\a^@\e]10;[:[apptitle:mailgate telnet]:]\a
|
||||
{mwdev1} ^@\e]10;[echo:telnet mwdev1]\a^@\e]10;[:[apptitle:mwdev1 telnet]:]\a
|
||||
{mwdev2} ^@\e]10;[echo:telnet mwdev2]\a^@\e]10;[:[apptitle:mwdev2 telnet]:]\a
|
||||
{mwdev3} ^@\e]10;[echo:telnet mwdev3]\a^@\e]10;[:[apptitle:mwdev3 telnet]:]\a
|
||||
{mwdocs1} ^@\e]10;[echo:telnet mwdocs1]\a^@\e]10;[:[apptitle:mwdocs1 telnet]:]\a
|
||||
{mwprod1} ^@\e]10;[echo:telnet mwprod1]\a^@\e]10;[:[apptitle:mwprod1 telnet]:]\a
|
||||
{mwprod2} ^@\e]10;[echo:telnet mwprod2]\a^@\e]10;[:[apptitle:mwprod2 telnet]:]\a
|
||||
{mwprod3} ^@\e]10;[echo:telnet mwprod3]\a^@\e]10;[:[apptitle:mwprod3 telnet]:]\a
|
||||
{netscop} ^@\e]10;[echo:telnet netscop]\a^@\e]10;[:[apptitle:netscop telnet]:]\a
|
||||
{notes-mp} ^@\e]10;[echo:telnet notes-mp]\a^@\e]10;[:[apptitle:notes-mp telnet]:]\a
|
||||
{oraweb1} ^@\e]10;[echo:telnet oraweb1]\a^@\e]10;[:[apptitle:oraweb1 telnet]:]\a
|
||||
{pcdprod} ^@\e]10;[echo:telnet pcdprod]\a^@\e]10;[:[apptitle:pcdprod telnet]:]\a
|
||||
{prod-mp} ^@\e]10;[echo:telnet prod-mp]\a^@\e]10;[:[apptitle:prod-mp telnet]:]\a
|
||||
{rdpvcs} ^@\e]10;[echo:telnet rdpvcs]\a^@\e]10;[:[apptitle:rdpvcs telnet]:]\a
|
||||
{rdsgi1-mp} ^@\e]10;[echo:telnet rdsgi1-mp]\a^@\e]10;[:[apptitle:rdsgi1-mp telnet]:]\a
|
||||
{recov-mp} ^@\e]10;[echo:telnet recov-mp]\a^@\e]10;[:[apptitle:recov-mp telnet]:]\a
|
||||
{ren} ^@\e]10;[echo:telnet ren]\a^@\e]10;[:[apptitle:ren telnet]:]\a
|
||||
{scop-us} ^@\e]10;[echo:telnet scop-us]\a^@\e]10;[:[apptitle:scop-us telnet]:]\a
|
||||
{ship-eg} ^@\e]10;[echo:telnet ship-eg]\a^@\e]10;[:[apptitle:ship-eg telnet]:]\a
|
||||
{ship-mp} ^@\e]10;[echo:telnet ship-mp]\a^@\e]10;[:[apptitle:ship-mp telnet]:]\a
|
||||
{stimpy} ^@\e]10;[echo:telnet stimpy]\a^@\e]10;[:[apptitle:stimpy telnet]:]\a
|
||||
{test-mp} ^@\e]10;[echo:telnet test-mp]\a^@\e]10;[:[apptitle:test-mp telnet]:]\a
|
||||
{townesquare} ^@\e]10;[echo:telnet townesquare]\a^@\e]10;[:[apptitle:townesquare telnet]:]\a
|
||||
{ussk1rdu1} ^@\e]10;[echo:telnet ussk1rdu1]\a^@\e]10;[:[apptitle:ussk1rdu1 telnet]:]\a
|
||||
{uw-inet} ^@\e]10;[echo:telnet uw-inet]\a^@\e]10;[:[apptitle:uw-inet telnet]:]\a
|
||||
{webmw} ^@\e]10;[echo:telnet webmw]\a^@\e]10;[:[apptitle:webmw telnet]:]\a
|
||||
|
||||
../External/*
|
||||
{ftp.mandrake.net} ^@\e]10;[echo:telnet ftp.mandrake.net]\a^@\e]10;[:[apptitle:ftp.mandrake.net telnet]:]\a
|
||||
{ganja.tky.hut.fi} ^@\e]10;[echo:telnet ganja.tky.hut.fi]\a^@\e]10;[:[apptitle:ganja.tky.hut.fi telnet]:]\a
|
||||
{tcserv.com} ^@\e]10;[echo:telnet tcserv.com]\a^@\e]10;[:[apptitle:tcserv.com telnet]:]\a
|
||||
|
||||
../../FTP/*
|
||||
|
||||
./Alien Cluster/*
|
||||
{apone} ^@\e]10;[echo:ftp apone]\a^@\e]10;[:[apptitle:apone ftp]:]\a
|
||||
{ash} ^@\e]10;[echo:ftp ash]\a^@\e]10;[:[apptitle:ash ftp]:]\a
|
||||
{bishop} ^@\e]10;[echo:ftp bishop]\a^@\e]10;[:[apptitle:bishop ftp]:]\a
|
||||
{burke} ^@\e]10;[echo:ftp burke]\a^@\e]10;[:[apptitle:burke ftp]:]\a
|
||||
{dallas} ^@\e]10;[echo:ftp dallas]\a^@\e]10;[:[apptitle:dallas ftp]:]\a
|
||||
{drake} ^@\e]10;[echo:ftp drake]\a^@\e]10;[:[apptitle:drake ftp]:]\a
|
||||
{ripley} ^@\e]10;[echo:ftp ripley]\a^@\e]10;[:[apptitle:ripley ftp]:]\a
|
||||
{view1-mp} ^@\e]10;[echo:ftp view1-mp]\a^@\e]10;[:[apptitle:view1-mp ftp]:]\a
|
||||
{vob1-mp} ^@\e]10;[echo:ftp vob1-mp]\a^@\e]10;[:[apptitle:vob1-mp ftp]:]\a
|
||||
{vob2-mp} ^@\e]10;[echo:ftp vob2-mp]\a^@\e]10;[:[apptitle:vob2-mp ftp]:]\a
|
||||
|
||||
../IT Hosts/*
|
||||
{allen} ^@\e]10;[echo:ftp allen]\a^@\e]10;[:[apptitle:allen ftp]:]\a
|
||||
{babylon4} ^@\e]10;[echo:ftp babylon4]\a^@\e]10;[:[apptitle:babylon4 ftp]:]\a
|
||||
{icarus} ^@\e]10;[echo:ftp icarus]\a^@\e]10;[:[apptitle:icarus ftp]:]\a
|
||||
{orwell} ^@\e]10;[echo:ftp orwell]\a^@\e]10;[:[apptitle:orwell ftp]:]\a
|
||||
{phantom} ^@\e]10;[echo:ftp phantom]\a^@\e]10;[:[apptitle:phantom ftp]:]\a
|
||||
{viper} ^@\e]10;[echo:ftp viper]\a^@\e]10;[:[apptitle:viper ftp]:]\a
|
||||
{whitestar} ^@\e]10;[echo:ftp whitestar]\a^@\e]10;[:[apptitle:whitestar ftp]:]\a
|
||||
|
||||
../3Com/*
|
||||
{bkup-u2} ^@\e]10;[echo:ftp bkup-u2]\a^@\e]10;[:[apptitle:bkup-u2 ftp]:]\a
|
||||
{bkup-us} ^@\e]10;[echo:ftp bkup-us]\a^@\e]10;[:[apptitle:bkup-us ftp]:]\a
|
||||
{corsys1} ^@\e]10;[echo:ftp corsys1]\a^@\e]10;[:[apptitle:corsys1 ftp]:]\a
|
||||
{dmc-mp} ^@\e]10;[echo:ftp dmc-mp]\a^@\e]10;[:[apptitle:dmc-mp ftp]:]\a
|
||||
{dw-dev} ^@\e]10;[echo:ftp dw-dev]\a^@\e]10;[:[apptitle:dw-dev ftp]:]\a
|
||||
{dw1-uw} ^@\e]10;[echo:ftp dw1-uw]\a^@\e]10;[:[apptitle:dw1-uw ftp]:]\a
|
||||
{dw2-mp} ^@\e]10;[echo:ftp dw2-mp]\a^@\e]10;[:[apptitle:dw2-mp ftp]:]\a
|
||||
{firegate} ^@\e]10;[echo:ftp firegate]\a^@\e]10;[:[apptitle:firegate ftp]:]\a
|
||||
{hicks} ^@\e]10;[echo:ftp hicks]\a^@\e]10;[:[apptitle:hicks ftp]:]\a
|
||||
{hp-carp} ^@\e]10;[echo:ftp hp-carp]\a^@\e]10;[:[apptitle:hp-carp ftp]:]\a
|
||||
{hp-sales} ^@\e]10;[echo:ftp hp-sales]\a^@\e]10;[:[apptitle:hp-sales ftp]:]\a
|
||||
{hp9000} ^@\e]10;[echo:ftp hp9000]\a^@\e]10;[:[apptitle:hp9000 ftp]:]\a
|
||||
{hprpc1} ^@\e]10;[echo:ftp 149.112.166.42]\a^@\e]10;[:[apptitle:hprpc1 ftp]:]\a
|
||||
{hprpc2} ^@\e]10;[echo:ftp 149.112.166.43]\a^@\e]10;[:[apptitle:hprpc2 ftp]:]\a
|
||||
{intergate} ^@\e]10;[echo:ftp intergate]\a^@\e]10;[:[apptitle:intergate ftp]:]\a
|
||||
{lnnsdintra1} ^@\e]10;[echo:ftp lnnsdintra1]\a^@\e]10;[:[apptitle:lnnsdintra1 ftp]:]\a
|
||||
{mailgate} ^@\e]10;[echo:ftp mailgate]\a^@\e]10;[:[apptitle:mailgate ftp]:]\a
|
||||
{mwdev1} ^@\e]10;[echo:ftp mwdev1]\a^@\e]10;[:[apptitle:mwdev1 ftp]:]\a
|
||||
{mwdev2} ^@\e]10;[echo:ftp mwdev2]\a^@\e]10;[:[apptitle:mwdev2 ftp]:]\a
|
||||
{mwdev3} ^@\e]10;[echo:ftp mwdev3]\a^@\e]10;[:[apptitle:mwdev3 ftp]:]\a
|
||||
{mwdocs1} ^@\e]10;[echo:ftp mwdocs1]\a^@\e]10;[:[apptitle:mwdocs1 ftp]:]\a
|
||||
{mwprod1} ^@\e]10;[echo:ftp mwprod1]\a^@\e]10;[:[apptitle:mwprod1 ftp]:]\a
|
||||
{mwprod2} ^@\e]10;[echo:ftp mwprod2]\a^@\e]10;[:[apptitle:mwprod2 ftp]:]\a
|
||||
{mwprod3} ^@\e]10;[echo:ftp mwprod3]\a^@\e]10;[:[apptitle:mwprod3 ftp]:]\a
|
||||
{netscop} ^@\e]10;[echo:ftp netscop]\a^@\e]10;[:[apptitle:netscop ftp]:]\a
|
||||
{notes-mp} ^@\e]10;[echo:ftp notes-mp]\a^@\e]10;[:[apptitle:notes-mp ftp]:]\a
|
||||
{oraweb1} ^@\e]10;[echo:ftp oraweb1]\a^@\e]10;[:[apptitle:oraweb1 ftp]:]\a
|
||||
{pcdprod} ^@\e]10;[echo:ftp pcdprod]\a^@\e]10;[:[apptitle:pcdprod ftp]:]\a
|
||||
{prod-mp} ^@\e]10;[echo:ftp prod-mp]\a^@\e]10;[:[apptitle:prod-mp ftp]:]\a
|
||||
{rdpvcs} ^@\e]10;[echo:ftp rdpvcs]\a^@\e]10;[:[apptitle:rdpvcs ftp]:]\a
|
||||
{rdsgi1-mp} ^@\e]10;[echo:ftp rdsgi1-mp]\a^@\e]10;[:[apptitle:rdsgi1-mp ftp]:]\a
|
||||
{recov-mp} ^@\e]10;[echo:ftp recov-mp]\a^@\e]10;[:[apptitle:recov-mp ftp]:]\a
|
||||
{ren} ^@\e]10;[echo:ftp ren]\a^@\e]10;[:[apptitle:ren ftp]:]\a
|
||||
{scop-us} ^@\e]10;[echo:ftp scop-us]\a^@\e]10;[:[apptitle:scop-us ftp]:]\a
|
||||
{ship-eg} ^@\e]10;[echo:ftp ship-eg]\a^@\e]10;[:[apptitle:ship-eg ftp]:]\a
|
||||
{ship-mp} ^@\e]10;[echo:ftp ship-mp]\a^@\e]10;[:[apptitle:ship-mp ftp]:]\a
|
||||
{stimpy} ^@\e]10;[echo:ftp stimpy]\a^@\e]10;[:[apptitle:stimpy ftp]:]\a
|
||||
{test-mp} ^@\e]10;[echo:ftp test-mp]\a^@\e]10;[:[apptitle:test-mp ftp]:]\a
|
||||
{townesquare} ^@\e]10;[echo:ftp townesquare]\a^@\e]10;[:[apptitle:townesquare ftp]:]\a
|
||||
{ussk1rdu1} ^@\e]10;[echo:ftp ussk1rdu1]\a^@\e]10;[:[apptitle:ussk1rdu1 ftp]:]\a
|
||||
{uw-inet} ^@\e]10;[echo:ftp uw-inet]\a^@\e]10;[:[apptitle:uw-inet ftp]:]\a
|
||||
{webmw} ^@\e]10;[echo:ftp webmw]\a^@\e]10;[:[apptitle:webmw ftp]:]\a
|
||||
|
||||
../External/*
|
||||
{ftp.mandrake.net} ^@\e]10;[echo:ftp ftp.mandrake.net]\a^@\e]10;[:[apptitle:ftp.mandrake.net ftp]:]\a
|
||||
{ganja.tky.hut.fi} ^@\e]10;[echo:ftp ganja.tky.hut.fi]\a^@\e]10;[:[apptitle:ganja.tky.hut.fi ftp]:]\a
|
||||
{tcserv.com} ^@\e]10;[echo:ftp tcserv.com]\a^@\e]10;[:[apptitle:tcserv.com ftp]:]\a
|
||||
|
||||
# make sure the change gets updated
|
||||
[show]
|
||||
[done]
|
||||
#--------------------------------------------------------------------- eof
|
|
@ -0,0 +1,332 @@
|
|||
<Eterm-0.8>
|
||||
# ^- This must be the first line of any Eterm config file!
|
||||
# Format is: <Eterm-VERSION> where VERSION is replaced by
|
||||
# the version it was written for,
|
||||
# minus the "DR-" if any.
|
||||
#
|
||||
# This is a sample Eterm config file. It should be placed in
|
||||
# ~/.Eterm/themes/@THEME@/MAIN and modified to suit your needs
|
||||
#
|
||||
# As always, the authors guarantee absolutely nothing and take
|
||||
# no responsibility for anything that might happen to you, your
|
||||
# computer, your dog, your sex life, or anyone or anything else
|
||||
# directly or indirectly through the use of, or inability to use,
|
||||
# this program. Use at your OWN risk.
|
||||
|
||||
# A begin to get things started.
|
||||
begin main
|
||||
|
||||
# Define the color properties
|
||||
begin color
|
||||
|
||||
# Foreground, background, cursor, scrollbar, pointer colors
|
||||
foreground white
|
||||
background black
|
||||
cursor #ffff00
|
||||
cursor_text #880000
|
||||
scrollbar #3f1c00
|
||||
unfocusedscrollbar #777777
|
||||
menu #777777
|
||||
unfocusedmenu #777777
|
||||
menu_text black
|
||||
pointer white
|
||||
|
||||
# video attribute can either be "normal" or "reverse"
|
||||
video normal
|
||||
|
||||
# Redefine the 16 basic colors, if you really feel the need
|
||||
# First word is "color", next is the number (0-15, BD, or UL),
|
||||
# then the values for red, green, and blue separated by spaces
|
||||
# Numbers are base 10 unless preceded by "0x" (base 16) or '0'
|
||||
# (base 8). Alternatively, you can use color names or #xxxxxx
|
||||
# format.
|
||||
|
||||
# The colors below are taken from Rasterman's .Xdefaults file. They are intended to
|
||||
# display ANSI art properly when combined with a good ANSI-art font (like vga or
|
||||
# Rasterman's nexus font).
|
||||
# color 0 0 0 0
|
||||
# color 1 0xaa 0 0
|
||||
# color 2 0 0210 0
|
||||
# color 3 0xaa 0x55 0x22
|
||||
# color 4 0 0 0xaa
|
||||
# color 5 0xaa 0 0xaa
|
||||
# color 6 0 0xaa 0xaa
|
||||
# color 7 0xaa 0xaa 0xaa
|
||||
# color 8 0x44 0x44 0x44
|
||||
# color 9 0xff 0x44 0x44
|
||||
# color 10 0x44 0xff 0x44
|
||||
# color 11 0xff 0xff 0x44
|
||||
# color 12 0x44 0x44 0xff
|
||||
# color 13 0xff 0x44 0xff
|
||||
# color 14 0x44 0xff 0xff
|
||||
# color 15 #ffffff
|
||||
# color bd #ffffff
|
||||
# color ul #ffffff
|
||||
|
||||
# This ends the color section. Any text after the word "end" is
|
||||
# assumed to be a comment and ignored.
|
||||
end color
|
||||
|
||||
# The X11 attributes section. Should be fairly self-explanatory,
|
||||
# but if not, consult the X man page.
|
||||
begin attributes
|
||||
|
||||
# Geometry == widthxheight+x_offset+y_offset, offsets from top left
|
||||
# if +, bottom right if -
|
||||
# geometry 132x50+100+100
|
||||
# title "%appname() -- Host Chooser"
|
||||
name "%appname() -- Host Chooser"
|
||||
# iconname Eterm
|
||||
|
||||
# Set the fonts. These must be monospace fonts. The values shown are
|
||||
# the Eterm defaults. The "bold" font is the font used if color BD has
|
||||
# not been set and Eterm cannot map the foreground color to one of the
|
||||
# high-intensity colors (8-15).
|
||||
font 0 fixed
|
||||
font 1 6x10
|
||||
font 2 6x13
|
||||
font 3 8x13
|
||||
font 4 9x15
|
||||
# font bold 7x14
|
||||
end attributes
|
||||
|
||||
# Define the imageclasses.
|
||||
begin imageclasses
|
||||
|
||||
# You must define this before setting any images that use it. This is the $PATH-style variable
|
||||
# that determines where Eterm looks for image files.
|
||||
path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:@PKGDATADIR@/pix/"
|
||||
|
||||
# If you want a different icon than the standard Eterm one, set this.
|
||||
# icon Eterm.xpm
|
||||
|
||||
# This is the background animator. See the man page for the syntax.
|
||||
# anim 3 foo1 foo2 foo3
|
||||
|
||||
# Here we define an image.
|
||||
begin image
|
||||
|
||||
# The first thing you set when defining an image MUST be the type. No type, no dice. The type
|
||||
# should be one of the following: background, up_arrow, down_arrow, left_arrow, right_arrow,
|
||||
# trough, anchor, menu, or submenu
|
||||
type background
|
||||
|
||||
# Next you should set the state. This is either normal, selected, or clicked.
|
||||
state normal
|
||||
|
||||
# Here you set the file. You can also set the geometry string here if you follow the filename with
|
||||
# an @ sign. That way, you can include the geometries in your pixmaps.list file.
|
||||
file %random(`cat pixmaps.list`)
|
||||
|
||||
# The mode line. This defines the startup mode for the image, as well as what modes are allowed.
|
||||
# Valid modes are "image" (to display the image file), "trans" (to be transparent), or "viewport"
|
||||
# (for viewport mode). Syntax is "mode <startup_mode> allow <allowed_modes>".
|
||||
mode image allow trans viewport
|
||||
|
||||
# Set the image border. This is a portion of the image which will be kept at its actual size when
|
||||
# scaling. Use this for beveled images (buttons, etc.).
|
||||
border 0 0 0 0
|
||||
|
||||
# Th-th-th-th-that's all folks.
|
||||
end image
|
||||
|
||||
# The rest of the images.
|
||||
begin image
|
||||
type trough
|
||||
mode image allow trans viewport
|
||||
state normal
|
||||
file bar_vertical_3.png
|
||||
# Here is how you specify the geometry string separately. See the man page for its syntax.
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type anchor
|
||||
state normal
|
||||
file bar_vertical_1.png
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
state selected
|
||||
file bar_vertical_2.png
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type up_arrow
|
||||
state normal
|
||||
file button_arrow_up_1.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state selected
|
||||
file button_arrow_up_2.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state clicked
|
||||
file button_arrow_up_3.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
end image
|
||||
begin image
|
||||
type down_arrow
|
||||
state normal
|
||||
file button_arrow_down_1.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state selected
|
||||
file button_arrow_down_2.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state clicked
|
||||
file button_arrow_down_3.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
end image
|
||||
begin image
|
||||
type menu
|
||||
state normal
|
||||
file bar_horizontal_1.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 3 2 2
|
||||
state selected
|
||||
file bar_horizontal_2.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type submenu
|
||||
state normal
|
||||
file menu1.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
state selected
|
||||
file menu2.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
state clicked
|
||||
file menu3.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
end image
|
||||
end
|
||||
|
||||
%include "chooser-menu.cfg"
|
||||
|
||||
# This section *must* come after the menu definitions if you want
|
||||
# menu actions to work. C'est la vie. :-)
|
||||
#
|
||||
# Syntax: bind [ { <modifiers> | anymod } ] { <key> | <keysym> | <button> } to { string | echo | menu } <parameter>
|
||||
#
|
||||
begin actions
|
||||
bind ctrl button1 to string "\e]5;\a"
|
||||
bind ctrl button2 to string "\e[?30t"
|
||||
bind ctrl button3 to menu Eterm
|
||||
bind anymod f1 to menu Eterm
|
||||
end actions
|
||||
|
||||
# The Multichar support options. Same goes for these fonts as for the normal
|
||||
# ones. The "encoding" attribute can be either "eucj" or "sjis" or "euckr"
|
||||
# or big5 or gb
|
||||
# begin multichar
|
||||
# font 0 k14
|
||||
# font 1 jiskan16
|
||||
# font 2 jiskan18
|
||||
# font 3 jiskan24
|
||||
# font 4 jiskan26
|
||||
# encoding eucj
|
||||
# end multichar
|
||||
|
||||
# The XIM support options.
|
||||
# input_method: set the name of your favorate input method program
|
||||
# preedit_type: OverTheSpot or OffTheSpot or Root
|
||||
# begin xim
|
||||
# input_method Ami
|
||||
# preedit_type OverTheSpot
|
||||
# end xim
|
||||
|
||||
# Boolean variables. The values can be "1", "on", or "true" for TRUE, or "0",
|
||||
# "off", or "false" for FALSE.
|
||||
begin toggles
|
||||
|
||||
# If true, Eterm will un-iconify itself when it receives a beep (ASCII 0x07)
|
||||
map_alert on
|
||||
|
||||
# If true, Eterm will flash rather than sending a beep.
|
||||
visual_bell off
|
||||
|
||||
# If true, Eterm will prepend '-' to the shell name when calling it.
|
||||
login_shell true
|
||||
|
||||
# If true, Eterm will display the scroll bar
|
||||
scrollbar on
|
||||
|
||||
# If true, Eterm will attempt to make an entry in the utmp file to record the
|
||||
# login information. Eterm *must* run privileged to do this.
|
||||
utmp_logging on
|
||||
|
||||
# If true, Eterm will handle the Meta (Alt) + keypress to set the 8th bit.
|
||||
# If false, Eterm will handle the Meta + keypress as an escape prefix. (default)
|
||||
# meta8 false
|
||||
|
||||
# If true, Eterm will start iconified.
|
||||
iconic false
|
||||
|
||||
# If true, Eterm will jump to the bottom of the window when something is echoed
|
||||
# to the terminal, either by program output or user input.
|
||||
home_on_echo 1
|
||||
|
||||
# If true, Eterm will jump to the bottom of the window when you refresh the
|
||||
# screen (^L).
|
||||
home_on_refresh 1
|
||||
|
||||
# If true, Eterm will put the scrollbar on the right of the window (default is left).
|
||||
scrollbar_right true
|
||||
|
||||
# If true, the scrollbar will have no trough.
|
||||
scrollbar_floating false
|
||||
|
||||
# If true, Eterm will run with no window borders.
|
||||
borderless false
|
||||
|
||||
end toggles
|
||||
|
||||
begin keyboard
|
||||
|
||||
# Use the supplied keysym to reduce/enlarge the font
|
||||
smallfont_key LessThan
|
||||
bigfont_key GreaterThan
|
||||
|
||||
# You can also associate a given keysym (0xff00 - 0xffff) with a string
|
||||
# keysym 0xffff "\r\n\e\007\t"
|
||||
|
||||
# Greek keyboard mode. First the word "greek", then its boolean
|
||||
# state, then its mode (either "iso" or "ibm").
|
||||
# greek off iso
|
||||
end keyboard
|
||||
|
||||
begin misc
|
||||
|
||||
# The command to which to pipe print requests (printscreen)
|
||||
# print_pipe "lpr"
|
||||
|
||||
# The number of lines in the scrollback buffer. More lines, more memory needed.
|
||||
save_lines 1024
|
||||
|
||||
# The characters to use as word delimiters for double-click selection
|
||||
cut_chars "\t\\\`\\\"\'&() *,;<=>?@[]{|}"
|
||||
|
||||
# Defines the width of the border between the terminal window and the client window.
|
||||
# (Default is 5).
|
||||
border_width 5
|
||||
|
||||
# Value to use for $TERM
|
||||
term_name xterm
|
||||
|
||||
# Program to exec (intended for use with themes)
|
||||
# exec foo
|
||||
|
||||
end misc
|
||||
|
||||
end main
|
|
@ -1 +1 @@
|
|||
MAIN
|
||||
theme.cfg
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,269 +0,0 @@
|
|||
# standard settings for an Eterm control menu
|
||||
[menu:Eterm]
|
||||
|
||||
/Eterm/*
|
||||
|
||||
./Font/*
|
||||
{Normal} ^@\e]50;#
|
||||
{Larger} ^@\e]50;#+
|
||||
{Smaller} ^@\e]50;#-
|
||||
{-}
|
||||
{Font 1} ^@\e]50;#1
|
||||
{Font 2} ^@\e]50;#2
|
||||
{Font 3} ^@\e]50;#3
|
||||
{Font 4} ^@\e]50;#4
|
||||
|
||||
../Terminal/*
|
||||
./Toggles/*
|
||||
{Cursor Visible} ^@\e[?25t
|
||||
{Home on Echo} ^@\e[?1010t
|
||||
{Home on Refresh} ^@\e[?1011t
|
||||
{Home on Input} ^@\e[?1012t
|
||||
{Map Alert} ^@\e]6;21\a
|
||||
{Primary/Secondary Screen} ^@\e[?47t
|
||||
{Reverse Video} ^@\e[?5t
|
||||
{Select Trailing Spaces} ^@\e]6;25\a
|
||||
{Select Whole Line on Triple-click} ^@\e]6;23\a
|
||||
{Visual Bell} ^@\e]6;20\a
|
||||
{X11 Mouse Reporting} ^@\e[?1000t
|
||||
{Xterm Selection Behavior} ^@\e]6;22\a
|
||||
../Keys/*
|
||||
{Application Arrow Keys} ^@\e[?1t
|
||||
{Application Keypad} ^@\e[?66t
|
||||
{Backspace/Delete} ^@\e[?67t
|
||||
{Xterm Shift-Keys} ^@\e[?35t
|
||||
../Menubar/*
|
||||
{Toggle Visibility}{Ctrl-Button3} ^@\e[?10t
|
||||
{Refresh Menubar} ^@\e[?10h
|
||||
{Toggle Window Move by Menubar} ^@\e]6;15\a
|
||||
../Scrollbar/*
|
||||
{Toggle Visibility}{Ctrl-Button2} ^@\e[?30t
|
||||
{Swap Sides} ^@\e]6;11\a
|
||||
{Toggle Floating} ^@\e]6;12\a
|
||||
{Toggle Popup Mode} ^@\e]6;13\a
|
||||
{-}
|
||||
{Motif (Traditional) Style} ^@\e]6;10;motif;;\a
|
||||
{NeXT Style} ^@\e]6;10;next;;\a
|
||||
{Xterm Style} ^@\e]6;10;xterm;;\a
|
||||
./Width/*
|
||||
{5} ^@\e]6;10;;5;\a
|
||||
{6} ^@\e]6;10;;6;\a
|
||||
{7} ^@\e]6;10;;7;\a
|
||||
{8} ^@\e]6;10;;8;\a
|
||||
{9} ^@\e]6;10;;9;\a
|
||||
{10} ^@\e]6;10;;10;\a
|
||||
{11} ^@\e]6;10;;11;\a
|
||||
{12} ^@\e]6;10;;12;\a
|
||||
{13} ^@\e]6;10;;13;\a
|
||||
{14} ^@\e]6;10;;14;\a
|
||||
{15} ^@\e]6;10;;15;\a
|
||||
{16} ^@\e]6;10;;16;\a
|
||||
{17} ^@\e]6;10;;17;\a
|
||||
{18} ^@\e]6;10;;18;\a
|
||||
{19} ^@\e]6;10;;19;\a
|
||||
{20} ^@\e]6;10;;20;\a
|
||||
../
|
||||
../Move to Desktop/*
|
||||
{0} ^@\e]6;50;0;\a
|
||||
{1} ^@\e]6;50;1;\a
|
||||
{2} ^@\e]6;50;2;\a
|
||||
{3} ^@\e]6;50;3;\a
|
||||
{4} ^@\e]6;50;4;\a
|
||||
{5} ^@\e]6;50;5;\a
|
||||
{6} ^@\e]6;50;6;\a
|
||||
{7} ^@\e]6;50;7;\a
|
||||
../
|
||||
{-}
|
||||
{Steal Focus}{Ctrl-Button1} ^@\e]5;\a
|
||||
{Full Reset} ^@\ec
|
||||
|
||||
../Background/*
|
||||
./Transparency/*
|
||||
{Force Update} ^@\e]6;3\a
|
||||
{Toggle Desktop Watching} ^@\e]6;4\a
|
||||
{Toggle Transparency} ^@\e]6;0\a
|
||||
../Pixmap/*
|
||||
{None} ^@\e[m\e]20;;\a
|
||||
{Toggle Viewport Mode} ^@\e]6;24\a
|
||||
./Tiled/*
|
||||
{70's Marble} ^@\e]20;70s_marble.png;0x0+50+50\a
|
||||
{7m} ^@\e]10;[pixmap:7m.png;0x0+50+50]
|
||||
{Alabama Clay} ^@\e]10;[pixmap:dirt.png;0x0+50+50]
|
||||
{Anomaly} ^@\e]20;a8.png;0x0+50+50\a
|
||||
{Black Stone} ^@\e]20;blackstone.png;0x0+50+50\a
|
||||
{Blue Ether} ^@\e]10;[pixmap:ether_blue.png;0x0+50+50]
|
||||
{Blue Marble} ^@\e]10;[pixmap:blue_marble.png;0x0+50+50]
|
||||
{Blue Maze} ^@\e]10;[pixmap:blue_maze.png;0x0+50+50]
|
||||
{Blue Puzzle} ^@\e]10;[pixmap:026.png;0x0+50+50]
|
||||
{Circuit} ^@\e]10;[pixmap:circuit.png;0x0+50+50]
|
||||
{Cyber Playground} ^@\e]10;[pixmap:cyber_bg.png;0x0+50+50]
|
||||
{Dark Marble} ^@\e]10;[pixmap:dark_marble.png;0x0+50+50]
|
||||
{Dimples} ^@\e]20;014.png;0x0+50+50\a
|
||||
{Ether} ^@\e]10;[pixmap:ether.png;0x0+50+50]
|
||||
{Giger 1} ^@\e]10;[pixmap:giger1.png;0x0+50+50]
|
||||
{Giger 2} ^@\e]10;[pixmap:giger2.png;0x0+50+50]
|
||||
{Gray Matter} ^@\e]10;[pixmap:22.png;0x0+50+50]
|
||||
{Gray Waves} ^@\e]10;[pixmap:gray_waves.png;0x0+50+50]
|
||||
{Jungle} ^@\e]20;43.png;0x0+50+50\a
|
||||
{Lava} ^@\e]20;4.png;0x0+50+50\a
|
||||
{Light B1} ^@\e]10;[pixmap:lightb1.png;0x0+50+50]
|
||||
{Maple Leaves} ^@\e]10;[pixmap:maple1.png;0x0+50+50]
|
||||
{Marble} ^@\e]10;[pixmap:marbled.png;0x0+50+50]
|
||||
{Pebbles} ^@\e]10;[pixmap:pebble1.png;0x0+50+50]
|
||||
{Purple Rain} ^@\e]20;024.png;0x0+50+50\a
|
||||
{Purple Clouds} ^@\e]10;[pixmap:7.png;0x0+50+50]
|
||||
{Rainstorm} ^@\e]20;15.png;0x0+50+50\a
|
||||
{Red Whisper} ^@\e]10;[pixmap:40.png;0x0+50+50]
|
||||
{Soft Marble} ^@\e]10;[pixmap:soft.png;0x0+50+50]
|
||||
{Space 1} ^@\e]10;[pixmap:space.png;0x0+50+50]
|
||||
{Space 2} ^@\e]10;[pixmap:starry.png;0x0+50+50]
|
||||
{Whirlpool} ^@\e]20;015.png;0x0+50+50\a
|
||||
|
||||
../Scaled/*
|
||||
{Alien Spheres} ^@\e]20;alien_spheres.jpg;100x100+50+50\a
|
||||
{Atlantis} ^@\e]20;atlantis.jpg;100x100+50+50\a
|
||||
{Before the Storm} ^@\e]20;before_the_storm.jpg;100x100+50+50\a
|
||||
{Bladerunner} ^@\e]20;Bladerunner-bg.png;100x100+50+50\a
|
||||
{Canyon} ^@\e]20;Canyon.jpg;100x100+50+50\a
|
||||
{CaveFire} ^@\e]20;Cavefire-bg.png;100x100+50+50\a
|
||||
{Crater Lake} ^@\e]20;crater_lake.jpg;100x100+50+50\a
|
||||
{Daughter} ^@\e]20;Daughter.jpg;100x100+50+50\a
|
||||
{Dragon} ^@\e]20;Dragon.jpg;100x100+50+50\a
|
||||
{DVXVB} ^@\e]20;dvxvb.jpg;100x100+50+50\a
|
||||
{Elysium} ^@\e]20;elysium.jpg;100x100+50+50\a
|
||||
{Evocation} ^@\e]20;Evocation.jpg;100x100+50+50\a
|
||||
{Hourglass} ^@\e]20;hour.jpg;100x100+50+50\a
|
||||
{Ice Moon} ^@\e]20;icemoon.jpg;100x100+50+50\a
|
||||
{Iron Temple} ^@\e]20;iron_temple.jpg;100x100+50+50\a
|
||||
{Lake of Fire} ^@\e]20;lake_of_fire.jpg;100x100+50+50\a
|
||||
{Lighthouse} ^@\e]20;lighthouse.jpg;100x100+50+50\a
|
||||
{Monolith} ^@\e]20;monolith.jpg;100x100+50+50\a
|
||||
{Nebula} ^@\e]20;nebula.jpg;100x100+50+50\a
|
||||
{Neopolis} ^@\e]20;neopolis.jpg;100x100+50+50\a
|
||||
{Neopolis Horizon} ^@\e]20;Neopolis-horizon.png;100x100+50+50\a
|
||||
{Planet A} ^@\e]20;planeta.png;100x100+50+50\a
|
||||
{Pond} ^@\e]20;pond.png;100x100+50+50\a
|
||||
{Poseidon} ^@\e]20;poseidon.png;100x100+50+50\a
|
||||
{Return to Giza} ^@\e]20;return_to_giza.jpg;100x100+50+50\a
|
||||
{Ripple} ^@\e]20;ripple.png;100x100+50+50\a
|
||||
{River of Lead} ^@\e]20;river_of_lead.jpg;100x100+50+50\a
|
||||
{Silence} ^@\e]20;silence.jpg;100x100+50+50\a
|
||||
{Sun} ^@\e]20;sun.png;100x100+50+50\a
|
||||
{Tunnel} ^@\e]20;tunnel.jpg;100x100+50+50\a
|
||||
{Wasteland} ^@\e]20;wasteland.jpg;100x100+50+50\a
|
||||
../
|
||||
{-}
|
||||
./Attrib/*
|
||||
{Full} ^@\e]20;;100x100+50+50;
|
||||
{Tiled} ^@\e]20;;0
|
||||
{Center} ^@\e]20;;=+50+50;
|
||||
../
|
||||
../Shade/*
|
||||
{0%} ^@\e]6;1;0%\a
|
||||
{10%} ^@\e]6;1;10%\a
|
||||
{20%} ^@\e]6;1;20%\a
|
||||
{30%} ^@\e]6;1;30%\a
|
||||
{40%} ^@\e]6;1;40%\a
|
||||
{50%} ^@\e]6;1;50%\a
|
||||
{60%} ^@\e]6;1;60%\a
|
||||
{70%} ^@\e]6;1;70%\a
|
||||
{80%} ^@\e]6;1;80%\a
|
||||
{90%} ^@\e]6;1;90%\a
|
||||
{100%} ^@\e]6;1;100%\a
|
||||
../Tint/*
|
||||
{No Tint} ^@\e]6;2;0xffffff\a
|
||||
{Red Tint} ^@\e]6;2;0xff8080\a
|
||||
{Green Tint} ^@\e]6;2;0x80ff80\a
|
||||
{Blue Tint} ^@\e]6;2;0x8080ff\a
|
||||
{Cyan Tint} ^@\e]6;2;0x80ffff\a
|
||||
{Magenta Tint} ^@\e]6;2;0xff80ff\a
|
||||
{Yellow Tint} ^@\e]6;2;0xffff80\a
|
||||
../
|
||||
|
||||
../
|
||||
{-}
|
||||
{Version} ^@\e[8n
|
||||
{Status} ^@\e[9n
|
||||
{-}
|
||||
{Save Current Settings} ^@\e]6;71\a
|
||||
{Exit Eterm} ^@\e]6;70\a
|
||||
/
|
||||
|
||||
# If you change the default keybindings in Emacs (FWIW, a stupid idea), you must change these too!
|
||||
/Buffers/*
|
||||
{List all} C-xC-b
|
||||
{Change to other} C-xo
|
||||
{Change to...} C-xb
|
||||
|
||||
/Files/*
|
||||
{Open File...} C-xC-f
|
||||
{Open Directory...} C-xd
|
||||
{Save Buffer} C-xC-s
|
||||
{Save Buffer As...} C-xC-w
|
||||
{Revert Buffer} M-xrevert-buffer\r
|
||||
{Insert File...} C-xi
|
||||
{Kill Current Buffer} M-xkill-this-buffer\r
|
||||
{-}
|
||||
{Make New Frame} C-x52
|
||||
{Open New Display...} M-xmake-frame-on-display
|
||||
{Delete Frame} C-x50
|
||||
{Split Window} C-x2
|
||||
{One Window} C-x1
|
||||
{-}
|
||||
{Exit Emacs} C-xC-c
|
||||
|
||||
/Edit/*
|
||||
{Undo} C-_
|
||||
{-}
|
||||
{Set Mark} C-\40
|
||||
{Cut} C-w
|
||||
{Copy} M-w
|
||||
{Paste} C-y
|
||||
{Clear} M-xdelete-region
|
||||
{-}
|
||||
{Cut Rectangle} M-xkill-rectangle
|
||||
{Clear Rectangle} M-xclear-rectangle
|
||||
|
||||
/Search/*
|
||||
{Search...} C-s
|
||||
{Regexp Search...} M-xisearch-forward-regexp
|
||||
{Search Backward...} C-r
|
||||
{Regexp Search Backward...} M-xisearch-backward-regexp
|
||||
{-}
|
||||
{Repeat Search} M-xisearch-repeat-forward
|
||||
{Repeat Regexp Search} M-xisearch-repeat-forward
|
||||
{Repeat Search Backward} M-xisearch-repeat-backward
|
||||
{Repeat Regexp Search Backward} M-xisearch-repeat-backward
|
||||
{-}
|
||||
{Replace String...} M-xreplace-string
|
||||
{Replace Regexp...} M-xreplace-regexp
|
||||
{Query Replace String...} M-xquery-replace
|
||||
{Query Replace Regexp...} M-xquery-replace-regexp
|
||||
{-}
|
||||
{Goto Line...} M-xgoto-line
|
||||
|
||||
/Help/*
|
||||
{Customize} M-xcustomize
|
||||
{Emacs News} M-xview-emacs-news
|
||||
{Emacs FAQ} M-xview-emacs-FAQ
|
||||
{Info Browser} M-xinfo
|
||||
{-}
|
||||
{Describe Mode} M-xdescribe-mode
|
||||
{Command Apropos...} M-xcommand-apropos
|
||||
{List Keybindings} M-xdescribe-bindings
|
||||
{Describe Key...} M-xdescribe-key
|
||||
{Describe Function...} M-xdescribe-function
|
||||
{Describe Variable...} M-xdescribe-variable
|
||||
{-}
|
||||
{Man...} M-xman
|
||||
{Emacs Tutorial} M-xhelp-with-tutorial
|
||||
{Find Lisp Packages...} M-xfinder-by-keyword
|
||||
{Send Bug Report...} M-xreport-emacs-bug
|
||||
{-}
|
||||
{Show Version} M-xversion
|
||||
|
||||
# make sure the change gets updated
|
||||
[show]
|
||||
[done]
|
||||
#--------------------------------------------------------------------- eof
|
||||
\E[11~
|
|
@ -24,9 +24,11 @@ begin main
|
|||
background black
|
||||
cursor #ffff00
|
||||
cursor_text #880000
|
||||
menu_text white
|
||||
scrollbar #3f1c00
|
||||
unfocusedscrollbar #777777
|
||||
menu #777777
|
||||
unfocusedmenu #777777
|
||||
menu_text black
|
||||
pointer white
|
||||
|
||||
# video attribute can either be "normal" or "reverse"
|
||||
|
@ -88,31 +90,161 @@ begin main
|
|||
# font bold 7x14
|
||||
end attributes
|
||||
|
||||
# This section is for pixmap definitions. The only one used currently
|
||||
# is "background". The supplied numbers work just like they do for
|
||||
# Enlightenment: first is X (width), second is Y (height). -1 to
|
||||
# scale 100%, 0 to tile, any other number specifies W/H in pixels
|
||||
begin pixmaps
|
||||
background %random(`cat pixmaps.list 2>/dev/null`)
|
||||
path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:@DATADIR@/Eterm/pix/"
|
||||
# Define the imageclasses.
|
||||
begin imageclasses
|
||||
|
||||
# Support for these is forthcoming
|
||||
# scroll_up -1 -1 ~/.Eterm/up_arrow.ppm
|
||||
# scroll_down -1 -1 ~/.Eterm/down_arrow.ppm
|
||||
# scroll_background 0 0 ~/.Eterm/scroll.ppm
|
||||
# scroll_anchor -1 -1 ~/.Eterm/anchor.ppm
|
||||
# You must define this before setting any images that use it. This is the $PATH-style variable
|
||||
# that determines where Eterm looks for image files.
|
||||
path "./pix/:~/.Eterm/:~/.Eterm/themes/Eterm/pix:~/.Eterm/pix/:@PKGDATADIR@/pix/"
|
||||
|
||||
# If you want a different icon than the standard Eterm one, set this.
|
||||
# icon Eterm.xpm
|
||||
|
||||
# This is the background animator. See the man page for the syntax.
|
||||
# anim 3 foo1 foo2 foo3
|
||||
|
||||
# Here we define an image.
|
||||
begin image
|
||||
|
||||
# The first thing you set when defining an image MUST be the type. No type, no dice. The type
|
||||
# should be one of the following: background, up_arrow, down_arrow, left_arrow, right_arrow,
|
||||
# trough, anchor, menu, or submenu
|
||||
type background
|
||||
|
||||
# Next you should set the state. This is either normal, selected, or clicked.
|
||||
state normal
|
||||
|
||||
# Here you set the file. You can also set the geometry string here if you follow the filename with
|
||||
# an @ sign. That way, you can include the geometries in your pixmaps.list file.
|
||||
file %random(`cat pixmaps.list`)
|
||||
|
||||
# The mode line. This defines the startup mode for the image, as well as what modes are allowed.
|
||||
# Valid modes are "image" (to display the image file), "trans" (to be transparent), or "viewport"
|
||||
# (for viewport mode). Syntax is "mode <startup_mode> allow <allowed_modes>".
|
||||
mode image allow trans viewport
|
||||
|
||||
# Set the image border. This is a portion of the image which will be kept at its actual size when
|
||||
# scaling. Use this for beveled images (buttons, etc.).
|
||||
border 0 0 0 0
|
||||
|
||||
# Th-th-th-th-that's all folks.
|
||||
end image
|
||||
|
||||
# The rest of the images.
|
||||
begin image
|
||||
type trough
|
||||
mode image allow trans viewport
|
||||
state normal
|
||||
file bar_vertical_3.png
|
||||
# Here is how you specify the geometry string separately. See the man page for its syntax.
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type anchor
|
||||
state normal
|
||||
file bar_vertical_1.png
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
state selected
|
||||
file bar_vertical_2.png
|
||||
geom :scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type up_arrow
|
||||
state normal
|
||||
file button_arrow_up_1.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state selected
|
||||
file button_arrow_up_2.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state clicked
|
||||
file button_arrow_up_3.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
end image
|
||||
begin image
|
||||
type down_arrow
|
||||
state normal
|
||||
file button_arrow_down_1.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state selected
|
||||
file button_arrow_down_2.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
state clicked
|
||||
file button_arrow_down_3.png
|
||||
geom :scale
|
||||
border 2 2 2 2
|
||||
end image
|
||||
begin image
|
||||
type menu
|
||||
state normal
|
||||
file bar_horizontal_1.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 3 2 2
|
||||
state selected
|
||||
file bar_horizontal_2.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 3 2 2
|
||||
end image
|
||||
begin image
|
||||
type submenu
|
||||
state normal
|
||||
file menu1.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
state selected
|
||||
file menu2.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
state clicked
|
||||
file menu3.png
|
||||
geom 100x100+0+0:scale
|
||||
border 3 15 3 3
|
||||
padding 3 15 3 3
|
||||
end image
|
||||
end
|
||||
|
||||
# The Kanji support options. Same goes for these fonts as for the normal
|
||||
# ones. The "encoding" attribute can be either "eucj" or "sjis".
|
||||
# begin kanji
|
||||
%include "emacs-menu.cfg"
|
||||
|
||||
# This section *must* come after the menu definitions if you want
|
||||
# menu actions to work. C'est la vie. :-)
|
||||
#
|
||||
# Syntax: bind [ { <modifiers> | anymod } ] { <key> | <keysym> | <button> } to { string | echo | menu } <parameter>
|
||||
#
|
||||
begin actions
|
||||
bind ctrl button1 to string "\e]5;\a"
|
||||
bind ctrl button2 to string "\e[?30t"
|
||||
bind ctrl button3 to menu Eterm
|
||||
bind anymod f1 to menu Eterm
|
||||
end actions
|
||||
|
||||
# The Multichar support options. Same goes for these fonts as for the normal
|
||||
# ones. The "encoding" attribute can be either "eucj" or "sjis" or "euckr"
|
||||
# or big5 or gb
|
||||
# begin multichar
|
||||
# font 0 k14
|
||||
# font 1 jiskan16
|
||||
# font 2 jiskan18
|
||||
# font 3 jiskan24
|
||||
# font 4 jiskan26
|
||||
# encoding eucj
|
||||
# end kanji
|
||||
# end multichar
|
||||
|
||||
# The XIM support options.
|
||||
# input_method: set the name of your favorate input method program
|
||||
# preedit_type: OverTheSpot or OffTheSpot or Root
|
||||
# begin xim
|
||||
# input_method Ami
|
||||
# preedit_type OverTheSpot
|
||||
# end xim
|
||||
|
||||
# Boolean variables. The values can be "1", "on", or "true" for TRUE, or "0",
|
||||
# "off", or "false" for FALSE.
|
||||
|
@ -189,9 +321,6 @@ begin main
|
|||
# (Default is 5).
|
||||
border_width 5
|
||||
|
||||
# File to read for menubar
|
||||
menu emacs.menu
|
||||
|
||||
# Value to use for $TERM
|
||||
term_name xterm
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue