Start converting to C++. Start simplified icon placement.

This commit is contained in:
Mike Small 2019-10-06 22:28:07 -04:00
parent 6a3d5089d7
commit 740a9e9e79
24 changed files with 4759 additions and 3144 deletions

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -242,6 +242,9 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@ CWARNFLAGS = @CWARNFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
@ -270,7 +273,6 @@ LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_DIR = @MISC_MAN_DIR@
@ -305,6 +307,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
@ -359,7 +362,7 @@ all: config.h
.SUFFIXES: .SUFFIXES:
am--refresh: Makefile am--refresh: Makefile
@: @:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -385,9 +388,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF) $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -398,7 +401,7 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER)) ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1 rm -f stamp-h1
touch $@ touch $@
@ -580,7 +583,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)" || chmod -R a+r "$(distdir)"
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-bzip2: distdir dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
@ -605,7 +608,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \ @echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2 "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zip: distdir dist-zip: distdir
@ -623,7 +626,7 @@ dist dist-all:
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \ *.tar.lz*) \
@ -633,7 +636,7 @@ distcheck: dist
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac

2507
aclocal.m4 vendored

File diff suppressed because it is too large Load Diff

591
configure vendored
View File

@ -628,6 +628,12 @@ LTLIBOBJS
LIBOBJS LIBOBJS
TWM_LIBS TWM_LIBS
TWM_CFLAGS TWM_CFLAGS
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
ac_ct_CXX
CXXFLAGS
CXX
LEXLIB LEXLIB
LEX_OUTPUT_ROOT LEX_OUTPUT_ROOT
LEX LEX
@ -665,9 +671,6 @@ CHANGELOG_CMD
STRICT_CFLAGS STRICT_CFLAGS
CWARNFLAGS CWARNFLAGS
BASE_CFLAGS BASE_CFLAGS
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
AM_BACKSLASH AM_BACKSLASH
AM_DEFAULT_VERBOSITY AM_DEFAULT_VERBOSITY
AM_DEFAULT_V AM_DEFAULT_V
@ -758,7 +761,6 @@ ac_user_opts='
enable_option_checking enable_option_checking
enable_dependency_tracking enable_dependency_tracking
enable_silent_rules enable_silent_rules
enable_maintainer_mode
enable_selective_werror enable_selective_werror
enable_strict_compilation enable_strict_compilation
' '
@ -776,6 +778,9 @@ PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR PKG_CONFIG_LIBDIR
YACC YACC
YFLAGS YFLAGS
CXX
CXXFLAGS
CCC
TWM_CFLAGS TWM_CFLAGS
TWM_LIBS' TWM_LIBS'
@ -1402,9 +1407,6 @@ Optional Features:
speeds up one-time build speeds up one-time build
--enable-silent-rules less verbose build output (undo: "make V=1") --enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0") --disable-silent-rules verbose build output (undo: "make V=0")
--enable-maintainer-mode
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--disable-selective-werror --disable-selective-werror
Turn off selective compiler errors. (default: Turn off selective compiler errors. (default:
enabled) enabled)
@ -1432,6 +1434,8 @@ Some influential environment variables:
YFLAGS The list of arguments that will be passed by default to $YACC. YFLAGS The list of arguments that will be passed by default to $YACC.
This script will default YFLAGS to the empty string to avoid a This script will default YFLAGS to the empty string to avoid a
default value of `-d' given by some make applications. default value of `-d' given by some make applications.
CXX C++ compiler command
CXXFLAGS C++ compiler flags
TWM_CFLAGS C compiler flags for TWM, overriding pkg-config TWM_CFLAGS C compiler flags for TWM, overriding pkg-config
TWM_LIBS linker flags for TWM, overriding pkg-config TWM_LIBS linker flags for TWM, overriding pkg-config
@ -1846,6 +1850,44 @@ fi
} # ac_fn_c_try_link } # ac_fn_c_try_link
# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_compile
# ac_fn_c_check_func LINENO FUNC VAR # ac_fn_c_check_func LINENO FUNC VAR
# ---------------------------------- # ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly # Tests whether FUNC exists, setting the cache variable VAR accordingly
@ -4388,29 +4430,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
$as_echo "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
MAINT=$MAINTAINER_MODE_TRUE
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } $as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
if ${ac_cv_prog_cc_c99+:} false; then : if ${ac_cv_prog_cc_c99+:} false; then :
@ -6772,7 +6791,124 @@ $as_echo "$supported" >&6; }
fi fi
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
xorg_testset_save_CFLAGS="$CFLAGS"
if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5
$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; }
if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
xorg_cv_cc_flag_unknown_warning_option=yes
else
xorg_cv_cc_flag_unknown_warning_option=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5
$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; }
xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option
CFLAGS="$xorg_testset_save_CFLAGS"
fi
if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then
if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5
$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; }
if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
xorg_cv_cc_flag_unused_command_line_argument=yes
else
xorg_cv_cc_flag_unused_command_line_argument=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5
$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; }
xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument
CFLAGS="$xorg_testset_save_CFLAGS"
fi
found="no"
if test $found = "no" ; then
if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unknown-warning-option"
fi
if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then
CFLAGS="$CFLAGS -Werror=unused-command-line-argument"
fi
CFLAGS="$CFLAGS -Wredundant-decls"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wredundant-decls" >&5
$as_echo_n "checking if $CC supports -Wredundant-decls... " >&6; }
cacheid=xorg_cv_cc_flag__Wredundant_decls
if eval \${$cacheid+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int i;
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval $cacheid=yes
else
eval $cacheid=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
CFLAGS="$xorg_testset_save_CFLAGS"
eval supported=\$$cacheid
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5
$as_echo "$supported" >&6; }
if test "$supported" = "yes" ; then
BASE_CFLAGS="$BASE_CFLAGS -Wredundant-decls"
found="yes"
fi
fi
@ -10988,6 +11124,391 @@ fi
rm -f conftest.l $LEX_OUTPUT_ROOT.c rm -f conftest.l $LEX_OUTPUT_ROOT.c
fi fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -z "$CXX"; then
if test -n "$CCC"; then
CXX=$CCC
else
if test -n "$ac_tool_prefix"; then
for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CXX"; then
ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
$as_echo "$CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CXX" && break
done
fi
if test -z "$CXX"; then
ac_ct_CXX=$CXX
for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CXX"; then
ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
$as_echo "$ac_ct_CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CXX" && break
done
if test "x$ac_ct_CXX" = x; then
CXX="g++"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
fi
fi
fi
fi
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
if ${ac_cv_cxx_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GXX=yes
else
GXX=
fi
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
$as_echo_n "checking whether $CXX accepts -g... " >&6; }
if ${ac_cv_prog_cxx_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_cv_prog_cxx_g=no
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_prog_cxx_g=yes
else
CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_prog_cxx_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
$as_echo "$ac_cv_prog_cxx_g" >&6; }
if test "$ac_test_CXXFLAGS" = set; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
CXXFLAGS="-g -O2"
else
CXXFLAGS="-g"
fi
else
if test "$GXX" = yes; then
CXXFLAGS="-O2"
else
CXXFLAGS=
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
depcc="$CXX" am_compiler_list=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named 'D' -- because '-MD' means "put the output
# in D".
rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_CXX_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
fi
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
# Solaris 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle '-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# After this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_CXX_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_CXX_dependencies_compiler_type=none
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
am__fastdepCXX_TRUE=
am__fastdepCXX_FALSE='#'
else
am__fastdepCXX_TRUE='#'
am__fastdepCXX_FALSE=
fi
for ac_func in mkstemp for ac_func in mkstemp
do : do :
@ -11004,8 +11525,8 @@ done
# Checks for pkg-config packages # Checks for pkg-config packages
pkg_failed=no pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TWM" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for x11 xext xt xmu ice sm xproto >= 7.0.17" >&5
$as_echo_n "checking for TWM... " >&6; } $as_echo_n "checking for x11 xext xt xmu ice sm xproto >= 7.0.17... " >&6; }
if test -n "$TWM_CFLAGS"; then if test -n "$TWM_CFLAGS"; then
pkg_cv_TWM_CFLAGS="$TWM_CFLAGS" pkg_cv_TWM_CFLAGS="$TWM_CFLAGS"
@ -11229,8 +11750,8 @@ else
am__EXEEXT_FALSE= am__EXEEXT_FALSE=
fi fi
if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi

View File

@ -45,6 +45,7 @@ if test ! -f "$srcdir/gram.c"; then
fi fi
fi fi
AC_PROG_LEX AC_PROG_LEX
AC_PROG_CXX
AC_CHECK_FUNCS([mkstemp]) AC_CHECK_FUNCS([mkstemp])

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -191,6 +191,9 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@ CWARNFLAGS = @CWARNFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
@ -219,7 +222,6 @@ LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__datadir__|$(datadir)|g' MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__datadir__|$(datadir)|g'
MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_DIR = @MISC_MAN_DIR@
@ -254,6 +256,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
@ -309,7 +312,7 @@ all: all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .$(APP_MAN_SUFFIX) .man .SUFFIXES: .$(APP_MAN_SUFFIX) .man
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -333,9 +336,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
install-appmanDATA: $(appman_DATA) install-appmanDATA: $(appman_DATA)

View File

@ -28,11 +28,10 @@ rcdir = ${datadir}/X11/twmruined
dist_rc_DATA = system.twmruinedrc dist_rc_DATA = system.twmruinedrc
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-DXVENDORNAME=\"The\ X.Org\ Foundation\" \
-DXORG_RELEASE=\"Release\ $(VERSION)\" \
-DSYSTEM_INIT_FILE=\"${datadir}/X11/twmruined/system.twmruinedrc\" -DSYSTEM_INIT_FILE=\"${datadir}/X11/twmruined/system.twmruinedrc\"
AM_CFLAGS = -Werror $(TWM_CFLAGS) AM_CFLAGS = -Werror $(TWM_CFLAGS)
AM_CXXFLAGS = -std=c++11
twmruined_LDADD = $(TWM_LIBS) twmruined_LDADD = $(TWM_LIBS)
twmruined_SOURCES = \ twmruined_SOURCES = \
@ -44,7 +43,7 @@ twmruined_SOURCES = \
events.h \ events.h \
gc.c \ gc.c \
gc.h \ gc.h \
icons.c \ icons.cc \
icons.h \ icons.h \
list.c \ list.c \
list.h \ list.h \

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -160,14 +160,25 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 = am__v_CCLD_1 =
@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
-o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS)
AM_V_LEX = $(am__v_LEX_@AM_V@) AM_V_LEX = $(am__v_LEX_@AM_V@)
am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@)
am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_0 = @echo " LEX " $@;
am__v_LEX_1 = am__v_LEX_1 =
YLWRAP = $(top_srcdir)/ylwrap YLWRAP = $(top_srcdir)/ylwrap
@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ ||
am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \
-e s/c++$$/h++/ -e s/c$$/h/ -e s/c++$$/h++/ -e s/c$$/h/
YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS)
@ -251,6 +262,9 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
CPP = @CPP@ CPP = @CPP@
CPPFLAGS = @CPPFLAGS@ CPPFLAGS = @CPPFLAGS@
CWARNFLAGS = @CWARNFLAGS@ CWARNFLAGS = @CWARNFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@ CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@ DEFS = @DEFS@
DEPDIR = @DEPDIR@ DEPDIR = @DEPDIR@
@ -279,7 +293,6 @@ LIBS = @LIBS@
LIB_MAN_DIR = @LIB_MAN_DIR@ LIB_MAN_DIR = @LIB_MAN_DIR@
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_DIR = @MISC_MAN_DIR@
@ -314,6 +327,7 @@ abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@ abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@ ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
am__include = @am__include@ am__include = @am__include@
am__leading_dot = @am__leading_dot@ am__leading_dot = @am__leading_dot@
am__quote = @am__quote@ am__quote = @am__quote@
@ -363,11 +377,10 @@ AM_YFLAGS = -d
rcdir = ${datadir}/X11/twmruined rcdir = ${datadir}/X11/twmruined
dist_rc_DATA = system.twmruinedrc dist_rc_DATA = system.twmruinedrc
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-DXVENDORNAME=\"The\ X.Org\ Foundation\" \
-DXORG_RELEASE=\"Release\ $(VERSION)\" \
-DSYSTEM_INIT_FILE=\"${datadir}/X11/twmruined/system.twmruinedrc\" -DSYSTEM_INIT_FILE=\"${datadir}/X11/twmruined/system.twmruinedrc\"
AM_CFLAGS = -Werror $(TWM_CFLAGS) AM_CFLAGS = -Werror $(TWM_CFLAGS)
AM_CXXFLAGS = -std=c++11
twmruined_LDADD = $(TWM_LIBS) twmruined_LDADD = $(TWM_LIBS)
twmruined_SOURCES = \ twmruined_SOURCES = \
add_window.c \ add_window.c \
@ -378,7 +391,7 @@ twmruined_SOURCES = \
events.h \ events.h \
gc.c \ gc.c \
gc.h \ gc.h \
icons.c \ icons.cc \
icons.h \ icons.h \
list.c \ list.c \
list.h \ list.h \
@ -406,8 +419,8 @@ all: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) all-am $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .l .o .obj .y .SUFFIXES: .c .cc .l .o .obj .y
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -431,9 +444,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS) install-binPROGRAMS: $(bin_PROGRAMS)
@ -484,7 +497,7 @@ gram.h: gram.c
twmruined$(EXEEXT): $(twmruined_OBJECTS) $(twmruined_DEPENDENCIES) $(EXTRA_twmruined_DEPENDENCIES) twmruined$(EXEEXT): $(twmruined_OBJECTS) $(twmruined_DEPENDENCIES) $(EXTRA_twmruined_DEPENDENCIES)
@rm -f twmruined$(EXEEXT) @rm -f twmruined$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(twmruined_OBJECTS) $(twmruined_LDADD) $(LIBS) $(AM_V_CXXLD)$(CXXLINK) $(twmruined_OBJECTS) $(twmruined_LDADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
@ -523,6 +536,20 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cc.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cc.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.l.c: .l.c:
$(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE)

View File

@ -180,8 +180,8 @@ AddWindow(Window w)
if (!I18N_FetchName(dpy, tmp_win->w, &name)) if (!I18N_FetchName(dpy, tmp_win->w, &name))
name = NULL; name = NULL;
tmp_win->class = NoClass; tmp_win->classh = NoClass;
XGetClassHint(dpy, tmp_win->w, &tmp_win->class); XGetClassHint(dpy, tmp_win->w, &tmp_win->classh);
FetchWmProtocols (tmp_win); FetchWmProtocols (tmp_win);
FetchWmColormapWindows (tmp_win); FetchWmColormapWindows (tmp_win);
@ -260,25 +260,25 @@ AddWindow(Window w)
tmp_win->transient = Transient(tmp_win->w, &tmp_win->transientfor); tmp_win->transient = Transient(tmp_win->w, &tmp_win->transientfor);
tmp_win->nameChanged = 0; tmp_win->nameChanged = 0;
if (tmp_win->class.res_name == NULL) if (tmp_win->classh.res_name == NULL)
tmp_win->class.res_name = NoName; tmp_win->classh.res_name = NoName;
if (tmp_win->class.res_class == NULL) if (tmp_win->classh.res_class == NULL)
tmp_win->class.res_class = NoName; tmp_win->classh.res_class = NoName;
tmp_win->full_name = strdup(tmp_win->name); tmp_win->full_name = strdup(tmp_win->name);
namelen = strlen (tmp_win->name); namelen = strlen (tmp_win->name);
tmp_win->stackmode = Scr->StackMode && tmp_win->stackmode = Scr->StackMode &&
(!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name, (!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name,
&tmp_win->class)); &tmp_win->classh));
tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise, tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise,
tmp_win->full_name, tmp_win->full_name,
&tmp_win->class); &tmp_win->classh);
if (tmp_win->auto_raise) if (tmp_win->auto_raise)
Scr->NumAutoRaises++; Scr->NumAutoRaises++;
if (LookInList(Scr->WindowRingL, tmp_win->full_name, &tmp_win->class)) { if (LookInList(Scr->WindowRingL, tmp_win->full_name, &tmp_win->classh)) {
if (Scr->Ring) { if (Scr->Ring) {
tmp_win->ring.next = Scr->Ring->ring.next; tmp_win->ring.next = Scr->Ring->ring.next;
if (Scr->Ring->ring.next->ring.prev) if (Scr->Ring->ring.next->ring.prev)
@ -299,16 +299,16 @@ AddWindow(Window w)
tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw; tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw;
if (Scr->NoTitlebar) if (Scr->NoTitlebar)
tmp_win->title_height = 0; tmp_win->title_height = 0;
if (LookInList(Scr->MakeTitle, tmp_win->full_name, &tmp_win->class)) if (LookInList(Scr->MakeTitle, tmp_win->full_name, &tmp_win->classh))
tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw; tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw;
if (LookInList(Scr->NoTitle, tmp_win->full_name, &tmp_win->class)) if (LookInList(Scr->NoTitle, tmp_win->full_name, &tmp_win->classh))
tmp_win->title_height = 0; tmp_win->title_height = 0;
/* if it is a transient window, don't put a title on it */ /* if it is a transient window, don't put a title on it */
if (tmp_win->transient && !Scr->DecorateTransients) if (tmp_win->transient && !Scr->DecorateTransients)
tmp_win->title_height = 0; tmp_win->title_height = 0;
if (LookInList(Scr->StartIconified, tmp_win->full_name, &tmp_win->class)) if (LookInList(Scr->StartIconified, tmp_win->full_name, &tmp_win->classh))
{ {
if (!tmp_win->wmhints) if (!tmp_win->wmhints)
{ {
@ -438,21 +438,21 @@ AddWindow(Window w)
tmp_win->iconc.fore = Scr->IconC.fore; tmp_win->iconc.fore = Scr->IconC.fore;
tmp_win->iconc.back = Scr->IconC.back; tmp_win->iconc.back = Scr->IconC.back;
GetColorFromList(Scr->BorderColorL, tmp_win->full_name, &tmp_win->class, GetColorFromList(Scr->BorderColorL, tmp_win->full_name, &tmp_win->classh,
&tmp_win->border); &tmp_win->border);
GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->class, GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->classh,
&tmp_win->icon_border); &tmp_win->icon_border);
GetColorFromList(Scr->BorderTileForegroundL, tmp_win->full_name, GetColorFromList(Scr->BorderTileForegroundL, tmp_win->full_name,
&tmp_win->class, &tmp_win->border_tile.fore); &tmp_win->classh, &tmp_win->border_tile.fore);
GetColorFromList(Scr->BorderTileBackgroundL, tmp_win->full_name, GetColorFromList(Scr->BorderTileBackgroundL, tmp_win->full_name,
&tmp_win->class, &tmp_win->border_tile.back); &tmp_win->classh, &tmp_win->border_tile.back);
GetColorFromList(Scr->TitleForegroundL, tmp_win->full_name, &tmp_win->class, GetColorFromList(Scr->TitleForegroundL, tmp_win->full_name, &tmp_win->classh,
&tmp_win->title.fore); &tmp_win->title.fore);
GetColorFromList(Scr->TitleBackgroundL, tmp_win->full_name, &tmp_win->class, GetColorFromList(Scr->TitleBackgroundL, tmp_win->full_name, &tmp_win->classh,
&tmp_win->title.back); &tmp_win->title.back);
GetColorFromList(Scr->IconForegroundL, tmp_win->full_name, &tmp_win->class, GetColorFromList(Scr->IconForegroundL, tmp_win->full_name, &tmp_win->classh,
&tmp_win->iconc.fore); &tmp_win->iconc.fore);
GetColorFromList(Scr->IconBackgroundL, tmp_win->full_name, &tmp_win->class, GetColorFromList(Scr->IconBackgroundL, tmp_win->full_name, &tmp_win->classh,
&tmp_win->iconc.back); &tmp_win->iconc.back);

View File

@ -632,7 +632,7 @@ HandleKeyPress(void)
for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL;
Tmp_win = Tmp_win->next) Tmp_win = Tmp_win->next)
{ {
if (!strncmp(key->win_name, Tmp_win->class.res_name, len)) if (!strncmp(key->win_name, Tmp_win->classh.res_name, len))
{ {
matched = TRUE; matched = TRUE;
ExecuteFunction(key->func, key->action, Tmp_win->frame, ExecuteFunction(key->func, key->action, Tmp_win->frame,
@ -646,7 +646,7 @@ HandleKeyPress(void)
for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL;
Tmp_win = Tmp_win->next) Tmp_win = Tmp_win->next)
{ {
if (!strncmp(key->win_name, Tmp_win->class.res_class, len)) if (!strncmp(key->win_name, Tmp_win->classh.res_class, len))
{ {
matched = TRUE; matched = TRUE;
ExecuteFunction(key->func, key->action, Tmp_win->frame, ExecuteFunction(key->func, key->action, Tmp_win->frame,
@ -1183,8 +1183,8 @@ HandleDestroyNotify(void)
* 2. name * 2. name
* 3. icon_name * 3. icon_name
* 4. wmhints * 4. wmhints
* 5. class.res_name * 5. classh.res_name
* 6. class.res_class * 6. classh.res_class
* *
* *
* 9. cwins * 9. cwins
@ -1206,10 +1206,10 @@ HandleDestroyNotify(void)
free_window_names (Tmp_win, True, True, True); /* 1, 2, 3 */ free_window_names (Tmp_win, True, True, True); /* 1, 2, 3 */
if (Tmp_win->wmhints) /* 4 */ if (Tmp_win->wmhints) /* 4 */
XFree (Tmp_win->wmhints); XFree (Tmp_win->wmhints);
if (Tmp_win->class.res_name && Tmp_win->class.res_name != NoName) /* 5 */ if (Tmp_win->classh.res_name && Tmp_win->classh.res_name != NoName) /* 5 */
XFree (Tmp_win->class.res_name); XFree (Tmp_win->classh.res_name);
if (Tmp_win->class.res_class && Tmp_win->class.res_class != NoName) /* 6 */ if (Tmp_win->classh.res_class && Tmp_win->classh.res_class != NoName) /* 6 */
XFree (Tmp_win->class.res_class); XFree (Tmp_win->classh.res_class);
free_cwins (Tmp_win); /* 9 */ free_cwins (Tmp_win); /* 9 */
if (Tmp_win->titlebuttons) /* 10 */ if (Tmp_win->titlebuttons) /* 10 */
free (Tmp_win->titlebuttons); free (Tmp_win->titlebuttons);

3866
src/gram.c

File diff suppressed because it is too large Load Diff

View File

@ -1,68 +1,193 @@
#define LB 257 /* A Bison parser, made by GNU Bison 3.0.4. */
#define RB 258
#define LP 259 /* Bison interface for Yacc-like parsers in C
#define RP 260
#define MENUS 261 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
#define MENU 262
#define BUTTON 263 This program is free software: you can redistribute it and/or modify
#define DEFAULT_FUNCTION 264 it under the terms of the GNU General Public License as published by
#define PLUS 265 the Free Software Foundation, either version 3 of the License, or
#define MINUS 266 (at your option) any later version.
#define ALL 267
#define OR 268 This program is distributed in the hope that it will be useful,
#define CURSORS 269 but WITHOUT ANY WARRANTY; without even the implied warranty of
#define ICONS 270 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#define COLOR 271 GNU General Public License for more details.
#define SAVECOLOR 272
#define MONOCHROME 273 You should have received a copy of the GNU General Public License
#define FUNCTION 274 along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define WINDOW_FUNCTION 275
#define ZOOM 276 /* As a special exception, you may create a larger work that contains
#define MAKE_TITLE 277 part or all of the Bison parser skeleton and distribute that work
#define GRAYSCALE 278 under terms of your choice, so long as that work isn't itself a
#define NO_TITLE 279 parser generator using the skeleton or a modified version thereof
#define AUTO_RAISE 280 as a parser skeleton. Alternatively, if you modify or redistribute
#define ICON_REGION 281 the parser skeleton itself, you may (at your option) remove this
#define META 282 special exception, which will cause the skeleton and the resulting
#define SHIFT 283 Bison output files to be licensed under the GNU General Public
#define LOCK 284 License without this special exception.
#define CONTROL 285
#define WINDOW 286 This special exception was added by the Free Software Foundation in
#define TITLE 287 version 2.2 of Bison. */
#define ICON 288
#define ROOT 289 #ifndef YY_YY_GRAM_H_INCLUDED
#define FRAME 290 # define YY_YY_GRAM_H_INCLUDED
#define COLON 291 /* Debug traces. */
#define EQUALS 292 #ifndef YYDEBUG
#define START_ICONIFIED 293 # define YYDEBUG 0
#define MOVE 294 #endif
#define RESIZE 295 #if YYDEBUG
#define WAIT 296 extern int yydebug;
#define SELECT 297 #endif
#define KILL 298
#define LEFT_TITLEBUTTON 299 /* Token type. */
#define RIGHT_TITLEBUTTON 300 #ifndef YYTOKENTYPE
#define NUMBER 301 # define YYTOKENTYPE
#define KEYWORD 302 enum yytokentype
#define NKEYWORD 303 {
#define CKEYWORD 304 LB = 258,
#define CLKEYWORD 305 RB = 259,
#define FKEYWORD 306 LP = 260,
#define FSKEYWORD 307 RP = 261,
#define SKEYWORD 308 MENUS = 262,
#define DKEYWORD 309 MENU = 263,
#define JKEYWORD 310 BUTTON = 264,
#define WINDOW_RING 311 DEFAULT_FUNCTION = 265,
#define WARP_CURSOR 312 PLUS = 266,
#define ERRORTOKEN 313 MINUS = 267,
#define NO_STACKMODE 314 ALL = 268,
#define STRING 315 OR = 269,
#ifndef YYSTYPE_DEFINED CURSORS = 270,
#define YYSTYPE_DEFINED ICONS = 271,
typedef union COLOR = 272,
SAVECOLOR = 273,
MONOCHROME = 274,
FUNCTION = 275,
WINDOW_FUNCTION = 276,
ZOOM = 277,
MAKE_TITLE = 278,
GRAYSCALE = 279,
NO_TITLE = 280,
AUTO_RAISE = 281,
ICON_REGION = 282,
META = 283,
SHIFT = 284,
LOCK = 285,
CONTROL = 286,
WINDOW = 287,
TITLE = 288,
ICON = 289,
ROOT = 290,
FRAME = 291,
COLON = 292,
EQUALS = 293,
START_ICONIFIED = 294,
MOVE = 295,
RESIZE = 296,
WAIT = 297,
SELECT = 298,
KILL = 299,
LEFT_TITLEBUTTON = 300,
RIGHT_TITLEBUTTON = 301,
NUMBER = 302,
KEYWORD = 303,
NKEYWORD = 304,
CKEYWORD = 305,
CLKEYWORD = 306,
FKEYWORD = 307,
FSKEYWORD = 308,
SKEYWORD = 309,
DKEYWORD = 310,
JKEYWORD = 311,
WINDOW_RING = 312,
WARP_CURSOR = 313,
ERRORTOKEN = 314,
NO_STACKMODE = 315,
STRING = 316
};
#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 ICONS 271
#define COLOR 272
#define SAVECOLOR 273
#define MONOCHROME 274
#define FUNCTION 275
#define WINDOW_FUNCTION 276
#define ZOOM 277
#define MAKE_TITLE 278
#define GRAYSCALE 279
#define NO_TITLE 280
#define AUTO_RAISE 281
#define ICON_REGION 282
#define META 283
#define SHIFT 284
#define LOCK 285
#define CONTROL 286
#define WINDOW 287
#define TITLE 288
#define ICON 289
#define ROOT 290
#define FRAME 291
#define COLON 292
#define EQUALS 293
#define START_ICONIFIED 294
#define MOVE 295
#define RESIZE 296
#define WAIT 297
#define SELECT 298
#define KILL 299
#define LEFT_TITLEBUTTON 300
#define RIGHT_TITLEBUTTON 301
#define NUMBER 302
#define KEYWORD 303
#define NKEYWORD 304
#define CKEYWORD 305
#define CLKEYWORD 306
#define FKEYWORD 307
#define FSKEYWORD 308
#define SKEYWORD 309
#define DKEYWORD 310
#define JKEYWORD 311
#define WINDOW_RING 312
#define WARP_CURSOR 313
#define ERRORTOKEN 314
#define NO_STACKMODE 315
#define STRING 316
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{ {
#line 106 "gram.y" /* yacc.c:1909 */
int num; int num;
char *ptr; char *ptr;
} YYSTYPE;
#endif /* YYSTYPE_DEFINED */ #line 181 "gram.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval; extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_GRAM_H_INCLUDED */

View File

@ -74,7 +74,6 @@ in this Software without prior written authorization from The Open Group.
#include "screen.h" #include "screen.h"
#include "parse.h" #include "parse.h"
#include "add_window.h" #include "add_window.h"
#include "icons.h"
#include <X11/Xos.h> #include <X11/Xos.h>
#include <X11/Xmu/CharSet.h> #include <X11/Xmu/CharSet.h>
@ -142,8 +141,6 @@ stmt : error
| noarg | noarg
| sarg | sarg
| narg | narg
| ICON_REGION string DKEYWORD DKEYWORD number number
{ AddIconRegion($2, $3, $4, $5, $6); }
| ZOOM number { if (Scr->FirstTime) | ZOOM number { if (Scr->FirstTime)
{ {
Scr->DoZoom = TRUE; Scr->DoZoom = TRUE;

View File

@ -31,7 +31,9 @@ in this Software without prior written authorization from The Open Group.
* *
**********************************************************************/ **********************************************************************/
#include <algorithm>
#include <stdio.h> #include <stdio.h>
#include <vector>
#include "twm.h" #include "twm.h"
#include "screen.h" #include "screen.h"
#include "icons.h" #include "icons.h"
@ -39,97 +41,75 @@ in this Software without prior written authorization from The Open Group.
#include "parse.h" #include "parse.h"
#include "util.h" #include "util.h"
using namespace std;
// TODO: initialize at runtime. Per screen unless you simplify to only one screen allowed.
const int icon_area_x = 1600; // big enough area for my xclock to look like an icon, not be stacked on.
const int icon_pad = 10;
#define iconWidth(w) (BW2 + w->icon_w_width) #define iconWidth(w) (BW2 + w->icon_w_width)
#define iconHeight(w) (BW2 + w->icon_w_height) #define iconHeight(w) (BW2 + 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 static inline int
roundUp (int v, int multiple) roundUp (int v, int multiple)
{ {
return ((v + multiple - 1) / multiple) * multiple; return ((v + multiple - 1) / multiple) * multiple;
} }
struct Span {
int p1, p2;
};
inline bool operator<(Span a, Span b)
{
return a.p1 == b.p1 && a.p2 < b.p2 || a.p1 < b.p1;
}
static void static void
PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y) PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y)
{ {
IconRegion *ir; // Try to place in a gap on the right side.
IconEntry *ie;
int w = 0, h = 0;
ie = 0; Window root, parent;
for (ir = Scr->FirstRegion; ir; ir = ir->next) { Window* children;
w = roundUp (iconWidth (tmp_win), ir->stepx); unsigned int nchildren;
h = roundUp (iconHeight (tmp_win), ir->stepy); XWindowAttributes attr;
for (ie = ir->entries; ie; ie=ie->next) { int y = 0;
if (ie->used) if (XQueryTree(dpy, Scr->Root, &root, &parent, &children, &nchildren)) {
continue; XArray<Window> childarray(children, nchildren);
if (ie->w >= w && ie->h >= h) vector<Span> occupied;
for (Window w : childarray) {
if (XGetWindowAttributes(dpy, w, &attr)) {
// w looks like icon?
if (attr.map_state != IsUnmapped
&& attr.height <= 200 && attr.width <= 200
&& attr.x >= icon_area_x) {
occupied.push_back({attr.y, attr.y + attr.height});
}
}
}
int h = 64;
if (tmp_win->icon_height) {
h = tmp_win->icon_height;
}
sort(occupied.begin(), occupied.end());
int prev = 0;
for (auto span : occupied) {
if (span.p1 - prev >= h) {
if (span.p1 - prev >= h + 2*icon_pad)
y = prev + icon_pad;
else
y = prev;
break; break;
} }
if (ie) prev = span.p2;
break;
} }
if (ie) { }
splitEntry (ie, ir->grav1, ir->grav2, w, h);
ie->used = 1; if (y) {
ie->twm_win = tmp_win; *final_x = icon_area_x + 20; // TODO: stick the icon roughly in the center of the space.
*final_x = ie->x + (ie->w - iconWidth (tmp_win)) / 2; *final_y = y;
*final_y = ie->y + (ie->h - iconHeight (tmp_win)) / 2;
} else { } else {
*final_x = def_x; *final_x = def_x;
*final_y = def_y; *final_y = def_y;
@ -137,201 +117,16 @@ PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y)
return; 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 void
IconUp (TwmWindow *tmp_win) 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 void
IconDown (TwmWindow *tmp_win) 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 void
CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y)
{ {
@ -360,7 +155,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y)
icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name); icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name);
if (icon_name == NULL) if (icon_name == NULL)
icon_name = LookInList(Scr->IconNames, tmp_win->full_name, icon_name = LookInList(Scr->IconNames, tmp_win->full_name,
&tmp_win->class); &tmp_win->classh);
bm = None; bm = None;
if (icon_name != NULL) if (icon_name != NULL)
@ -420,7 +215,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y)
icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name); icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name);
if (icon_name == NULL) if (icon_name == NULL)
icon_name = LookInList(Scr->IconNames, tmp_win->full_name, icon_name = LookInList(Scr->IconNames, tmp_win->full_name,
&tmp_win->class); &tmp_win->classh);
bm = None; bm = None;
if (icon_name != NULL) if (icon_name != NULL)

View File

@ -34,27 +34,14 @@ in this Software without prior written authorization from The Open Group.
#ifndef ICONS_H #ifndef ICONS_H
#define ICONS_H #define ICONS_H
typedef struct IconRegion #ifdef __cplusplus
{ #define EXTERN extern "C"
struct IconRegion *next; #else
int x, y, w, h; #define EXTERN extern
int grav1, grav2; #endif
int stepx, stepy; /* allocation granularity */
struct IconEntry *entries;
} IconRegion;
typedef struct IconEntry EXTERN void IconUp ( TwmWindow *tmp_win );
{ EXTERN void IconDown ( TwmWindow *tmp_win );
struct IconEntry *next; EXTERN void CreateIconWindow ( TwmWindow *tmp_win, int def_x, int def_y );
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 */ #endif /* ICONS_H */

View File

@ -117,7 +117,7 @@ AddToList(name_list **list_head, char *name, char *ptr)
* \param class a pointer to the class to look for * \param class a pointer to the class to look for
*/ */
char * char *
LookInList(name_list *list_head, char *name, XClassHint *class) LookInList(name_list *list_head, char *name, XClassHint *classh)
{ {
name_list *nptr; name_list *nptr;
@ -126,16 +126,16 @@ LookInList(name_list *list_head, char *name, XClassHint *class)
if (strcmp(name, nptr->name) == 0) if (strcmp(name, nptr->name) == 0)
return (nptr->ptr); return (nptr->ptr);
if (class) if (classh)
{ {
/* look for the res_name next */ /* look for the res_name next */
for (nptr = list_head; nptr != NULL; nptr = nptr->next) for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_name, nptr->name) == 0) if (strcmp(classh->res_name, nptr->name) == 0)
return (nptr->ptr); return (nptr->ptr);
/* finally look for the res_class */ /* finally look for the res_class */
for (nptr = list_head; nptr != NULL; nptr = nptr->next) for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_class, nptr->name) == 0) if (strcmp(classh->res_class, nptr->name) == 0)
return (nptr->ptr); return (nptr->ptr);
} }
return (NULL); return (NULL);
@ -155,10 +155,10 @@ LookInNameList(name_list *list_head, char *name)
* *
* \param list a pointer to the head of a list * \param list a pointer to the head of a list
* \param name a pointer to the name to look for * \param name a pointer to the name to look for
* \param class a pointer to the class to look for * \param classh a pointer to the class to look for
* \param[out] ptr fill in the list value if the name was found * \param[out] ptr fill in the list value if the name was found
*/ */
int GetColorFromList(name_list *list_head, char *name, XClassHint *class, int GetColorFromList(name_list *list_head, char *name, XClassHint *classh,
Pixel *ptr) Pixel *ptr)
{ {
int save; int save;
@ -174,10 +174,10 @@ int GetColorFromList(name_list *list_head, char *name, XClassHint *class,
return (TRUE); return (TRUE);
} }
if (class) if (classh)
{ {
for (nptr = list_head; nptr != NULL; nptr = nptr->next) for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_name, nptr->name) == 0) if (strcmp(classh->res_name, nptr->name) == 0)
{ {
save = Scr->FirstTime; save = Scr->FirstTime;
Scr->FirstTime = TRUE; Scr->FirstTime = TRUE;
@ -187,7 +187,7 @@ int GetColorFromList(name_list *list_head, char *name, XClassHint *class,
} }
for (nptr = list_head; nptr != NULL; nptr = nptr->next) for (nptr = list_head; nptr != NULL; nptr = nptr->next)
if (strcmp(class->res_class, nptr->name) == 0) if (strcmp(classh->res_class, nptr->name) == 0)
{ {
save = Scr->FirstTime; save = Scr->FirstTime;
Scr->FirstTime = TRUE; Scr->FirstTime = TRUE;

View File

@ -65,16 +65,23 @@ in this Software without prior written authorization from The Open Group.
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#ifdef __cplusplus
#define EXTERN extern "C"
#else
#define EXTERN extern
#endif
typedef struct name_list_struct name_list; typedef struct name_list_struct name_list;
extern void AddToList ( name_list **list_head, char *name, char *ptr ); EXTERN void AddToList ( name_list **list_head, char *name, char *ptr );
extern void FreeList ( name_list **list ); EXTERN void FreeList ( name_list **list );
extern int GetColorFromList ( name_list *list_head, char *name, EXTERN int GetColorFromList ( name_list *list_head, char *name,
XClassHint *class, Pixel *ptr ); XClassHint *classh, Pixel *ptr );
extern char * LookInList ( name_list *list_head, char *name, EXTERN char * LookInList ( name_list *list_head, char *name,
XClassHint *class ); XClassHint *classh );
extern char * LookInNameList ( name_list *list_head, char *name ); EXTERN char * LookInNameList ( name_list *list_head, char *name );
#endif /* _LIST_ */ #endif /* _LIST_ */

View File

@ -2018,12 +2018,12 @@ ExecuteFunction(int func, const char *action, Window w, TwmWindow *tmp_win,
} }
if (!t) { if (!t) {
for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { for (t = Scr->TwmRoot.next; t != NULL; t = t->next) {
if (!strncmp(action, t->class.res_name, len)) if (!strncmp(action, t->classh.res_name, len))
if (WarpThere(t)) break; if (WarpThere(t)) break;
} }
if (!t) { if (!t) {
for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { for (t = Scr->TwmRoot.next; t != NULL; t = t->next) {
if (!strncmp(action, t->class.res_class, len)) if (!strncmp(action, t->classh.res_class, len))
if (WarpThere(t)) break; if (WarpThere(t)) break;
} }
} }
@ -2313,7 +2313,7 @@ DeIconify(TwmWindow *tmp_win)
IconDown (tmp_win); IconDown (tmp_win);
} }
if ((Scr->WarpCursor || if ((Scr->WarpCursor ||
LookInList(Scr->WarpCursorL, tmp_win->full_name, &tmp_win->class)) && LookInList(Scr->WarpCursorL, tmp_win->full_name, &tmp_win->classh)) &&
tmp_win->icon) tmp_win->icon)
WarpToWindow (tmp_win); WarpToWindow (tmp_win);
tmp_win->icon = FALSE; tmp_win->icon = FALSE;
@ -2451,9 +2451,9 @@ Identify (TwmWindow *t)
snprintf(Info[n++], INFO_SIZE, snprintf(Info[n++], INFO_SIZE,
"Name = \"%s\"", t->full_name); "Name = \"%s\"", t->full_name);
snprintf(Info[n++], INFO_SIZE, snprintf(Info[n++], INFO_SIZE,
"Class.res_name = \"%s\"", t->class.res_name); "Class.res_name = \"%s\"", t->classh.res_name);
snprintf(Info[n++], INFO_SIZE, snprintf(Info[n++], INFO_SIZE,
"Class.res_class = \"%s\"", t->class.res_class); "Class.res_class = \"%s\"", t->classh.res_class);
Info[n++][0] = '\0'; Info[n++][0] = '\0';
snprintf(Info[n++], INFO_SIZE, snprintf(Info[n++], INFO_SIZE,
"Geometry/root = %dx%d+%d+%d", wwidth, wheight, x, y); "Geometry/root = %dx%d+%d+%d", wwidth, wheight, x, y);

View File

@ -57,7 +57,7 @@ typedef struct _TitlebarPixmaps {
Pixmap resize; Pixmap resize;
Pixmap question; Pixmap question;
Pixmap menu; Pixmap menu;
Pixmap delete; Pixmap del;
} TitlebarPixmaps; } TitlebarPixmaps;
typedef struct ScreenInfo typedef struct ScreenInfo
@ -177,8 +177,6 @@ typedef struct ScreenInfo
MyFont IconFont; /* icon font structure */ MyFont IconFont; /* icon font structure */
MyFont SizeFont; /* resize font structure */ MyFont SizeFont; /* resize font structure */
MyFont DefaultFont; MyFont DefaultFont;
struct IconRegion *FirstRegion; /* pointer to icon regions */
struct IconRegion *LastRegion; /* pointer to the last icon region */
const char *IconDirectory; /* icon directory to search */ const char *IconDirectory; /* icon directory to search */
int SizeStringOffset; /* x offset in size window for drawing */ int SizeStringOffset; /* x offset in size window for drawing */
int SizeStringWidth; /* minimum width of size window */ int SizeStringWidth; /* minimum width of size window */

View File

@ -303,9 +303,9 @@ WriteWinConfigEntry (FILE *configFile, TwmWindow *theWindow,
if (!windowRole) if (!windowRole)
{ {
if (!write_counted_string (configFile, theWindow->class.res_name)) if (!write_counted_string (configFile, theWindow->classh.res_name))
return 0; return 0;
if (!write_counted_string (configFile, theWindow->class.res_class)) if (!write_counted_string (configFile, theWindow->classh.res_class))
return 0; return 0;
if (theWindow->nameChanged) if (theWindow->nameChanged)
{ {
@ -397,8 +397,8 @@ ReadWinConfigEntry (FILE *configFile, unsigned short version,
entry->tag = 0; entry->tag = 0;
entry->client_id = NULL; entry->client_id = NULL;
entry->window_role = NULL; entry->window_role = NULL;
entry->class.res_name = NULL; entry->classh.res_name = NULL;
entry->class.res_class = NULL; entry->classh.res_class = NULL;
entry->wm_name = NULL; entry->wm_name = NULL;
entry->wm_command = NULL; entry->wm_command = NULL;
entry->wm_command_count = 0; entry->wm_command_count = 0;
@ -411,9 +411,9 @@ ReadWinConfigEntry (FILE *configFile, unsigned short version,
if (!entry->window_role) if (!entry->window_role)
{ {
if (!read_counted_string (configFile, &entry->class.res_name)) if (!read_counted_string (configFile, &entry->classh.res_name))
goto give_up; goto give_up;
if (!read_counted_string (configFile, &entry->class.res_class)) if (!read_counted_string (configFile, &entry->classh.res_class))
goto give_up; goto give_up;
if (!read_counted_string (configFile, &entry->wm_name)) if (!read_counted_string (configFile, &entry->wm_name))
goto give_up; goto give_up;
@ -487,10 +487,10 @@ give_up:
free (entry->client_id); free (entry->client_id);
if (entry->window_role) if (entry->window_role)
free (entry->window_role); free (entry->window_role);
if (entry->class.res_name) if (entry->classh.res_name)
free (entry->class.res_name); free (entry->classh.res_name);
if (entry->class.res_class) if (entry->classh.res_class)
free (entry->class.res_class); free (entry->classh.res_class);
if (entry->wm_name) if (entry->wm_name)
free (entry->wm_name); free (entry->wm_name);
if (entry->wm_command_count && entry->wm_command) if (entry->wm_command_count && entry->wm_command)
@ -597,10 +597,10 @@ GetWindowConfig (
* changed in the previous session. * changed in the previous session.
*/ */
if (strcmp(theWindow->class.res_name, if (strcmp(theWindow->classh.res_name,
ptr->class.res_name) == 0 && ptr->classh.res_name) == 0 &&
strcmp(theWindow->class.res_class, strcmp(theWindow->classh.res_class,
ptr->class.res_class) == 0 && ptr->classh.res_class) == 0 &&
(ptr->wm_name == NULL || (ptr->wm_name == NULL ||
strcmp(theWindow->name, ptr->wm_name) == 0)) strcmp(theWindow->name, ptr->wm_name) == 0))
{ {

View File

@ -522,7 +522,7 @@ main(int argc, char *argv[])
Scr->tbpm.resize = None; Scr->tbpm.resize = None;
Scr->tbpm.question = None; Scr->tbpm.question = None;
Scr->tbpm.menu = None; Scr->tbpm.menu = None;
Scr->tbpm.delete = None; Scr->tbpm.del = None;
InitVariables(); InitVariables();
InitMenus(); InitMenus();
@ -720,8 +720,6 @@ InitVariables(void)
Scr->ZoomCount = 8; Scr->ZoomCount = 8;
Scr->Shadow = TRUE; Scr->Shadow = TRUE;
Scr->InterpolateMenuColors = FALSE; Scr->InterpolateMenuColors = FALSE;
Scr->FirstRegion = NULL;
Scr->LastRegion = NULL;
Scr->FirstTime = TRUE; Scr->FirstTime = TRUE;
Scr->HaveFonts = FALSE; /* i.e. not loaded yet */ Scr->HaveFonts = FALSE; /* i.e. not loaded yet */
Scr->CaseSensitive = TRUE; Scr->CaseSensitive = TRUE;

View File

@ -247,7 +247,7 @@ typedef struct TwmWindow
XSizeHints hints; /* normal hints */ XSizeHints hints; /* normal hints */
XWMHints *wmhints; /* WM hints */ XWMHints *wmhints; /* WM hints */
Window group; /* group ID */ Window group; /* group ID */
XClassHint class; XClassHint classh;
/*********************************************************************** /***********************************************************************
* color definitions per window * color definitions per window
**********************************************************************/ **********************************************************************/
@ -299,7 +299,7 @@ typedef struct TWMWinConfigEntry
int tag; int tag;
char *client_id; char *client_id;
char *window_role; char *window_role;
XClassHint class; XClassHint classh;
char *wm_name; char *wm_name;
int wm_command_count; int wm_command_count;
char **wm_command; char **wm_command;

View File

@ -879,11 +879,11 @@ CreateDotPixmap (unsigned *widthp, unsigned *heightp)
if (!(h & 1)) if (!(h & 1))
h--; h--;
*widthp = *heightp = (unsigned int) h; *widthp = *heightp = (unsigned int) h;
if (Scr->tbpm.delete == None) { if (Scr->tbpm.del == None) {
GC gc; GC gc;
Pixmap pix; Pixmap pix;
pix = Scr->tbpm.delete = XCreatePixmap (dpy, Scr->Root, h, h, 1); pix = Scr->tbpm.del = XCreatePixmap (dpy, Scr->Root, h, h, 1);
gc = XCreateGC (dpy, pix, 0L, NULL); gc = XCreateGC (dpy, pix, 0L, NULL);
XSetLineAttributes (dpy, gc, h, LineSolid, CapRound, JoinRound); XSetLineAttributes (dpy, gc, h, LineSolid, CapRound, JoinRound);
XSetForeground (dpy, gc, 0L); XSetForeground (dpy, gc, 0L);
@ -892,7 +892,7 @@ CreateDotPixmap (unsigned *widthp, unsigned *heightp)
XDrawLine (dpy, pix, gc, h/2, h/2, h/2, h/2); XDrawLine (dpy, pix, gc, h/2, h/2, h/2, h/2);
XFreeGC (dpy, gc); XFreeGC (dpy, gc);
} }
return Scr->tbpm.delete; return Scr->tbpm.del;
} }
#define questionmark_width 8 #define questionmark_width 8

View File

@ -61,35 +61,41 @@ in this Software without prior written authorization from The Open Group.
#ifndef _UTIL_ #ifndef _UTIL_
#define _UTIL_ #define _UTIL_
extern void MoveOutline ( Window root, int x, int y, int width, int height, #ifdef __cplusplus
#define EXTERN extern "C"
#else
#define EXTERN extern
#endif
EXTERN void MoveOutline ( Window root, int x, int y, int width, int height,
int bw, int th ); int bw, int th );
extern void Zoom ( Window wf, Window wt ); EXTERN void Zoom ( Window wf, Window wt );
extern const char * ExpandFilename ( const char *name ); EXTERN const char * ExpandFilename ( const char *name );
extern void GetUnknownIcon ( const char *name ); EXTERN void GetUnknownIcon ( const char *name );
extern Pixmap FindBitmap ( const char *name, unsigned int *widthp, EXTERN Pixmap FindBitmap ( const char *name, unsigned int *widthp,
unsigned int *heightp ); unsigned int *heightp );
extern Pixmap GetBitmap ( const char *name ); EXTERN Pixmap GetBitmap ( const char *name );
extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps, EXTERN void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps,
Bool replace ); Bool replace );
extern void RemoveRGBColormap ( Atom a ); EXTERN void RemoveRGBColormap ( Atom a );
extern void LocateStandardColormaps ( void ); EXTERN void LocateStandardColormaps ( void );
extern void GetColor ( int kind, Pixel *what, const char *name ); EXTERN void GetColor ( int kind, Pixel *what, const char *name );
extern void GetColorValue ( int kind, XColor *what, const char *name ); EXTERN void GetColorValue ( int kind, XColor *what, const char *name );
extern void GetFont ( MyFont *font ); EXTERN void GetFont ( MyFont *font );
extern int MyFont_TextWidth( MyFont *font, const char *string, int len); EXTERN int MyFont_TextWidth( MyFont *font, const char *string, int len);
extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font, EXTERN void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font,
GC gc, int x, int y, const char * string, GC gc, int x, int y, const char * string,
int len); int len);
extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc, EXTERN void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc,
int x, int y, const char * string, int len); int x, int y, const char * string, int len);
extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back, EXTERN void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back,
MyFont *fix_font); MyFont *fix_font);
extern Status I18N_FetchName( Display *dpy, Window win, char **winname); EXTERN Status I18N_FetchName( Display *dpy, Window win, char **winname);
extern Status I18N_GetIconName( Display *dpy, Window win, char **iconname); EXTERN Status I18N_GetIconName( Display *dpy, Window win, char **iconname);
extern void SetFocus ( TwmWindow *tmp_win, Time time ); EXTERN void SetFocus ( TwmWindow *tmp_win, Time time );
extern void Bell ( int type, int percent, Window win ); EXTERN void Bell ( int type, int percent, Window win );
extern int HotX, HotY; EXTERN int HotX, HotY;
#define WM_BELL 0 #define WM_BELL 0
#define MINOR_ERROR_BELL 1 #define MINOR_ERROR_BELL 1
@ -109,4 +115,31 @@ extern int HotX, HotY;
#define XkbBI_MajorError 2 #define XkbBI_MajorError 2
#endif #endif
#ifdef __cplusplus
template<typename T>
class XArray
{
T *array;
int sz;
public:
XArray(T * a, int s) : array{a}, sz{s}
{
}
T* begin() const
{
return array;
}
T* end() const
{
return array+sz;
}
~XArray()
{
XFree(array);
}
};
#endif
#endif /* _UTIL_ */ #endif /* _UTIL_ */

View File

@ -49,5 +49,5 @@ in this Software without prior written authorization from The Open Group.
/** OR PERFORMANCE OF THIS SOFTWARE. **/ /** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/ /*****************************************************************************/
const char *Version = XVENDORNAME", "XORG_RELEASE; const char *Version = "0.1";