twm-1.0.9

This commit is contained in:
Michael Small 2017-09-15 23:01:49 -04:00
commit 20894d7b1b
62 changed files with 49783 additions and 0 deletions

73
COPYING Normal file
View File

@ -0,0 +1,73 @@
Copyright 1989, 1994, 1998 The Open Group
Copyright 2005 Hitachi, Ltd.
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1988 by Evans & Sutherland Computer Corporation,
Salt Lake City, Utah
Cambridge, Massachusetts
All Rights Reserved
Permission to use, copy, modify, and distribute this software and
its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that copyright notice and this permis-
sion notice appear in supporting documentation, and that the
name of Evans & Sutherland not be used in advertising
in publicity pertaining to distribution of the software without
specific, written prior permission.
EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD
TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND
BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM-
AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
OR PERFORMANCE OF THIS SOFTWARE.
Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the XFree86 Project shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from the
XFree86 Project.

1092
ChangeLog Normal file

File diff suppressed because it is too large Load Diff

370
INSTALL Normal file
View File

@ -0,0 +1,370 @@
Installation Instructions
*************************
Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without warranty of any kind.
Basic Installation
==================
Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
below. The lack of an optional feature in a given package is not
necessarily a bug. More recommendations for GNU packages can be found
in *note Makefile Conventions: (standards)Makefile Conventions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You need `configure.ac' if
you want to change it or regenerate `configure' using a newer version
of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints
some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package, generally using the just-built uninstalled binaries.
4. Type `make install' to install the programs and any data files and
documentation. When installing into a prefix owned by root, it is
recommended that the package be configured and built as a regular
user, and only the `make install' phase executed with root
privileges.
5. Optionally, type `make installcheck' to repeat any self-tests, but
this time using the binaries in their final installed location.
This target does not install anything. Running this target as a
regular user, particularly if the prior `make install' required
root privileges, verifies that the installation completed
correctly.
6. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
7. Often, you can also type `make uninstall' to remove the installed
files again. In practice, not all packages have tested that
uninstallation works correctly, even though it is required by the
GNU Coding Standards.
8. Some packages, particularly those that use Automake, provide `make
distcheck', which can by used by developers to test that all other
targets like `make install' and `make uninstall' work correctly.
This target is generally not run by end users.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'. This
is known as a "VPATH" build.
With a non-GNU `make', it is safer to compile the package for one
architecture at a time in the source code directory. After you have
installed the package for one architecture, use `make distclean' before
reconfiguring for another architecture.
On MacOS X 10.5 and later systems, you can create libraries and
executables that work on multiple system types--known as "fat" or
"universal" binaries--by specifying multiple `-arch' options to the
compiler but only a single `-arch' option to the preprocessor. Like
this:
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
CPP="gcc -E" CXXCPP="g++ -E"
This is not guaranteed to produce working output in all cases, you
may have to build one architecture at a time and combine the results
using the `lipo' tool if you have problems.
Installation Names
==================
By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving
`configure' the option `--prefix=PREFIX', where PREFIX must be an
absolute file name.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
pass the option `--exec-prefix=PREFIX' to `configure', the package uses
PREFIX as the prefix for installing programs and libraries.
Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them. In general, the
default for these options is expressed in terms of `${prefix}', so that
specifying just `--prefix' will affect all of the other directory
specifications that were not explicitly provided.
The most portable way to affect installation locations is to pass the
correct locations to `configure'; however, many packages provide one or
both of the following shortcuts of passing variable assignments to the
`make install' command line to change installation locations without
having to reconfigure or recompile.
The first method involves providing an override variable for each
affected directory. For example, `make install
prefix=/alternate/directory' will choose an alternate location for all
directory configuration variables that were expressed in terms of
`${prefix}'. Any directories that were specified during `configure',
but not in terms of `${prefix}', must each be overridden at install
time for the entire installation to be relocated. The approach of
makefile variable overrides for each directory variable is required by
the GNU Coding Standards, and ideally causes no recompilation.
However, some platforms have known limitations with the semantics of
shared libraries that end up requiring recompilation when using this
method, particularly noticeable in packages that use GNU Libtool.
The second method involves providing the `DESTDIR' variable. For
example, `make install DESTDIR=/alternate/directory' will prepend
`/alternate/directory' before all installation names. The approach of
`DESTDIR' overrides is not required by the GNU Coding Standards, and
does not work on platforms that have drive letters. On the other hand,
it does better at avoiding recompilation issues, and works well even
when some directory options were not specified in terms of `${prefix}'
at `configure' time.
Optional Features
=================
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Some packages offer the ability to configure how verbose the
execution of `make' will be. For these packages, running `./configure
--enable-silent-rules' sets the default to minimal output, which can be
overridden with `make V=1'; while running `./configure
--disable-silent-rules' sets the default to verbose, which can be
overridden with `make V=0'.
Particular systems
==================
On HP-UX, the default C compiler is not ANSI C compatible. If GNU
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
HP-UX `make' updates targets which have the same time stamps as
their prerequisites, which makes it generally unusable when shipped
generated files such as `configure' are involved. Use GNU `make'
instead.
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended
to try
./configure CC="cc"
and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
Unfortunately, this technique does not work for `CONFIG_SHELL' due to
an Autoconf bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of all of the options to `configure', and exit.
`--help=short'
`--help=recursive'
Print a summary of the options unique to this package's
`configure', and exit. The `short' variant lists options used
only in the top level, while the `recursive' variant lists options
also present in any nested packages.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--prefix=DIR'
Use DIR as the installation prefix. *note Installation Names::
for more details, including other options available for fine-tuning
the installation locations.
`--no-create'
`-n'
Run the configure checks, but stop before creating any output
files.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.

35
Makefile.am Normal file
View File

@ -0,0 +1,35 @@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
SUBDIRS = src man
EXTRA_DIST = sample-twmrc/jim.twmrc sample-twmrc/keith.twmrc sample-twmrc/lemke.twmrc
MAINTAINERCLEANFILES = ChangeLog INSTALL
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL

840
Makefile.in Normal file
View File

@ -0,0 +1,840 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
$(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in COPYING \
ChangeLog INSTALL README compile config.guess config.sub \
install-sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
DIST_TARGETS = dist-bzip2 dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
TWM_CFLAGS = @TWM_CFLAGS@
TWM_LIBS = @TWM_LIBS@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
YACC = @YACC@
YACC_INST = @YACC_INST@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src man
EXTRA_DIST = sample-twmrc/jim.twmrc sample-twmrc/keith.twmrc sample-twmrc/lemke.twmrc
MAINTAINERCLEANFILES = ChangeLog INSTALL
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
config.h: stamp-h1
@test -f $@ || rm -f stamp-h1
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
distclean-hdr:
-rm -f config.h stamp-h1
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-hook
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile config.h
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
dist-zip distcheck distclean distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs installdirs-am \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PRECIOUS: Makefile
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

30
README Normal file
View File

@ -0,0 +1,30 @@
twm - Tab Window Manager for the X Window System
twm is a window manager for the X Window System. It provides
titlebars, shaped windows, several forms of icon management,
user-defined macro functions, click-to-type and pointer-driven
keyboard focus, and user-specified key and pointer button bindings.
All questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg
Please submit bug reports to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
The master development code repository can be found at:
git://anongit.freedesktop.org/git/xorg/app/twm
http://cgit.freedesktop.org/xorg/app/twm
For patch submission instructions, see:
http://www.x.org/wiki/Development/Documentation/SubmittingPatches
For more information on the git code manager, see:
http://wiki.x.org/wiki/GitPage

3203
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

347
compile Executable file
View File

@ -0,0 +1,347 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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, 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
ofile=$2
;;
*)
set x "$@" -o "$2"
shift
;;
esac
;;
*.c)
cfile=$1
set x "$@" "$1"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -z "$ofile" || test -z "$cfile"; then
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
# Name of file we expect compiler to create.
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
while true; do
if mkdir "$lockdir" >/dev/null 2>&1; then
break
fi
sleep 1
done
# FIXME: race condition here if user kills between mkdir and trap.
trap "rmdir '$lockdir'; exit 1" 1 2 15
# Run the compile.
"$@"
ret=$?
if test -f "$cofile"; then
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
fi
rmdir "$lockdir"
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

1421
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

103
config.h.in Normal file
View File

@ -0,0 +1,103 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Major version of this package */
#undef PACKAGE_VERSION_MAJOR
/* Minor version of this package */
#undef PACKAGE_VERSION_MINOR
/* Patch version of this package */
#undef PACKAGE_VERSION_PATCHLEVEL
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# undef _GNU_SOURCE
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# undef _TANDEM_SOURCE
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# undef __EXTENSIONS__
#endif
/* Version number of package */
#undef VERSION
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
/* Define to 1 if on MINIX. */
#undef _MINIX
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE

1807
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

12625
configure vendored Executable file

File diff suppressed because it is too large Load Diff

57
configure.ac Normal file
View File

@ -0,0 +1,57 @@
dnl Copyright 2005 Red Hat, Inc.
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
dnl copyright notice and this permission notice appear in supporting
dnl documentation, and that the name of Red Hat not be used in
dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty.
dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dnl PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([twm], [1.0.9],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [twm])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AC_PROG_YACC
AC_PATH_PROG([YACC_INST], $YACC)
if test ! -f "$srcdir/gram.c"; then
if test -z "$YACC_INST"; then
AC_MSG_ERROR([yacc not found - unable to compile gram.y])
fi
fi
AC_PROG_LEX
AC_CHECK_FUNCS([mkstemp])
# Checks for pkg-config packages
PKG_CHECK_MODULES(TWM, x11 xext xt xmu ice sm xproto >= 7.0.17)
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile])
AC_OUTPUT

791
depcomp Executable file
View File

@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# 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, 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

501
install-sh Executable file
View File

@ -0,0 +1,501 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

40
man/Makefile.am Normal file
View File

@ -0,0 +1,40 @@
#
# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
appmandir = $(APP_MAN_DIR)
appman_PRE = twm.man
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SUFFIXES = .$(APP_MAN_SUFFIX) .man
MAN_SUBSTS += -e 's|__datadir__|$(datadir)|g'
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@

523
man/Makefile.in Normal file
View File

@ -0,0 +1,523 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = man
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(appmandir)"
DATA = $(appman_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__datadir__|$(datadir)|g'
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
TWM_CFLAGS = @TWM_CFLAGS@
TWM_LIBS = @TWM_LIBS@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
YACC = @YACC@
YACC_INST = @YACC_INST@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
appmandir = $(APP_MAN_DIR)
appman_PRE = twm.man
appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@)
EXTRA_DIST = $(appman_PRE)
CLEANFILES = $(appman_DATA)
SUFFIXES = .$(APP_MAN_SUFFIX) .man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(APP_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign man/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-appmanDATA: $(appman_DATA)
@$(NORMAL_INSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(appmandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
done
uninstall-appmanDATA:
@$(NORMAL_UNINSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(appmandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-appmanDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-appmanDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic cscopelist-am \
ctags-am distclean distclean-generic distdir dvi dvi-am html \
html-am info info-am install install-am install-appmanDATA \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am \
uninstall-appmanDATA
.PRECIOUS: Makefile
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1281
man/twm.man Normal file

File diff suppressed because it is too large Load Diff

215
missing Executable file
View File

@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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, 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

250
sample-twmrc/jim.twmrc Normal file
View File

@ -0,0 +1,250 @@
#**********************************************************************
#
# .twmrc
#
#**********************************************************************
#IconDirectory "/users/jim/icons" # use *bitmapFilePath instead.
#
# Use the SHAPE extension to make titles use as little space as possible. The
# location of the titles is specified as a fraction of the distance from the
# left (numerator positive) or right edge (numerator negative). A denominator
# of 0 indicates that the numerator is measured in pixels. The title is then
# justified over the indicated spot (note special cases are made for center on
# 0/0 and right on 0/0 to indicate the center and right edge of the titlebar).
#
SqueezeTitle # also sets default to Squeeze all Titles
{
# name justify num denom
"oclock" center 0 0 # centered over middle of title
"XTerm" left 0 0 # left edge of title
"xlogo" right 0 0 # for kicks
"emacs" right 0 0 # left side emacs with center tab
"xmh" center 0 0
}
DontSqueezeTitle
{
"XLogout" # make it stand out when mapped
}
NoDefaults # turn off iconify and resize button
LeftTitleButton "menu12" = f.menu "windowmenu" # add a menu to each window
TitleButtonBorderWidth 0 # don't want to see box around button
ButtonIndent 0 # button doesn't have to be smaller
UsePPosition "on" # use program-specified size hints accepted
NoHighlight # do not flash borders on enter events
OpaqueMove # actually move window instead of outline
AutoRelativeResize # don't require resize to cross border to start
RestartPreviousState # reiconify iconified things on startup
ClientBorderWidth # use the application border width on frame
BorderWidth 2 # width of top level windows created by twm
NoGrabServer # don't grab server during menus, etc.
NoRaiseOnMove # allow moving under other windows
NoRaiseOnResize # allow resizing under other windows
NoTitleFocus # avoid keystrokes in wrong window cause of lag
DecorateTransients # put titlebars on transients
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*"
NoSaveUnders # faster to just repaint then save
XORvalue 1 # tend to use visually distinct adjacent colors
ConstrainedMoveTime 0 # turn off horizontal/vertical only moving
NoCaseSensitive # turn off case-sensitivity in sorting icons
WarpUnmapped # allow warping to unmapped windows
###############################################################################
# #
# Declare some nice colors #
# #
###############################################################################
Pixmaps
{
# TitleHighlight "solid4x4" # make it stand out
}
Color
{
DefaultBackground "maroon"
DefaultForeground "gray85"
BorderColor "gray70"
TitleBackground "maroon"
TitleForeground "gray85"
MenuBackground "maroon"
MenuForeground "gray85"
MenuTitleBackground "gray70"
MenuTitleForeground "maroon"
IconBackground "maroon"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "maroon"
IconManagerForeground "gray85"
}
Monochrome
{
IconManagerHighlight "white"
BorderColor "black"
}
###############################################################################
# #
# Define key bindings #
# #
###############################################################################
MoveDelta 3 # need to move this much before takes effect
Function "move-or-raise" # simulate uwm action
{
f.move
f.deltastop
f.raise
}
DefaultFunction f.nop # ignore extraneous events
Button1 = : root : f.menu "twmops"
Button2 = : root : f.menu "windowops"
Button3 = : root : f.menu "TwmWindows"
Button1 = : title : f.function "move-or-raise"
Button1 = : icon : f.iconify
Button1 = : iconmgr : f.iconify
Button1 = m : window|icon|frame|title : f.lower
Button2 = m : window : f.resize
Button3 = m : window|icon|frame|title : f.function "move-or-raise"
Button1 = c|m|s : all : f.menu "twmops"
#Button1 = c|m|s : root : f.refresh
#"F20" = : all : f.warptoscreen "next"
"F21" = : all : f.warpring "next"
"F22" = : all : f.warptoiconmgr ""
"F23" = : all : f.raiselower
"Num_Lock" = : all : f.iconify
"F24" = : all : f.warpto "xmh"
"F25" = : all : f.warpto "[expo]"
"F26" = : all : f.warpto "emacs"
"KP_Subtract" = mod5 : all : f.colormap "prev"
"KP_Add" = mod5 : all : f.colormap "next"
"KP_Enter" = mod5 : all : f.colormap "default"
"Left" = m : all : f.backiconmgr
"Right" = m : all : f.forwiconmgr
"Up" = m : all : f.upiconmgr
"Down" = m : all : f.downiconmgr
"Left" = mod5 : all : f.warpring "prev"
"Right" = mod5 : all : f.warpring "next"
###############################################################################
# #
# Display an icon manager across the top of the screen. Don't manage #
# the windows for which you don't show a title. #
# #
###############################################################################
SortIconManager # keep them in alphabetic order
ShowIconManager # start with iconmgr up
IconManagerGeometry "700x50+246+2" 14 # strip across top
IconRegion "200x300+950+2" North East 50 50
IconifyByUnmapping # just use icon manager
IconManagerDontShow # but ignore these windows
{
"xclock"
"xbiff"
"xload"
"oclock"
"xcutsel"
"XLogout"
}
DontIconifyByUnmapping # don't lose them (still in TwmWindows menu)
{
"xclock"
"xbiff"
"xload"
"oclock"
"xcutsel"
"Untitled"
}
NoTitle # little programs that look like icons
{
"xclock"
"xbiff"
"xload"
"TWM Icon Manager"
"xcutsel"
}
NoStackMode # prevent hostile clients from hosing display
{
"saber"
}
WindowRing # f.warpring acts along these windows
{
"XTerm"
"emacs"
"Xmh"
}
###############################################################################
# #
# Define some useful menus. #
# #
###############################################################################
menu "twmops"
{
"System" f.title
"Restart Twm" f.restart
"Exit Twm" f.quit
"" f.nop
"xterm" !"xterm &"
"xterm -e /bin/sh" !"xterm -e /bin/sh &"
"xhost +" !"xhost + >/dev/null"
"xhost -" !"xhost - >/dev/null"
"" f.nop
"Kill" f.menu "kill"
"" f.nop
"Logout" f.warpto "xlogout"
}
menu "windowops"
{
"Windows" f.title
"Kill" f.menu "kill"
"Save" f.saveyourself
"Refresh" f.refresh
"" f.nop
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"Info" f.identify
"Focus" f.focus
"Unfocus" f.unfocus
"" f.nop
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"Prev Iconmgr" f.previconmgr
"Next Iconmgr" f.nexticonmgr
}
menu "windowmenu"
{
"Iconify" f.iconify
"RaiseLower" f.raiselower
"Refresh" f.winrefresh
"Focus" f.focus
"" f.nop
"Kill" f.menu "kill"
}
menu "kill"
{
"Send Delete" f.delete
"Kill Window" f.destroy
}

223
sample-twmrc/keith.twmrc Normal file
View File

@ -0,0 +1,223 @@
#**********************************************************************
#
# .twmrc
#
#**********************************************************************
IconDirectory "/users/keith/misc/bitmaps"
#NoDefaults
NoVersion
NoGrabServer
NoRaiseOnMove
NoRaiseOnResize
#NoMenuShadows
NoTitleHighlight
NoHighlight
NoTitleFocus
NoSaveUnders
SqueezeTitle
ConstrainedMoveTime 0
DecorateTransients
#TitleButtonBorderWidth 0
#ButtonIndent 0
#LeftTitleButton "iconify.bm" = f.iconify
#RightTitleButton "resize.bm" = f.resize
OpaqueMove
#ClientBorderWidth
BorderWidth 1
RandomPlacement
#IconRegion "1024x250+0+600" NORTH WEST 1024 25
IconRegion "600x200-200+0" NORTH EAST 75 25
#IconRegion "200x100-0+200" WEST NORTH 25 50
TitleFont "-*-helvetica-bold-o-normal--*-140-*-*-*-*-iso8859-1"
MenuFont "-*-helvetica-bold-r-normal--*-140-*-*-*-*-iso8859-1"
IconFont "-*-helvetica-bold-r-normal--*-140-*-*-*-*-iso8859-1"
ResizeFont "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
IconManagerFont "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"
#ShowIconManager
SortIconManager
IconManagerGeometry "=100x100-200+0"
# nice colors: background of wheat, foreground of #d36
Cursors
{
Button "left_ptr"
Menu "left_ptr"
Title "left_ptr"
Frame "left_ptr"
Icon "left_ptr"
}
Color
{
BorderColor "black"
TitleBackground "CadetBlue"
TitleForeground "#fffff0"
MenuBackground "#fffff0"
MenuForeground "black"
MenuTitleBackground "CadetBlue"
MenuTitleForeground "#fffff0"
IconBackground "#fffff0"
IconForeground "black"
IconBorderColor "black"
}
Monochrome
{
IconManagerHighlight "white"
}
# define key bindings
MoveDelta 3
Function "move-or-raise"
{
f.move
f.deltastop
f.raise
}
Function "move-or-raiselower"
{
f.move
f.deltastop
f.raiselower
}
Function "move-or-iconify"
{
f.move
f.deltastop
f.iconify
}
Function "next-window"
{
}
Function "previous-window"
{
}
DefaultFunction f.nop
Button1 = : title : f.function "move-or-raiselower"
Button2 = : title : f.menu "Title Menu"
Button3 = : title : f.resize
Button1 = m : window|icon : f.iconify
Button2 = m : window|icon : f.function "move-or-raiselower"
Button3 = m : window|icon : f.resize
Button3 = c m : title : f.destroy
Button1 = : root : f.menu "Hosts"
Button2 = : root : f.menu "Toys"
Button3 = : root : f.menu "System"
Button1 = : icon : f.function "move-or-iconify"
#ForceIcons
Icons
{
"Xmh" "mail-up.bm" # from IconDirectory
"XTerm" "xterm.bm" # from IconDirectory
}
#UnknownIcon "icon"
NoTitle
{
"clock"
"oclock"
"xclock"
"xbiff"
"xeyes"
"xload"
}
IconManagerDontShow {
"clock"
"oclock"
"xclock"
"xbiff"
"xeyes"
"xload"
}
menu "Hosts"
{
"Hosts" f.title
"xenon" !"xenon &"
"expo" !"expo &"
"kanga" !"kanga &"
"exile" !"exile &"
"expire" !"expire &"
"excalibur" !"excalibur &"
"hpx" !"hpx &"
"expo bugs" !"expo -l bugs &"
"extort" !"extort &"
"apx" !"apx &"
"mfb" !"mfb &"
"sushi" !"sushi &"
"tempura" !"tempora &"
}
menu "Toys"
{
"Toys" f.title
"Jove" !"xjove &"
"Mail" !"xmh &"
"Manual" !"xman &"
"Troff Viewer" !"xditview &"
"Calculator" !"xcalc &"
"Mille Bornes" !"xmille `path -n .mille` &"
"Notepad" !"xclipboard &"
"Eyes" !"xeyes &"
"Lens" !"xmag &"
"expo jove" !"expo xjove&"
"expo mail" !"expo xmh &"
}
menu "System"
{
"System" f.title
"Window ops" f.menu "Window Ops"
"Windows" f.menu "TwmWindows"
"" f.nop
"Refresh" f.refresh
"Unfocus" f.unfocus
"Show Icon Box" f.showiconmgr
"Hide Icon Box" f.hideiconmgr
"Version" f.version
"" f.nop
"Restart" f.restart
"Logout" f.quit
}
menu "Window Ops"
{
"Window Ops" f.title
"Lower" f.lower
"Raise" f.raise
"Resize" f.resize
"Move" f.move
"Deiconify" f.deiconify
"Iconify" f.iconify
"Identify" f.identify
"Focus" f.focus
"Kill" f.destroy
}
menu "Title Menu"
{
"Lower" f.lower
"Raise" f.raise
"Resize" f.resize
"Move" f.move
"Iconify" f.iconify
"Identify" f.identify
"Focus" f.focus
"Kill" f.destroy
"Dismiss" f.delete
}

255
sample-twmrc/lemke.twmrc Normal file
View File

@ -0,0 +1,255 @@
#
# Dave Lemke's .twmrc
#
IconDirectory "/u/lemke/lib/icons"
#AutoRelativeResize
BorderWidth 3
ButtonIndent 0
ClientBorderWidth
#DefaultFunction f.nop
#DontMoveOff
IconifyByUnmapping
IconFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"
IconManagerFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"
IconManagerGeometry "=98x5-2+50"
#LeftTitleButton "menu12.xbm" = f.menu "window-ops"
MenuFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"
MoveDelta 5
#NoBackingStore
NoDefaults
NoGrabServer
NoMenuShadows
#NoRaiseOnDeiconify
NoRaiseOnMove
#NoRaiseOnResize
#NoSaveUnder
#NoTitleFocus
#NoVersion
#OpaqueMove
ResizeFont "10x20"
RestartPreviousState
#ReverseVideo
ShowIconManager
SortIconManager
SqueezeTitle
{
"XTerm" center 0 0
"Xsol" center 0 0
"Spider" center 0 0
}
TitleFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1"
TitleButtonBorderWidth 1
UnknownIcon "ncdlogo64.xbm"
#WarpCursor
XORValue 1
#Zoom
DefaultFunction f.nop
Function "move-or-raise"
{
f.move
f.deltastop
f.raise
}
AutoRaise
{
"xtrek"
"TWM Icon Manager"
"xclock"
"xbiff"
"xeyes"
}
Cursors
{
Menu "right_ptr"
}
DontIconifyByUnmapping
{
"xclock"
"xbiff"
"twmOutput"
"xload"
"oclock"
"xeyes"
}
IconManagerDontShow
{
"xclock"
"xbiff"
"twmOutput"
"xload"
"oclock"
"xeyes"
}
Monochrome
{
DefaultForeground "black"
DefaultBackground "white"
BorderColor "black"
TitleForeground "black"
TitleBackground "white"
MenuForeground "black"
MenuBackground "white"
}
NoTitle
{
"xclock"
"xbiff"
"xload"
"TWM Icon Manager"
"FrameMaker"
"FrameWriter"
"oclock"
"twmOutput"
"xeyes"
}
#
# buttons
#
Button1 = : root : f.menu "button1"
Button2 = : root : f.menu "Util_menu"
Button3 = : root : f.menu "Hosts_menu"
Button1 = : m : f.iconify
Button2 = : m : f.lower
Button1 = : t : f.function "move-or-raise"
Button2 = : t : f.lower
Button3 = : t : f.menu "window-ops"
Button1 = : i : f.iconify
Button2 = : i : f.function "move-or-raise"
"F1" = : w|t|i : f.iconify
"F2" = : all : f.refresh
"F3" = : w|t|i : f.raise
"F4" = : w|t|i : f.lower
"F5" = : w|t|i : f.zoom
menu "button1"
{
"Applications" f.title
#"FrameWriter" !"rsh indian -n /usr/local/xframewriter $DISPLAY& "
#"Q Calc " !"rsh indian -n /usr/bin/X11/xterm -display $DISPLAY -T Qcalc -e /pmax/u/demo/qsp/bin/qcalc &"
#"Notepad" !"/usr/bin/dxnotepad -display $DISPLAY&"
#"Calculator" !"xcalc -display $DISPLAY&"
"Mail Box" !"/usr/bin/X11/xbiff -display $DISPLAY&"
"Clock" !"oclock -display $DISPLAY &"
"Xterm" !"/usr/bin/X11/xterm -ls -display $DISPLAY &"
"Big Xterm" !"/usr/bin/X11/xterm -ls -fn 9x15 -display $DISPLAY &"
"xsol" !"$HOME/games/bin/`arch`/xsol &"
"Spider" !"$HOME/games/bin/`arch`/spider &"
"Utility" f.title
#"Focus" f.focus
#"UnFocus" f.unfocus
#"More.." f.title
"..Hosts" f.menu "Hosts_menu"
"..Applications" f.menu "Apps_menu"
"..Utility" f.menu "Util_menu"
"" f.title
"Exit" f.quit
}
menu "Hosts_menu"
{
"Host Connections" f.title
"Almanor" !"rsh -n almanor exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Almanor&"
"Hamilton" !"rsh -n hamilton exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Hamilton&"
"Homer" !"rsh -n Homer exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Homer&"
"Lupine" !"TERM=xterms xterm -fn 10x20 -T lupine -e rlogin lupine&"
"Ramona" !"rsh -n ramona exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Ramona&"
"Pagemill" !"rsh pagemill -n /usr/bin/X11/xterm -display $DISPLAY -T Pagemill -e /bin/ksh&"
"Sheridan" !"rsh -n sheridan exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Sheridan&"
}
menu "Apps_menu"
{
"Applications" f.title
"Man Pages" !"/usr/bin/X11/xman -display $DISPLAY&"
#"Notepad" !"/usr/bin/dxnotepad -display $DISPLAY&"
#"FrameMaker" !"rsh indian -n /usr/local/xframemaker $DISPLAY& "
#"Calendar" !"/usr/bin/dxcalendar -display $DISPLAY &"
"Clock" !"/usr/bin/X11/xclock -display $DISPLAY &"
#"Rolodex" !"/usr/bin/dxcardfiler -display $DISPLAY &"
#"Paint" !"/usr/bin/dxpaint -display $DISPLAY &"
"Lock Screen" !"/usr/bin/X11/xlock & "
"Preferences" !"/usr/bin/X11/xpref -display $DISPLAY&"
"Xterm" !"/usr/bin/X11/xterm -ls -display $DISPLAY &"
}
menu "Util_menu"
{
"Utilities" f.title
"Refresh" f.refresh
"twm Version" f.version
"Source .twmrc" f.twmrc
"Restart twm" f.restart
#"Hide IconManager" f.hideiconmgr
#"Show IconManager" f.showiconmgr
#"Destroy All Window" !"xkill -a&"
"Preferences" f.menu "Pref_menu"
"TwmWindows" f.menu "TwmWindows"
"Exit twm" f.quit
"Window Ops" f.title
"Refresh Window" f.winrefresh
"Move Window" f.move
"Resize Window" f.resize
"Lower Window" f.lower
"Raise Window" f.raise
"Iconify" f.iconify
"Window Info" f.identify
"Destroy Window" f.destroy
"Focus on Window" f.focus
"Focus on Root" f.unfocus
}
menu "Pref_menu"
{
"Preferences" f.title
"Bell Loud" !"xset b 75&"
"Bell Normal" !"xset b 50&"
"Bell Quiet" !"xset b 25&"
"Bell Off" !"xset b off&"
"Mouse Fast" !"xset m 5 1&"
"Mouse Normal" !"xset m 3 1&"
"Mouse Slow" !"xset m 1 1&"
"Screen Saver" f.menu "SSaver"
}
menu "SSaver"
{
"Screen Saver" f.title
"Blank" !"/usr/bin/X11/xset s blank -display $DISPLAY &"
"No Blank" !"/usr/bin/X11/xset s noblank -display $DISPLAY &"
"Saver 2 Sec." !"/usr/bin/X11/xset s 2 2 -display $DISPLAY &"
"Saver 2 Min." !"/usr/bin/X11/xset s 120 120 -display $DISPLAY &"
"Saver 10 Min." !"/usr/bin/X11/xset s 600 600 -display $DISPLAY &"
}
menu "window-ops"
{
"Window Ops" f.title
"Iconify" f.iconify
"Refresh Window" f.winrefresh
"Move Window" f.move
"Resize Window" f.resize
"Hide Window" f.lower
"Expose Window" f.raise
"Destroy Window" f.destroy
"Delete Window" f.delete
"Save" f.saveyourself
}

84
src/Makefile.am Normal file
View File

@ -0,0 +1,84 @@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
AM_YFLAGS = -d
bin_PROGRAMS = twm
rcdir = ${datadir}/X11/twm
dist_rc_DATA = system.twmrc
AM_CPPFLAGS = \
-DXVENDORNAME=\"The\ X.Org\ Foundation\" \
-DXORG_RELEASE=\"Release\ $(VERSION)\" \
-DSYSTEM_INIT_FILE=\"${datadir}/X11/twm/system.twmrc\"
AM_CFLAGS = $(TWM_CFLAGS)
twm_LDADD = $(TWM_LIBS)
twm_SOURCES = \
add_window.c \
add_window.h \
cursor.c \
deftwmrc.c \
events.c \
events.h \
gc.c \
gc.h \
iconmgr.c \
iconmgr.h \
icons.c \
icons.h \
list.c \
list.h \
menus.c \
menus.h \
parse.c \
parse.h \
resize.c \
resize.h \
screen.h \
session.c \
session.h \
twm.c \
twm.h \
util.c \
util.h \
version.c \
version.h \
gram.y \
lex.l
BUILT_SOURCES = gram.h deftwmrc.c
deftwmrc.c: system.twmrc
$(AM_V_at)rm -f $@ ; \
echo '/* ' >>$@ ; \
echo ' * This file is generated automatically from the default' >>$@ ; \
echo ' * twm bindings file system.twmrc by the twm Makefile.' >>$@ ; \
echo ' */' >>$@ ; \
echo '' >>$@ ; \
echo 'unsigned char *defTwmrc[] = {' >>$@ ; \
$(SED) -f ${srcdir}/deftwmrc.sed < ${srcdir}/system.twmrc >>$@ ; \
echo ' (unsigned char *) 0 };' >>$@
EXTRA_DIST = deftwmrc.sed siconify.bm

778
src/Makefile.in Normal file
View File

@ -0,0 +1,778 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
#
# Copyright 2005 Red Hat, Inc.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of Red Hat not be used in
# advertising or publicity pertaining to distribution of the software without
# specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty.
#
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = twm$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_rc_DATA) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(rcdir)"
PROGRAMS = $(bin_PROGRAMS)
am_twm_OBJECTS = add_window.$(OBJEXT) cursor.$(OBJEXT) \
deftwmrc.$(OBJEXT) events.$(OBJEXT) gc.$(OBJEXT) \
iconmgr.$(OBJEXT) icons.$(OBJEXT) list.$(OBJEXT) \
menus.$(OBJEXT) parse.$(OBJEXT) resize.$(OBJEXT) \
session.$(OBJEXT) twm.$(OBJEXT) util.$(OBJEXT) \
version.$(OBJEXT) gram.$(OBJEXT) lex.$(OBJEXT)
twm_OBJECTS = $(am_twm_OBJECTS)
am__DEPENDENCIES_1 =
twm_DEPENDENCIES = $(am__DEPENDENCIES_1)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
AM_V_LEX = $(am__v_LEX_@AM_V@)
am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@)
am__v_LEX_0 = @echo " LEX " $@;
am__v_LEX_1 =
YLWRAP = $(top_srcdir)/ylwrap
am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
-e s/c++$$/h++/ -e s/c$$/h/
YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
AM_V_YACC = $(am__v_YACC_@AM_V@)
am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@)
am__v_YACC_0 = @echo " YACC " $@;
am__v_YACC_1 =
SOURCES = $(twm_SOURCES)
DIST_SOURCES = $(twm_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
DATA = $(dist_rc_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
$(top_srcdir)/ylwrap gram.c gram.h lex.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BASE_CFLAGS = @BASE_CFLAGS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_CFLAGS = @STRICT_CFLAGS@
STRIP = @STRIP@
TWM_CFLAGS = @TWM_CFLAGS@
TWM_LIBS = @TWM_LIBS@
VERSION = @VERSION@
XORG_MAN_PAGE = @XORG_MAN_PAGE@
YACC = @YACC@
YACC_INST = @YACC_INST@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_YFLAGS = -d
rcdir = ${datadir}/X11/twm
dist_rc_DATA = system.twmrc
AM_CPPFLAGS = \
-DXVENDORNAME=\"The\ X.Org\ Foundation\" \
-DXORG_RELEASE=\"Release\ $(VERSION)\" \
-DSYSTEM_INIT_FILE=\"${datadir}/X11/twm/system.twmrc\"
AM_CFLAGS = $(TWM_CFLAGS)
twm_LDADD = $(TWM_LIBS)
twm_SOURCES = \
add_window.c \
add_window.h \
cursor.c \
deftwmrc.c \
events.c \
events.h \
gc.c \
gc.h \
iconmgr.c \
iconmgr.h \
icons.c \
icons.h \
list.c \
list.h \
menus.c \
menus.h \
parse.c \
parse.h \
resize.c \
resize.h \
screen.h \
session.c \
session.h \
twm.c \
twm.h \
util.c \
util.h \
version.c \
version.h \
gram.y \
lex.l
BUILT_SOURCES = gram.h deftwmrc.c
EXTRA_DIST = deftwmrc.sed siconify.bm
all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .l .o .obj .y
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
gram.h: gram.c
@if test ! -f $@; then rm -f gram.c; else :; fi
@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) gram.c; else :; fi
twm$(EXEEXT): $(twm_OBJECTS) $(twm_DEPENDENCIES) $(EXTRA_twm_DEPENDENCIES)
@rm -f twm$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(twm_OBJECTS) $(twm_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_window.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cursor.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/deftwmrc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/events.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gram.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconmgr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icons.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menus.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resize.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/session.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.l.c:
$(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)
.y.c:
$(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE)
install-dist_rcDATA: $(dist_rc_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_rc_DATA)'; test -n "$(rcdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(rcdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(rcdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(rcdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(rcdir)" || exit $$?; \
done
uninstall-dist_rcDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_rc_DATA)'; test -n "$(rcdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(rcdir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-am
all-am: Makefile $(PROGRAMS) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(rcdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-rm -f gram.c
-rm -f gram.h
-rm -f lex.c
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_rcDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-dist_rcDATA
.MAKE: all check install install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
install-dist_rcDATA install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-dist_rcDATA
.PRECIOUS: Makefile
deftwmrc.c: system.twmrc
$(AM_V_at)rm -f $@ ; \
echo '/* ' >>$@ ; \
echo ' * This file is generated automatically from the default' >>$@ ; \
echo ' * twm bindings file system.twmrc by the twm Makefile.' >>$@ ; \
echo ' */' >>$@ ; \
echo '' >>$@ ; \
echo 'unsigned char *defTwmrc[] = {' >>$@ ; \
$(SED) -f ${srcdir}/deftwmrc.sed < ${srcdir}/system.twmrc >>$@ ; \
echo ' (unsigned char *) 0 };' >>$@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

1592
src/add_window.c Normal file

File diff suppressed because it is too large Load Diff

86
src/add_window.h Normal file
View File

@ -0,0 +1,86 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* AddWindow include file
*
* 31-Mar-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef _ADD_WINDOW_
#define _ADD_WINDOW_
#include "iconmgr.h"
extern char NoName[];
extern void AddDefaultBindings ( void );
extern TwmWindow * AddWindow ( Window w, int iconm, IconMgr *iconp );
extern ColormapWindow * CreateColormapWindow ( Window w, Bool creating_parent, Bool property_window );
extern TwmColormap * CreateTwmColormap ( Colormap c );
extern void FetchWmColormapWindows ( TwmWindow *tmp );
extern void FetchWmProtocols ( TwmWindow *tmp );
extern void GetGravityOffsets ( TwmWindow *tmp, int *xp, int *yp );
extern void GetWindowSizeHints ( TwmWindow *tmp );
extern void GrabButtons ( TwmWindow *tmp_win );
extern void GrabKeys ( TwmWindow *tmp_win );
extern int MappedNotOverride ( Window w );
extern void SetHighlightPixmap ( char *filename );
extern int AddingX;
extern int AddingY;
extern int AddingW;
extern int AddingH;
#endif /* _ADD_WINDOW_ */

171
src/cursor.c Normal file
View File

@ -0,0 +1,171 @@
/*
*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* */
/***********************************************************************
*
* cursor creation code
*
* 05-Apr-89 Thomas E. LaStrange File created
*
***********************************************************************/
#include <stdio.h>
#include "twm.h"
#include <X11/Xos.h>
#include "screen.h"
#include "util.h"
static struct _CursorName {
const char *name;
unsigned int shape;
Cursor cursor;
} cursor_names[] = {
{"X_cursor", XC_X_cursor, None},
{"arrow", XC_arrow, None},
{"based_arrow_down", XC_based_arrow_down, None},
{"based_arrow_up", XC_based_arrow_up, None},
{"boat", XC_boat, None},
{"bogosity", XC_bogosity, None},
{"bottom_left_corner", XC_bottom_left_corner, None},
{"bottom_right_corner", XC_bottom_right_corner, None},
{"bottom_side", XC_bottom_side, None},
{"bottom_tee", XC_bottom_tee, None},
{"box_spiral", XC_box_spiral, None},
{"center_ptr", XC_center_ptr, None},
{"circle", XC_circle, None},
{"clock", XC_clock, None},
{"coffee_mug", XC_coffee_mug, None},
{"cross", XC_cross, None},
{"cross_reverse", XC_cross_reverse, None},
{"crosshair", XC_crosshair, None},
{"diamond_cross", XC_diamond_cross, None},
{"dot", XC_dot, None},
{"dotbox", XC_dotbox, None},
{"double_arrow", XC_double_arrow, None},
{"draft_large", XC_draft_large, None},
{"draft_small", XC_draft_small, None},
{"draped_box", XC_draped_box, None},
{"exchange", XC_exchange, None},
{"fleur", XC_fleur, None},
{"gobbler", XC_gobbler, None},
{"gumby", XC_gumby, None},
{"hand1", XC_hand1, None},
{"hand2", XC_hand2, None},
{"heart", XC_heart, None},
{"icon", XC_icon, None},
{"iron_cross", XC_iron_cross, None},
{"left_ptr", XC_left_ptr, None},
{"left_side", XC_left_side, None},
{"left_tee", XC_left_tee, None},
{"leftbutton", XC_leftbutton, None},
{"ll_angle", XC_ll_angle, None},
{"lr_angle", XC_lr_angle, None},
{"man", XC_man, None},
{"middlebutton", XC_middlebutton, None},
{"mouse", XC_mouse, None},
{"pencil", XC_pencil, None},
{"pirate", XC_pirate, None},
{"plus", XC_plus, None},
{"question_arrow", XC_question_arrow, None},
{"right_ptr", XC_right_ptr, None},
{"right_side", XC_right_side, None},
{"right_tee", XC_right_tee, None},
{"rightbutton", XC_rightbutton, None},
{"rtl_logo", XC_rtl_logo, None},
{"sailboat", XC_sailboat, None},
{"sb_down_arrow", XC_sb_down_arrow, None},
{"sb_h_double_arrow", XC_sb_h_double_arrow, None},
{"sb_left_arrow", XC_sb_left_arrow, None},
{"sb_right_arrow", XC_sb_right_arrow, None},
{"sb_up_arrow", XC_sb_up_arrow, None},
{"sb_v_double_arrow", XC_sb_v_double_arrow, None},
{"shuttle", XC_shuttle, None},
{"sizing", XC_sizing, None},
{"spider", XC_spider, None},
{"spraycan", XC_spraycan, None},
{"star", XC_star, None},
{"target", XC_target, None},
{"tcross", XC_tcross, None},
{"top_left_arrow", XC_top_left_arrow, None},
{"top_left_corner", XC_top_left_corner, None},
{"top_right_corner", XC_top_right_corner, None},
{"top_side", XC_top_side, None},
{"top_tee", XC_top_tee, None},
{"trek", XC_trek, None},
{"ul_angle", XC_ul_angle, None},
{"umbrella", XC_umbrella, None},
{"ur_angle", XC_ur_angle, None},
{"watch", XC_watch, None},
{"xterm", XC_xterm, None},
};
void
NewFontCursor (Cursor *cp, const char *str)
{
int i;
for (i = 0; i < sizeof(cursor_names)/sizeof(struct _CursorName); i++)
{
if (strcmp(str, cursor_names[i].name) == 0)
{
if (cursor_names[i].cursor == None)
cursor_names[i].cursor = XCreateFontCursor(dpy,
cursor_names[i].shape);
*cp = cursor_names[i].cursor;
return;
}
}
fprintf (stderr, "%s: unable to find font cursor \"%s\"\n",
ProgramName, str);
}
void
NewBitmapCursor(Cursor *cp, char *source, char *mask)
{
int hotx, hoty;
int sx, sy, mx, my;
unsigned int sw, sh, mw, mh;
Pixmap spm, mpm;
spm = GetBitmap(source);
if ((hotx = HotX) < 0) hotx = 0;
if ((hoty = HotY) < 0) hoty = 0;
mpm = GetBitmap(mask);
/* make sure they are the same size */
XGetGeometry(dpy, spm, &JunkRoot, &sx, &sy, &sw, &sh, &JunkBW,&JunkDepth);
XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW,&JunkDepth);
if (sw != mw || sh != mh)
{
fprintf (stderr,
"%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n",
ProgramName, source, mask);
return;
}
*cp = XCreatePixmapCursor(dpy, spm, mpm, &Scr->PointerForeground,
&Scr->PointerBackground, hotx,hoty);
}

78
src/deftwmrc.c Normal file
View File

@ -0,0 +1,78 @@
/*
* This file is generated automatically from the default
* twm bindings file system.twmrc by the twm Makefile.
*/
unsigned char *defTwmrc[] = {
(unsigned char *) "",
(unsigned char *) "NoGrabServer",
(unsigned char *) "RestartPreviousState",
(unsigned char *) "DecorateTransients",
(unsigned char *) "TitleFont \"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*\"",
(unsigned char *) "ResizeFont \"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*\"",
(unsigned char *) "MenuFont \"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*\"",
(unsigned char *) "IconFont \"-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*\"",
(unsigned char *) "IconManagerFont \"-adobe-helvetica-bold-r-normal--*-100-*-*-*\"",
(unsigned char *) "",
(unsigned char *) "Color",
(unsigned char *) "{",
(unsigned char *) " BorderColor \"slategrey\"",
(unsigned char *) " DefaultBackground \"rgb:2/a/9\"",
(unsigned char *) " DefaultForeground \"gray85\"",
(unsigned char *) " TitleBackground \"rgb:2/a/9\"",
(unsigned char *) " TitleForeground \"gray85\"",
(unsigned char *) " MenuBackground \"rgb:2/a/9\"",
(unsigned char *) " MenuForeground \"gray85\"",
(unsigned char *) " MenuBorderColor \"slategrey\"",
(unsigned char *) " MenuTitleBackground \"gray70\"",
(unsigned char *) " MenuTitleForeground \"rgb:2/a/9\"",
(unsigned char *) " IconBackground \"rgb:2/a/9\"",
(unsigned char *) " IconForeground \"gray85\"",
(unsigned char *) " IconBorderColor \"gray85\"",
(unsigned char *) " IconManagerBackground \"rgb:2/a/9\"",
(unsigned char *) " IconManagerForeground \"gray85\"",
(unsigned char *) "}",
(unsigned char *) "",
(unsigned char *) "MoveDelta 3",
(unsigned char *) "Function \"move-or-lower\" { f.move f.deltastop f.lower }",
(unsigned char *) "Function \"move-or-raise\" { f.move f.deltastop f.raise }",
(unsigned char *) "Function \"move-or-iconify\" { f.move f.deltastop f.iconify }",
(unsigned char *) "",
(unsigned char *) "Button1 = : root : f.menu \"defops\"",
(unsigned char *) "",
(unsigned char *) "Button1 = m : window|icon : f.function \"move-or-lower\"",
(unsigned char *) "Button2 = m : window|icon : f.iconify",
(unsigned char *) "Button3 = m : window|icon : f.function \"move-or-raise\"",
(unsigned char *) "",
(unsigned char *) "Button1 = : title : f.function \"move-or-raise\"",
(unsigned char *) "Button2 = : title : f.raiselower",
(unsigned char *) "",
(unsigned char *) "Button1 = : icon : f.function \"move-or-iconify\"",
(unsigned char *) "Button2 = : icon : f.iconify",
(unsigned char *) "",
(unsigned char *) "Button1 = : iconmgr : f.iconify",
(unsigned char *) "Button2 = : iconmgr : f.iconify",
(unsigned char *) "",
(unsigned char *) "menu \"defops\"",
(unsigned char *) "{",
(unsigned char *) "\"Twm\" f.title",
(unsigned char *) "\"Iconify\" f.iconify",
(unsigned char *) "\"Resize\" f.resize",
(unsigned char *) "\"Move\" f.move",
(unsigned char *) "\"Raise\" f.raise",
(unsigned char *) "\"Lower\" f.lower",
(unsigned char *) "\"\" f.nop",
(unsigned char *) "\"Focus\" f.focus",
(unsigned char *) "\"Unfocus\" f.unfocus",
(unsigned char *) "\"Show Iconmgr\" f.showiconmgr",
(unsigned char *) "\"Hide Iconmgr\" f.hideiconmgr",
(unsigned char *) "\"\" f.nop",
(unsigned char *) "\"Xterm\" f.exec \"exec xterm &\"",
(unsigned char *) "\"\" f.nop",
(unsigned char *) "\"Kill\" f.destroy",
(unsigned char *) "\"Delete\" f.delete",
(unsigned char *) "\"\" f.nop",
(unsigned char *) "\"Restart\" f.restart",
(unsigned char *) "\"Exit\" f.quit",
(unsigned char *) "}",
(unsigned char *) 0 };

4
src/deftwmrc.sed Normal file
View File

@ -0,0 +1,4 @@
/^#/d
s/"/\\"/g
s/^/ (unsigned char *) "/
s/$/",/

2691
src/events.c Normal file

File diff suppressed because it is too large Load Diff

129
src/events.h Normal file
View File

@ -0,0 +1,129 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
*
* twm event handler include file
*
* 17-Nov-87 Thomas E. LaStrange File created
*
***********************************************************************/
#ifndef _EVENTS_
#define _EVENTS_
#include "screen.h"
#include "twm.h"
typedef void (*event_proc)(void);
extern Time lastTimestamp;
#define LastTimestamp() lastTimestamp
extern void AutoRaiseWindow ( TwmWindow *tmp );
extern void SetRaiseWindow ( TwmWindow *tmp );
extern void InitEvents ( void );
extern Bool StashEventTime ( XEvent *ev );
extern Window WindowOfEvent ( XEvent *e );
extern Bool DispatchEvent2 ( void );
extern Bool DispatchEvent ( void );
extern void HandleEvents ( void );
extern void HandleColormapNotify ( void );
extern void HandleVisibilityNotify ( void );
extern void HandleKeyPress ( void );
extern void free_cwins ( TwmWindow *tmp );
extern void HandlePropertyNotify ( void );
extern void HandleClientMessage ( void );
extern void HandleExpose ( void );
extern void HandleDestroyNotify ( void );
extern void HandleCreateNotify ( void );
extern void HandleMapRequest ( void );
extern void SimulateMapRequest ( Window w );
extern void HandleMapNotify ( void );
extern void HandleUnmapNotify ( void );
extern void HandleMotionNotify ( void );
extern void HandleButtonRelease ( void );
extern void HandleButtonPress ( void );
extern void HandleEnterNotify ( void );
extern void HandleLeaveNotify ( void );
extern void HandleConfigureRequest ( void );
extern void HandleShapeNotify ( void );
extern void HandleUnknown ( void );
extern int Transient ( Window w, Window *propw );
extern ScreenInfo * FindScreenInfo ( Window w );
extern void InstallWindowColormaps ( int type, TwmWindow *tmp );
extern void InstallRootColormap ( void );
extern void UninstallRootColormap ( void );
extern event_proc EventHandler[];
extern Window DragWindow;
extern int origDragX;
extern int origDragY;
extern int DragX;
extern int DragY;
extern int DragWidth;
extern int DragHeight;
extern int CurrentDragX;
extern int CurrentDragY;
extern int ButtonPressed;
extern int Cancel;
extern int Context;
extern XEvent Event;
extern unsigned int mods_used;
extern int MovedFromKeyPress;
#endif /* _EVENTS_ */

112
src/gc.c Normal file
View File

@ -0,0 +1,112 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/* Copyright 1988 by Evans & Sutherland Computer Corporation, */
/* Salt Lake City, Utah */
/* Cambridge, Massachusetts */
/* */
/* All Rights Reserved */
/* */
/* Permission to use, copy, modify, and distribute this software and */
/* its documentation for any purpose and without fee is hereby */
/* granted, provided that the above copyright notice appear in all */
/* copies and that both that copyright notice and this permis- */
/* sion notice appear in supporting documentation, and that the */
/* name of Evans & Sutherland not be used in advertising */
/* in publicity pertaining to distribution of the software without */
/* specific, written prior permission. */
/* */
/* EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD */
/* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- */
/* ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND */
/* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- */
/* AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA */
/* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER */
/* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE */
/* OR PERFORMANCE OF THIS SOFTWARE. */
/*********************************************************************(*****/
/**********************************************************************
*
* Open the fonts and create the GCs
*
* 31-Mar-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#include <stdio.h>
#include "twm.h"
#include "util.h"
#include "screen.h"
#include "gc.h"
/** \fn CreateGCs
* open fonts and create all the needed GC's. I only
* want to do this once, hence the first_time flag.
*/
void
CreateGCs(void)
{
static ScreenInfo *prevScr = NULL;
XGCValues gcv;
unsigned long gcm;
if (!Scr->FirstTime || prevScr == Scr)
return;
prevScr = Scr;
/* create GC's */
gcm = 0;
gcm |= GCFunction; gcv.function = GXxor;
gcm |= GCLineWidth; gcv.line_width = 0;
gcm |= GCForeground; gcv.foreground = Scr->XORvalue;
gcm |= GCSubwindowMode; gcv.subwindow_mode = IncludeInferiors;
Scr->DrawGC = XCreateGC(dpy, Scr->Root, gcm, &gcv);
gcm = 0;
gcm |= GCForeground; gcv.foreground = Scr->MenuC.fore;
gcm |= GCBackground; gcv.background = Scr->MenuC.back;
if (!use_fontset)
{gcm |= GCFont; gcv.font = Scr->MenuFont.font->fid;}
Scr->MenuGC = XCreateGC(dpy, Scr->Root, gcm, &gcv);
gcm = 0;
gcm |= GCPlaneMask; gcv.plane_mask = AllPlanes;
/*
* Prevent GraphicsExpose and NoExpose events. We'd only get NoExpose
* events anyway; they cause BadWindow errors from XGetWindowAttributes
* call in FindScreenInfo (events.c) (since drawable is a pixmap).
*/
gcm |= GCGraphicsExposures; gcv.graphics_exposures = False;
gcm |= GCLineWidth; gcv.line_width = 0;
Scr->NormalGC = XCreateGC(dpy, Scr->Root, gcm, &gcv);
}

66
src/gc.h Normal file
View File

@ -0,0 +1,66 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* GC related externs
*
* 8-Apr-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef _GC_
#define _GC_
extern void CreateGCs( void );
#endif /* _GC_ */

3094
src/gram.c Normal file

File diff suppressed because it is too large Load Diff

209
src/gram.h Normal file
View File

@ -0,0 +1,209 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
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, 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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
LB = 258,
RB = 259,
LP = 260,
RP = 261,
MENUS = 262,
MENU = 263,
BUTTON = 264,
DEFAULT_FUNCTION = 265,
PLUS = 266,
MINUS = 267,
ALL = 268,
OR = 269,
CURSORS = 270,
PIXMAPS = 271,
ICONS = 272,
COLOR = 273,
SAVECOLOR = 274,
MONOCHROME = 275,
FUNCTION = 276,
ICONMGR_SHOW = 277,
ICONMGR = 278,
WINDOW_FUNCTION = 279,
ZOOM = 280,
ICONMGRS = 281,
ICONMGR_GEOMETRY = 282,
ICONMGR_NOSHOW = 283,
MAKE_TITLE = 284,
GRAYSCALE = 285,
ICONIFY_BY_UNMAPPING = 286,
DONT_ICONIFY_BY_UNMAPPING = 287,
NO_TITLE = 288,
AUTO_RAISE = 289,
NO_HILITE = 290,
ICON_REGION = 291,
META = 292,
SHIFT = 293,
LOCK = 294,
CONTROL = 295,
WINDOW = 296,
TITLE = 297,
ICON = 298,
ROOT = 299,
FRAME = 300,
COLON = 301,
EQUALS = 302,
SQUEEZE_TITLE = 303,
DONT_SQUEEZE_TITLE = 304,
START_ICONIFIED = 305,
NO_TITLE_HILITE = 306,
TITLE_HILITE = 307,
MOVE = 308,
RESIZE = 309,
WAIT = 310,
SELECT = 311,
KILL = 312,
LEFT_TITLEBUTTON = 313,
RIGHT_TITLEBUTTON = 314,
NUMBER = 315,
KEYWORD = 316,
NKEYWORD = 317,
CKEYWORD = 318,
CLKEYWORD = 319,
FKEYWORD = 320,
FSKEYWORD = 321,
SKEYWORD = 322,
DKEYWORD = 323,
JKEYWORD = 324,
WINDOW_RING = 325,
WARP_CURSOR = 326,
ERRORTOKEN = 327,
NO_STACKMODE = 328,
STRING = 329
};
#endif
/* Tokens. */
#define LB 258
#define RB 259
#define LP 260
#define RP 261
#define MENUS 262
#define MENU 263
#define BUTTON 264
#define DEFAULT_FUNCTION 265
#define PLUS 266
#define MINUS 267
#define ALL 268
#define OR 269
#define CURSORS 270
#define PIXMAPS 271
#define ICONS 272
#define COLOR 273
#define SAVECOLOR 274
#define MONOCHROME 275
#define FUNCTION 276
#define ICONMGR_SHOW 277
#define ICONMGR 278
#define WINDOW_FUNCTION 279
#define ZOOM 280
#define ICONMGRS 281
#define ICONMGR_GEOMETRY 282
#define ICONMGR_NOSHOW 283
#define MAKE_TITLE 284
#define GRAYSCALE 285
#define ICONIFY_BY_UNMAPPING 286
#define DONT_ICONIFY_BY_UNMAPPING 287
#define NO_TITLE 288
#define AUTO_RAISE 289
#define NO_HILITE 290
#define ICON_REGION 291
#define META 292
#define SHIFT 293
#define LOCK 294
#define CONTROL 295
#define WINDOW 296
#define TITLE 297
#define ICON 298
#define ROOT 299
#define FRAME 300
#define COLON 301
#define EQUALS 302
#define SQUEEZE_TITLE 303
#define DONT_SQUEEZE_TITLE 304
#define START_ICONIFIED 305
#define NO_TITLE_HILITE 306
#define TITLE_HILITE 307
#define MOVE 308
#define RESIZE 309
#define WAIT 310
#define SELECT 311
#define KILL 312
#define LEFT_TITLEBUTTON 313
#define RIGHT_TITLEBUTTON 314
#define NUMBER 315
#define KEYWORD 316
#define NKEYWORD 317
#define CKEYWORD 318
#define CLKEYWORD 319
#define FKEYWORD 320
#define FSKEYWORD 321
#define SKEYWORD 322
#define DKEYWORD 323
#define JKEYWORD 324
#define WINDOW_RING 325
#define WARP_CURSOR 326
#define ERRORTOKEN 327
#define NO_STACKMODE 328
#define STRING 329
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 107 "gram.y"
{
int num;
char *ptr;
}
/* Line 1489 of yacc.c. */
#line 202 "gram.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE yylval;

882
src/gram.y Normal file
View File

@ -0,0 +1,882 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
*
* $Xorg: gram.y,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $
*
* .twmrc command grammer
*
* 07-Jan-86 Thomas E. LaStrange File created
* 11-Nov-90 Dave Sternlicht Adding SaveColors
* 10-Oct-90 David M. Sternlicht Storing saved colors on root
*
* $XFree86: xc/programs/twm/gram.y,v 3.8 2002/10/16 21:33:03 tsi Exp $
*
***********************************************************************/
%{
#include <stdio.h>
#include <ctype.h>
#include "twm.h"
#include "menus.h"
#include "list.h"
#include "util.h"
#include "screen.h"
#include "parse.h"
#include "add_window.h"
#include "icons.h"
#include <X11/Xos.h>
#include <X11/Xmu/CharSet.h>
static char *Action = "";
static char *Name = "";
static MenuRoot *root, *pull = NULL;
static MenuRoot *GetRoot ( const char *name, const char *fore, const char *back );
static void GotButton ( int butt, int func );
static void GotKey ( char *key, int func );
static void GotTitleButton ( char *bitmapname, int func, Bool rightside );
static Bool CheckWarpScreenArg ( char *s );
static Bool CheckWarpRingArg ( char *s );
static Bool CheckColormapArg ( char *s );
static void RemoveDQuote ( char *str );
static char *ptr;
static name_list **list;
static int cont = 0;
static int color;
int mods = 0;
unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask);
extern int yylineno;
static void yyerror ( const char *s );
%}
%union
{
int num;
char *ptr;
};
%token <num> LB RB LP RP MENUS MENU BUTTON DEFAULT_FUNCTION PLUS MINUS
%token <num> ALL OR CURSORS PIXMAPS ICONS COLOR SAVECOLOR MONOCHROME FUNCTION
%token <num> ICONMGR_SHOW ICONMGR WINDOW_FUNCTION ZOOM ICONMGRS
%token <num> ICONMGR_GEOMETRY ICONMGR_NOSHOW MAKE_TITLE GRAYSCALE
%token <num> ICONIFY_BY_UNMAPPING DONT_ICONIFY_BY_UNMAPPING
%token <num> NO_TITLE AUTO_RAISE NO_HILITE ICON_REGION
%token <num> META SHIFT LOCK CONTROL WINDOW TITLE ICON ROOT FRAME
%token <num> COLON EQUALS SQUEEZE_TITLE DONT_SQUEEZE_TITLE
%token <num> START_ICONIFIED NO_TITLE_HILITE TITLE_HILITE
%token <num> MOVE RESIZE WAIT SELECT KILL LEFT_TITLEBUTTON RIGHT_TITLEBUTTON
%token <num> NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD
%token <num> SKEYWORD DKEYWORD JKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN
%token <num> NO_STACKMODE
%token <ptr> STRING
%type <ptr> string
%type <num> pixmap_list cursor_list color_list save_color_list stmt
%type <num> win_color_list iconm_list win_list icon_list function menu
%type <num> noarg sarg error narg squeeze color_entry
%type <num> action button number signed_number full fullkey
%start twmrc
%%
twmrc : stmts
;
stmts : /* Empty */
| stmts stmt
;
stmt : error
| noarg
| sarg
| narg
| squeeze
| ICON_REGION string DKEYWORD DKEYWORD number number
{ AddIconRegion($2, $3, $4, $5, $6); }
| ICONMGR_GEOMETRY string number { if (Scr->FirstTime)
{
Scr->iconmgr.geometry=$2;
Scr->iconmgr.columns=$3;
}
}
| ICONMGR_GEOMETRY string { if (Scr->FirstTime)
Scr->iconmgr.geometry = $2;
}
| ZOOM number { if (Scr->FirstTime)
{
Scr->DoZoom = TRUE;
Scr->ZoomCount = $2;
}
}
| ZOOM { if (Scr->FirstTime)
Scr->DoZoom = TRUE; }
| PIXMAPS pixmap_list {}
| CURSORS cursor_list {}
| ICONIFY_BY_UNMAPPING { list = &Scr->IconifyByUn; }
win_list
| ICONIFY_BY_UNMAPPING { if (Scr->FirstTime)
Scr->IconifyByUnmapping = TRUE; }
| LEFT_TITLEBUTTON string EQUALS action {
GotTitleButton ($2, $4, False);
}
| RIGHT_TITLEBUTTON string EQUALS action {
GotTitleButton ($2, $4, True);
}
| button string { root = GetRoot($2, NULLSTR, NULLSTR);
Scr->Mouse[$1][C_ROOT][0].func = F_MENU;
Scr->Mouse[$1][C_ROOT][0].menu = root;
}
| button action { Scr->Mouse[$1][C_ROOT][0].func = $2;
if ($2 == F_MENU)
{
pull->prev = NULL;
Scr->Mouse[$1][C_ROOT][0].menu = pull;
}
else
{
root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
Scr->Mouse[$1][C_ROOT][0].item =
AddToMenu(root,"x",Action,
NULL,$2,NULLSTR,NULLSTR);
}
Action = "";
pull = NULL;
}
| string fullkey { GotKey($1, $2); }
| button full { GotButton($1, $2); }
| DONT_ICONIFY_BY_UNMAPPING { list = &Scr->DontIconify; }
win_list
| ICONMGR_NOSHOW { list = &Scr->IconMgrNoShow; }
win_list
| ICONMGR_NOSHOW { Scr->IconManagerDontShow = TRUE; }
| ICONMGRS { list = &Scr->IconMgrs; }
iconm_list
| ICONMGR_SHOW { list = &Scr->IconMgrShow; }
win_list
| NO_TITLE_HILITE { list = &Scr->NoTitleHighlight; }
win_list
| NO_TITLE_HILITE { if (Scr->FirstTime)
Scr->TitleHighlight = FALSE; }
| NO_HILITE { list = &Scr->NoHighlight; }
win_list
| NO_HILITE { if (Scr->FirstTime)
Scr->Highlight = FALSE; }
| NO_STACKMODE { list = &Scr->NoStackModeL; }
win_list
| NO_STACKMODE { if (Scr->FirstTime)
Scr->StackMode = FALSE; }
| NO_TITLE { list = &Scr->NoTitle; }
win_list
| NO_TITLE { if (Scr->FirstTime)
Scr->NoTitlebar = TRUE; }
| MAKE_TITLE { list = &Scr->MakeTitle; }
win_list
| START_ICONIFIED { list = &Scr->StartIconified; }
win_list
| AUTO_RAISE { list = &Scr->AutoRaise; }
win_list
| MENU string LP string COLON string RP {
root = GetRoot($2, $4, $6); }
menu { root->real_menu = TRUE;}
| MENU string { root = GetRoot($2, NULLSTR, NULLSTR); }
menu { root->real_menu = TRUE; }
| FUNCTION string { root = GetRoot($2, NULLSTR, NULLSTR); }
function
| ICONS { list = &Scr->IconNames; }
icon_list
| COLOR { color = COLOR; }
color_list
| GRAYSCALE { color = GRAYSCALE; }
color_list
| SAVECOLOR
save_color_list
| MONOCHROME { color = MONOCHROME; }
color_list
| DEFAULT_FUNCTION action { Scr->DefaultFunction.func = $2;
if ($2 == F_MENU)
{
pull->prev = NULL;
Scr->DefaultFunction.menu = pull;
}
else
{
root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
Scr->DefaultFunction.item =
AddToMenu(root,"x",Action,
NULL,$2, NULLSTR, NULLSTR);
}
Action = "";
pull = NULL;
}
| WINDOW_FUNCTION action { Scr->WindowFunction.func = $2;
root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
Scr->WindowFunction.item =
AddToMenu(root,"x",Action,
NULL,$2, NULLSTR, NULLSTR);
Action = "";
pull = NULL;
}
| WARP_CURSOR { list = &Scr->WarpCursorL; }
win_list
| WARP_CURSOR { if (Scr->FirstTime)
Scr->WarpCursor = TRUE; }
| WINDOW_RING { list = &Scr->WindowRingL; }
win_list
;
noarg : KEYWORD { if (!do_single_keyword ($1)) {
twmrc_error_prefix();
fprintf (stderr,
"unknown singleton keyword %d\n",
$1);
ParseError = 1;
}
}
;
sarg : SKEYWORD string { if (!do_string_keyword ($1, $2)) {
twmrc_error_prefix();
fprintf (stderr,
"unknown string keyword %d (value \"%s\")\n",
$1, $2);
ParseError = 1;
}
}
;
narg : NKEYWORD number { if (!do_number_keyword ($1, $2)) {
twmrc_error_prefix();
fprintf (stderr,
"unknown numeric keyword %d (value %d)\n",
$1, $2);
ParseError = 1;
}
}
;
full : EQUALS keys COLON contexts COLON action { $$ = $6; }
;
fullkey : EQUALS keys COLON contextkeys COLON action { $$ = $6; }
;
keys : /* Empty */
| keys key
;
key : META { mods |= Mod1Mask; }
| SHIFT { mods |= ShiftMask; }
| LOCK { mods |= LockMask; }
| CONTROL { mods |= ControlMask; }
| META number { if ($2 < 1 || $2 > 5) {
twmrc_error_prefix();
fprintf (stderr,
"bad modifier number (%d), must be 1-5\n",
$2);
ParseError = 1;
} else {
mods |= (Mod1Mask << ($2 - 1));
}
}
| OR { }
;
contexts : /* Empty */
| contexts context
;
context : WINDOW { cont |= C_WINDOW_BIT; }
| TITLE { cont |= C_TITLE_BIT; }
| ICON { cont |= C_ICON_BIT; }
| ROOT { cont |= C_ROOT_BIT; }
| FRAME { cont |= C_FRAME_BIT; }
| ICONMGR { cont |= C_ICONMGR_BIT; }
| META { cont |= C_ICONMGR_BIT; }
| ALL { cont |= C_ALL_BITS; }
| OR { }
;
contextkeys : /* Empty */
| contextkeys contextkey
;
contextkey : WINDOW { cont |= C_WINDOW_BIT; }
| TITLE { cont |= C_TITLE_BIT; }
| ICON { cont |= C_ICON_BIT; }
| ROOT { cont |= C_ROOT_BIT; }
| FRAME { cont |= C_FRAME_BIT; }
| ICONMGR { cont |= C_ICONMGR_BIT; }
| META { cont |= C_ICONMGR_BIT; }
| ALL { cont |= C_ALL_BITS; }
| OR { }
| string { Name = $1; cont |= C_NAME_BIT; }
;
pixmap_list : LB pixmap_entries RB
;
pixmap_entries : /* Empty */
| pixmap_entries pixmap_entry
;
pixmap_entry : TITLE_HILITE string { SetHighlightPixmap ($2); }
;
cursor_list : LB cursor_entries RB
;
cursor_entries : /* Empty */
| cursor_entries cursor_entry
;
cursor_entry : FRAME string string {
NewBitmapCursor(&Scr->FrameCursor, $2, $3); }
| FRAME string {
NewFontCursor(&Scr->FrameCursor, $2); }
| TITLE string string {
NewBitmapCursor(&Scr->TitleCursor, $2, $3); }
| TITLE string {
NewFontCursor(&Scr->TitleCursor, $2); }
| ICON string string {
NewBitmapCursor(&Scr->IconCursor, $2, $3); }
| ICON string {
NewFontCursor(&Scr->IconCursor, $2); }
| ICONMGR string string {
NewBitmapCursor(&Scr->IconMgrCursor, $2, $3); }
| ICONMGR string {
NewFontCursor(&Scr->IconMgrCursor, $2); }
| BUTTON string string {
NewBitmapCursor(&Scr->ButtonCursor, $2, $3); }
| BUTTON string {
NewFontCursor(&Scr->ButtonCursor, $2); }
| MOVE string string {
NewBitmapCursor(&Scr->MoveCursor, $2, $3); }
| MOVE string {
NewFontCursor(&Scr->MoveCursor, $2); }
| RESIZE string string {
NewBitmapCursor(&Scr->ResizeCursor, $2, $3); }
| RESIZE string {
NewFontCursor(&Scr->ResizeCursor, $2); }
| WAIT string string {
NewBitmapCursor(&Scr->WaitCursor, $2, $3); }
| WAIT string {
NewFontCursor(&Scr->WaitCursor, $2); }
| MENU string string {
NewBitmapCursor(&Scr->MenuCursor, $2, $3); }
| MENU string {
NewFontCursor(&Scr->MenuCursor, $2); }
| SELECT string string {
NewBitmapCursor(&Scr->SelectCursor, $2, $3); }
| SELECT string {
NewFontCursor(&Scr->SelectCursor, $2); }
| KILL string string {
NewBitmapCursor(&Scr->DestroyCursor, $2, $3); }
| KILL string {
NewFontCursor(&Scr->DestroyCursor, $2); }
;
color_list : LB color_entries RB
;
color_entries : /* Empty */
| color_entries color_entry
;
color_entry : CLKEYWORD string { if (!do_colorlist_keyword ($1, color,
$2)) {
twmrc_error_prefix();
fprintf (stderr,
"unhandled list color keyword %d (string \"%s\")\n",
$1, $2);
ParseError = 1;
}
}
| CLKEYWORD string { list = do_colorlist_keyword($1,color,
$2);
if (!list) {
twmrc_error_prefix();
fprintf (stderr,
"unhandled color list keyword %d (string \"%s\")\n",
$1, $2);
ParseError = 1;
}
}
win_color_list { /* No action */; }
| CKEYWORD string { if (!do_color_keyword ($1, color,
$2)) {
twmrc_error_prefix();
fprintf (stderr,
"unhandled color keyword %d (string \"%s\")\n",
$1, $2);
ParseError = 1;
}
}
;
save_color_list : LB s_color_entries RB
;
s_color_entries : /* Empty */
| s_color_entries s_color_entry
;
s_color_entry : string { do_string_savecolor(color, $1); }
| CLKEYWORD { do_var_savecolor($1); }
;
win_color_list : LB win_color_entries RB
;
win_color_entries : /* Empty */
| win_color_entries win_color_entry
;
win_color_entry : string string { if (Scr->FirstTime &&
color == Scr->Monochrome)
AddToList(list, $1, $2); }
;
squeeze : SQUEEZE_TITLE {
if (HasShape) Scr->SqueezeTitle = TRUE;
}
| SQUEEZE_TITLE { list = &Scr->SqueezeTitleL;
if (HasShape && Scr->SqueezeTitle == -1)
Scr->SqueezeTitle = TRUE;
}
LB win_sqz_entries RB
| DONT_SQUEEZE_TITLE { Scr->SqueezeTitle = FALSE; }
| DONT_SQUEEZE_TITLE { list = &Scr->DontSqueezeTitleL; }
win_list
;
win_sqz_entries : /* Empty */
| win_sqz_entries string JKEYWORD signed_number number {
if (Scr->FirstTime) {
do_squeeze_entry (list, $2, $3, $4, $5);
}
}
;
iconm_list : LB iconm_entries RB
;
iconm_entries : /* Empty */
| iconm_entries iconm_entry
;
iconm_entry : string string number { if (Scr->FirstTime)
AddToList(list, $1, (char *)
AllocateIconManager($1, NULLSTR,
$2,$3));
}
| string string string number
{ if (Scr->FirstTime)
AddToList(list, $1, (char *)
AllocateIconManager($1,$2,
$3, $4));
}
;
win_list : LB win_entries RB
;
win_entries : /* Empty */
| win_entries win_entry
;
win_entry : string { if (Scr->FirstTime)
AddToList(list, $1, 0);
}
;
icon_list : LB icon_entries RB
;
icon_entries : /* Empty */
| icon_entries icon_entry
;
icon_entry : string string { if (Scr->FirstTime) AddToList(list, $1, $2); }
;
function : LB function_entries RB
;
function_entries: /* Empty */
| function_entries function_entry
;
function_entry : action { AddToMenu(root, "", Action, NULL, $1,
NULLSTR, NULLSTR);
Action = "";
}
;
menu : LB menu_entries RB
;
menu_entries : /* Empty */
| menu_entries menu_entry
;
menu_entry : string action { AddToMenu(root, $1, Action, pull, $2,
NULLSTR, NULLSTR);
Action = "";
pull = NULL;
}
| string LP string COLON string RP action {
AddToMenu(root, $1, Action, pull, $7,
$3, $5);
Action = "";
pull = NULL;
}
;
action : FKEYWORD { $$ = $1; }
| FSKEYWORD string {
$$ = $1;
Action = $2;
switch ($1) {
case F_MENU:
pull = GetRoot ($2, NULLSTR,NULLSTR);
pull->prev = root;
break;
case F_WARPRING:
if (!CheckWarpRingArg (Action)) {
twmrc_error_prefix();
fprintf (stderr,
"ignoring invalid f.warptoring argument \"%s\"\n",
Action);
$$ = F_NOP;
}
case F_WARPTOSCREEN:
if (!CheckWarpScreenArg (Action)) {
twmrc_error_prefix();
fprintf (stderr,
"ignoring invalid f.warptoscreen argument \"%s\"\n",
Action);
$$ = F_NOP;
}
break;
case F_COLORMAP:
if (CheckColormapArg (Action)) {
$$ = F_COLORMAP;
} else {
twmrc_error_prefix();
fprintf (stderr,
"ignoring invalid f.colormap argument \"%s\"\n",
Action);
$$ = F_NOP;
}
break;
} /* end switch */
}
;
signed_number : number { $$ = $1; }
| PLUS number { $$ = $2; }
| MINUS number { $$ = -($2); }
;
button : BUTTON number { $$ = $2;
if ($2 == 0)
yyerror("bad button 0");
if ($2 > MAX_BUTTONS)
{
$$ = 0;
yyerror("button number too large");
}
}
;
string : STRING { ptr = strdup($1);
RemoveDQuote(ptr);
$$ = ptr;
}
;
number : NUMBER { $$ = $1; }
;
%%
static void
yyerror(const char *s)
{
twmrc_error_prefix();
fprintf (stderr, "error in input file: %s\n", s ? s : "");
ParseError = 1;
}
static void
RemoveDQuote(char *str)
{
register char *i, *o;
register int n;
register int count;
for (i=str+1, o=str; *i && *i != '\"'; o++)
{
if (*i == '\\')
{
switch (*++i)
{
case 'n':
*o = '\n';
i++;
break;
case 'b':
*o = '\b';
i++;
break;
case 'r':
*o = '\r';
i++;
break;
case 't':
*o = '\t';
i++;
break;
case 'f':
*o = '\f';
i++;
break;
case '0':
if (*++i == 'x')
goto hex;
else
--i;
case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
n = 0;
count = 0;
while (*i >= '0' && *i <= '7' && count < 3)
{
n = (n<<3) + (*i++ - '0');
count++;
}
*o = n;
break;
hex:
case 'x':
n = 0;
count = 0;
while (i++, count++ < 2)
{
if (*i >= '0' && *i <= '9')
n = (n<<4) + (*i - '0');
else if (*i >= 'a' && *i <= 'f')
n = (n<<4) + (*i - 'a') + 10;
else if (*i >= 'A' && *i <= 'F')
n = (n<<4) + (*i - 'A') + 10;
else
break;
}
*o = n;
break;
case '\n':
i++; /* punt */
o--; /* to account for o++ at end of loop */
break;
case '\"':
case '\'':
case '\\':
default:
*o = *i++;
break;
}
}
else
*o = *i++;
}
*o = '\0';
}
static MenuRoot *GetRoot(const char *name, const char* fore, const char *back)
{
MenuRoot *tmp;
tmp = FindMenuRoot(name);
if (tmp == NULL)
tmp = NewMenuRoot(name);
if (fore)
{
int save;
save = Scr->FirstTime;
Scr->FirstTime = TRUE;
GetColor(COLOR, &tmp->hi_fore, fore);
GetColor(COLOR, &tmp->hi_back, back);
Scr->FirstTime = save;
}
return tmp;
}
static void GotButton(int butt, int func)
{
int i;
for (i = 0; i < NUM_CONTEXTS; i++)
{
if ((cont & (1 << i)) == 0)
continue;
Scr->Mouse[butt][i][mods].func = func;
if (func == F_MENU)
{
pull->prev = NULL;
Scr->Mouse[butt][i][mods].menu = pull;
}
else
{
root = GetRoot(TWM_ROOT, NULLSTR, NULLSTR);
Scr->Mouse[butt][i][mods].item = AddToMenu(root,"x",Action,
NULL, func, NULLSTR, NULLSTR);
}
}
Action = "";
pull = NULL;
cont = 0;
mods_used |= mods;
mods = 0;
}
static void GotKey(char *key, int func)
{
int i;
for (i = 0; i < NUM_CONTEXTS; i++)
{
if ((cont & (1 << i)) == 0)
continue;
if (!AddFuncKey(key, i, mods, func, Name, Action))
break;
}
Action = "";
pull = NULL;
cont = 0;
mods_used |= mods;
mods = 0;
}
static void GotTitleButton (char *bitmapname, int func, Bool rightside)
{
if (!CreateTitleButton (bitmapname, func, Action, pull, rightside, True)) {
twmrc_error_prefix();
fprintf (stderr,
"unable to create %s titlebutton \"%s\"\n",
rightside ? "right" : "left", bitmapname);
}
Action = "";
pull = NULL;
}
static Bool CheckWarpScreenArg (char *s)
{
XmuCopyISOLatin1Lowered (s, s);
if (strcmp (s, WARPSCREEN_NEXT) == 0 ||
strcmp (s, WARPSCREEN_PREV) == 0 ||
strcmp (s, WARPSCREEN_BACK) == 0)
return True;
for (; *s && isascii(*s) && isdigit(*s); s++) ; /* SUPPRESS 530 */
return (*s ? False : True);
}
static Bool CheckWarpRingArg (char *s)
{
XmuCopyISOLatin1Lowered (s, s);
if (strcmp (s, WARPSCREEN_NEXT) == 0 ||
strcmp (s, WARPSCREEN_PREV) == 0)
return True;
return False;
}
static Bool CheckColormapArg (char *s)
{
XmuCopyISOLatin1Lowered (s, s);
if (strcmp (s, COLORMAP_NEXT) == 0 ||
strcmp (s, COLORMAP_PREV) == 0 ||
strcmp (s, COLORMAP_DEFAULT) == 0)
return True;
return False;
}
void
twmrc_error_prefix (void)
{
fprintf (stderr, "%s: line %d: ", ProgramName, yylineno);
}

691
src/iconmgr.c Normal file
View File

@ -0,0 +1,691 @@
/*
*
Copyright 1989,1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* */
/***********************************************************************
*
* Icon Manager routines
*
* 09-Mar-89 Tom LaStrange File Created
*
***********************************************************************/
#include <stdio.h>
#include "twm.h"
#include "util.h"
#include "parse.h"
#include "screen.h"
#include "resize.h"
#include "add_window.h"
#include "siconify.bm"
#include <X11/Xos.h>
#include <X11/Xmu/CharSet.h>
static void InsertInIconManager ( IconMgr *ip, WList *tmp, TwmWindow *tmp_win );
int iconmgr_textx = siconify_width+11;
static WList *Active = NULL;
WList *DownIconManager = NULL;
int iconifybox_width = siconify_width;
int iconifybox_height = siconify_height;
/**
* create all the icon manager windows for this screen.
*/
void
CreateIconManagers(void)
{
IconMgr *p;
int mask;
char str[100];
char str1[100];
Pixel background;
char *icon_name;
if (Scr->NoIconManagers)
return;
if (Scr->siconifyPm == None)
{
Scr->siconifyPm = XCreatePixmapFromBitmapData(dpy, Scr->Root,
(char *)siconify_bits, siconify_width, siconify_height, 1, 0, 1);
}
for (p = &Scr->iconmgr; p != NULL; p = p->next)
{
mask = XParseGeometry(p->geometry, &JunkX, &JunkY,
(unsigned int *) &p->width, (unsigned int *)&p->height);
if (mask & XNegative)
JunkX = Scr->MyDisplayWidth - p->width -
(2 * Scr->BorderWidth) + JunkX;
if (mask & YNegative)
JunkY = Scr->MyDisplayHeight - p->height -
(2 * Scr->BorderWidth) + JunkY;
background = Scr->IconManagerC.back;
GetColorFromList(Scr->IconManagerBL, p->name, (XClassHint *)NULL,
&background);
p->w = XCreateSimpleWindow(dpy, Scr->Root,
JunkX, JunkY, p->width, p->height, 1,
Scr->Black, background);
snprintf(str, sizeof(str), "%s Icon Manager", p->name);
snprintf(str1, sizeof(str1), "%s Icons", p->name);
if (p->icon_name)
icon_name = p->icon_name;
else
icon_name = str1;
XSetStandardProperties(dpy, p->w, str, icon_name, None, NULL, 0, NULL);
p->twm_win = AddWindow(p->w, TRUE, p);
SetMapStateProp (p->twm_win, WithdrawnState);
}
for (p = &Scr->iconmgr; p != NULL; p = p->next)
{
GrabButtons(p->twm_win);
GrabKeys(p->twm_win);
}
}
/**
* allocate a new icon manager
*
* \param name the name of this icon manager
* \param con_name the name of the associated icon
* \param geom a geometry string to eventually parse
* \param columns the number of columns this icon manager has
*/
IconMgr *AllocateIconManager(char *name, char *icon_name, char *geom, int columns)
{
IconMgr *p;
#ifdef DEBUG_ICONMGR
fprintf(stderr, "AllocateIconManager\n");
fprintf(stderr, " name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n",
name, icon_name, geom, columns);
#endif
if (Scr->NoIconManagers)
return NULL;
p = malloc(sizeof(IconMgr));
p->name = name;
p->icon_name = icon_name;
p->geometry = geom;
p->columns = columns;
p->first = NULL;
p->last = NULL;
p->active = NULL;
p->scr = Scr;
p->count = 0;
p->x = 0;
p->y = 0;
p->width = 150;
p->height = 10;
Scr->iconmgr.lasti->next = p;
p->prev = Scr->iconmgr.lasti;
Scr->iconmgr.lasti = p;
p->next = NULL;
return(p);
}
/**
* move the pointer around in an icon manager
*
* \param dir one of the following:
* - F_FORWICONMGR: forward in the window list
* - F_BACKICONMGR: backward in the window list
* - F_UPICONMGR: up one row
* - F_DOWNICONMG: down one row
* - F_LEFTICONMGR: left one column
* - F_RIGHTICONMGR: right one column
*/
void MoveIconManager(int dir)
{
IconMgr *ip;
WList *tmp = NULL;
int cur_row, cur_col, new_row, new_col;
int row_inc, col_inc;
int got_it;
if (!Active) return;
cur_row = Active->row;
cur_col = Active->col;
ip = Active->iconmgr;
row_inc = 0;
col_inc = 0;
got_it = FALSE;
switch (dir)
{
case F_FORWICONMGR:
if ((tmp = Active->next) == NULL)
tmp = ip->first;
got_it = TRUE;
break;
case F_BACKICONMGR:
if ((tmp = Active->prev) == NULL)
tmp = ip->last;
got_it = TRUE;
break;
case F_UPICONMGR:
row_inc = -1;
break;
case F_DOWNICONMGR:
row_inc = 1;
break;
case F_LEFTICONMGR:
col_inc = -1;
break;
case F_RIGHTICONMGR:
col_inc = 1;
break;
}
/* If got_it is FALSE ast this point then we got a left, right,
* up, or down, command. We will enter this loop until we find
* a window to warp to.
*/
new_row = cur_row;
new_col = cur_col;
while (!got_it)
{
new_row += row_inc;
new_col += col_inc;
if (new_row < 0)
new_row = ip->cur_rows - 1;
if (new_col < 0)
new_col = ip->cur_columns - 1;
if (new_row >= ip->cur_rows)
new_row = 0;
if (new_col >= ip->cur_columns)
new_col = 0;
/* Now let's go through the list to see if there is an entry with this
* new position
*/
for (tmp = ip->first; tmp != NULL; tmp = tmp->next)
{
if (tmp->row == new_row && tmp->col == new_col)
{
got_it = TRUE;
break;
}
}
}
if (!got_it)
{
fprintf (stderr,
"%s: unable to find window (%d, %d) in icon manager\n",
ProgramName, new_row, new_col);
return;
}
if (tmp == NULL)
return;
/* raise the frame so the icon manager is visible */
if (ip->twm_win->mapped) {
XRaiseWindow(dpy, ip->twm_win->frame);
XWarpPointer(dpy, None, tmp->icon, 0,0,0,0, 5, 5);
} else {
if (tmp->twm->title_height) {
int tbx = Scr->TBInfo.titlex;
int x = tmp->twm->highlightx;
XWarpPointer (dpy, None, tmp->twm->title_w, 0, 0, 0, 0,
tbx + (x - tbx) / 2,
Scr->TitleHeight / 4);
} else {
XWarpPointer (dpy, None, tmp->twm->w, 0, 0, 0, 0, 5, 5);
}
}
}
/**
* jump from one icon manager to another, possibly even on another screen
* \param dir one of the following:
* - F_NEXTICONMGR - go to the next icon manager
* - F_PREVICONMGR - go to the previous one
*/
void JumpIconManager(int dir)
{
IconMgr *ip, *tmp_ip = NULL;
int got_it = FALSE;
ScreenInfo *sp;
int screen;
if (!Active) return;
#define ITER(i) (dir == F_NEXTICONMGR ? (i)->next : (i)->prev)
#define IPOFSP(sp) (dir == F_NEXTICONMGR ? &(sp->iconmgr) : sp->iconmgr.lasti)
#define TEST(ip) if ((ip)->count != 0 && (ip)->twm_win->mapped) \
{ got_it = TRUE; break; }
ip = Active->iconmgr;
for (tmp_ip = ITER(ip); tmp_ip; tmp_ip = ITER(tmp_ip)) {
TEST (tmp_ip);
}
if (!got_it) {
int origscreen = ip->scr->screen;
int inc = (dir == F_NEXTICONMGR ? 1 : -1);
for (screen = origscreen + inc; ; screen += inc) {
if (screen >= NumScreens)
screen = 0;
else if (screen < 0)
screen = NumScreens - 1;
sp = ScreenList[screen];
if (sp) {
for (tmp_ip = IPOFSP (sp); tmp_ip; tmp_ip = ITER(tmp_ip)) {
TEST (tmp_ip);
}
}
if (got_it || screen == origscreen) break;
}
}
#undef ITER
#undef IPOFSP
#undef TEST
if (!got_it) {
Bell(XkbBI_MinorError,0,None);
return;
}
/* raise the frame so it is visible */
XRaiseWindow(dpy, tmp_ip->twm_win->frame);
if (tmp_ip->active)
XWarpPointer(dpy, None, tmp_ip->active->icon, 0,0,0,0, 5, 5);
else
XWarpPointer(dpy, None, tmp_ip->w, 0,0,0,0, 5, 5);
}
/**
* add a window to an icon manager
*
* \param tmp_win the TwmWindow structure
*/
WList *AddIconManager(TwmWindow *tmp_win)
{
WList *tmp;
int h;
unsigned long valuemask; /* mask for create windows */
XSetWindowAttributes attributes; /* attributes for create windows */
IconMgr *ip;
tmp_win->list = NULL;
if (tmp_win->iconmgr || tmp_win->transient || Scr->NoIconManagers)
return NULL;
if (LookInList(Scr->IconMgrNoShow, tmp_win->full_name, &tmp_win->class))
return NULL;
if (Scr->IconManagerDontShow &&
!LookInList(Scr->IconMgrShow, tmp_win->full_name, &tmp_win->class))
return NULL;
if ((ip = (IconMgr *)LookInList(Scr->IconMgrs, tmp_win->full_name,
&tmp_win->class)) == NULL)
ip = &Scr->iconmgr;
tmp = malloc(sizeof(WList));
tmp->iconmgr = ip;
tmp->next = NULL;
tmp->active = FALSE;
tmp->down = FALSE;
InsertInIconManager(ip, tmp, tmp_win);
tmp->twm = tmp_win;
tmp->fore = Scr->IconManagerC.fore;
tmp->back = Scr->IconManagerC.back;
tmp->highlight = Scr->IconManagerHighlight;
GetColorFromList(Scr->IconManagerFL, tmp_win->full_name, &tmp_win->class,
&tmp->fore);
GetColorFromList(Scr->IconManagerBL, tmp_win->full_name, &tmp_win->class,
&tmp->back);
GetColorFromList(Scr->IconManagerHighlightL, tmp_win->full_name,
&tmp_win->class, &tmp->highlight);
h = Scr->IconManagerFont.height + 10;
if (h < (siconify_height + 4))
h = siconify_height + 4;
ip->height = h * ip->count;
tmp->me = ip->count;
tmp->x = -1;
tmp->y = -1;
valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor);
attributes.background_pixel = tmp->back;
attributes.border_pixel = tmp->back;
attributes.event_mask = (KeyPressMask | ButtonPressMask |
ButtonReleaseMask | ExposureMask |
EnterWindowMask | LeaveWindowMask);
attributes.cursor = Scr->IconMgrCursor;
tmp->w = XCreateWindow (dpy, ip->w, 0, 0, (unsigned int) 1,
(unsigned int) h, (unsigned int) 0,
CopyFromParent, (unsigned int) CopyFromParent,
(Visual *) CopyFromParent, valuemask, &attributes);
valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor);
attributes.background_pixel = tmp->back;
attributes.border_pixel = Scr->Black;
attributes.event_mask = (ButtonReleaseMask| ButtonPressMask |
ExposureMask);
attributes.cursor = Scr->ButtonCursor;
tmp->icon = XCreateWindow (dpy, tmp->w, 5, (int) (h - siconify_height)/2,
(unsigned int) siconify_width,
(unsigned int) siconify_height,
(unsigned int) 0, CopyFromParent,
(unsigned int) CopyFromParent,
(Visual *) CopyFromParent,
valuemask, &attributes);
ip->count += 1;
PackIconManager(ip);
XMapWindow(dpy, tmp->w);
XSaveContext(dpy, tmp->w, IconManagerContext, (caddr_t) tmp);
XSaveContext(dpy, tmp->w, TwmContext, (caddr_t) tmp_win);
XSaveContext(dpy, tmp->w, ScreenContext, (caddr_t) Scr);
XSaveContext(dpy, tmp->icon, TwmContext, (caddr_t) tmp_win);
XSaveContext(dpy, tmp->icon, ScreenContext, (caddr_t) Scr);
tmp_win->list = tmp;
if (!ip->twm_win->icon)
{
XMapWindow(dpy, ip->w);
XMapWindow(dpy, ip->twm_win->frame);
}
if (Active == NULL) Active = tmp;
return (tmp);
}
/**
* put an allocated entry into an icon manager
*
* \param ip the icon manager pointer
* \param tmp the entry to insert
*/
static void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win)
{
WList *tmp1;
int added;
int (*compar)(const char *, const char *)
= (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
added = FALSE;
if (ip->first == NULL)
{
ip->first = tmp;
tmp->prev = NULL;
ip->last = tmp;
added = TRUE;
}
else if (Scr->SortIconMgr)
{
for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next)
{
if ((*compar)(tmp_win->icon_name, tmp1->twm->icon_name) < 0)
{
tmp->next = tmp1;
tmp->prev = tmp1->prev;
tmp1->prev = tmp;
if (tmp->prev == NULL)
ip->first = tmp;
else
tmp->prev->next = tmp;
added = TRUE;
break;
}
}
}
if (!added)
{
ip->last->next = tmp;
tmp->prev = ip->last;
ip->last = tmp;
}
}
static void RemoveFromIconManager(IconMgr *ip, WList *tmp)
{
if (tmp->prev == NULL)
ip->first = tmp->next;
else
tmp->prev->next = tmp->next;
if (tmp->next == NULL)
ip->last = tmp->prev;
else
tmp->next->prev = tmp->prev;
}
/**
* remove a window from the icon manager
* \param tmp_win the TwmWindow structure
*/
void RemoveIconManager(TwmWindow *tmp_win)
{
IconMgr *ip;
WList *tmp;
if (tmp_win->list == NULL)
return;
tmp = tmp_win->list;
tmp_win->list = NULL;
ip = tmp->iconmgr;
RemoveFromIconManager(ip, tmp);
XDeleteContext(dpy, tmp->icon, TwmContext);
XDeleteContext(dpy, tmp->icon, ScreenContext);
XDestroyWindow(dpy, tmp->icon);
XDeleteContext(dpy, tmp->w, IconManagerContext);
XDeleteContext(dpy, tmp->w, TwmContext);
XDeleteContext(dpy, tmp->w, ScreenContext);
XDestroyWindow(dpy, tmp->w);
ip->count -= 1;
free(tmp);
PackIconManager(ip);
if (ip->count == 0)
{
XUnmapWindow(dpy, ip->twm_win->frame);
}
}
void ActiveIconManager(WList *active)
{
active->active = TRUE;
Active = active;
Active->iconmgr->active = active;
DrawIconManagerBorder(active);
}
void NotActiveIconManager(WList *active)
{
active->active = FALSE;
DrawIconManagerBorder(active);
}
void DrawIconManagerBorder(WList *tmp)
{
{
XSetForeground(dpy, Scr->NormalGC, tmp->fore);
XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 2, 2,
tmp->width-5, tmp->height-5);
if (tmp->active && Scr->Highlight)
XSetForeground(dpy, Scr->NormalGC, tmp->highlight);
else
XSetForeground(dpy, Scr->NormalGC, tmp->back);
XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 0, 0,
tmp->width-1, tmp->height-1);
XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 1, 1,
tmp->width-3, tmp->height-3);
}
}
/**
* sort The Dude
*
* \param ip a pointer to the icon manager struture
*/
void SortIconManager(IconMgr *ip)
{
WList *tmp1, *tmp2;
int done;
int (*compar)(const char *, const char *)
= (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1);
if (ip == NULL)
ip = Active->iconmgr;
done = FALSE;
do
{
for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next)
{
if ((tmp2 = tmp1->next) == NULL)
{
done = TRUE;
break;
}
if ((*compar)(tmp1->twm->icon_name, tmp2->twm->icon_name) > 0)
{
/* take it out and put it back in */
RemoveFromIconManager(ip, tmp2);
InsertInIconManager(ip, tmp2, tmp2->twm);
break;
}
}
}
while (!done);
PackIconManager(ip);
}
/**
* pack the icon manager windows following
* an addition or deletion
*
* \param ip a pointer to the icon manager struture
*/
void PackIconManager(IconMgr *ip)
{
int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth;
int new_x, new_y;
int savewidth;
WList *tmp;
wheight = Scr->IconManagerFont.height + 10;
if (wheight < (siconify_height + 4))
wheight = siconify_height + 4;
wwidth = ip->width / ip->columns;
rowinc = wheight;
colinc = wwidth;
row = 0;
col = ip->columns;
maxcol = 0;
for (i = 0, tmp = ip->first; tmp != NULL; i++, tmp = tmp->next)
{
tmp->me = i;
if (++col >= ip->columns)
{
col = 0;
row += 1;
}
if (col > maxcol)
maxcol = col;
new_x = col * colinc;
new_y = (row-1) * rowinc;
/* if the position or size has not changed, don't touch it */
if (tmp->x != new_x || tmp->y != new_y ||
tmp->width != wwidth || tmp->height != wheight)
{
XMoveResizeWindow(dpy, tmp->w, new_x, new_y, wwidth, wheight);
tmp->row = row-1;
tmp->col = col;
tmp->x = new_x;
tmp->y = new_y;
tmp->width = wwidth;
tmp->height = wheight;
}
}
maxcol += 1;
ip->cur_rows = row;
ip->cur_columns = maxcol;
ip->height = row * rowinc;
if (ip->height == 0)
ip->height = rowinc;
newwidth = maxcol * colinc;
if (newwidth == 0)
newwidth = colinc;
XResizeWindow(dpy, ip->w, newwidth, ip->height);
savewidth = ip->width;
if (ip->twm_win)
SetupWindow (ip->twm_win,
ip->twm_win->frame_x, ip->twm_win->frame_y,
newwidth, ip->height + ip->twm_win->title_height, -1);
ip->width = savewidth;
}

89
src/iconmgr.h Normal file
View File

@ -0,0 +1,89 @@
/*
*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* */
/***********************************************************************
*
* Icon Manager includes
*
* 09-Mar-89 Tom LaStrange File Created
*
***********************************************************************/
#ifndef _ICONMGR_
#define _ICONMGR_
typedef struct WList
{
struct WList *next;
struct WList *prev;
struct TwmWindow *twm;
struct IconMgr *iconmgr;
Window w;
Window icon;
int x, y, width, height;
int row, col;
int me;
Pixel fore, back, highlight;
unsigned top, bottom;
short active;
short down;
} WList;
typedef struct IconMgr
{
struct IconMgr *next; /* pointer to the next icon manager */
struct IconMgr *prev; /* pointer to the previous icon mgr */
struct IconMgr *lasti; /* pointer to the last icon mgr */
struct WList *first; /* first window in the list */
struct WList *last; /* last window in the list */
struct WList *active; /* the active entry */
TwmWindow *twm_win; /* back pointer to the new parent */
struct ScreenInfo *scr; /* the screen this thing is on */
Window w; /* this icon manager window */
char *geometry; /* geometry string */
char *name;
char *icon_name;
int x, y, width, height;
int columns, cur_rows, cur_columns;
int count;
} IconMgr;
extern int iconmgr_textx;
extern WList *DownIconManager;
extern int iconifybox_width, iconifybox_height;
extern void ActiveIconManager ( WList *active );
extern WList *AddIconManager ( TwmWindow *tmp_win );
extern IconMgr *AllocateIconManager ( char *name, char *icon_name, char *geom, int columns );
extern void CreateIconManagers ( void );
extern void DrawIconManagerBorder ( WList *tmp );
extern void JumpIconManager ( int dir );
extern void MoveIconManager ( int dir );
extern void NotActiveIconManager ( WList *active );
extern void PackIconManager ( IconMgr *ip );
extern void RemoveIconManager ( TwmWindow *tmp_win );
extern void SortIconManager ( IconMgr *ip );
#endif /* _ICONMGR_ */

582
src/icons.c Normal file
View File

@ -0,0 +1,582 @@
/*
*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* */
/**********************************************************************
*
* Icon releated routines
*
* 10-Apr-89 Tom LaStrange Initial Version.
*
**********************************************************************/
#include <stdio.h>
#include "twm.h"
#include "screen.h"
#include "icons.h"
#include "gram.h"
#include "parse.h"
#include "util.h"
#define iconWidth(w) (Scr->IconBorderWidth * 2 + w->icon_w_width)
#define iconHeight(w) (Scr->IconBorderWidth * 2 + w->icon_w_height)
static void splitEntry ( IconEntry *ie, int grav1, int grav2, int w, int h );
static IconEntry * FindIconEntry ( TwmWindow *tmp_win, IconRegion **irp );
static IconEntry * prevIconEntry ( IconEntry *ie, IconRegion *ir );
static void mergeEntries ( IconEntry *old, IconEntry *ie );
static void
splitEntry (IconEntry *ie, int grav1, int grav2, int w, int h)
{
IconEntry *new;
switch (grav1) {
case D_NORTH:
case D_SOUTH:
if (w != ie->w)
splitEntry (ie, grav2, grav1, w, ie->h);
if (h != ie->h) {
new = malloc (sizeof (IconEntry));
new->twm_win = 0;
new->used = 0;
new->next = ie->next;
ie->next = new;
new->x = ie->x;
new->h = (ie->h - h);
new->w = ie->w;
ie->h = h;
if (grav1 == D_SOUTH) {
new->y = ie->y;
ie->y = new->y + new->h;
} else
new->y = ie->y + ie->h;
}
break;
case D_EAST:
case D_WEST:
if (h != ie->h)
splitEntry (ie, grav2, grav1, ie->w, h);
if (w != ie->w) {
new = malloc (sizeof (IconEntry));
new->twm_win = 0;
new->used = 0;
new->next = ie->next;
ie->next = new;
new->y = ie->y;
new->w = (ie->w - w);
new->h = ie->h;
ie->w = w;
if (grav1 == D_EAST) {
new->x = ie->x;
ie->x = new->x + new->w;
} else
new->x = ie->x + ie->w;
}
break;
}
}
static inline int
roundUp (int v, int multiple)
{
return ((v + multiple - 1) / multiple) * multiple;
}
static void
PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y)
{
IconRegion *ir;
IconEntry *ie;
int w = 0, h = 0;
ie = 0;
for (ir = Scr->FirstRegion; ir; ir = ir->next) {
w = roundUp (iconWidth (tmp_win), ir->stepx);
h = roundUp (iconHeight (tmp_win), ir->stepy);
for (ie = ir->entries; ie; ie=ie->next) {
if (ie->used)
continue;
if (ie->w >= w && ie->h >= h)
break;
}
if (ie)
break;
}
if (ie) {
splitEntry (ie, ir->grav1, ir->grav2, w, h);
ie->used = 1;
ie->twm_win = tmp_win;
*final_x = ie->x + (ie->w - iconWidth (tmp_win)) / 2;
*final_y = ie->y + (ie->h - iconHeight (tmp_win)) / 2;
} else {
*final_x = def_x;
*final_y = def_y;
}
return;
}
static IconEntry *
FindIconEntry (TwmWindow *tmp_win, IconRegion **irp)
{
IconRegion *ir;
IconEntry *ie;
for (ir = Scr->FirstRegion; ir; ir = ir->next) {
for (ie = ir->entries; ie; ie=ie->next)
if (ie->twm_win == tmp_win) {
if (irp)
*irp = ir;
return ie;
}
}
return 0;
}
void
IconUp (TwmWindow *tmp_win)
{
int x, y;
int defx, defy;
struct IconRegion *ir;
/*
* If the client specified a particular location, let's use it (this might
* want to be an option at some point). Otherwise, try to fit within the
* icon region.
*/
if (tmp_win->wmhints && (tmp_win->wmhints->flags & IconPositionHint))
return;
if (tmp_win->icon_moved) {
if (!XGetGeometry (dpy, tmp_win->icon_w, &JunkRoot, &defx, &defy,
&JunkWidth, &JunkHeight, &JunkBW, &JunkDepth))
return;
x = defx + ((int) JunkWidth) / 2;
y = defy + ((int) JunkHeight) / 2;
for (ir = Scr->FirstRegion; ir; ir = ir->next) {
if (x >= ir->x && x < (ir->x + ir->w) &&
y >= ir->y && y < (ir->y + ir->h))
break;
}
if (!ir) return; /* outside icon regions, leave alone */
}
defx = -100;
defy = -100;
PlaceIcon(tmp_win, defx, defy, &x, &y);
if (x != defx || y != defy) {
XMoveWindow (dpy, tmp_win->icon_w, x, y);
tmp_win->icon_moved = FALSE; /* since we've restored it */
}
}
static IconEntry *
prevIconEntry (IconEntry *ie, IconRegion *ir)
{
IconEntry *ip;
if (ie == ir->entries)
return 0;
for (ip = ir->entries; ip->next != ie; ip=ip->next)
;
return ip;
}
/**
* old is being freed; and is adjacent to ie. Merge
* regions together
*/
static void
mergeEntries (IconEntry *old, IconEntry *ie)
{
if (old->y == ie->y) {
ie->w = old->w + ie->w;
if (old->x < ie->x)
ie->x = old->x;
} else {
ie->h = old->h + ie->h;
if (old->y < ie->y)
ie->y = old->y;
}
}
void
IconDown (TwmWindow *tmp_win)
{
IconEntry *ie, *ip, *in;
IconRegion *ir;
ie = FindIconEntry (tmp_win, &ir);
if (ie) {
ie->twm_win = 0;
ie->used = 0;
ip = prevIconEntry (ie, ir);
in = ie->next;
for (;;) {
if (ip && ip->used == 0 &&
((ip->x == ie->x && ip->w == ie->w) ||
(ip->y == ie->y && ip->h == ie->h)))
{
ip->next = ie->next;
mergeEntries (ie, ip);
free (ie);
ie = ip;
ip = prevIconEntry (ip, ir);
} else if (in && in->used == 0 &&
((in->x == ie->x && in->w == ie->w) ||
(in->y == ie->y && in->h == ie->h)))
{
ie->next = in->next;
mergeEntries (in, ie);
free (in);
in = ie->next;
} else
break;
}
}
}
void
AddIconRegion(char *geom, int grav1, int grav2, int stepx, int stepy)
{
IconRegion *ir;
int mask;
ir = malloc(sizeof(IconRegion));
ir->next = NULL;
if (Scr->LastRegion)
Scr->LastRegion->next = ir;
Scr->LastRegion = ir;
if (!Scr->FirstRegion)
Scr->FirstRegion = ir;
ir->entries = NULL;
ir->grav1 = grav1;
ir->grav2 = grav2;
if (stepx <= 0)
stepx = 1;
if (stepy <= 0)
stepy = 1;
ir->stepx = stepx;
ir->stepy = stepy;
ir->x = ir->y = ir->w = ir->h = 0;
mask = XParseGeometry(geom, &ir->x, &ir->y, (unsigned int *)&ir->w, (unsigned int *)&ir->h);
if (mask & XNegative)
ir->x += Scr->MyDisplayWidth - ir->w;
if (mask & YNegative)
ir->y += Scr->MyDisplayHeight - ir->h;
ir->entries = malloc(sizeof(IconEntry));
ir->entries->next = 0;
ir->entries->x = ir->x;
ir->entries->y = ir->y;
ir->entries->w = ir->w;
ir->entries->h = ir->h;
ir->entries->twm_win = 0;
ir->entries->used = 0;
}
#ifdef comment
void
FreeIconEntries (IconRegion *ir)
{
IconEntry *ie, *tmp;
for (ie = ir->entries; ie; ie=tmp)
{
tmp = ie->next;
free (ie);
}
}
void
FreeIconRegions(void)
{
IconRegion *ir, *tmp;
for (ir = Scr->FirstRegion; ir != NULL;)
{
tmp = ir;
FreeIconEntries (ir);
ir = ir->next;
free(tmp);
}
Scr->FirstRegion = NULL;
Scr->LastRegion = NULL;
}
#endif
void
CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y)
{
unsigned long event_mask;
unsigned long valuemask; /* mask for create windows */
XSetWindowAttributes attributes; /* attributes for create windows */
Pixmap pm = None; /* tmp pixmap variable */
int final_x, final_y;
int x;
FB(tmp_win->iconc.fore, tmp_win->iconc.back);
tmp_win->forced = FALSE;
tmp_win->icon_not_ours = FALSE;
/* now go through the steps to get an icon window, if ForceIcon is
* set, then no matter what else is defined, the bitmap from the
* .twmrc file is used
*/
if (Scr->ForceIcon)
{
char *icon_name;
Pixmap bm;
icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name);
if (icon_name == NULL)
icon_name = LookInList(Scr->IconNames, tmp_win->full_name,
&tmp_win->class);
bm = None;
if (icon_name != NULL)
{
if ((bm = (Pixmap)LookInNameList(Scr->Icons, icon_name)) == None)
{
if ((bm = GetBitmap (icon_name)) != None)
AddToList(&Scr->Icons, icon_name, (char *)bm);
}
}
if (bm != None)
{
XGetGeometry(dpy, bm, &JunkRoot, &JunkX, &JunkY,
(unsigned int *) &tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height,
&JunkBW, &JunkDepth);
pm = XCreatePixmap(dpy, Scr->Root, tmp_win->icon_width,
tmp_win->icon_height, Scr->d_depth);
/* the copy plane works on color ! */
XCopyPlane(dpy, bm, pm, Scr->NormalGC,
0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 );
tmp_win->forced = TRUE;
}
}
/* if the pixmap is still NULL, we didn't get one from the above code,
* that could mean that ForceIcon was not set, or that the window
* was not in the Icons list, now check the WM hints for an icon
*/
if (pm == None && tmp_win->wmhints &&
tmp_win->wmhints->flags & IconPixmapHint)
{
XGetGeometry(dpy, tmp_win->wmhints->icon_pixmap,
&JunkRoot, &JunkX, &JunkY,
(unsigned int *)&tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height, &JunkBW, &JunkDepth);
pm = XCreatePixmap(dpy, Scr->Root,
tmp_win->icon_width, tmp_win->icon_height,
Scr->d_depth);
XCopyPlane(dpy, tmp_win->wmhints->icon_pixmap, pm, Scr->NormalGC,
0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 );
}
/* if we still haven't got an icon, let's look in the Icon list
* if ForceIcon is not set
*/
if (pm == None && !Scr->ForceIcon)
{
char *icon_name;
Pixmap bm;
icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name);
if (icon_name == NULL)
icon_name = LookInList(Scr->IconNames, tmp_win->full_name,
&tmp_win->class);
bm = None;
if (icon_name != NULL)
{
if ((bm = (Pixmap)LookInNameList(Scr->Icons, icon_name)) == None)
{
if ((bm = GetBitmap (icon_name)) != None)
AddToList(&Scr->Icons, icon_name, (char *)bm);
}
}
if (bm != None)
{
XGetGeometry(dpy, bm, &JunkRoot, &JunkX, &JunkY,
(unsigned int *)&tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height,
&JunkBW, &JunkDepth);
pm = XCreatePixmap(dpy, Scr->Root, tmp_win->icon_width,
tmp_win->icon_height, Scr->d_depth);
/* the copy plane works on color ! */
XCopyPlane(dpy, bm, pm, Scr->NormalGC,
0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 );
}
}
/* if we still don't have an icon, assign the UnknownIcon */
if (pm == None && Scr->UnknownPm != None)
{
tmp_win->icon_width = Scr->UnknownWidth;
tmp_win->icon_height = Scr->UnknownHeight;
pm = XCreatePixmap(dpy, Scr->Root, tmp_win->icon_width,
tmp_win->icon_height, Scr->d_depth);
/* the copy plane works on color ! */
XCopyPlane(dpy, Scr->UnknownPm, pm, Scr->NormalGC,
0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 );
}
if (pm == None)
{
tmp_win->icon_height = 0;
tmp_win->icon_width = 0;
valuemask = 0;
}
else
{
valuemask = CWBackPixmap;
attributes.background_pixmap = pm;
}
tmp_win->icon_w_width = MyFont_TextWidth(&Scr->IconFont,
tmp_win->icon_name, strlen(tmp_win->icon_name));
tmp_win->icon_w_width += 6;
if (tmp_win->icon_w_width < tmp_win->icon_width)
{
tmp_win->icon_x = (tmp_win->icon_width - tmp_win->icon_w_width)/2;
tmp_win->icon_x += 3;
tmp_win->icon_w_width = tmp_win->icon_width;
}
else
{
tmp_win->icon_x = 3;
}
tmp_win->icon_y = tmp_win->icon_height + Scr->IconFont.height;
tmp_win->icon_w_height = tmp_win->icon_height + Scr->IconFont.height + 4;
event_mask = 0;
if (tmp_win->wmhints && tmp_win->wmhints->flags & IconWindowHint)
{
tmp_win->icon_w = tmp_win->wmhints->icon_window;
if (tmp_win->forced ||
XGetGeometry(dpy, tmp_win->icon_w, &JunkRoot, &JunkX, &JunkY,
(unsigned int *)&tmp_win->icon_w_width, (unsigned int *)&tmp_win->icon_w_height,
&JunkBW, &JunkDepth) == 0)
{
tmp_win->icon_w = None;
tmp_win->wmhints->flags &= ~IconWindowHint;
}
else
{
tmp_win->icon_not_ours = TRUE;
event_mask = EnterWindowMask | LeaveWindowMask;
}
}
else
{
tmp_win->icon_w = None;
}
if (tmp_win->icon_w == None)
{
tmp_win->icon_w = XCreateSimpleWindow(dpy, Scr->Root,
0,0,
tmp_win->icon_w_width, tmp_win->icon_w_height,
Scr->IconBorderWidth, tmp_win->icon_border, tmp_win->iconc.back);
event_mask = ExposureMask;
}
XSelectInput (dpy, tmp_win->icon_w,
KeyPressMask | ButtonPressMask | ButtonReleaseMask |
event_mask);
tmp_win->icon_bm_w = None;
if (pm != None &&
(! (tmp_win->wmhints && tmp_win->wmhints->flags & IconWindowHint)))
{
int y;
y = 0;
if (tmp_win->icon_w_width == tmp_win->icon_width)
x = 0;
else
x = (tmp_win->icon_w_width - tmp_win->icon_width)/2;
tmp_win->icon_bm_w = XCreateWindow (dpy, tmp_win->icon_w, x, y,
(unsigned int)tmp_win->icon_width,
(unsigned int)tmp_win->icon_height,
(unsigned int) 0, Scr->d_depth,
(unsigned int) CopyFromParent,
Scr->d_visual, valuemask,
&attributes);
}
/* I need to figure out where to put the icon window now, because
* getting here means that I am going to make the icon visible
*/
if (tmp_win->wmhints &&
tmp_win->wmhints->flags & IconPositionHint)
{
final_x = tmp_win->wmhints->icon_x;
final_y = tmp_win->wmhints->icon_y;
}
else
{
PlaceIcon(tmp_win, def_x, def_y, &final_x, &final_y);
}
if (final_x > Scr->MyDisplayWidth)
final_x = Scr->MyDisplayWidth - tmp_win->icon_w_width -
(2 * Scr->IconBorderWidth);
if (final_y > Scr->MyDisplayHeight)
final_y = Scr->MyDisplayHeight - tmp_win->icon_height -
Scr->IconFont.height - 4 - (2 * Scr->IconBorderWidth);
XMoveWindow(dpy, tmp_win->icon_w, final_x, final_y);
tmp_win->iconified = TRUE;
XMapSubwindows(dpy, tmp_win->icon_w);
XSaveContext(dpy, tmp_win->icon_w, TwmContext, (caddr_t)tmp_win);
XSaveContext(dpy, tmp_win->icon_w, ScreenContext, (caddr_t)Scr);
XDefineCursor(dpy, tmp_win->icon_w, Scr->IconCursor);
if (pm) XFreePixmap (dpy, pm);
return;
}

60
src/icons.h Normal file
View File

@ -0,0 +1,60 @@
/*
*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* */
/**********************************************************************
*
* Icon releated definitions
*
* 10-Apr-89 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef ICONS_H
#define ICONS_H
typedef struct IconRegion
{
struct IconRegion *next;
int x, y, w, h;
int grav1, grav2;
int stepx, stepy; /* allocation granularity */
struct IconEntry *entries;
} IconRegion;
typedef struct IconEntry
{
struct IconEntry *next;
int x, y, w, h;
TwmWindow *twm_win;
short used;
}IconEntry;
extern void IconUp ( TwmWindow *tmp_win );
extern void IconDown ( TwmWindow *tmp_win );
extern void AddIconRegion ( char *geom, int grav1, int grav2,
int stepx, int stepy );
extern void CreateIconWindow ( TwmWindow *tmp_win, int def_x, int def_y );
#endif /* ICONS_H */

1953
src/lex.c Normal file

File diff suppressed because it is too large Load Diff

146
src/lex.l Normal file
View File

@ -0,0 +1,146 @@
%{
/*****************************************************************************/
/*
Copyright 1989,1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
*
* $Xorg: lex.l,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $
*
* .twmrc lex file
*
* 12-Nov-87 Thomas E. LaStrange File created
*
***********************************************************************/
/* $XFree86: xc/programs/twm/lex.l,v 3.13 2001/08/27 21:11:39 dawes Exp $ */
/* #include <stdio.h> */ /* lex already includes stdio.h */
#include "twm.h"
#include "gram.h"
#include "list.h"
#include "parse.h"
#ifdef FLEX_SCANNER
int yylineno;
#undef YY_INPUT
#define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size)))
static int doinput (char *buf, int size)
{
int c;
if (size == 0)
return (0);
if ((c = (*twmInputFunc)()) <= 0)
return (0);
buf[0] = c;
return (1);
}
#define YY_NO_UNPUT
#endif
%}
string \"([^"]|\\.)*\"
number [0-9]+
%%
"{" { return (LB); }
"}" { return (RB); }
"(" { return (LP); }
")" { return (RP); }
"=" { return (EQUALS); }
":" { return (COLON); }
"+" { return PLUS; }
"-" { return MINUS; }
"|" { return OR; }
[a-zA-Z\.]+ { int token = parse_keyword ((char *)yytext,
&yylval.num);
if (token == ERRORTOKEN) {
twmrc_error_prefix();
fprintf (stderr,
"ignoring unknown keyword: %s\n",
yytext);
ParseError = 1;
} else
return token;
}
"!" { yylval.num = F_EXEC; return FSKEYWORD; }
"^" { yylval.num = F_CUT; return FSKEYWORD; }
{string} { yylval.ptr = (char *)yytext; return STRING; }
{number} { (void)sscanf((char *)yytext, "%d", &yylval.num);
return (NUMBER);
}
\#[^\n]*\n {;}
[\r\n\t ] {;}
. {
twmrc_error_prefix();
fprintf (stderr,
"ignoring character \"%s\"\n",
yytext);
ParseError = 1;
}
%%
#ifndef yywrap
int yywrap() { return(1);}
#endif
#undef unput
#undef input
#undef output
#undef feof
#define unput(c) twmUnput(c)
#define input() (*twmInputFunc)()
#define output(c) TwmOutput(c)
#define feof() (1)

217
src/list.c Normal file
View File

@ -0,0 +1,217 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* TWM code to deal with the name lists for the NoTitle list and
* the AutoRaise list
*
* 11-Apr-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#include <stdio.h>
#include "twm.h"
#include "screen.h"
#include "gram.h"
#include "util.h"
struct name_list_struct
{
name_list *next; /**< pointer to the next name */
char *name; /**< the name of the window */
char *ptr; /**< list dependent data */
};
/**
* add a window name to the appropriate list.
*
* If the list does not use the ptr value, a non-null value
* should be placed in it. LookInList returns this ptr value
* and procedures calling LookInList will check for a non-null
* return value as an indication of success.
*
* \param list the address of the pointer to the head of a list
* \param name a pointer to the name of the window
* \param ptr pointer to list dependent data
*/
void
AddToList(name_list **list_head, char *name, char *ptr)
{
name_list *nptr;
if (!list_head) return; /* ignore empty inserts */
nptr = malloc(sizeof(name_list));
if (nptr == NULL)
{
twmrc_error_prefix();
fprintf (stderr, "unable to allocate %ld bytes for name_list\n",
(unsigned long)sizeof(name_list));
Done(NULL, NULL);
}
nptr->next = *list_head;
nptr->name = name;
nptr->ptr = (ptr == NULL) ? (char *)TRUE : ptr;
*list_head = nptr;
}
/**
* look through a list for a window name, or class
*
* \return the ptr field of the list structure or NULL if the name
* or class was not found in the list
*
* \param list a pointer to the head of a list
* \param name a pointer to the name to look for
* \param class a pointer to the class to look for
*/
char *
LookInList(name_list *list_head, char *name, XClassHint *class)
{
name_list *nptr;
/* look for the name first */
for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(name, nptr->name) == 0)
return (nptr->ptr);
if (class)
{
/* look for the res_name next */
for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_name, nptr->name) == 0)
return (nptr->ptr);
/* finally look for the res_class */
for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_class, nptr->name) == 0)
return (nptr->ptr);
}
return (NULL);
}
char *
LookInNameList(name_list *list_head, char *name)
{
return (LookInList(list_head, name, NULL));
}
/**
* look through a list for a window name, or class
*
* \return TRUE if the name was found
* \return FALSE if the name was not found
*
* \param list a pointer to the head of a list
* \param name a pointer to the name to look for
* \param class a pointer to the class to look for
* \param[out] ptr fill in the list value if the name was found
*/
int GetColorFromList(name_list *list_head, char *name, XClassHint *class,
Pixel *ptr)
{
int save;
name_list *nptr;
for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(name, nptr->name) == 0)
{
save = Scr->FirstTime;
Scr->FirstTime = TRUE;
GetColor(Scr->Monochrome, ptr, nptr->ptr);
Scr->FirstTime = save;
return (TRUE);
}
if (class)
{
for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_name, nptr->name) == 0)
{
save = Scr->FirstTime;
Scr->FirstTime = TRUE;
GetColor(Scr->Monochrome, ptr, nptr->ptr);
Scr->FirstTime = save;
return (TRUE);
}
for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_class, nptr->name) == 0)
{
save = Scr->FirstTime;
Scr->FirstTime = TRUE;
GetColor(Scr->Monochrome, ptr, nptr->ptr);
Scr->FirstTime = save;
return (TRUE);
}
}
return (FALSE);
}
/**
* free up a list
*/
void FreeList(name_list **list)
{
name_list *nptr;
name_list *tmp;
for (nptr = *list; nptr != NULL; )
{
tmp = nptr->next;
free(nptr);
nptr = tmp;
}
*list = NULL;
}

81
src/list.h Normal file
View File

@ -0,0 +1,81 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* TWM list handling external definitions
*
* 11-Apr-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef _LIST_
#define _LIST_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Intrinsic.h>
typedef struct name_list_struct name_list;
extern void AddToList ( name_list **list_head, char *name, char *ptr );
extern void FreeList ( name_list **list );
extern int GetColorFromList ( name_list *list_head, char *name,
XClassHint *class, Pixel *ptr );
extern char * LookInList ( name_list *list_head, char *name,
XClassHint *class );
extern char * LookInNameList ( name_list *list_head, char *name );
#endif /* _LIST_ */

2937
src/menus.c Normal file

File diff suppressed because it is too large Load Diff

192
src/menus.h Normal file
View File

@ -0,0 +1,192 @@
/*****************************************************************************/
/*
Copyright 1989,1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
*
* twm menus include file
*
* 17-Nov-87 Thomas E. LaStrange File created
*
***********************************************************************/
#ifndef _MENUS_
#define _MENUS_
#define TWM_ROOT "bLoB_GoOp" /* my private root menu */
#define TWM_WINDOWS "TwmWindows" /* for f.menu "TwmWindows" */
#define MAX_FILE_SIZE 4096 /* max chars to read from file for cut */
typedef struct MenuItem
{
struct MenuItem *next; /* next menu item */
struct MenuItem *prev; /* prev menu item */
struct MenuRoot *sub; /* MenuRoot of a pull right menu */
struct MenuRoot *root; /* back pointer to my MenuRoot */
const char *item; /* the character string displayed */
const char *action; /* action to be performed */
Pixel fore; /* foreground color */
Pixel back; /* background color */
Pixel hi_fore; /* highlight foreground */
Pixel hi_back; /* highlight background */
short item_num; /* item number of this menu */
short x; /* x coordinate for text */
short func; /* twm built in function */
short state; /* video state, 0 = normal, 1 = reversed */
short strlen; /* strlen(item) */
short user_colors; /* colors were specified */
} MenuItem;
typedef struct MenuRoot
{
struct MenuItem *first; /* first item in menu */
struct MenuItem *last; /* last item in menu */
struct MenuRoot *prev; /* previous root menu if pull right */
struct MenuRoot *next; /* next in list of root menus */
const char *name; /* name of root */
Window w; /* the window of the menu */
Window shadow; /* the shadow window */
Pixel hi_fore; /* highlight foreground */
Pixel hi_back; /* highlight background */
short mapped; /* NEVER_MAPPED, UNMAPPED, or MAPPED */
short height; /* height of the menu */
short width; /* width of the menu */
short items; /* number of items in the menu */
short pull; /* is there a pull right entry ? */
short entered; /* EnterNotify following pop up */
short real_menu; /* this is a real menu */
} MenuRoot;
#define NEVER_MAPPED 0 /* constants for mapped field of MenuRoot */
#define UNMAPPED 1
#define MAPPED 2
typedef struct MouseButton
{
int func; /* the function number */
int mask; /* modifier mask */
MenuRoot *menu; /* menu if func is F_MENU */
MenuItem *item; /* action to perform if func != F_MENU */
} MouseButton;
typedef struct FuncKey
{
struct FuncKey *next; /* next in the list of function keys */
char *name; /* key name */
KeySym keysym; /* X keysym */
KeyCode keycode; /* X keycode */
int cont; /* context */
int mods; /* modifiers */
int func; /* function to perform */
char *win_name; /* window name (if any) */
char *action; /* action string (if any) */
} FuncKey;
extern int RootFunction;
extern MenuRoot *ActiveMenu;
extern MenuItem *ActiveItem;
extern int MoveFunction;
extern int WindowMoved;
extern int ConstMove;
extern int ConstMoveDir;
extern int ConstMoveX;
extern int ConstMoveY;
extern int ConstMoveXL;
extern int ConstMoveXR;
extern int ConstMoveYT;
extern int ConstMoveYB;
extern int menuFromFrameOrWindowOrTitlebar;
extern int ResizeOrigX;
extern int ResizeOrigY;
#define MAXMENUDEPTH 10 /* max number of nested menus */
extern int MenuDepth;
#define MOVE_NONE 0 /* modes of constrained move */
#define MOVE_VERT 1
#define MOVE_HORIZ 2
#define WARPSCREEN_NEXT "next"
#define WARPSCREEN_PREV "prev"
#define WARPSCREEN_BACK "back"
#define COLORMAP_NEXT "next"
#define COLORMAP_PREV "prev"
#define COLORMAP_DEFAULT "default"
extern void InitMenus ( void );
extern Bool AddFuncKey ( char *name, int cont, int mods, int func, char *win_name, char *action );
extern int CreateTitleButton ( const char *name, int func, const char *action, MenuRoot *menuroot, Bool rightside, Bool append );
extern void InitTitlebarButtons ( void );
extern void PaintEntry ( MenuRoot *mr, MenuItem *mi, int exposure );
extern void PaintMenu ( MenuRoot *mr, XEvent *e );
extern void UpdateMenu ( void );
extern MenuRoot * NewMenuRoot ( const char *name );
extern MenuItem * AddToMenu ( MenuRoot *menu, const char *item, const char *action, MenuRoot *sub, int func, const char *fore, const char *back );
extern void MakeMenus ( void );
extern Bool PopUpMenu ( MenuRoot *menu, int x, int y, Bool center );
extern void PopDownMenu ( void );
extern MenuRoot * FindMenuRoot ( const char *name );
extern int ExecuteFunction ( int func, const char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown );
extern void ReGrab ( void );
extern void FocusOnRoot ( void );
extern void DeIconify ( TwmWindow *tmp_win );
extern void Iconify ( TwmWindow *tmp_win, int def_x, int def_y );
extern void SetMapStateProp ( TwmWindow *tmp_win, int state );
extern void WarpToScreen ( int n, int inc );
extern void SetBorder ( TwmWindow *tmp, Bool onoroff );
extern void SendDeleteWindowMessage ( TwmWindow *tmp, Time timestamp );
extern void SendSaveYourselfMessage ( TwmWindow *tmp, Time timestamp );
extern void SendTakeFocusMessage ( TwmWindow *tmp, Time timestamp );
#endif /* _MENUS_ */

1122
src/parse.c Normal file

File diff suppressed because it is too large Load Diff

155
src/parse.h Normal file
View File

@ -0,0 +1,155 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* .twmrc parsing externs
*
* 8-Apr-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef _PARSE_
#define _PARSE_
#include "list.h"
extern void assign_var_savecolor ( void );
extern int do_single_keyword ( int keyword );
extern int do_string_keyword ( int keyword, char *s );
extern int do_number_keyword ( int keyword, int num );
extern name_list **do_colorlist_keyword ( int keyword, int colormode,
char *s );
extern int do_color_keyword ( int keyword, int colormode, char *s );
extern void do_string_savecolor ( int colormode, char *s );
extern void do_var_savecolor ( int key );
extern int ParseTwmrc ( char *filename );
extern int parse_keyword ( char *s, int *nump );
extern void TwmOutput ( int c );
extern void twmUnput ( int c );
extern void do_squeeze_entry ( name_list **list, char *name, int justify,
int num, int denom );
extern int (*twmInputFunc)(void);
extern int ConstrainedMoveTime;
extern unsigned char *defTwmrc[];
extern int mods;
#define F_NOP 0
#define F_BEEP 1
#define F_RESTART 2
#define F_QUIT 3
#define F_FOCUS 4
#define F_REFRESH 5
#define F_WINREFRESH 6
#define F_DELTASTOP 7
#define F_MOVE 8
#define F_POPUP 9
#define F_FORCEMOVE 10
#define F_AUTORAISE 11
#define F_IDENTIFY 12
#define F_ICONIFY 13
#define F_DEICONIFY 14
#define F_UNFOCUS 15
#define F_RESIZE 16
#define F_ZOOM 17
#define F_LEFTZOOM 18
#define F_RIGHTZOOM 19
#define F_TOPZOOM 20
#define F_BOTTOMZOOM 21
#define F_HORIZOOM 22
#define F_FULLZOOM 23
#define F_RAISE 24
#define F_RAISELOWER 25
#define F_LOWER 26
#define F_DESTROY 27
#define F_DELETE 28
#define F_SAVEYOURSELF 29
#define F_VERSION 30
#define F_TITLE 31
#define F_RIGHTICONMGR 32
#define F_LEFTICONMGR 33
#define F_UPICONMGR 34
#define F_DOWNICONMGR 35
#define F_FORWICONMGR 36
#define F_BACKICONMGR 37
#define F_NEXTICONMGR 38
#define F_PREVICONMGR 39
#define F_SORTICONMGR 40
#define F_CIRCLEUP 41
#define F_CIRCLEDOWN 42
#define F_CUTFILE 43
#define F_SHOWLIST 44
#define F_HIDELIST 45
#define F_MENU 101 /* string */
#define F_WARPNEXT 112 /* string */
#define F_WARPPREV 113 /* string */
#define F_WARPTO 102 /* string */
#define F_WARPTOICONMGR 103 /* string */
#define F_WARPRING 104 /* string */
#define F_FILE 105 /* string */
#define F_EXEC 106 /* string */
#define F_CUT 107 /* string */
#define F_FUNCTION 108 /* string */
#define F_WARPTOSCREEN 109 /* string */
#define F_COLORMAP 110 /* string */
#define F_PRIORITY 111 /* string */
#define F_STARTWM 114 /* string */
#define D_NORTH 1
#define D_SOUTH 2
#define D_EAST 3
#define D_WEST 4
#endif /* _PARSE_ */

1141
src/resize.c Normal file

File diff suppressed because it is too large Load Diff

78
src/resize.h Normal file
View File

@ -0,0 +1,78 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* resize function externs
*
* 8-Apr-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef _RESIZE_
#define _RESIZE_
extern void AddEndResize ( TwmWindow *tmp_win );
extern void AddStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h );
extern void ConstrainSize ( TwmWindow *tmp_win, int *widthp, int *heightp );
extern void DoResize ( int x_root, int y_root, TwmWindow *tmp_win );
extern void EndResize ( void );
extern void fullzoom ( TwmWindow *tmp_win, int flag );
extern void MenuDoResize ( int x_root, int y_root, TwmWindow *tmp_win );
extern void MenuEndResize ( TwmWindow *tmp_win );
extern void MenuStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h );
extern void SetFrameShape ( TwmWindow *tmp );
extern void SetupFrame ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent );
extern void SetupWindow ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw );
extern void StartResize ( XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar );
#endif /* _RESIZE_ */

267
src/screen.h Normal file
View File

@ -0,0 +1,267 @@
/*
*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
* */
/***********************************************************************
*
* twm per-screen data include file
*
* 11-3-88 Dave Payne, Apple Computer File created
*
***********************************************************************/
#ifndef _SCREEN_
#define _SCREEN_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include "list.h"
#include "menus.h"
#include "iconmgr.h"
typedef struct _StdCmap {
struct _StdCmap *next; /* next link in chain */
Atom atom; /* property from which this came */
int nmaps; /* number of maps below */
XStandardColormap *maps; /* the actual maps */
} StdCmap;
#define SIZE_HINDENT 10
#define SIZE_VINDENT 2
typedef struct _TitlebarPixmaps {
Pixmap xlogo;
Pixmap resize;
Pixmap question;
Pixmap menu;
Pixmap delete;
} TitlebarPixmaps;
typedef struct ScreenInfo
{
int screen; /* the default screen */
int d_depth; /* copy of DefaultDepth(dpy, screen) */
Visual *d_visual; /* copy of DefaultVisual(dpy, screen) */
int Monochrome; /* is the display monochrome ? */
int MyDisplayWidth; /* my copy of DisplayWidth(dpy, screen) */
int MyDisplayHeight; /* my copy of DisplayHeight(dpy, screen) */
int MaxWindowWidth; /* largest window to allow */
int MaxWindowHeight; /* ditto */
TwmWindow TwmRoot; /* the head of the twm window list */
Window Root; /* the root window */
Window SizeWindow; /* the resize dimensions window */
Window InfoWindow; /* the information window */
name_list *Icons; /* list of icon pixmaps */
TitlebarPixmaps tbpm; /* titlebar pixmaps */
Pixmap UnknownPm; /* the unknown icon pixmap */
Pixmap siconifyPm; /* the icon manager iconify pixmap */
Pixmap pullPm; /* pull right menu icon */
unsigned int pullW, pullH; /* size of pull right menu icon */
Pixmap hilitePm; /* focus highlight window background */
int hilite_pm_width, hilite_pm_height; /* cache the size */
MenuRoot *MenuList; /* head of the menu list */
MenuRoot *LastMenu; /* the last menu (mostly unused?) */
MenuRoot *Windows; /* the TwmWindows menu */
TwmWindow *Ring; /* one of the windows in window ring */
TwmWindow *RingLeader; /* current winodw in ring */
MouseButton Mouse[MAX_BUTTONS+1][NUM_CONTEXTS][MOD_SIZE];
MouseButton DefaultFunction;
MouseButton WindowFunction;
struct {
Colormaps *cmaps; /* current list of colormap windows */
int maxCmaps; /* maximum number of installed colormaps */
unsigned long first_req; /* seq # for first XInstallColormap() req in
pass thru loading a colortable list */
int root_pushes; /* current push level to install root
colormap windows */
TwmWindow *pushed_window; /* saved window to install when pushes drops
to zero */
} cmapInfo;
struct {
StdCmap *head, *tail; /* list of maps */
StdCmap *mru; /* most recently used in list */
int mruindex; /* index of mru in entry */
} StdCmapInfo;
struct {
int nleft, nright; /* numbers of buttons in list */
TitleButton *head; /* start of list */
int border; /* button border */
int pad; /* button-padding */
int width; /* width of single button & border */
int leftx; /* start of left buttons */
int titlex; /* start of title string */
int rightoff; /* offset back from right edge */
} TBInfo;
ColorPair BorderTileC; /* border tile colors */
ColorPair TitleC; /* titlebar colors */
ColorPair MenuC; /* menu colors */
ColorPair MenuTitleC; /* menu title colors */
ColorPair IconC; /* icon colors */
ColorPair IconManagerC; /* icon manager colors */
XColor PointerForeground; /* pointer foreground color */
XColor PointerBackground; /* pointer background color */
ColorPair DefaultC; /* default colors */
Pixel BorderColor; /* color of window borders */
Pixel MenuShadowColor; /* menu shadow color */
Pixel MenuBorderColor; /* menu border color */
Pixel IconBorderColor; /* icon border color */
Pixel IconManagerHighlight; /* icon manager highlight */
Cursor TitleCursor; /* title bar cursor */
Cursor FrameCursor; /* frame cursor */
Cursor IconCursor; /* icon cursor */
Cursor IconMgrCursor; /* icon manager cursor */
Cursor ButtonCursor; /* title bar button cursor */
Cursor MoveCursor; /* move cursor */
Cursor ResizeCursor; /* resize cursor */
Cursor WaitCursor; /* wait a while cursor */
Cursor MenuCursor; /* menu cursor */
Cursor SelectCursor; /* dot cursor for f.move, etc. from menus */
Cursor DestroyCursor; /* skull and cross bones, f.destroy */
name_list *BorderColorL;
name_list *IconBorderColorL;
name_list *BorderTileForegroundL;
name_list *BorderTileBackgroundL;
name_list *TitleForegroundL;
name_list *TitleBackgroundL;
name_list *IconForegroundL;
name_list *IconBackgroundL;
name_list *IconManagerFL;
name_list *IconManagerBL;
name_list *IconMgrs;
name_list *NoTitle; /* list of window names with no title bar */
name_list *MakeTitle; /* list of window names with title bar */
name_list *AutoRaise; /* list of window names to auto-raise */
name_list *IconNames; /* list of window names and icon names */
name_list *NoHighlight; /* list of windows to not highlight */
name_list *NoStackModeL; /* windows to ignore stack mode requests */
name_list *NoTitleHighlight;/* list of windows to not highlight the TB*/
name_list *DontIconify; /* don't iconify by unmapping */
name_list *IconMgrNoShow; /* don't show in the icon manager */
name_list *IconMgrShow; /* show in the icon manager */
name_list *IconifyByUn; /* windows to iconify by unmapping */
name_list *StartIconified; /* windows to start iconic */
name_list *IconManagerHighlightL; /* icon manager highlight colors */
name_list *SqueezeTitleL; /* windows of which to squeeze title */
name_list *DontSqueezeTitleL; /* windows of which not to squeeze */
name_list *WindowRingL; /* windows in ring */
name_list *WarpCursorL; /* windows to warp cursor to on deiconify */
GC NormalGC; /* normal GC for everything */
GC MenuGC; /* gc for menus */
GC DrawGC; /* GC to draw lines for move and resize */
unsigned long Black;
unsigned long White;
unsigned long XORvalue; /* number to use when drawing xor'ed */
MyFont TitleBarFont; /* title bar font structure */
MyFont MenuFont; /* menu font structure */
MyFont IconFont; /* icon font structure */
MyFont SizeFont; /* resize font structure */
MyFont IconManagerFont; /* window list font structure */
MyFont DefaultFont;
IconMgr iconmgr; /* default icon manager */
struct IconRegion *FirstRegion; /* pointer to icon regions */
struct IconRegion *LastRegion; /* pointer to the last icon region */
char *IconDirectory; /* icon directory to search */
int SizeStringOffset; /* x offset in size window for drawing */
int SizeStringWidth; /* minimum width of size window */
int BorderWidth; /* border width of twm windows */
int IconBorderWidth; /* border width of icon windows */
int MenuBorderWidth; /* border width of twm menus */
int UnknownWidth; /* width of the unknown icon */
int UnknownHeight; /* height of the unknown icon */
int TitleHeight; /* height of the title bar window */
TwmWindow *Focus; /* the twm window that has focus */
int EntryHeight; /* menu entry height */
int FramePadding; /* distance between decorations and border */
int TitlePadding; /* distance between items in titlebar */
int ButtonIndent; /* amount to shrink buttons on each side */
int NumAutoRaises; /* number of autoraise windows on screen */
short NoDefaults; /* do not add in default UI stuff */
short UsePPosition; /* what do with PPosition, see values below */
short AutoRelativeResize; /* start resize relative to position in quad */
short FocusRoot; /* is the input focus on the root ? */
short WarpCursor; /* warp cursor on de-iconify ? */
short ForceIcon; /* force the icon to the user specified */
short NoGrabServer; /* don't do server grabs */
short NoRaiseMove; /* don't raise window following move */
short NoRaiseResize; /* don't raise window following resize */
short NoRaiseDeicon; /* don't raise window on deiconify */
short NoRaiseWarp; /* don't raise window on warp */
short DontMoveOff; /* don't allow windows to be moved off */
short DoZoom; /* zoom in and out of icons */
short TitleFocus; /* focus on window in title bar ? */
short NoTitlebar; /* put title bars on windows */
short DecorateTransients; /* put title bars on transients */
short IconifyByUnmapping; /* simply unmap windows when iconifying */
short ShowIconManager; /* display the window list */
short IconManagerDontShow; /* show nothing in the icon manager */
short BackingStore; /* use backing store for menus */
short SaveUnder; /* use save under's for menus */
short RandomPlacement; /* randomly place windows that no give hints */
short OpaqueMove; /* move the window rather than outline */
short Highlight; /* should we highlight the window borders */
short StackMode; /* should we honor stack mode requests */
short TitleHighlight; /* should we highlight the titlebar */
short MoveDelta; /* number of pixels before f.move starts */
short ZoomCount; /* zoom outline count */
short SortIconMgr; /* sort entries in the icon manager */
short Shadow; /* show the menu shadow */
short InterpolateMenuColors;/* make pretty menus */
short NoIconManagers; /* Don't create any icon managers */
short ClientBorderWidth; /* respect client window border width */
short SqueezeTitle; /* make title as small as possible */
short HaveFonts; /* set if fonts have been loaded */
short FirstTime; /* first time we've read .twmrc */
short CaseSensitive; /* be case-sensitive when sorting names */
short WarpUnmapped; /* allow warping to unmapped windows */
FuncKey FuncKeyRoot;
} ScreenInfo;
extern int MultiScreen;
extern int NumScreens;
extern ScreenInfo **ScreenList;
extern ScreenInfo *Scr;
extern int FirstScreen;
#define PPOS_OFF 0
#define PPOS_ON 1
#define PPOS_NON_ZERO 2
/* may eventually want an option for having the PPosition be the initial
location for the drag lines */
#endif /* _SCREEN_ */

1007
src/session.c Normal file

File diff suppressed because it is too large Load Diff

36
src/session.h Normal file
View File

@ -0,0 +1,36 @@
/*
* Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the XFree86 Project shall
* not be used in advertising or otherwise to promote the sale, use or other
* dealings in this Software without prior written authorization from the
* XFree86 Project.
*/
#ifndef _SESSION_H
#define _SESSION_H
#include <X11/SM/SMlib.h>
extern void ConnectToSessionManager ( char *previous_id );
extern int GetWindowConfig ( TwmWindow *theWindow, short *x, short *y, unsigned short *width, unsigned short *height, Bool *iconified, Bool *icon_info_present, short *icon_x, short *icon_y, Bool *width_ever_changed_by_user, Bool *height_ever_changed_by_user );
extern void ReadWinConfigFile ( char *filename );
extern SmcConn smcConn;
#endif

5
src/siconify.bm Normal file
View File

@ -0,0 +1,5 @@
#define siconify_width 11
#define siconify_height 11
static unsigned char siconify_bits[] = {
0xff, 0x07, 0x01, 0x04, 0x0d, 0x05, 0x9d, 0x05, 0xb9, 0x04, 0x51, 0x04,
0xe9, 0x04, 0xcd, 0x05, 0x85, 0x05, 0x01, 0x04, 0xff, 0x07};

90
src/system.twmrc Normal file
View File

@ -0,0 +1,90 @@
#
# Default twm configuration file; needs to be kept small to conserve string
# space in systems whose compilers don't handle medium-sized strings.
#
# Sites should tailor this file, providing any extra title buttons, menus, etc.
# that may be appropriate for their environment. For example, if most of the
# users were accustomed to uwm, the defaults could be set up not to decorate
# any windows and to use meta-keys.
#
NoGrabServer
RestartPreviousState
DecorateTransients
TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*"
IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*"
IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*"
#ClientBorderWidth
Color
{
BorderColor "slategrey"
DefaultBackground "rgb:2/a/9"
DefaultForeground "gray85"
TitleBackground "rgb:2/a/9"
TitleForeground "gray85"
MenuBackground "rgb:2/a/9"
MenuForeground "gray85"
MenuBorderColor "slategrey"
MenuTitleBackground "gray70"
MenuTitleForeground "rgb:2/a/9"
IconBackground "rgb:2/a/9"
IconForeground "gray85"
IconBorderColor "gray85"
IconManagerBackground "rgb:2/a/9"
IconManagerForeground "gray85"
}
#
# Define some useful functions for motion-based actions.
#
MoveDelta 3
Function "move-or-lower" { f.move f.deltastop f.lower }
Function "move-or-raise" { f.move f.deltastop f.raise }
Function "move-or-iconify" { f.move f.deltastop f.iconify }
#
# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish
#
Button1 = : root : f.menu "defops"
Button1 = m : window|icon : f.function "move-or-lower"
Button2 = m : window|icon : f.iconify
Button3 = m : window|icon : f.function "move-or-raise"
Button1 = : title : f.function "move-or-raise"
Button2 = : title : f.raiselower
Button1 = : icon : f.function "move-or-iconify"
Button2 = : icon : f.iconify
Button1 = : iconmgr : f.iconify
Button2 = : iconmgr : f.iconify
#
# And a menus with the usual things
#
menu "defops"
{
"Twm" f.title
"Iconify" f.iconify
"Resize" f.resize
"Move" f.move
"Raise" f.raise
"Lower" f.lower
"" f.nop
"Focus" f.focus
"Unfocus" f.unfocus
"Show Iconmgr" f.showiconmgr
"Hide Iconmgr" f.hideiconmgr
"" f.nop
"Xterm" f.exec "exec xterm &"
"" f.nop
"Kill" f.destroy
"Delete" f.delete
"" f.nop
"Restart" f.restart
"Exit" f.quit
}

972
src/twm.c Normal file
View File

@ -0,0 +1,972 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Copyright 2005 Hitachi, Ltd.
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
*
* twm - "Tom's Window Manager"
*
* 27-Oct-1987 Thomas E. LaStrange File created
* 10-Oct-1990 David M. Sternlicht Storing saved colors on root
* 19-Feb-2005 Julien Lafon Handle print screens for unified Xserver
***********************************************************************/
#include <stdio.h>
#include <signal.h>
#include <fcntl.h>
#include "twm.h"
#include "iconmgr.h"
#include "add_window.h"
#include "gc.h"
#include "parse.h"
#include "version.h"
#include "menus.h"
#include "events.h"
#include "util.h"
#include "gram.h"
#include "screen.h"
#include "parse.h"
#include "session.h"
#include <X11/Xproto.h>
#include <X11/Xatom.h>
#include <X11/SM/SMlib.h>
#include <X11/Xmu/Error.h>
#include <X11/extensions/sync.h>
#include <X11/Xlocale.h>
#ifdef XPRINT
#include <X11/extensions/Print.h>
#endif /* XPRINT */
static void InitVariables ( void );
XtAppContext appContext; /* Xt application context */
XtSignalId si;
Display *dpy = NULL; /* which display are we talking to */
Window ResizeWindow; /* the window we are resizing */
int MultiScreen = TRUE; /* try for more than one screen? */
int NoPrintscreens = False; /* ignore special handling of print screens? */
int NumScreens; /* number of screens in ScreenList */
int HasShape; /* server supports shape extension? */
int ShapeEventBase, ShapeErrorBase;
int HasSync; /* server supports SYNC extension? */
int SyncEventBase, SyncErrorBase;
ScreenInfo **ScreenList; /* structures for each screen */
ScreenInfo *Scr = NULL; /* the cur and prev screens */
int PreviousScreen; /* last screen that we were on */
int FirstScreen; /* TRUE ==> first screen of display */
static Bool PrintErrorMessages = False; /* controls error messages */
static int RedirectError; /* TRUE ==> another window manager running */
static int TwmErrorHandler ( Display *dpy, XErrorEvent *event ); /* for settting RedirectError */
static int CatchRedirectError ( Display *dpy, XErrorEvent *event ); /* for everything else */
static void sigHandler(int);
char Info[INFO_LINES][INFO_SIZE]; /* info strings to print */
int InfoLines;
static char *InitFile = NULL;
Cursor UpperLeftCursor; /* upper Left corner cursor */
Cursor RightButt;
Cursor MiddleButt;
Cursor LeftButt;
XContext TwmContext; /* context for twm windows */
XContext MenuContext; /* context for all menu windows */
XContext IconManagerContext; /* context for all window list windows */
XContext ScreenContext; /* context to get screen data */
XContext ColormapContext; /* context for colormap operations */
XClassHint NoClass; /* for applications with no class */
XGCValues Gcv;
const char *Home; /* the HOME environment variable */
int HomeLen; /* length of Home */
int ParseError; /* error parsing the .twmrc file */
int HandlingEvents = FALSE; /* are we handling events yet? */
Window JunkRoot; /* junk window */
Window JunkChild; /* junk window */
int JunkX; /* junk variable */
int JunkY; /* junk variable */
unsigned int JunkWidth, JunkHeight, JunkBW, JunkDepth, JunkMask;
char *ProgramName;
int Argc;
char **Argv;
Bool RestartPreviousState = False; /* try to restart in previous state */
static unsigned long black, white;
Atom TwmAtoms[11];
Bool use_fontset; /* use XFontSet-related functions or not */
/* don't change the order of these strings */
static char* atom_names[11] = {
"_MIT_PRIORITY_COLORS",
"WM_CHANGE_STATE",
"WM_STATE",
"WM_COLORMAP_WINDOWS",
"WM_PROTOCOLS",
"WM_TAKE_FOCUS",
"WM_SAVE_YOURSELF",
"WM_DELETE_WINDOW",
"SM_CLIENT_ID",
"WM_CLIENT_LEADER",
"WM_WINDOW_ROLE"
};
#ifdef XPRINT
/* |hasExtension()| and |IsPrintScreen()| have been stolen from
* xc/programs/xdpyinfo/xdpyinfo.c */
static
Bool hasExtension(Display *dpy, char *extname)
{
int num_extensions,
i;
char **extensions;
extensions = XListExtensions(dpy, &num_extensions);
for (i = 0; i < num_extensions &&
(strcmp(extensions[i], extname) != 0); i++);
XFreeExtensionList(extensions);
return i != num_extensions;
}
static
Bool IsPrintScreen(Screen *s)
{
Display *dpy = XDisplayOfScreen(s);
int i;
/* Check whether this is a screen of a print DDX */
if (hasExtension(dpy, XP_PRINTNAME)) {
Screen **pscreens;
int pscrcount;
pscreens = XpQueryScreens(dpy, &pscrcount);
for( i = 0 ; (i < pscrcount) && pscreens ; i++ ) {
if (s == pscreens[i]) {
return True;
}
}
XFree(pscreens);
}
return False;
}
#endif /* XPRINT */
/***********************************************************************
*
* Procedure:
* main - start of twm
*
***********************************************************************
*/
int
main(int argc, char *argv[])
{
Window root, parent, *children;
unsigned int nchildren;
int i, j;
char *display_name = NULL;
unsigned long valuemask; /* mask for create windows */
XSetWindowAttributes attributes; /* attributes for create windows */
int numManaged, firstscrn, lastscrn, scrnum;
int zero = 0;
char *restore_filename = NULL;
char *client_id = NULL;
char *loc;
ProgramName = argv[0];
Argc = argc;
Argv = argv;
for (i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'd': /* -display dpy */
if (strcmp(&argv[i][1], "display")) goto usage;
if (++i >= argc) goto usage;
display_name = argv[i];
continue;
case 's': /* -single */
MultiScreen = FALSE;
continue;
#ifdef XPRINT
case 'n': /* -noprint */
if (strcmp(&argv[i][1], "noprint")) goto usage;
NoPrintscreens = True;
continue;
#endif /* XPRINT */
case 'f': /* -file twmrcfilename */
if (++i >= argc) goto usage;
InitFile = argv[i];
continue;
case 'v': /* -verbose */
PrintErrorMessages = True;
continue;
case 'c': /* -clientId */
if (strcmp(&argv[i][1], "clientId")) goto usage;
if (++i >= argc) goto usage;
client_id = argv[i];
continue;
case 'r': /* -restore */
if (strcmp(&argv[i][1], "restore")) goto usage;
if (++i >= argc) goto usage;
restore_filename = argv[i];
continue;
case 'q': /* -quiet */
PrintErrorMessages = False;
continue;
}
}
usage:
fprintf (stderr,
"usage: %s [-display dpy] [-f file] [-s] [-q] [-v]"
#ifdef XPRINT
" [-noprint]"
#endif /* XPRINT */
" [-clientId id] [-restore file]\n",
ProgramName);
exit (1);
}
loc = setlocale(LC_ALL, "");
if (!loc || !strcmp(loc, "C") || !strcmp(loc, "POSIX") ||
!XSupportsLocale()) {
use_fontset = False;
} else {
use_fontset = True;
}
#define newhandler(sig) \
if (signal (sig, SIG_IGN) != SIG_IGN) (void) signal (sig, sigHandler)
newhandler (SIGINT);
newhandler (SIGHUP);
newhandler (SIGQUIT);
newhandler (SIGTERM);
#undef newhandler
Home = getenv("HOME");
if (Home != NULL) {
char *temp_p;
/*
* Make a copy of Home because the string returned by getenv() can be
* overwritten by some POSIX.1 and ANSI-C implementations of getenv()
* when further calls to getenv() are made
*/
temp_p = strdup(Home);
Home = temp_p;
}
if (Home == NULL)
Home = "./";
HomeLen = strlen(Home);
NoClass.res_name = NoName;
NoClass.res_class = NoName;
XtToolkitInitialize ();
appContext = XtCreateApplicationContext ();
si = XtAppAddSignal(appContext, Done, NULL);
if (!(dpy = XtOpenDisplay (appContext, display_name, "twm", "twm",
NULL, 0, &zero, NULL))) {
fprintf (stderr, "%s: unable to open display \"%s\"\n",
ProgramName, XDisplayName(display_name));
exit (1);
}
if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) {
fprintf (stderr,
"%s: unable to mark display connection as close-on-exec\n",
ProgramName);
exit (1);
}
if (restore_filename)
ReadWinConfigFile (restore_filename);
HasShape = XShapeQueryExtension (dpy, &ShapeEventBase, &ShapeErrorBase);
HasSync = XSyncQueryExtension(dpy, &SyncEventBase, &SyncErrorBase);
TwmContext = XUniqueContext();
MenuContext = XUniqueContext();
IconManagerContext = XUniqueContext();
ScreenContext = XUniqueContext();
ColormapContext = XUniqueContext();
(void) XInternAtoms(dpy, atom_names, sizeof TwmAtoms / sizeof TwmAtoms[0],
False, TwmAtoms);
/* Set up the per-screen global information. */
NumScreens = ScreenCount(dpy);
if (MultiScreen)
{
firstscrn = 0;
lastscrn = NumScreens - 1;
}
else
{
firstscrn = lastscrn = DefaultScreen(dpy);
}
InfoLines = 0;
/* for simplicity, always allocate NumScreens ScreenInfo struct pointers */
ScreenList = calloc (NumScreens, sizeof (ScreenInfo *));
if (ScreenList == NULL)
{
fprintf (stderr, "%s: Unable to allocate memory for screen list, exiting.\n",
ProgramName);
exit (1);
}
numManaged = 0;
PreviousScreen = DefaultScreen(dpy);
FirstScreen = TRUE;
for (scrnum = firstscrn ; scrnum <= lastscrn; scrnum++)
{
#ifdef XPRINT
/* Ignore print screens to avoid that users accidentally warp on a
* print screen (which are not visible on video displays) */
if ((!NoPrintscreens) && IsPrintScreen(XScreenOfDisplay(dpy, scrnum)))
{
fprintf (stderr, "%s: skipping print screen %d\n",
ProgramName, scrnum);
continue;
}
#endif /* XPRINT */
/* Make sure property priority colors is empty */
XChangeProperty (dpy, RootWindow(dpy, scrnum), _XA_MIT_PRIORITY_COLORS,
XA_CARDINAL, 32, PropModeReplace, NULL, 0);
RedirectError = FALSE;
XSetErrorHandler(CatchRedirectError);
XSelectInput(dpy, RootWindow (dpy, scrnum),
ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask |
ButtonPressMask | ButtonReleaseMask);
XSync(dpy, 0);
XSetErrorHandler(TwmErrorHandler);
if (RedirectError)
{
fprintf (stderr, "%s: another window manager is already running.",
ProgramName);
if (MultiScreen && NumScreens > 0)
fprintf(stderr, " on screen %d?\n", scrnum);
else
fprintf(stderr, "?\n");
continue;
}
numManaged ++;
/* Note: ScreenInfo struct is calloc'ed to initialize to zero. */
Scr = ScreenList[scrnum] = calloc(1, sizeof(ScreenInfo));
if (Scr == NULL)
{
fprintf (stderr, "%s: unable to allocate memory for ScreenInfo structure for screen %d.\n",
ProgramName, scrnum);
continue;
}
/* initialize list pointers, remember to put an initialization
* in InitVariables also
*/
Scr->BorderColorL = NULL;
Scr->IconBorderColorL = NULL;
Scr->BorderTileForegroundL = NULL;
Scr->BorderTileBackgroundL = NULL;
Scr->TitleForegroundL = NULL;
Scr->TitleBackgroundL = NULL;
Scr->IconForegroundL = NULL;
Scr->IconBackgroundL = NULL;
Scr->NoTitle = NULL;
Scr->MakeTitle = NULL;
Scr->AutoRaise = NULL;
Scr->IconNames = NULL;
Scr->NoHighlight = NULL;
Scr->NoStackModeL = NULL;
Scr->NoTitleHighlight = NULL;
Scr->DontIconify = NULL;
Scr->IconMgrNoShow = NULL;
Scr->IconMgrShow = NULL;
Scr->IconifyByUn = NULL;
Scr->IconManagerFL = NULL;
Scr->IconManagerBL = NULL;
Scr->IconMgrs = NULL;
Scr->StartIconified = NULL;
Scr->SqueezeTitleL = NULL;
Scr->DontSqueezeTitleL = NULL;
Scr->WindowRingL = NULL;
Scr->WarpCursorL = NULL;
/* remember to put an initialization in InitVariables also
*/
Scr->screen = scrnum;
Scr->d_depth = DefaultDepth(dpy, scrnum);
Scr->d_visual = DefaultVisual(dpy, scrnum);
Scr->Root = RootWindow(dpy, scrnum);
XSaveContext (dpy, Scr->Root, ScreenContext, (caddr_t) Scr);
Scr->TwmRoot.cmaps.number_cwins = 1;
Scr->TwmRoot.cmaps.cwins = malloc(sizeof(ColormapWindow *));
Scr->TwmRoot.cmaps.cwins[0] =
CreateColormapWindow(Scr->Root, True, False);
Scr->TwmRoot.cmaps.cwins[0]->visibility = VisibilityPartiallyObscured;
Scr->cmapInfo.cmaps = NULL;
Scr->cmapInfo.maxCmaps =
MaxCmapsOfScreen(ScreenOfDisplay(dpy, Scr->screen));
Scr->cmapInfo.root_pushes = 0;
InstallWindowColormaps(0, &Scr->TwmRoot);
Scr->StdCmapInfo.head = Scr->StdCmapInfo.tail =
Scr->StdCmapInfo.mru = NULL;
Scr->StdCmapInfo.mruindex = 0;
LocateStandardColormaps();
Scr->TBInfo.nleft = Scr->TBInfo.nright = 0;
Scr->TBInfo.head = NULL;
Scr->TBInfo.border = 1;
Scr->TBInfo.width = 0;
Scr->TBInfo.leftx = 0;
Scr->TBInfo.titlex = 0;
Scr->MyDisplayWidth = DisplayWidth(dpy, scrnum);
Scr->MyDisplayHeight = DisplayHeight(dpy, scrnum);
Scr->MaxWindowWidth = 32767 - Scr->MyDisplayWidth;
Scr->MaxWindowHeight = 32767 - Scr->MyDisplayHeight;
Scr->XORvalue = (((unsigned long) 1) << Scr->d_depth) - 1;
if (DisplayCells(dpy, scrnum) < 3)
Scr->Monochrome = MONOCHROME;
else if (DefaultVisual(dpy, scrnum)->class == GrayScale)
Scr->Monochrome = GRAYSCALE;
else
Scr->Monochrome = COLOR;
/* setup default colors */
Scr->FirstTime = TRUE;
GetColor(Scr->Monochrome, &black, "black");
Scr->Black = black;
GetColor(Scr->Monochrome, &white, "white");
Scr->White = white;
if (FirstScreen)
{
SetFocus ((TwmWindow *)NULL, CurrentTime);
/* define cursors */
NewFontCursor(&UpperLeftCursor, "top_left_corner");
NewFontCursor(&RightButt, "rightbutton");
NewFontCursor(&LeftButt, "leftbutton");
NewFontCursor(&MiddleButt, "middlebutton");
}
Scr->iconmgr.x = 0;
Scr->iconmgr.y = 0;
Scr->iconmgr.width = 150;
Scr->iconmgr.height = 5;
Scr->iconmgr.next = NULL;
Scr->iconmgr.prev = NULL;
Scr->iconmgr.lasti = &(Scr->iconmgr);
Scr->iconmgr.first = NULL;
Scr->iconmgr.last = NULL;
Scr->iconmgr.active = NULL;
Scr->iconmgr.scr = Scr;
Scr->iconmgr.columns = 1;
Scr->iconmgr.count = 0;
Scr->iconmgr.name = "TWM";
Scr->iconmgr.icon_name = "Icons";
Scr->IconDirectory = NULL;
Scr->siconifyPm = None;
Scr->pullPm = None;
Scr->hilitePm = None;
Scr->tbpm.xlogo = None;
Scr->tbpm.resize = None;
Scr->tbpm.question = None;
Scr->tbpm.menu = None;
Scr->tbpm.delete = None;
InitVariables();
InitMenus();
/* Parse it once for each screen. */
ParseTwmrc(InitFile);
assign_var_savecolor(); /* storeing pixels for twmrc "entities" */
if (Scr->SqueezeTitle == -1) Scr->SqueezeTitle = FALSE;
if (!Scr->HaveFonts) CreateFonts();
CreateGCs();
MakeMenus();
Scr->TitleBarFont.y += Scr->FramePadding;
Scr->TitleHeight = Scr->TitleBarFont.height + Scr->FramePadding * 2;
/* make title height be odd so buttons look nice and centered */
if (!(Scr->TitleHeight & 1)) Scr->TitleHeight++;
InitTitlebarButtons (); /* menus are now loaded! */
XGrabServer(dpy);
XSync(dpy, 0);
JunkX = 0;
JunkY = 0;
XQueryTree(dpy, Scr->Root, &root, &parent, &children, &nchildren);
CreateIconManagers();
if (!Scr->NoIconManagers)
Scr->iconmgr.twm_win->icon = TRUE;
/*
* weed out icon windows
*/
for (i = 0; i < nchildren; i++) {
if (children[i]) {
XWMHints *wmhintsp = XGetWMHints (dpy, children[i]);
if (wmhintsp) {
if (wmhintsp->flags & IconWindowHint) {
for (j = 0; j < nchildren; j++) {
if (children[j] == wmhintsp->icon_window) {
children[j] = None;
break;
}
}
}
XFree (wmhintsp);
}
}
}
/*
* map all of the non-override windows
*/
for (i = 0; i < nchildren; i++)
{
if (children[i] && MappedNotOverride(children[i]))
{
XUnmapWindow(dpy, children[i]);
SimulateMapRequest(children[i]);
}
}
if (Scr->ShowIconManager && !Scr->NoIconManagers)
{
Scr->iconmgr.twm_win->icon = FALSE;
if (Scr->iconmgr.count)
{
SetMapStateProp (Scr->iconmgr.twm_win, NormalState);
XMapWindow(dpy, Scr->iconmgr.w);
XMapWindow(dpy, Scr->iconmgr.twm_win->frame);
}
}
attributes.border_pixel = Scr->DefaultC.fore;
attributes.background_pixel = Scr->DefaultC.back;
attributes.event_mask = (ExposureMask | ButtonPressMask |
KeyPressMask | ButtonReleaseMask);
attributes.backing_store = NotUseful;
attributes.cursor = XCreateFontCursor (dpy, XC_hand2);
valuemask = (CWBorderPixel | CWBackPixel | CWEventMask |
CWBackingStore | CWCursor);
Scr->InfoWindow = XCreateWindow (dpy, Scr->Root, 0, 0,
(unsigned int) 5, (unsigned int) 5,
(unsigned int) BW, 0,
(unsigned int) CopyFromParent,
(Visual *) CopyFromParent,
valuemask, &attributes);
Scr->SizeStringWidth = MyFont_TextWidth (&Scr->SizeFont,
" 8888 x 8888 ", 13);
valuemask = (CWBorderPixel | CWBackPixel | CWBitGravity);
attributes.bit_gravity = NorthWestGravity;
Scr->SizeWindow = XCreateWindow (dpy, Scr->Root, 0, 0,
(unsigned int) Scr->SizeStringWidth,
(unsigned int) (Scr->SizeFont.height +
SIZE_VINDENT*2),
(unsigned int) BW, 0,
(unsigned int) CopyFromParent,
(Visual *) CopyFromParent,
valuemask, &attributes);
XUngrabServer(dpy);
FirstScreen = FALSE;
Scr->FirstTime = FALSE;
} /* for */
if (numManaged == 0) {
if (MultiScreen && NumScreens > 0)
fprintf (stderr, "%s: unable to find any unmanaged %sscreens.\n",
ProgramName, NoPrintscreens?"":"video ");
exit (1);
}
(void) ConnectToSessionManager (client_id);
RestartPreviousState = False;
HandlingEvents = TRUE;
InitEvents();
HandleEvents();
exit(0);
}
/**
* initialize twm variables
*/
static void
InitVariables(void)
{
FreeList(&Scr->BorderColorL);
FreeList(&Scr->IconBorderColorL);
FreeList(&Scr->BorderTileForegroundL);
FreeList(&Scr->BorderTileBackgroundL);
FreeList(&Scr->TitleForegroundL);
FreeList(&Scr->TitleBackgroundL);
FreeList(&Scr->IconForegroundL);
FreeList(&Scr->IconBackgroundL);
FreeList(&Scr->IconManagerFL);
FreeList(&Scr->IconManagerBL);
FreeList(&Scr->IconMgrs);
FreeList(&Scr->NoTitle);
FreeList(&Scr->MakeTitle);
FreeList(&Scr->AutoRaise);
FreeList(&Scr->IconNames);
FreeList(&Scr->NoHighlight);
FreeList(&Scr->NoStackModeL);
FreeList(&Scr->NoTitleHighlight);
FreeList(&Scr->DontIconify);
FreeList(&Scr->IconMgrNoShow);
FreeList(&Scr->IconMgrShow);
FreeList(&Scr->IconifyByUn);
FreeList(&Scr->StartIconified);
FreeList(&Scr->IconManagerHighlightL);
FreeList(&Scr->SqueezeTitleL);
FreeList(&Scr->DontSqueezeTitleL);
FreeList(&Scr->WindowRingL);
FreeList(&Scr->WarpCursorL);
NewFontCursor(&Scr->FrameCursor, "top_left_arrow");
NewFontCursor(&Scr->TitleCursor, "top_left_arrow");
NewFontCursor(&Scr->IconCursor, "top_left_arrow");
NewFontCursor(&Scr->IconMgrCursor, "top_left_arrow");
NewFontCursor(&Scr->MoveCursor, "fleur");
NewFontCursor(&Scr->ResizeCursor, "fleur");
NewFontCursor(&Scr->MenuCursor, "sb_left_arrow");
NewFontCursor(&Scr->ButtonCursor, "hand2");
NewFontCursor(&Scr->WaitCursor, "watch");
NewFontCursor(&Scr->SelectCursor, "dot");
NewFontCursor(&Scr->DestroyCursor, "pirate");
Scr->Ring = NULL;
Scr->RingLeader = NULL;
Scr->DefaultC.fore = black;
Scr->DefaultC.back = white;
Scr->BorderColor = black;
Scr->BorderTileC.fore = black;
Scr->BorderTileC.back = white;
Scr->TitleC.fore = black;
Scr->TitleC.back = white;
Scr->MenuC.fore = black;
Scr->MenuC.back = white;
Scr->MenuTitleC.fore = black;
Scr->MenuTitleC.back = white;
Scr->MenuShadowColor = black;
Scr->MenuBorderColor = black;
Scr->IconC.fore = black;
Scr->IconC.back = white;
Scr->IconBorderColor = black;
Scr->PointerForeground.pixel = black;
XQueryColor(dpy, Scr->TwmRoot.cmaps.cwins[0]->colormap->c,
&Scr->PointerForeground);
Scr->PointerBackground.pixel = white;
XQueryColor(dpy, Scr->TwmRoot.cmaps.cwins[0]->colormap->c,
&Scr->PointerBackground);
Scr->IconManagerC.fore = black;
Scr->IconManagerC.back = white;
Scr->IconManagerHighlight = black;
Scr->FramePadding = 2; /* values that look "nice" on */
Scr->TitlePadding = 8; /* 75 and 100dpi displays */
Scr->ButtonIndent = 1;
Scr->SizeStringOffset = 0;
Scr->BorderWidth = BW;
Scr->IconBorderWidth = BW;
Scr->MenuBorderWidth = BW;
Scr->UnknownWidth = 0;
Scr->UnknownHeight = 0;
Scr->NumAutoRaises = 0;
Scr->NoDefaults = FALSE;
Scr->UsePPosition = PPOS_OFF;
Scr->FocusRoot = TRUE;
Scr->Focus = NULL;
Scr->WarpCursor = FALSE;
Scr->ForceIcon = FALSE;
Scr->NoGrabServer = FALSE;
Scr->NoRaiseMove = FALSE;
Scr->NoRaiseResize = FALSE;
Scr->NoRaiseDeicon = FALSE;
Scr->NoRaiseWarp = FALSE;
Scr->DontMoveOff = FALSE;
Scr->DoZoom = FALSE;
Scr->TitleFocus = TRUE;
Scr->NoTitlebar = FALSE;
Scr->DecorateTransients = FALSE;
Scr->IconifyByUnmapping = FALSE;
Scr->ShowIconManager = FALSE;
Scr->IconManagerDontShow =FALSE;
Scr->BackingStore = TRUE;
Scr->SaveUnder = TRUE;
Scr->RandomPlacement = FALSE;
Scr->OpaqueMove = FALSE;
Scr->Highlight = TRUE;
Scr->StackMode = TRUE;
Scr->TitleHighlight = TRUE;
Scr->MoveDelta = 1; /* so that f.deltastop will work */
Scr->ZoomCount = 8;
Scr->SortIconMgr = FALSE;
Scr->Shadow = TRUE;
Scr->InterpolateMenuColors = FALSE;
Scr->NoIconManagers = FALSE;
Scr->ClientBorderWidth = FALSE;
Scr->SqueezeTitle = -1;
Scr->FirstRegion = NULL;
Scr->LastRegion = NULL;
Scr->FirstTime = TRUE;
Scr->HaveFonts = FALSE; /* i.e. not loaded yet */
Scr->CaseSensitive = TRUE;
Scr->WarpUnmapped = FALSE;
/* setup default fonts; overridden by defaults from system.twmrc */
#define DEFAULT_NICE_FONT "variable"
#define DEFAULT_FAST_FONT "fixed"
Scr->TitleBarFont.font = NULL;
Scr->TitleBarFont.fontset = NULL;
Scr->TitleBarFont.name = DEFAULT_NICE_FONT;
Scr->MenuFont.font = NULL;
Scr->MenuFont.fontset = NULL;
Scr->MenuFont.name = DEFAULT_NICE_FONT;
Scr->IconFont.font = NULL;
Scr->IconFont.fontset = NULL;
Scr->IconFont.name = DEFAULT_NICE_FONT;
Scr->SizeFont.font = NULL;
Scr->SizeFont.fontset = NULL;
Scr->SizeFont.name = DEFAULT_FAST_FONT;
Scr->IconManagerFont.font = NULL;
Scr->IconManagerFont.fontset = NULL;
Scr->IconManagerFont.name = DEFAULT_NICE_FONT;
Scr->DefaultFont.font = NULL;
Scr->DefaultFont.fontset = NULL;
Scr->DefaultFont.name = DEFAULT_FAST_FONT;
}
void
CreateFonts (void)
{
GetFont(&Scr->TitleBarFont);
GetFont(&Scr->MenuFont);
GetFont(&Scr->IconFont);
GetFont(&Scr->SizeFont);
GetFont(&Scr->IconManagerFont);
GetFont(&Scr->DefaultFont);
Scr->HaveFonts = TRUE;
}
void
RestoreWithdrawnLocation (TwmWindow *tmp)
{
int gravx, gravy;
unsigned int bw, mask;
XWindowChanges xwc;
if (XGetGeometry (dpy, tmp->w, &JunkRoot, &xwc.x, &xwc.y,
&JunkWidth, &JunkHeight, &bw, &JunkDepth)) {
GetGravityOffsets (tmp, &gravx, &gravy);
if (gravy < 0) xwc.y -= tmp->title_height;
if (bw != tmp->old_bw) {
int xoff, yoff;
if (!Scr->ClientBorderWidth) {
xoff = gravx;
yoff = gravy;
} else {
xoff = 0;
yoff = 0;
}
xwc.x -= (xoff + 1) * tmp->old_bw;
xwc.y -= (yoff + 1) * tmp->old_bw;
}
if (!Scr->ClientBorderWidth) {
xwc.x += gravx * tmp->frame_bw;
xwc.y += gravy * tmp->frame_bw;
}
mask = (CWX | CWY);
if (bw != tmp->old_bw) {
xwc.border_width = tmp->old_bw;
mask |= CWBorderWidth;
}
XConfigureWindow (dpy, tmp->w, mask, &xwc);
if (tmp->wmhints && (tmp->wmhints->flags & IconWindowHint)) {
XUnmapWindow (dpy, tmp->wmhints->icon_window);
}
}
}
void
Reborder (Time time)
{
TwmWindow *tmp; /* temp twm window structure */
int scrnum;
/* put a border back around all windows */
XGrabServer (dpy);
for (scrnum = 0; scrnum < NumScreens; scrnum++)
{
if ((Scr = ScreenList[scrnum]) == NULL)
continue;
InstallWindowColormaps (0, &Scr->TwmRoot); /* force reinstall */
for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next)
{
RestoreWithdrawnLocation (tmp);
XMapWindow (dpy, tmp->w);
}
}
XUngrabServer (dpy);
SetFocus ((TwmWindow*)NULL, time);
}
static void
sigHandler(int sig)
{
XtNoticeSignal(si);
}
/**
* cleanup and exit twm
*/
void
Done(XtPointer client_data, XtSignalId *si)
{
if (dpy)
{
Reborder(CurrentTime);
XCloseDisplay(dpy);
}
exit(0);
}
/*
* Error Handlers. If a client dies, we'll get a BadWindow error (except for
* GetGeometry which returns BadDrawable) for most operations that we do before
* manipulating the client's window.
*/
Bool ErrorOccurred = False;
XErrorEvent LastErrorEvent;
static int
TwmErrorHandler(Display *dpy, XErrorEvent *event)
{
LastErrorEvent = *event;
ErrorOccurred = True;
if (PrintErrorMessages && /* don't be too obnoxious */
event->error_code != BadWindow && /* watch for dead puppies */
(event->request_code != X_GetGeometry && /* of all styles */
event->error_code != BadDrawable))
XmuPrintDefaultErrorMessage (dpy, event, stderr);
return 0;
}
static int
CatchRedirectError(Display *dpy, XErrorEvent *event)
{
RedirectError = TRUE;
LastErrorEvent = *event;
ErrorOccurred = True;
return 0;
}

425
src/twm.h Normal file
View File

@ -0,0 +1,425 @@
/*****************************************************************************/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** names of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND AND DISCLAIMS ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES **/
/** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/*
Portions Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from The Open Group.
*/
/***********************************************************************
*
* twm include file
*
* 28-Oct-87 Thomas E. LaStrange File created
* 10-Oct-90 David M. Sternlicht Storeing saved colors on root
***********************************************************************/
#ifndef _TWM_
#define _TWM_
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/extensions/shape.h>
#include <X11/Xfuncs.h>
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
#ifndef WithdrawnState
#define WithdrawnState 0
#endif
#define PIXEL_ALREADY_TYPEDEFED /* for Xmu/Drawing.h */
typedef void (*SigProc)(int); /* type of function returned by signal() */
#define BW 2 /* border width */
#define BW2 4 /* border width * 2 */
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define NULLSTR ((char *) NULL)
#define MAX_BUTTONS 16 /* max mouse buttons supported */
/* info stings defines */
#define INFO_LINES 30
#define INFO_SIZE 200
/* contexts for button presses */
#define C_NO_CONTEXT -1
#define C_WINDOW 0
#define C_TITLE 1
#define C_ICON 2
#define C_ROOT 3
#define C_FRAME 4
#define C_ICONMGR 5
#define C_NAME 6
#define C_IDENTIFY 7
#define NUM_CONTEXTS 8
#define C_WINDOW_BIT (1 << C_WINDOW)
#define C_TITLE_BIT (1 << C_TITLE)
#define C_ICON_BIT (1 << C_ICON)
#define C_ROOT_BIT (1 << C_ROOT)
#define C_FRAME_BIT (1 << C_FRAME)
#define C_ICONMGR_BIT (1 << C_ICONMGR)
#define C_NAME_BIT (1 << C_NAME)
#define C_ALL_BITS (C_WINDOW_BIT | C_TITLE_BIT | C_ICON_BIT |\
C_ROOT_BIT | C_FRAME_BIT | C_ICONMGR_BIT)
/* modifiers for button presses */
#define MOD_SIZE ((ShiftMask | ControlMask | Mod1Mask \
| Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask) + 1)
#define TITLE_BAR_SPACE 1 /* 2 pixel space bordering chars */
#define TITLE_BAR_FONT_HEIGHT 15 /* max of 15 pixel high chars */
#define TITLE_BAR_HEIGHT (TITLE_BAR_FONT_HEIGHT+(2*TITLE_BAR_SPACE))
/* defines for zooming/unzooming */
#define ZOOM_NONE 0
#define FB(fix_fore, fix_back)\
Gcv.foreground = fix_fore;\
Gcv.background = fix_back;\
XChangeGC(dpy, Scr->NormalGC, GCForeground|GCBackground,&Gcv)
typedef struct MyFont
{
const char *name; /* name of the font */
XFontStruct *font; /* font structure */
XFontSet fontset; /* fontset structure */
int height; /* height of the font */
int y; /* Y coordinate to draw characters */
int ascent;
int descent;
} MyFont;
typedef struct ColorPair
{
Pixel fore, back;
} ColorPair;
typedef struct _TitleButton {
struct _TitleButton *next; /* next link in chain */
const char *name; /* bitmap name in case of deferal */
Pixmap bitmap; /* image to display in button */
int srcx, srcy; /* from where to start copying */
unsigned int width, height; /* size of pixmap */
int dstx, dsty; /* to where to start copying */
int func; /* function to execute */
const char *action; /* optional action arg */
struct MenuRoot *menuroot; /* menu to pop on F_MENU */
Bool rightside; /* t: on right, f: on left */
} TitleButton;
typedef struct _TBWindow {
Window window; /* which window in this frame */
TitleButton *info; /* description of this window */
} TBWindow;
typedef struct _SqueezeInfo {
int justify; /* left, center, right */
int num; /* signed pixel count or numerator */
int denom; /* 0 for pix count or denominator */
} SqueezeInfo;
#define J_LEFT 1
#define J_CENTER 2
#define J_RIGHT 3
/* Colormap window entry for each window in WM_COLORMAP_WINDOWS
* ICCCM property.
*/
typedef struct TwmColormap
{
Colormap c; /* Colormap id */
int state; /* install(ability) state */
unsigned long install_req; /* request number which installed it */
Window w; /* window causing load of color table */
int refcnt;
} TwmColormap;
#define CM_INSTALLABLE 1
#define CM_INSTALLED 2
#define CM_INSTALL 4
typedef struct ColormapWindow
{
Window w; /* Window id */
TwmColormap *colormap; /* Colormap for this window */
int visibility; /* Visibility of this window */
int refcnt;
} ColormapWindow;
typedef struct Colormaps
{
ColormapWindow **cwins; /* current list of colormap windows */
int number_cwins; /* number of elements in current list */
char *scoreboard; /* conflicts between installable colortables */
} Colormaps;
#define ColormapsScoreboardLength(cm) ((cm)->number_cwins * \
((cm)->number_cwins - 1) / 2)
/* for each window that is on the display, one of these structures
* is allocated and linked into a list
*/
typedef struct TwmWindow
{
struct TwmWindow *next; /* next twm window */
struct TwmWindow *prev; /* previous twm window */
Window w; /* the child window */
int old_bw; /* border width before reparenting */
Window frame; /* the frame window */
Window title_w; /* the title bar window */
Window hilite_w; /* the hilite window */
Pixmap gray;
Window icon_w; /* the icon window */
Window icon_bm_w; /* the icon bitmap window */
int frame_x; /* x position of frame */
int frame_y; /* y position of frame */
int frame_width; /* width of frame */
int frame_height; /* height of frame */
int frame_bw; /* borderwidth of frame */
int title_x;
int title_y;
int icon_x; /* icon text x coordinate */
int icon_y; /* icon text y coordiante */
int icon_w_width; /* width of the icon window */
int icon_w_height; /* height of the icon window */
int icon_width; /* width of the icon bitmap */
int icon_height; /* height of the icon bitmap */
int title_height; /* height of the title bar */
int title_width; /* width of the title bar */
char *full_name; /* full name of the window */
char *name; /* name of the window */
char *icon_name; /* name of the icon */
int name_width; /* width of name text */
int highlightx; /* start of highlight window */
int rightx; /* start of right buttons */
XWindowAttributes attr; /* the child window attributes */
XSizeHints hints; /* normal hints */
XWMHints *wmhints; /* WM hints */
Window group; /* group ID */
XClassHint class;
struct WList *list;
/***********************************************************************
* color definitions per window
**********************************************************************/
Pixel border; /* border color */
Pixel icon_border; /* border color */
ColorPair border_tile;
ColorPair title;
ColorPair iconc;
short iconified; /* has the window ever been iconified? */
short icon; /* is the window an icon now ? */
short icon_on; /* is the icon visible */
short mapped; /* is the window mapped ? */
short auto_raise; /* should we auto-raise this window ? */
short forced; /* has had an icon forced upon it */
short icon_not_ours; /* icon pixmap or window supplied to us */
short icon_moved; /* user explicitly moved the icon */
short highlight; /* should highlight this window */
short stackmode; /* honor stackmode requests */
short iconify_by_unmapping; /* unmap window to iconify it */
short iconmgr; /* this is an icon manager window */
short transient; /* this is a transient window */
Window transientfor; /* window contained in XA_XM_TRANSIENT_FOR */
short titlehighlight; /* should I highlight the title bar */
struct IconMgr *iconmgrp; /* pointer to it if this is an icon manager */
int save_frame_x; /* x position of frame */
int save_frame_y; /* y position of frame */
int save_frame_width; /* width of frame */
int save_frame_height; /* height of frame */
short zoomed; /* is the window zoomed? */
short wShaped; /* this window has a bounding shape */
unsigned long protocols; /* which protocols this window handles */
Colormaps cmaps; /* colormaps for this application */
TBWindow *titlebuttons;
SqueezeInfo *squeeze_info; /* should the title be squeezed? */
struct {
struct TwmWindow *next, *prev;
Bool cursor_valid;
int curs_x, curs_y;
} ring;
Bool nameChanged; /* did WM_NAME ever change? */
/* did the user ever change the width/height? {yes, no, or unknown} */
Bool widthEverChangedByUser;
Bool heightEverChangedByUser;
} TwmWindow;
typedef struct TWMWinConfigEntry
{
struct TWMWinConfigEntry *next;
int tag;
char *client_id;
char *window_role;
XClassHint class;
char *wm_name;
int wm_command_count;
char **wm_command;
short x, y;
unsigned short width, height;
short icon_x, icon_y;
Bool iconified;
Bool icon_info_present;
Bool width_ever_changed_by_user;
Bool height_ever_changed_by_user;
} TWMWinConfigEntry;
#define DoesWmTakeFocus (1L << 0)
#define DoesWmSaveYourself (1L << 1)
#define DoesWmDeleteWindow (1L << 2)
#define TBPM_DOT ":dot" /* name of titlebar pixmap for dot */
#define TBPM_ICONIFY ":iconify" /* same image as dot */
#define TBPM_RESIZE ":resize" /* name of titlebar pixmap for resize button */
#define TBPM_XLOGO ":xlogo" /* name of titlebar pixmap for xlogo */
#define TBPM_DELETE ":delete" /* same image as xlogo */
#define TBPM_MENU ":menu" /* name of titlebar pixmap for menus */
#define TBPM_QUESTION ":question" /* name of unknown titlebar pixmap */
#include <X11/Xosdefs.h>
#include <stdlib.h>
extern void CreateFonts ( void );
extern void RestoreWithdrawnLocation ( TwmWindow *tmp );
extern void Reborder( Time time);
extern void Done( XtPointer, XtSignalId * ) _X_NORETURN;
extern void ComputeCommonTitleOffsets ( void );
extern void ComputeTitleLocation ( TwmWindow *tmp );
extern void ComputeWindowTitleOffsets ( TwmWindow *tmp_win, int width, Bool squeeze );
extern char *ProgramName;
extern Display *dpy;
extern XtAppContext appContext;
extern Window ResizeWindow; /* the window we are resizing */
extern int HasShape; /* this server supports Shape extension */
extern int HasSync; /* this server supports SYNC extension */
extern int PreviousScreen;
extern Cursor UpperLeftCursor;
extern Cursor RightButt;
extern Cursor MiddleButt;
extern Cursor LeftButt;
extern XClassHint NoClass;
extern XContext TwmContext;
extern XContext MenuContext;
extern XContext IconManagerContext;
extern XContext ScreenContext;
extern XContext ColormapContext;
extern const char *Home;
extern int HomeLen;
extern int ParseError;
extern int HandlingEvents;
extern Window JunkRoot;
extern Window JunkChild;
extern int JunkX;
extern int JunkY;
extern unsigned int JunkWidth, JunkHeight, JunkBW, JunkDepth, JunkMask;
extern XGCValues Gcv;
extern int InfoLines;
extern char Info[][INFO_SIZE];
extern int Argc;
extern char **Argv;
extern void NewFontCursor ( Cursor *cp, const char *str );
extern void NewBitmapCursor ( Cursor *cp, char *source, char *mask );
extern Pixmap CreateMenuIcon ( int height, unsigned int *widthp, unsigned int *heightp );
extern Bool ErrorOccurred;
extern XErrorEvent LastErrorEvent;
#define ResetError() (ErrorOccurred = False)
extern Bool RestartPreviousState;
extern Bool GetWMState ( Window w, int *statep, Window *iwp );
extern void twmrc_error_prefix ( void );
extern int yyparse ( void );
extern int yylex ( void );
extern Atom TwmAtoms[];
extern Bool use_fontset;
extern int ShapeEventBase;
extern int ShapeErrorBase;
#define _XA_MIT_PRIORITY_COLORS TwmAtoms[0]
#define _XA_WM_CHANGE_STATE TwmAtoms[1]
#define _XA_WM_STATE TwmAtoms[2]
#define _XA_WM_COLORMAP_WINDOWS TwmAtoms[3]
#define _XA_WM_PROTOCOLS TwmAtoms[4]
#define _XA_WM_TAKE_FOCUS TwmAtoms[5]
#define _XA_WM_SAVE_YOURSELF TwmAtoms[6]
#define _XA_WM_DELETE_WINDOW TwmAtoms[7]
#define _XA_SM_CLIENT_ID TwmAtoms[8]
#define _XA_WM_CLIENT_LEADER TwmAtoms[9]
#define _XA_WM_WINDOW_ROLE TwmAtoms[10]
#endif /* _TWM_ */

1002
src/util.c Normal file

File diff suppressed because it is too large Load Diff

112
src/util.h Normal file
View File

@ -0,0 +1,112 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/***********************************************************************
*
* utility routines header file
*
* 28-Oct-87 Thomas E. LaStrange File created
*
***********************************************************************/
#ifndef _UTIL_
#define _UTIL_
extern void MoveOutline ( Window root, int x, int y, int width, int height,
int bw, int th );
extern void Zoom ( Window wf, Window wt );
extern char * ExpandFilename ( char *name );
extern void GetUnknownIcon ( const char *name );
extern Pixmap FindBitmap ( const char *name, unsigned int *widthp,
unsigned int *heightp );
extern Pixmap GetBitmap ( const char *name );
extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps,
Bool replace );
extern void RemoveRGBColormap ( Atom a );
extern void LocateStandardColormaps ( void );
extern void GetColor ( int kind, Pixel *what, const char *name );
extern void GetColorValue ( int kind, XColor *what, const char *name );
extern void GetFont ( MyFont *font );
extern int MyFont_TextWidth( MyFont *font, const char *string, int len);
extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font,
GC gc, int x, int y, const char * string,
int len);
extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc,
int x, int y, const char * string, int len);
extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back,
MyFont *fix_font);
extern Status I18N_FetchName( Display *dpy, Window win, char **winname);
extern Status I18N_GetIconName( Display *dpy, Window win, char **iconname);
extern void SetFocus ( TwmWindow *tmp_win, Time time );
extern void Bell ( int type, int percent, Window win );
extern int HotX, HotY;
#define WM_BELL 0
#define MINOR_ERROR_BELL 1
#define MAJOR_ERROR_BELL 2
#define INFO_BELL 3
#define NUM_BELLS 4
#define QUIET_BELL -100
#define MODERATE_BELL 0
#define LOUD_BELL 100
#ifdef XKB
#include <X11/extensions/XKBbells.h>
#else
#define XkbBI_Info 0
#define XkbBI_MinorError 1
#define XkbBI_MajorError 2
#endif
#endif /* _UTIL_ */

53
src/version.c Normal file
View File

@ -0,0 +1,53 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
const char *Version = XVENDORNAME", "XORG_RELEASE;

65
src/version.h Normal file
View File

@ -0,0 +1,65 @@
/*****************************************************************************/
/*
Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/
/** Salt Lake City, Utah **/
/** Cambridge, Massachusetts **/
/** **/
/** All Rights Reserved **/
/** **/
/** Permission to use, copy, modify, and distribute this software and **/
/** its documentation for any purpose and without fee is hereby **/
/** granted, provided that the above copyright notice appear in all **/
/** copies and that both that copyright notice and this permis- **/
/** sion notice appear in supporting documentation, and that the **/
/** name of Evans & Sutherland not be used in advertising **/
/** in publicity pertaining to distribution of the software without **/
/** specific, written prior permission. **/
/** **/
/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/
/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/
/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/
/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/
/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/
/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/
/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
/**********************************************************************
*
* TWM version externs
*
* 8-Apr-88 Tom LaStrange Initial Version.
*
**********************************************************************/
#ifndef _VERSION_
#define _VERSION_
extern const char *Version;
#endif /* _VERSION_ */

247
ylwrap Executable file
View File

@ -0,0 +1,247 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
scriptversion=2013-01-12.17; # UTC
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# Written by Tom Tromey <tromey@cygnus.com>.
#
# 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, 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, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
get_dirname ()
{
case $1 in
*/*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
# Otherwise, we want the empty string (not ".").
esac
}
# guard FILE
# ----------
# The CPP macro used to guard inclusion of FILE.
guard ()
{
printf '%s\n' "$1" \
| sed \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
-e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
-e 's/__*/_/g'
}
# quote_for_sed [STRING]
# ----------------------
# Return STRING (or stdin) quoted to be used as a sed pattern.
quote_for_sed ()
{
case $# in
0) cat;;
1) printf '%s\n' "$1";;
esac \
| sed -e 's|[][\\.*]|\\&|g'
}
case "$1" in
'')
echo "$0: No files given. Try '$0 --help' for more information." 1>&2
exit 1
;;
--basedir)
basedir=$2
shift 2
;;
-h|--h*)
cat <<\EOF
Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]...
Wrapper for lex/yacc invocations, renaming files as desired.
INPUT is the input file
OUTPUT is one file PROG generates
DESIRED is the file we actually want instead of OUTPUT
PROGRAM is program to run
ARGS are passed to PROG
Any number of OUTPUT,DESIRED pairs may be used.
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v|--v*)
echo "ylwrap $scriptversion"
exit $?
;;
esac
# The input.
input=$1
shift
# We'll later need for a correct munging of "#line" directives.
input_sub_rx=`get_dirname "$input" | quote_for_sed`
case $input in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
input=`pwd`/$input
;;
esac
input_rx=`get_dirname "$input" | quote_for_sed`
# Since DOS filename conventions don't allow two dots,
# the DOS version of Bison writes out y_tab.c instead of y.tab.c
# and y_tab.h instead of y.tab.h. Test to see if this is the case.
y_tab_nodot=false
if test -f y_tab.c || test -f y_tab.h; then
y_tab_nodot=true
fi
# The parser itself, the first file, is the destination of the .y.c
# rule in the Makefile.
parser=$1
# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
# instance, we rename #include "y.tab.h" into #include "parse.h"
# during the conversion from y.tab.c to parse.c.
sed_fix_filenames=
# Also rename header guards, as Bison 2.7 for instance uses its header
# guard in its implementation file.
sed_fix_header_guards=
while test $# -ne 0; do
if test x"$1" = x"--"; then
shift
break
fi
from=$1
# Handle y_tab.c and y_tab.h output by DOS
if $y_tab_nodot; then
case $from in
"y.tab.c") from=y_tab.c;;
"y.tab.h") from=y_tab.h;;
esac
fi
shift
to=$1
shift
sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
done
# The program to run.
prog=$1
shift
# Make any relative path in $prog absolute.
case $prog in
[\\/]* | ?:[\\/]*) ;;
*[\\/]*) prog=`pwd`/$prog ;;
esac
dirname=ylwrap$$
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
mkdir $dirname || exit 1
cd $dirname
case $# in
0) "$prog" "$input" ;;
*) "$prog" "$@" "$input" ;;
esac
ret=$?
if test $ret -eq 0; then
for from in *
do
to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend '../'.
case $to in
[\\/]* | ?:[\\/]*) target=$to;;
*) target=../$to;;
esac
# Do not overwrite unchanged header files to avoid useless
# recompilations. Always update the parser itself: it is the
# destination of the .y.c rule in the Makefile. Divert the
# output of all other files to a temporary file so we can
# compare them to existing versions.
if test $from != $parser; then
realtarget=$target
target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
fi
# Munge "#line" or "#" directives. Don't let the resulting
# debug information point at an absolute srcdir. Use the real
# output file name, not yy.lex.c for instance. Adjust the
# include guards too.
sed -e "/^#/!b" \
-e "s|$input_rx|$input_sub_rx|" \
-e "$sed_fix_filenames" \
-e "$sed_fix_header_guards" \
"$from" >"$target" || ret=$?
# Check whether files must be updated.
if test "$from" != "$parser"; then
if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
echo "$to is unchanged"
rm -f "$target"
else
echo "updating $to"
mv -f "$target" "$realtarget"
fi
fi
else
# A missing file is only an error for the parser. This is a
# blatant hack to let us support using "yacc -d". If -d is not
# specified, don't fail when the header file is "missing".
if test "$from" = "$parser"; then
ret=1
fi
fi
done
fi
# Remove the directory.
cd ..
rm -rf $dirname
exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End: