jwm-2.1.0+svn579/0000755000000000000000000000000011710374021012050 5ustar rootrootjwm-2.1.0+svn579/config.sub0000644000000000000000000010115311710374020014030 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: jwm-2.1.0+svn579/Makefile.in0000644000000000000000000000372011710374020014116 0ustar rootrootPACKAGE = jwm SYSCONF = $(DESTDIR)@SYSCONF@ MANDIR = $(DESTDIR)@MANDIR@ VERSION ?= @VERSION@ USE_NLS = @USE_NLS@ all: cd src ; $(MAKE) all ; cd .. cd po ; $(MAKE) all ; cd .. install: all cd src ; $(MAKE) install ; cd .. cd po ; $(MAKE) install ; cd .. install -d -m 0755 $(SYSCONF) install -m 644 example.jwmrc $(SYSCONF)/system.jwmrc install -d -m 0755 $(MANDIR)/man1 install -m 644 jwm.1 $(MANDIR)/man1/jwm.1 depend: cd src ; $(MAKE) depend tarball: rm -f ../jwm-$(VERSION).tar.bz2 ; rm -fr ../jwm-$(VERSION) ; cp -r ../jwm ../jwm-$(VERSION) ; (cd ../jwm-$(VERSION) && $(MAKE) distclean) ; (cd .. && tar -cf jwm-$(VERSION).tar jwm-$(VERSION)); rm -fr ../jwm-$(VERSION) ; (cd .. && bzip2 jwm-$(VERSION).tar) clean: (cd src && $(MAKE) clean) (cd po && $(MAKE) clean) rm -rf doc distclean: clean rm -f *[~#] config.cache config.log config.status config.h rm -f Makefile src/Makefile jwm.tardist jwm.1 rm -fr autom4te.cache rm -f Makefile.bak src/Makefile.bak rm -fr `find . \( -name .svn -o -name .gdb_history \) -print` ; check-gettext: @if test x$(USE_NLS) != "xyes" ; then \ echo "Missing gettext. Rerun configure and check for" \ "'checking whether to use NLS... yes'!" ; exit 1 ; fi update-po: check-gettext @find src/ -name "*.c" -print | sort > po/POTFILES.in.2 ; \ if diff po/POTFILES.in po/POTFILES.in.2 >/dev/null 2>&1 ; then \ rm -f po/POTFILES.in.2 ; \ else \ mv po/POTFILES.in.2 po/POTFILES.in ; \ fi cd po && $(MAKE) $(AM_MAKEFLAGS) update-po update-gmo: check-gettext cd po && $(MAKE) $(AM_MAKEFLAGS) update-gmo force-update-gmo: check-gettext touch po/*.po cd po && $(MAKE) $(AM_MAKEFLAGS) update-gmo force-update-gmo-%: check-gettext @language=`echo $@ | sed s/force-update-gmo-//` ; \ if test ! -f po/$$language.po ; then \ echo "file po/$$language.po does not exist" ; exit 1 ; fi ; \ touch po/$$language.po ; \ cd po && $(MAKE) $(AM_MAKEFLAGS) update-gmo .PHONY: check-gettext update-po update-gmo force-update-gmo jwm-2.1.0+svn579/install-sh0000755000000000000000000001425311710374020014060 0ustar rootroot#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # 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 M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # 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. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d "$dst" ] then dst=$dst/`basename "$src"` else : fi fi ## this sed command emulates the dirname command dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp='' while [ $# -ne 0 ] ; do pathcomp=$pathcomp$1 shift if [ ! -d "$pathcomp" ] ; then $mkdirprog "$pathcomp" else : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename "$dst"` else : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/#inst.$$# rmtmp=$dstdir/#rm.$$# # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$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 $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # 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. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } jwm-2.1.0+svn579/LICENSE0000644000000000000000000004325411710374020013064 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. jwm-2.1.0+svn579/README0000644000000000000000000000146411710374020012734 0ustar rootrootJWM See LICENSE for license information. > Requirements To build JWM you will need a C compiler (gcc works), X11, and the "development headers" for X11 and Xlib. If available and not disabled at compile time, JWM will also use the following libraries: libfribidi for bi-directional text support. libjpeg for JPEG icons and backgrounds. libpng for PNG icons and backgrounds. libXext for the shape extension. libXext for the render extension. libXmu for rounded corners. libxft for antialiased and true type fonts. libXinerama for multiple head support. libXpm for XPM icons and backgrounds. > Installation Run "./configure --help" for configuration options. Run "./configure [options]" Run "make" to build JWM. Run "make install" to install JWM. For more information see http://joewing.net jwm-2.1.0+svn579/configure.in0000644000000000000000000003570511710374020014372 0ustar rootroot############################################################################ # JWM autoconf. ############################################################################ AC_INIT(jwm, svn-579, joewing@joewing.net) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src]) AC_CONFIG_SRCDIR([po]) AC_CONFIG_HEADER([config.h]) AC_LANG(C) AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL PACKAGE=jwm ############################################################################ # Check if we need _XOPEN_SOURCE ############################################################################ AC_MSG_CHECKING([if _XOPEN_SOURCE should be defined]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define _XOPEN_SOURCE 600L #include ]])], [use_xopen_source="yes"], [use_xopen_source="no"]) AC_MSG_RESULT([$use_xopen_source]) if test $use_xopen_source = "yes"; then AC_DEFINE(_XOPEN_SOURCE, 600L, [Define for single UNIX conformance]) # Needed for IRIX 6.2 so that struct timeval is declared. AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Define for timeval on IRIX 6.2]) # Needed for Solaris 2.5.1 so that struct timeval is declared. AC_DEFINE(__EXTENSIONS__, 1, [Define for timeval on Solaris 2.5.1]) fi ############################################################################ # Check for X11 ############################################################################ AC_PATH_X if test ! "$no_x" = "yes" ; then if test ! x"$x_libraries" = x ; then LDFLAGS="$LDFLAGS -L$x_libraries" fi if test ! x"$x_includes" = x ; then CFLAGS="$CFLAGS -I$x_includes" fi else AC_MSG_ERROR([Could not find X11]) fi AC_CHECK_LIB([X11], XOpenDisplay, [ LDFLAGS="$LDFLAGS -lX11" ], [ AC_MSG_ERROR([libX11 not found]) ]) AC_CHECK_LIB([X11], Xutf8TextPropertyToTextList, [ AC_DEFINE(USE_XUTF8, 1, [Define to use Xutf8TextPropertyToTextList]) ], [ AC_MSG_WARN([Xutf8TextPropertyToTextList not found in libX11]) ]) ############################################################################ # Check for necessary include files. ############################################################################ AC_CHECK_HEADERS([stdarg.h stdio.h stdlib.h ctype.h], [], [ AC_MSG_ERROR([one or more necessary header files not found]) ]) AC_CHECK_HEADERS([sys/select.h signal.h unistd.h time.h sys/wait.h sys/time.h]) AC_CHECK_HEADERS([alloca.h locale.h libintl.h]) AC_CHECK_HEADERS([X11/Xlib.h], [], [ AC_MSG_ERROR([Xlib.h could not be found]) ]) AC_CHECK_HEADERS([X11/Xutil.h X11/cursorfont.h X11/Xproto.h \ X11/Xatom.h X11/keysym.h X11/Xresource.h], [], [], [ #include ]) AC_CHECK_FUNCS([unsetenv putenv setlocale]) ############################################################################ # Check for pkg-config. ############################################################################ AC_DEFUN([JWM_PKGCONFIG_EXISTS], [ AC_MSG_CHECKING([for pkg-config]) if test -x `which pkg-config` ; then PKGCONFIG="pkg-config" fi AC_MSG_RESULT($PKGCONFIG) ]) AC_DEFUN([JWM_PKGCONFIG], [ AC_REQUIRE([JWM_PKGCONFIG_EXISTS]) if test "x$PKGCONFIG" != "x" ; then AC_MSG_CHECKING([if pkg-config knows about $2]) if test `$PKGCONFIG $2 ; echo $?` -eq 0 ; then $1="yes" else $1="no" fi AC_MSG_RESULT($$1) else $1="no" fi ]) JWM_PKGCONFIG([use_pkgconfig_png], [libpng]) JWM_PKGCONFIG([use_pkgconfig_jpeg], [libjpeg]) JWM_PKGCONFIG([use_pkgconfig_xft], [xft]) JWM_PKGCONFIG([use_pkgconfig_xrender], [xrender]) JWM_PKGCONFIG([use_pkgconfig_fribidi], [fribidi]) ############################################################################ # Check if confirm dialogs should be used. ############################################################################ AC_ARG_ENABLE(confirm, AC_HELP_STRING([--disable-confirm], [don't enable confirm dialogs]) ) if test "$enable_confirm" = "no" ; then AC_DEFINE(DISABLE_CONFIRM, 1, [Define to disable confirm dialogs]) else enable_confirm="yes" fi ############################################################################ # Check if icon support was requested. ############################################################################ AC_ARG_ENABLE(icons, AC_HELP_STRING([--disable-icons], [don't enable icon support]) ) if test "$enable_icons" != "no" ; then enable_icons="yes" AC_DEFINE(USE_ICONS, 1, [Define to enable icon support] ) fi ############################################################################ # Check if PNG support was requested and available. ############################################################################ AC_ARG_ENABLE(png, AC_HELP_STRING([--disable-png], [don't support PNG images]) ) if test "$enable_png" != "no" ; then if test "$use_pkgconfig_png" = "yes" ; then PNG_CFLAGS=`$PKGCONFIG --cflags libpng` PNG_LDFLAGS=`$PKGCONFIG --libs libpng` elif test -x `which libpng-config` ; then PNG_CFLAGS=`libpng-config --cflags` PNG_LDFLAGS=`libpng-config --libs` else PNG_LDFLAGS="-lpng -lz -lm" fi fi if test "$enable_png" != "no" ; then AC_CHECK_LIB(png, png_read_image, [ LDFLAGS="$LDFLAGS $PNG_LDFLAGS" CFLAGS="$CFLAGS $PNG_CFLAGS" enable_png="yes" AC_DEFINE(USE_PNG, 1, [Define to use libpng]) ], [ enable_png="no" AC_MSG_WARN([unable to use libpng, PNG support disabled]) ], [ $PNG_LDFLAGS ]) fi ############################################################################ # Check if JPEG support was requested and available. ############################################################################ AC_ARG_ENABLE(jpeg, AC_HELP_STRING([--disable-jpeg], [don't support JPEG images]) ) if test "$enable_jpeg" != "no" ; then if test "$use_pkgconfig_jpeg" = "yes" ; then JPEG_CFLAGS=`$PKGCONFIG --cflags libjpeg` JPEG_LDFLAGS=`$PKGCONFIG --libs libjpeg` else JPEG_LDFLAGS="-ljpeg" fi fi if test "$enable_jpeg" != "no" ; then AC_CHECK_LIB(jpeg, jpeg_start_decompress, [ LDFLAGS="$LDFLAGS $JPEG_LDFLAGS" CFLAGS="$CFLAGS $JPEG_CFLAGS" enable_jpeg="yes" AC_DEFINE(USE_JPEG, 1, [Define to use libjpeg]) ], [ enable_jpeg="no" AC_MSG_WARN([unable to use libjpeg, JPEG support disabled]) ], [ $JPEG_LDFLAGS ]) fi ############################################################################ # Check if XFT support was requested and available. ############################################################################ AC_ARG_ENABLE(xft, AC_HELP_STRING([--disable-xft], [don't use Xft]) ) if test "$enable_xft" != "no"; then if test "$use_pkgconfig_xft" = "yes" ; then XFT_CFLAGS=`$PKGCONFIG --cflags xft` XFT_LDFLAGS=`$PKGCONFIG --libs xft` elif test -x `which xft-config` ; then XFT_CFLAGS=`xft-config --cflags` XFT_LDFLAGS=`xft-config --libs` else XFT_LDFLAGS="-lXft" fi fi if test "$enable_xft" != "no" ; then AC_CHECK_LIB(Xft, XftFontOpenName, [ LDFLAGS="$LDFLAGS $XFT_LDFLAGS" CFLAGS="$CFLAGS $XFT_CFLAGS" enable_xft="yes" AC_DEFINE(USE_XFT, 1, [Define to enable Xft]) ], [ enable_xft="no" AC_MSG_WARN([unable to use Xft]) ], [ $XFT_LDFLAGS ]) fi if test "$enable_xft" != "no" ; then AC_CHECK_HEADERS([ft2build.h], [], [], [ #include ]) fi ############################################################################ # Check if support for the XRENDER extension was requested and available. ############################################################################ AC_ARG_ENABLE(xrender, AC_HELP_STRING([--disable-xrender], [don't use the XRender extension]) ) if test "$enable_xrender" != "no"; then if test "$use_pkgconfig_xrender" = "yes" ; then XRENDER_CFLAGS=`$PKGCONFIG --cflags xrender` XRENDER_LDFLAGS=`$PKGCONFIG --libs xrender` else XRENDER_LDFLAGS="-lXrender" fi AC_CHECK_HEADERS([X11/extensions/Xrender.h], [], [ enable_xrender="no"; AC_MSG_WARN([unable to use X11/extensions/Xrender.h]) ], [ #include ]) fi if test "$enable_xrender" != "no" ; then AC_CHECK_LIB(Xrender, XRenderComposite, [ LDFLAGS="$LDFLAGS $XRENDER_LDFLAGS" CFLAGS="$CFLAGS $XRENDER_CFLAGS" enable_xrender="yes" AC_DEFINE(USE_XRENDER, 1, [Define to enable the XRender extension]) ], [ enable_xrender="no" AC_MSG_WARN([unable to use the XRender extension]) ], [ $XRENDER_LDFLAGS ]) fi ############################################################################ # Check if FriBidi support was requested and available. ############################################################################ AC_ARG_ENABLE(fribidi, AC_HELP_STRING([--disable-fribidi], [disable bi-directional unicode support]) ) if test "$enable_fribidi" != "no" ; then if test "$use_pkgconfig_fribidi" = "yes" ; then FRIBIDI_CFLAGS=`$PKGCONFIG --cflags fribidi` FRIBIDI_LDFLAGS=`$PKGCONFIG --libs fribidi` elif test -x `which fribidi-config` ; then FRIBIDI_CFLAGS=`fribidi-config --cflags` FRIBIDI_LDFLAGS=`fribidi-config --libs` else FRIBIDI_LDFLAGS="-lfribidi" fi fi if test "$enable_fribidi" != "no" ; then AC_CHECK_LIB(fribidi, fribidi_log2vis, [ LDFLAGS="$LDFLAGS $FRIBIDI_LDFLAGS" CFLAGS="$CFLAGS $FRIBIDI_CFLAGS" enable_fribidi="yes" AC_DEFINE(USE_FRIBIDI, 1, [Define to use FriBidi]) ], [ enable_fribidi="no" AC_MSG_WARN([unable to use FriBidi]) ], [ $FRIBIDI_LDFLAGS ]) fi ############################################################################ # Check if XPM support was requested and available. ############################################################################ AC_ARG_ENABLE(xpm, AC_HELP_STRING([--disable-xpm], [don't support XPM images]) ) if test "$enable_xpm" != "no"; then AC_CHECK_HEADERS([X11/xpm.h], [], [ enable_xpm="no"; AC_MSG_WARN([unable to use X11/xpm.h]) ]) fi if test "$enable_xpm" != "no"; then AC_CHECK_DECL(XpmAllocColor, [], [ enable_xpm="no" AC_MSG_WARN([XPM library too old]) ], [ #include ]) fi if test "$enable_xpm" != "no"; then AC_CHECK_LIB(Xpm, XpmReadFileToImage, [ LDFLAGS="$LDFLAGS -lXpm"; enable_xpm="yes" AC_DEFINE(USE_XPM, 1, [Define to enable XPM support]) ], [ enable_xpm="no" AC_MSG_WARN([unable to use libXpm]) ]) fi ############################################################################ # Check if support for the shape extension was requested and available. ############################################################################ AC_ARG_ENABLE(shape, AC_HELP_STRING([--disable-shape], [don't use the X shape extension]) ) if test "$enable_shape" != "no"; then AC_CHECK_LIB(Xext, XShapeCombineRectangles, [ LDFLAGS="$LDFLAGS -lXext" enable_shape="yes" AC_DEFINE(USE_SHAPE, 1, [Define to enable the X shape extension]) ], [ enable_shape="no" AC_MSG_WARN([unable to use the X shape extension]) ]) fi ############################################################################ # Check if support for Xmu was requested and available. # Note that Xmu appears to be broken on IRIX (drawing rounded rectangles # larger than 800 pixels in either direction causes problems). ############################################################################ AC_ARG_ENABLE(xmu, AC_HELP_STRING([--disable-xmu], [don't use Xmu]), [], [ if test `uname` == "IRIX" -o `uname` == "IRIX64" ; then AC_MSG_WARN([disabling Xmu (it is broken on IRIX)]) enable_xmu="no" fi ]) if test "$enable_xmu" != "no"; then AC_CHECK_LIB(Xmu, XmuDrawRoundedRectangle, [ LDFLAGS="$LDFLAGS -lXmu" enable_xmu="yes" AC_DEFINE(USE_XMU, 1, [Define to use Xmu]) ], [ enable_xmu="no" AC_MSG_WARN([unable to use Xmu]) ]) fi ############################################################################ # Check if support for Xinerama was requested and available. ############################################################################ AC_ARG_ENABLE(xinerama, AC_HELP_STRING([--disable-xinerama], [don't use Xinerama]) ) if test "$enable_xinerama" != "no"; then AC_CHECK_LIB(Xinerama, XineramaQueryExtension, [ LDFLAGS="$LDFLAGS -lXinerama" enable_xinerama="yes" AC_DEFINE(USE_XINERAMA, 1, [Define to enable Xinerama]) ], [ enable_xinerama="no" AC_MSG_WARN([unable to use Xinerama]) ]) fi ############################################################################ # Check if support for gettext was requested and available. ############################################################################ AM_GNU_GETTEXT([external]) LDFLAGS="$LDFLAGS $LIBINTL" ############################################################################ # Check if debug mode was requested. ############################################################################ AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [use this to debug JWM]) ) if test "$enable_debug" = "yes"; then AC_DEFINE(DEBUG, 1, [Define to debug JWM]) CFLAGS="$CFLAGS -Wall -g -DDEBUG" LDFLAGS="$LDFLAGS -g" else enable_debug="no" fi ############################################################################ # Create the output files. ############################################################################ if test "$prefix" = "NONE" ; then PREFIX="$ac_default_prefix" prefix="$ac_default_prefix" else PREFIX="$prefix" fi if test "$exec_prefix" = "NONE" ; then exec_prefix="$PREFIX" fi if test "$sysconfdir" = "" ; then sysconfdir="$ac_default_sysconfdir" fi if test "$mandir" = "" ; then mandir="$ac_default_mandir" fi if test "$LOCALEDIR" = "" ; then localedir=`eval echo \""$datadir"/locale\"` localedir=`eval echo \""$localedir"\"` CFLAGS="$CFLAGS -DLOCALEDIR=\\\"$localedir\\\"" fi BINDIR=`eval echo \""$bindir"\"` SYSCONF=`eval echo \""$sysconfdir"\"` MANDIR=`eval echo \""$mandir"\"` MANDIR=`eval echo \""$MANDIR"\"` AC_DEFINE_UNQUOTED(SYSTEM_CONFIG, "$SYSCONF/system.jwmrc", [default system configuration path]) AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) AC_SUBST(VERSION, "$PACKAGE_VERSION") AC_SUBST(INSTVERSION, `echo $PACKAGE_VERSION | tr -d .`) AC_SUBST(BINDIR, "$BINDIR") AC_SUBST(MANDIR, "$MANDIR") AC_SUBST(DATE, `date "+%Y-%m-%d"`) AC_SUBST(SYSCONF, "$SYSCONF") AC_SUBST(PACKAGE, "$PACKAGE") AC_OUTPUT( po/Makefile.in Makefile src/Makefile jwm.1 ) ############################################################################ # Display the status. ############################################################################ echo "Compiler: $CC" echo "Compile flags: $CFLAGS" echo "Link flags: $LDFLAGS" echo echo "Options" echo echo " Confirm: $enable_confirm" echo " Icon: $enable_icons" echo " PNG: $enable_png" echo " JPEG: $enable_jpeg" echo " XPM: $enable_xpm" echo " XFT: $enable_xft" echo " XRender: $enable_xrender" echo " FriBidi: $enable_fribidi" echo " Shape: $enable_shape" echo " Xmu: $enable_xmu" echo " Xinerama: $enable_xinerama" echo " Debug: $enable_debug" echo jwm-2.1.0+svn579/po/0000755000000000000000000000000011710374021012466 5ustar rootrootjwm-2.1.0+svn579/po/jwm.pot0000644000000000000000000001633311710374020014014 0ustar rootroot# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: jwm 2.1.1\n" "Report-Msgid-Bugs-To: joewing@joewing.net\n" "POT-Creation-Date: 2011-12-22 18:24-0600\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: src/background.c:136 msgid "no value specified for background" msgstr "" #: src/background.c:152 #, c-format msgid "invalid background type: \"%s\"" msgstr "" #: src/background.c:301 #, c-format msgid "background image not found: \"%s\"" msgstr "" #: src/border.c:82 #, c-format msgid "bitmap could not be loaded: %s" msgstr "" #: src/border.c:654 #, c-format msgid "invalid border width specified: %d" msgstr "" #: src/border.c:673 #, c-format msgid "invalid title height specified: %d" msgstr "" #: src/client.c:490 #, c-format msgid "Client %s requested an invalid layer: %d" msgstr "" #: src/client.c:914 msgid "Kill this window?" msgstr "" #: src/client.c:915 msgid "This may cause data to be lost!" msgstr "" #: src/client.c:1487 #, c-format msgid "invalid active client opacity: %s" msgstr "" #: src/client.c:1514 src/client.c:1527 #, c-format msgid "invalid inactive client opacity: %s" msgstr "" #: src/client.c:1537 #, c-format msgid "invalid inactive client opacity delta: %s" msgstr "" #: src/command.c:146 src/main.c:198 #, c-format msgid "exec failed: (%s) %s" msgstr "" #: src/cursor.c:271 #, c-format msgid "invalid DoubleClickSpeed: %d" msgstr "" #: src/cursor.c:289 #, c-format msgid "invalid DoubleClickDelta: %d" msgstr "" #: src/desktop.c:269 msgid "invalid desktop count" msgstr "" #: src/desktop.c:283 msgid "empty Desktops Name tag" msgstr "" #: src/dock.c:149 msgid "only one Dock allowed" msgstr "" #: src/dock.c:226 msgid "could not acquire system tray selection" msgstr "" #: src/event.c:831 msgid "Fullscreen state will be shaped!" msgstr "" #: src/font.c:72 src/font.c:89 #, c-format msgid "could not load font: %s" msgstr "" #: src/font.c:79 src/font.c:96 #, c-format msgid "could not load the default font: %s" msgstr "" #: src/font.c:187 msgid "empty Font tag" msgstr "" #: src/group.c:133 msgid "invalid group class" msgstr "" #: src/group.c:146 msgid "invalid group name" msgstr "" #: src/group.c:271 #, c-format msgid "invalid group layer: %s" msgstr "" #: src/group.c:279 #, c-format msgid "invalid group desktop: %s" msgstr "" #: src/group.c:304 #, c-format msgid "invalid group opacity: %s" msgstr "" #: src/image.c:161 #, c-format msgid "could not create read struct for PNG image: %s" msgstr "" #: src/image.c:179 #, c-format msgid "error reading PNG image: %s" msgstr "" #: src/image.c:186 #, c-format msgid "could not create info struct for PNG image: %s" msgstr "" #: src/key.c:322 msgid "Specified KeySym is not defined for any KeyCode" msgstr "" #: src/key.c:330 #, c-format msgid "modifier not found for keysym 0x%0x" msgstr "" #: src/key.c:360 #, c-format msgid "invalid modifier: \"%c\"" msgstr "" #: src/key.c:376 #, c-format msgid "invalid key symbol: \"%s\"" msgstr "" #: src/key.c:457 msgid "neither key nor keycode specified for Key" msgstr "" #: src/key.c:474 #, c-format msgid "key binding: root menu %d not defined" msgstr "" #: src/lex.c:183 #, c-format msgid "%s[%d]: close tag \"%s\" does not match open tag \"%s\"" msgstr "" #: src/lex.c:190 #, c-format msgid "%s[%d]: unexpected and invalid close tag" msgstr "" #: src/lex.c:197 #, c-format msgid "%s[%d]: close tag \"%s\" without open tag" msgstr "" #: src/lex.c:200 #, c-format msgid "%s[%d]: invalid close tag" msgstr "" #: src/lex.c:219 #, c-format msgid "%s[%d]: invalid open tag" msgstr "" #: src/lex.c:232 #, c-format msgid "%s[%d]: invalid tag" msgstr "" #: src/lex.c:279 #, c-format msgid "%s[%d]: unexpected text: \"%s\"" msgstr "" #: src/lex.c:325 #, c-format msgid "%s[%d]: invalid entity: \"%.8s\"" msgstr "" #: src/menu.c:851 #, c-format msgid "invalid menu opacity: %s" msgstr "" #: src/move.c:83 #, c-format msgid "invalid snap distance specified: %d" msgstr "" #: src/parse.c:1738 #, c-format msgid "invalid tag in %s: %s" msgstr "" #: src/parse.c:1758 msgid "configuration error" msgstr "" #: src/popup.c:183 #, c-format msgid "invalid popup delay specified: %s" msgstr "" #: src/root.c:104 #, c-format msgid "invalid root menu specified: \"%c\"" msgstr "" #: src/root.c:225 msgid "Exit JWM" msgstr "" #: src/root.c:226 msgid "Are you sure?" msgstr "" #: src/status.c:227 #, c-format msgid "invalid MoveMode coordinates: \"%s\"" msgstr "" #: src/status.c:242 #, c-format msgid "invalid ResizeMode coordinates: \"%s\"" msgstr "" #: src/swallow.c:93 msgid "cannot swallow a client with no name" msgstr "" #: src/swallow.c:100 msgid "cannot swallow the same client multiple times" msgstr "" #: src/taskbar.c:766 #, c-format msgid "invalid maxwidth for TaskList: %s" msgstr "" #: src/taskbar.c:788 #, c-format msgid "invalid insert mode: \"%s\"" msgstr "" #: src/traybutton.c:91 #, c-format msgid "could not load tray icon: \"%s\"" msgstr "" #: src/traybutton.c:140 msgid "no icon or label for TrayButton" msgstr "" #: src/traybutton.c:145 #, c-format msgid "invalid TrayButton width: %d" msgstr "" #: src/traybutton.c:149 #, c-format msgid "invalid TrayButton height: %d" msgstr "" #: src/traybutton.c:254 #, c-format msgid "invalid TrayButton action: \"%s\"" msgstr "" #: src/traybutton.c:465 #, c-format msgid "tray button: root menu %d not defined" msgstr "" #: src/tray.c:1036 #, c-format msgid "invalid tray width: %d" msgstr "" #: src/tray.c:1054 #, c-format msgid "invalid tray height: %d" msgstr "" #: src/tray.c:1082 #, c-format msgid "invalid tray layout: \"%s\"" msgstr "" #: src/tray.c:1108 #, c-format msgid "invalid tray layer: %d" msgstr "" #: src/tray.c:1126 #, c-format msgid "invalid tray border: %d" msgstr "" #: src/tray.c:1148 #, c-format msgid "invalid tray horizontal alignment: \"%s\"" msgstr "" #: src/tray.c:1168 #, c-format msgid "invalid tray vertical alignment: \"%s\"" msgstr "" #: src/tray.c:1183 #, c-format msgid "invalid tray opacity: %s" msgstr "" #: src/winmenu.c:76 msgid "Close" msgstr "" #: src/winmenu.c:77 msgid "Kill" msgstr "" #: src/winmenu.c:83 msgid "Resize" msgstr "" #: src/winmenu.c:86 msgid "Move" msgstr "" #: src/winmenu.c:93 src/winmenu.c:117 msgid "Restore" msgstr "" #: src/winmenu.c:96 msgid "Unshade" msgstr "" #: src/winmenu.c:98 msgid "Shade" msgstr "" #: src/winmenu.c:100 msgid "Minimize" msgstr "" #: src/winmenu.c:109 msgid "Maximize-y" msgstr "" #: src/winmenu.c:113 msgid "Maximize-x" msgstr "" #: src/winmenu.c:119 msgid "Maximize" msgstr "" #: src/winmenu.c:127 msgid "Unstick" msgstr "" #: src/winmenu.c:129 msgid "Stick" msgstr "" #: src/winmenu.c:153 msgid "Layer" msgstr "" #: src/winmenu.c:168 msgid "[Top]" msgstr "" #: src/winmenu.c:170 msgid "Top" msgstr "" #: src/winmenu.c:177 msgid "[Normal]" msgstr "" #: src/winmenu.c:179 msgid "Normal" msgstr "" #: src/winmenu.c:200 msgid "[Bottom]" msgstr "" #: src/winmenu.c:202 msgid "Bottom" msgstr "" #: src/winmenu.c:221 msgid "Send To" msgstr "" jwm-2.1.0+svn579/po/boldquot.sed0000644000000000000000000000033111710374020015010 0ustar rootroots/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g jwm-2.1.0+svn579/po/Makefile.in0000644000000000000000000003707711710374020014550 0ustar rootroot# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = jwm VERSION = svn-579 PACKAGE_BUGREPORT = joewing@joewing.net SHELL = /bin/sh srcdir = . top_srcdir = .. prefix = /usr/local exec_prefix = /usr/local datarootdir = ${prefix}/share datadir = ${datarootdir} localedir = /usr/local/share/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) /usr/bin/install -c -d install_sh = $(SHELL) /usr/bin/install -c MKDIR_P = @MKDIR_P@ mkdir_p = @MKDIR_P@ GMSGFMT_ = : GMSGFMT_no = : GMSGFMT_yes = : GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = : MSGFMT_no = : MSGFMT_yes = : MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = : XGETTEXT_no = : XGETTEXT_yes = : XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = : --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-no all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "0.18" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version 0.18" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU jwm' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}jwm" \ --package-version='svn-579' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-no if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-no if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-no if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use /bin/sh, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && /bin/sh ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: jwm-2.1.0+svn579/po/en@boldquot.header0000644000000000000000000000247111710374020016117 0ustar rootroot# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # jwm-2.1.0+svn579/po/quot.sed0000644000000000000000000000023111710374020014146 0ustar rootroots/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g jwm-2.1.0+svn579/po/Makefile.in.in0000644000000000000000000003743411710374020015152 0ustar rootroot# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @INSTALL@ -d install_sh = $(SHELL) @INSTALL@ MKDIR_P = @MKDIR_P@ mkdir_p = @MKDIR_P@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: jwm-2.1.0+svn579/po/en@quot.header0000644000000000000000000000226311710374020015255 0ustar rootroot# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # jwm-2.1.0+svn579/po/Makevars0000644000000000000000000000343311710374020014164 0ustar rootroot# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = jwm # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = joewing@joewing.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = jwm-2.1.0+svn579/po/remove-potcdate.sin0000644000000000000000000000066011710374020016300 0ustar rootroot# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } jwm-2.1.0+svn579/po/Rules-quot0000644000000000000000000000340011710374020014465 0ustar rootroot# Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header jwm-2.1.0+svn579/po/POTFILES.in0000644000000000000000000000110311710374020014235 0ustar rootrootsrc/background.c src/border.c src/button.c src/client.c src/clientlist.c src/clock.c src/color.c src/command.c src/confirm.c src/cursor.c src/debug.c src/desktop.c src/dock.c src/error.c src/event.c src/font.c src/gradient.c src/group.c src/help.c src/hint.c src/icon.c src/image.c src/key.c src/lex.c src/main.c src/match.c src/menu.c src/misc.c src/move.c src/outline.c src/pager.c src/parse.c src/place.c src/popup.c src/render.c src/resize.c src/root.c src/screen.c src/spacer.c src/status.c src/swallow.c src/taskbar.c src/timing.c src/traybutton.c src/tray.c src/winmenu.c jwm-2.1.0+svn579/po/insert-header.sin0000644000000000000000000000124011710374020015727 0ustar rootroot# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } jwm-2.1.0+svn579/po/LINGUAS0000644000000000000000000000000011710374020013500 0ustar rootrootjwm-2.1.0+svn579/po/Makefile0000644000000000000000000005006011710374020014126 0ustar rootroot# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.18 GETTEXT_MACRO_VERSION = 0.18 PACKAGE = jwm VERSION = svn-579 PACKAGE_BUGREPORT = joewing@joewing.net SHELL = /bin/sh srcdir = . top_srcdir = .. prefix = /usr/local exec_prefix = /usr/local datarootdir = ${prefix}/share datadir = ${datarootdir} localedir = /usr/local/share/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) /usr/bin/install -c -d install_sh = $(SHELL) /usr/bin/install -c MKDIR_P = @MKDIR_P@ mkdir_p = @MKDIR_P@ GMSGFMT_ = : GMSGFMT_no = : GMSGFMT_yes = : GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = : MSGFMT_no = : MSGFMT_yes = : MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = : XGETTEXT_no = : XGETTEXT_yes = : XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = : --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = GMOFILES = UPDATEPOFILES = DUMMYPOFILES = DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ ../src/background.c \ ../src/border.c \ ../src/button.c \ ../src/client.c \ ../src/clientlist.c \ ../src/clock.c \ ../src/color.c \ ../src/command.c \ ../src/confirm.c \ ../src/cursor.c \ ../src/debug.c \ ../src/desktop.c \ ../src/dock.c \ ../src/error.c \ ../src/event.c \ ../src/font.c \ ../src/gradient.c \ ../src/group.c \ ../src/help.c \ ../src/hint.c \ ../src/icon.c \ ../src/image.c \ ../src/key.c \ ../src/lex.c \ ../src/main.c \ ../src/match.c \ ../src/menu.c \ ../src/misc.c \ ../src/move.c \ ../src/outline.c \ ../src/pager.c \ ../src/parse.c \ ../src/place.c \ ../src/popup.c \ ../src/render.c \ ../src/resize.c \ ../src/root.c \ ../src/screen.c \ ../src/spacer.c \ ../src/status.c \ ../src/swallow.c \ ../src/taskbar.c \ ../src/timing.c \ ../src/traybutton.c \ ../src/tray.c \ ../src/winmenu.c CATALOGS = # Makevars gets inserted here. (Don't remove this line!) # Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = jwm # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Free Software Foundation, Inc. # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = joewing@joewing.net # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: check-macro-version all-no all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. check-macro-version: @test "$(GETTEXT_MACRO_VERSION)" = "0.18" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version 0.18" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed if LC_ALL=C grep 'GNU jwm' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ package_gnu='GNU '; \ else \ package_gnu=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_gnu}jwm" \ --package-version='svn-579' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-no if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-no if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-no if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use /bin/sh, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in LINGUAS cd $(top_builddir) \ && /bin/sh ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header jwm-2.1.0+svn579/po/POTFILES0000644000000000000000000000201511710374020013633 0ustar rootroot ../src/background.c \ ../src/border.c \ ../src/button.c \ ../src/client.c \ ../src/clientlist.c \ ../src/clock.c \ ../src/color.c \ ../src/command.c \ ../src/confirm.c \ ../src/cursor.c \ ../src/debug.c \ ../src/desktop.c \ ../src/dock.c \ ../src/error.c \ ../src/event.c \ ../src/font.c \ ../src/gradient.c \ ../src/group.c \ ../src/help.c \ ../src/hint.c \ ../src/icon.c \ ../src/image.c \ ../src/key.c \ ../src/lex.c \ ../src/main.c \ ../src/match.c \ ../src/menu.c \ ../src/misc.c \ ../src/move.c \ ../src/outline.c \ ../src/pager.c \ ../src/parse.c \ ../src/place.c \ ../src/popup.c \ ../src/render.c \ ../src/resize.c \ ../src/root.c \ ../src/screen.c \ ../src/spacer.c \ ../src/status.c \ ../src/swallow.c \ ../src/taskbar.c \ ../src/timing.c \ ../src/traybutton.c \ ../src/tray.c \ ../src/winmenu.c jwm-2.1.0+svn579/configure0000755000000000000000000105740711710374020013774 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for jwm svn-579. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='jwm' PACKAGE_TARNAME='jwm' PACKAGE_VERSION='svn-579' PACKAGE_STRING='jwm svn-579' PACKAGE_BUGREPORT='joewing@joewing.net' ac_unique_file="src" ac_unique_file="po" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" gt_needs= ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA XMKMF GREP EGREP SET_MAKE USE_NLS GETTEXT_MACRO_VERSION MSGFMT GMSGFMT MSGFMT_015 GMSGFMT_015 XGETTEXT XGETTEXT_015 MSGMERGE XGETTEXT_EXTRA_OPTIONS build build_cpu build_vendor build_os host host_cpu host_vendor host_os LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB VERSION INSTVERSION BINDIR MANDIR DATE SYSCONF PACKAGE LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP XMKMF' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/[-.]/_/g'` eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures jwm svn-579 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/jwm] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of jwm svn-579:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-confirm don't enable confirm dialogs --disable-icons don't enable icon support --disable-png don't support PNG images --disable-jpeg don't support JPEG images --disable-xft don't use Xft --disable-xrender don't use the XRender extension --disable-fribidi disable bi-directional unicode support --disable-xpm don't support XPM images --disable-shape don't use the X shape extension --disable-xmu don't use Xmu --disable-xinerama don't use Xinerama --disable-nls do not use Native Language Support --disable-rpath do not hardcode runtime library paths --enable-debug use this to debug JWM Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-x use the X Window System --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF jwm configure svn-579 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by jwm $as_me svn-579, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 ac_config_headers="$ac_config_headers config.h" 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 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6; } { echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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_c_werror_flag=$ac_save_c_werror_flag fi { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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 { echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } 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 ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. { echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' PACKAGE=jwm ############################################################################ # Check if we need _XOPEN_SOURCE ############################################################################ { echo "$as_me:$LINENO: checking if _XOPEN_SOURCE should be defined" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE should be defined... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _XOPEN_SOURCE 600L #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then use_xopen_source="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 use_xopen_source="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $use_xopen_source" >&5 echo "${ECHO_T}$use_xopen_source" >&6; } if test $use_xopen_source = "yes"; then cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE 600L _ACEOF # Needed for IRIX 6.2 so that struct timeval is declared. cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF # Needed for Solaris 2.5.1 so that struct timeval is declared. cat >>confdefs.h <<\_ACEOF #define __EXTENSIONS__ 1 _ACEOF fi ############################################################################ # Check for X11 ############################################################################ { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test ! "$no_x" = "yes" ; then if test ! x"$x_libraries" = x ; then LDFLAGS="$LDFLAGS -L$x_libraries" fi if test ! x"$x_includes" = x ; then CFLAGS="$CFLAGS -I$x_includes" fi else { { echo "$as_me:$LINENO: error: Could not find X11" >&5 echo "$as_me: error: Could not find X11" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6; } if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_X11_XOpenDisplay=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6; } if test $ac_cv_lib_X11_XOpenDisplay = yes; then LDFLAGS="$LDFLAGS -lX11" else { { echo "$as_me:$LINENO: error: libX11 not found" >&5 echo "$as_me: error: libX11 not found" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for Xutf8TextPropertyToTextList in -lX11" >&5 echo $ECHO_N "checking for Xutf8TextPropertyToTextList in -lX11... $ECHO_C" >&6; } if test "${ac_cv_lib_X11_Xutf8TextPropertyToTextList+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char Xutf8TextPropertyToTextList (); int main () { return Xutf8TextPropertyToTextList (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_X11_Xutf8TextPropertyToTextList=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_X11_Xutf8TextPropertyToTextList=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_X11_Xutf8TextPropertyToTextList" >&5 echo "${ECHO_T}$ac_cv_lib_X11_Xutf8TextPropertyToTextList" >&6; } if test $ac_cv_lib_X11_Xutf8TextPropertyToTextList = yes; then cat >>confdefs.h <<\_ACEOF #define USE_XUTF8 1 _ACEOF else { echo "$as_me:$LINENO: WARNING: Xutf8TextPropertyToTextList not found in libX11" >&5 echo "$as_me: WARNING: Xutf8TextPropertyToTextList not found in libX11" >&2;} fi ############################################################################ # Check for necessary include files. ############################################################################ { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdarg.h stdio.h stdlib.h ctype.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to joewing@joewing.net ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: one or more necessary header files not found" >&5 echo "$as_me: error: one or more necessary header files not found" >&2;} { (exit 1); exit 1; }; } fi done for ac_header in sys/select.h signal.h unistd.h time.h sys/wait.h sys/time.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to joewing@joewing.net ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in alloca.h locale.h libintl.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to joewing@joewing.net ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in X11/Xlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to joewing@joewing.net ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { echo "$as_me:$LINENO: error: Xlib.h could not be found" >&5 echo "$as_me: error: Xlib.h could not be found" >&2;} { (exit 1); exit 1; }; } fi done for ac_header in X11/Xutil.h X11/cursorfont.h X11/Xproto.h \ X11/Xatom.h X11/keysym.h X11/Xresource.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in unsetenv putenv setlocale do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ############################################################################ # Check for pkg-config. ############################################################################ { echo "$as_me:$LINENO: checking for pkg-config" >&5 echo $ECHO_N "checking for pkg-config... $ECHO_C" >&6; } if test -x `which pkg-config` ; then PKGCONFIG="pkg-config" fi { echo "$as_me:$LINENO: result: $PKGCONFIG" >&5 echo "${ECHO_T}$PKGCONFIG" >&6; } if test "x$PKGCONFIG" != "x" ; then { echo "$as_me:$LINENO: checking if pkg-config knows about libpng" >&5 echo $ECHO_N "checking if pkg-config knows about libpng... $ECHO_C" >&6; } if test `$PKGCONFIG libpng ; echo $?` -eq 0 ; then use_pkgconfig_png="yes" else use_pkgconfig_png="no" fi { echo "$as_me:$LINENO: result: $use_pkgconfig_png" >&5 echo "${ECHO_T}$use_pkgconfig_png" >&6; } else use_pkgconfig_png="no" fi if test "x$PKGCONFIG" != "x" ; then { echo "$as_me:$LINENO: checking if pkg-config knows about libjpeg" >&5 echo $ECHO_N "checking if pkg-config knows about libjpeg... $ECHO_C" >&6; } if test `$PKGCONFIG libjpeg ; echo $?` -eq 0 ; then use_pkgconfig_jpeg="yes" else use_pkgconfig_jpeg="no" fi { echo "$as_me:$LINENO: result: $use_pkgconfig_jpeg" >&5 echo "${ECHO_T}$use_pkgconfig_jpeg" >&6; } else use_pkgconfig_jpeg="no" fi if test "x$PKGCONFIG" != "x" ; then { echo "$as_me:$LINENO: checking if pkg-config knows about xft" >&5 echo $ECHO_N "checking if pkg-config knows about xft... $ECHO_C" >&6; } if test `$PKGCONFIG xft ; echo $?` -eq 0 ; then use_pkgconfig_xft="yes" else use_pkgconfig_xft="no" fi { echo "$as_me:$LINENO: result: $use_pkgconfig_xft" >&5 echo "${ECHO_T}$use_pkgconfig_xft" >&6; } else use_pkgconfig_xft="no" fi if test "x$PKGCONFIG" != "x" ; then { echo "$as_me:$LINENO: checking if pkg-config knows about xrender" >&5 echo $ECHO_N "checking if pkg-config knows about xrender... $ECHO_C" >&6; } if test `$PKGCONFIG xrender ; echo $?` -eq 0 ; then use_pkgconfig_xrender="yes" else use_pkgconfig_xrender="no" fi { echo "$as_me:$LINENO: result: $use_pkgconfig_xrender" >&5 echo "${ECHO_T}$use_pkgconfig_xrender" >&6; } else use_pkgconfig_xrender="no" fi if test "x$PKGCONFIG" != "x" ; then { echo "$as_me:$LINENO: checking if pkg-config knows about fribidi" >&5 echo $ECHO_N "checking if pkg-config knows about fribidi... $ECHO_C" >&6; } if test `$PKGCONFIG fribidi ; echo $?` -eq 0 ; then use_pkgconfig_fribidi="yes" else use_pkgconfig_fribidi="no" fi { echo "$as_me:$LINENO: result: $use_pkgconfig_fribidi" >&5 echo "${ECHO_T}$use_pkgconfig_fribidi" >&6; } else use_pkgconfig_fribidi="no" fi ############################################################################ # Check if confirm dialogs should be used. ############################################################################ # Check whether --enable-confirm was given. if test "${enable_confirm+set}" = set; then enableval=$enable_confirm; fi if test "$enable_confirm" = "no" ; then cat >>confdefs.h <<\_ACEOF #define DISABLE_CONFIRM 1 _ACEOF else enable_confirm="yes" fi ############################################################################ # Check if icon support was requested. ############################################################################ # Check whether --enable-icons was given. if test "${enable_icons+set}" = set; then enableval=$enable_icons; fi if test "$enable_icons" != "no" ; then enable_icons="yes" cat >>confdefs.h <<\_ACEOF #define USE_ICONS 1 _ACEOF fi ############################################################################ # Check if PNG support was requested and available. ############################################################################ # Check whether --enable-png was given. if test "${enable_png+set}" = set; then enableval=$enable_png; fi if test "$enable_png" != "no" ; then if test "$use_pkgconfig_png" = "yes" ; then PNG_CFLAGS=`$PKGCONFIG --cflags libpng` PNG_LDFLAGS=`$PKGCONFIG --libs libpng` elif test -x `which libpng-config` ; then PNG_CFLAGS=`libpng-config --cflags` PNG_LDFLAGS=`libpng-config --libs` else PNG_LDFLAGS="-lpng -lz -lm" fi fi if test "$enable_png" != "no" ; then { echo "$as_me:$LINENO: checking for png_read_image in -lpng" >&5 echo $ECHO_N "checking for png_read_image in -lpng... $ECHO_C" >&6; } if test "${ac_cv_lib_png_png_read_image+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $PNG_LDFLAGS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_read_image (); int main () { return png_read_image (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_png_png_read_image=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_png_png_read_image=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_read_image" >&5 echo "${ECHO_T}$ac_cv_lib_png_png_read_image" >&6; } if test $ac_cv_lib_png_png_read_image = yes; then LDFLAGS="$LDFLAGS $PNG_LDFLAGS" CFLAGS="$CFLAGS $PNG_CFLAGS" enable_png="yes" cat >>confdefs.h <<\_ACEOF #define USE_PNG 1 _ACEOF else enable_png="no" { echo "$as_me:$LINENO: WARNING: unable to use libpng, PNG support disabled" >&5 echo "$as_me: WARNING: unable to use libpng, PNG support disabled" >&2;} fi fi ############################################################################ # Check if JPEG support was requested and available. ############################################################################ # Check whether --enable-jpeg was given. if test "${enable_jpeg+set}" = set; then enableval=$enable_jpeg; fi if test "$enable_jpeg" != "no" ; then if test "$use_pkgconfig_jpeg" = "yes" ; then JPEG_CFLAGS=`$PKGCONFIG --cflags libjpeg` JPEG_LDFLAGS=`$PKGCONFIG --libs libjpeg` else JPEG_LDFLAGS="-ljpeg" fi fi if test "$enable_jpeg" != "no" ; then { echo "$as_me:$LINENO: checking for jpeg_start_decompress in -ljpeg" >&5 echo $ECHO_N "checking for jpeg_start_decompress in -ljpeg... $ECHO_C" >&6; } if test "${ac_cv_lib_jpeg_jpeg_start_decompress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $JPEG_LDFLAGS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_start_decompress (); int main () { return jpeg_start_decompress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_jpeg_jpeg_start_decompress=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jpeg_jpeg_start_decompress=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_start_decompress" >&5 echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_start_decompress" >&6; } if test $ac_cv_lib_jpeg_jpeg_start_decompress = yes; then LDFLAGS="$LDFLAGS $JPEG_LDFLAGS" CFLAGS="$CFLAGS $JPEG_CFLAGS" enable_jpeg="yes" cat >>confdefs.h <<\_ACEOF #define USE_JPEG 1 _ACEOF else enable_jpeg="no" { echo "$as_me:$LINENO: WARNING: unable to use libjpeg, JPEG support disabled" >&5 echo "$as_me: WARNING: unable to use libjpeg, JPEG support disabled" >&2;} fi fi ############################################################################ # Check if XFT support was requested and available. ############################################################################ # Check whether --enable-xft was given. if test "${enable_xft+set}" = set; then enableval=$enable_xft; fi if test "$enable_xft" != "no"; then if test "$use_pkgconfig_xft" = "yes" ; then XFT_CFLAGS=`$PKGCONFIG --cflags xft` XFT_LDFLAGS=`$PKGCONFIG --libs xft` elif test -x `which xft-config` ; then XFT_CFLAGS=`xft-config --cflags` XFT_LDFLAGS=`xft-config --libs` else XFT_LDFLAGS="-lXft" fi fi if test "$enable_xft" != "no" ; then { echo "$as_me:$LINENO: checking for XftFontOpenName in -lXft" >&5 echo $ECHO_N "checking for XftFontOpenName in -lXft... $ECHO_C" >&6; } if test "${ac_cv_lib_Xft_XftFontOpenName+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $XFT_LDFLAGS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftFontOpenName (); int main () { return XftFontOpenName (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xft_XftFontOpenName=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xft_XftFontOpenName=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xft_XftFontOpenName" >&5 echo "${ECHO_T}$ac_cv_lib_Xft_XftFontOpenName" >&6; } if test $ac_cv_lib_Xft_XftFontOpenName = yes; then LDFLAGS="$LDFLAGS $XFT_LDFLAGS" CFLAGS="$CFLAGS $XFT_CFLAGS" enable_xft="yes" cat >>confdefs.h <<\_ACEOF #define USE_XFT 1 _ACEOF else enable_xft="no" { echo "$as_me:$LINENO: WARNING: unable to use Xft" >&5 echo "$as_me: WARNING: unable to use Xft" >&2;} fi fi if test "$enable_xft" != "no" ; then for ac_header in ft2build.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done fi ############################################################################ # Check if support for the XRENDER extension was requested and available. ############################################################################ # Check whether --enable-xrender was given. if test "${enable_xrender+set}" = set; then enableval=$enable_xrender; fi if test "$enable_xrender" != "no"; then if test "$use_pkgconfig_xrender" = "yes" ; then XRENDER_CFLAGS=`$PKGCONFIG --cflags xrender` XRENDER_LDFLAGS=`$PKGCONFIG --libs xrender` else XRENDER_LDFLAGS="-lXrender" fi for ac_header in X11/extensions/Xrender.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else enable_xrender="no"; { echo "$as_me:$LINENO: WARNING: unable to use X11/extensions/Xrender.h" >&5 echo "$as_me: WARNING: unable to use X11/extensions/Xrender.h" >&2;} fi done fi if test "$enable_xrender" != "no" ; then { echo "$as_me:$LINENO: checking for XRenderComposite in -lXrender" >&5 echo $ECHO_N "checking for XRenderComposite in -lXrender... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrender_XRenderComposite+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $XRENDER_LDFLAGS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderComposite (); int main () { return XRenderComposite (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrender_XRenderComposite=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrender_XRenderComposite=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderComposite" >&5 echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderComposite" >&6; } if test $ac_cv_lib_Xrender_XRenderComposite = yes; then LDFLAGS="$LDFLAGS $XRENDER_LDFLAGS" CFLAGS="$CFLAGS $XRENDER_CFLAGS" enable_xrender="yes" cat >>confdefs.h <<\_ACEOF #define USE_XRENDER 1 _ACEOF else enable_xrender="no" { echo "$as_me:$LINENO: WARNING: unable to use the XRender extension" >&5 echo "$as_me: WARNING: unable to use the XRender extension" >&2;} fi fi ############################################################################ # Check if FriBidi support was requested and available. ############################################################################ # Check whether --enable-fribidi was given. if test "${enable_fribidi+set}" = set; then enableval=$enable_fribidi; fi if test "$enable_fribidi" != "no" ; then if test "$use_pkgconfig_fribidi" = "yes" ; then FRIBIDI_CFLAGS=`$PKGCONFIG --cflags fribidi` FRIBIDI_LDFLAGS=`$PKGCONFIG --libs fribidi` elif test -x `which fribidi-config` ; then FRIBIDI_CFLAGS=`fribidi-config --cflags` FRIBIDI_LDFLAGS=`fribidi-config --libs` else FRIBIDI_LDFLAGS="-lfribidi" fi fi if test "$enable_fribidi" != "no" ; then { echo "$as_me:$LINENO: checking for fribidi_log2vis in -lfribidi" >&5 echo $ECHO_N "checking for fribidi_log2vis in -lfribidi... $ECHO_C" >&6; } if test "${ac_cv_lib_fribidi_fribidi_log2vis+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfribidi $FRIBIDI_LDFLAGS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fribidi_log2vis (); int main () { return fribidi_log2vis (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_fribidi_fribidi_log2vis=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_fribidi_fribidi_log2vis=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_fribidi_fribidi_log2vis" >&5 echo "${ECHO_T}$ac_cv_lib_fribidi_fribidi_log2vis" >&6; } if test $ac_cv_lib_fribidi_fribidi_log2vis = yes; then LDFLAGS="$LDFLAGS $FRIBIDI_LDFLAGS" CFLAGS="$CFLAGS $FRIBIDI_CFLAGS" enable_fribidi="yes" cat >>confdefs.h <<\_ACEOF #define USE_FRIBIDI 1 _ACEOF else enable_fribidi="no" { echo "$as_me:$LINENO: WARNING: unable to use FriBidi" >&5 echo "$as_me: WARNING: unable to use FriBidi" >&2;} fi fi ############################################################################ # Check if XPM support was requested and available. ############################################################################ # Check whether --enable-xpm was given. if test "${enable_xpm+set}" = set; then enableval=$enable_xpm; fi if test "$enable_xpm" != "no"; then for ac_header in X11/xpm.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? { echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to joewing@joewing.net ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else enable_xpm="no"; { echo "$as_me:$LINENO: WARNING: unable to use X11/xpm.h" >&5 echo "$as_me: WARNING: unable to use X11/xpm.h" >&2;} fi done fi if test "$enable_xpm" != "no"; then { echo "$as_me:$LINENO: checking whether XpmAllocColor is declared" >&5 echo $ECHO_N "checking whether XpmAllocColor is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_XpmAllocColor+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { #ifndef XpmAllocColor (void) XpmAllocColor; #endif ; return 0; } _ACEOF 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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_XpmAllocColor=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_XpmAllocColor=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_have_decl_XpmAllocColor" >&5 echo "${ECHO_T}$ac_cv_have_decl_XpmAllocColor" >&6; } if test $ac_cv_have_decl_XpmAllocColor = yes; then : else enable_xpm="no" { echo "$as_me:$LINENO: WARNING: XPM library too old" >&5 echo "$as_me: WARNING: XPM library too old" >&2;} fi fi if test "$enable_xpm" != "no"; then { echo "$as_me:$LINENO: checking for XpmReadFileToImage in -lXpm" >&5 echo $ECHO_N "checking for XpmReadFileToImage in -lXpm... $ECHO_C" >&6; } if test "${ac_cv_lib_Xpm_XpmReadFileToImage+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XpmReadFileToImage (); int main () { return XpmReadFileToImage (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xpm_XpmReadFileToImage=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xpm_XpmReadFileToImage=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToImage" >&5 echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToImage" >&6; } if test $ac_cv_lib_Xpm_XpmReadFileToImage = yes; then LDFLAGS="$LDFLAGS -lXpm"; enable_xpm="yes" cat >>confdefs.h <<\_ACEOF #define USE_XPM 1 _ACEOF else enable_xpm="no" { echo "$as_me:$LINENO: WARNING: unable to use libXpm" >&5 echo "$as_me: WARNING: unable to use libXpm" >&2;} fi fi ############################################################################ # Check if support for the shape extension was requested and available. ############################################################################ # Check whether --enable-shape was given. if test "${enable_shape+set}" = set; then enableval=$enable_shape; fi if test "$enable_shape" != "no"; then { echo "$as_me:$LINENO: checking for XShapeCombineRectangles in -lXext" >&5 echo $ECHO_N "checking for XShapeCombineRectangles in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XShapeCombineRectangles+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShapeCombineRectangles (); int main () { return XShapeCombineRectangles (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XShapeCombineRectangles=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XShapeCombineRectangles=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeCombineRectangles" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XShapeCombineRectangles" >&6; } if test $ac_cv_lib_Xext_XShapeCombineRectangles = yes; then LDFLAGS="$LDFLAGS -lXext" enable_shape="yes" cat >>confdefs.h <<\_ACEOF #define USE_SHAPE 1 _ACEOF else enable_shape="no" { echo "$as_me:$LINENO: WARNING: unable to use the X shape extension" >&5 echo "$as_me: WARNING: unable to use the X shape extension" >&2;} fi fi ############################################################################ # Check if support for Xmu was requested and available. # Note that Xmu appears to be broken on IRIX (drawing rounded rectangles # larger than 800 pixels in either direction causes problems). ############################################################################ # Check whether --enable-xmu was given. if test "${enable_xmu+set}" = set; then enableval=$enable_xmu; else if test `uname` == "IRIX" -o `uname` == "IRIX64" ; then { echo "$as_me:$LINENO: WARNING: disabling Xmu (it is broken on IRIX)" >&5 echo "$as_me: WARNING: disabling Xmu (it is broken on IRIX)" >&2;} enable_xmu="no" fi fi if test "$enable_xmu" != "no"; then { echo "$as_me:$LINENO: checking for XmuDrawRoundedRectangle in -lXmu" >&5 echo $ECHO_N "checking for XmuDrawRoundedRectangle in -lXmu... $ECHO_C" >&6; } if test "${ac_cv_lib_Xmu_XmuDrawRoundedRectangle+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XmuDrawRoundedRectangle (); int main () { return XmuDrawRoundedRectangle (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xmu_XmuDrawRoundedRectangle=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xmu_XmuDrawRoundedRectangle=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xmu_XmuDrawRoundedRectangle" >&5 echo "${ECHO_T}$ac_cv_lib_Xmu_XmuDrawRoundedRectangle" >&6; } if test $ac_cv_lib_Xmu_XmuDrawRoundedRectangle = yes; then LDFLAGS="$LDFLAGS -lXmu" enable_xmu="yes" cat >>confdefs.h <<\_ACEOF #define USE_XMU 1 _ACEOF else enable_xmu="no" { echo "$as_me:$LINENO: WARNING: unable to use Xmu" >&5 echo "$as_me: WARNING: unable to use Xmu" >&2;} fi fi ############################################################################ # Check if support for Xinerama was requested and available. ############################################################################ # Check whether --enable-xinerama was given. if test "${enable_xinerama+set}" = set; then enableval=$enable_xinerama; fi if test "$enable_xinerama" != "no"; then { echo "$as_me:$LINENO: checking for XineramaQueryExtension in -lXinerama" >&5 echo $ECHO_N "checking for XineramaQueryExtension in -lXinerama... $ECHO_C" >&6; } if test "${ac_cv_lib_Xinerama_XineramaQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XineramaQueryExtension (); int main () { return XineramaQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xinerama_XineramaQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xinerama_XineramaQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryExtension" >&6; } if test $ac_cv_lib_Xinerama_XineramaQueryExtension = yes; then LDFLAGS="$LDFLAGS -lXinerama" enable_xinerama="yes" cat >>confdefs.h <<\_ACEOF #define USE_XINERAMA 1 _ACEOF else enable_xinerama="no" { echo "$as_me:$LINENO: WARNING: unable to use Xinerama" >&5 echo "$as_me: WARNING: unable to use Xinerama" >&2;} fi fi ############################################################################ # Check if support for gettext was requested and available. ############################################################################ { echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SET_MAKE= else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi AM_PROG_MKDIR_P { echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6; } # Check whether --enable-nls was given. if test "${enable_nls+set}" = set; then enableval=$enable_nls; USE_NLS=$enableval else USE_NLS=yes fi { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } GETTEXT_MACRO_VERSION=0.18 # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != ":"; then { echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then { echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in [\\/]* | ?:[\\/]*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then { echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f messages.po case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "msgmerge", so it can be a program name with args. set dummy msgmerge; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_MSGMERGE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGMERGE" in [\\/]* | ?:[\\/]*) ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&5 if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":" ;; esac fi MSGMERGE="$ac_cv_path_MSGMERGE" if test "$MSGMERGE" != ":"; then { echo "$as_me:$LINENO: result: $MSGMERGE" >&5 echo "${ECHO_T}$MSGMERGE" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= ac_config_commands="$ac_config_commands po-directories" if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { echo "$as_me:$LINENO: checking for ld used by GCC" >&5 echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { echo "$as_me:$LINENO: checking for GNU ld" >&5 echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi if test "${acl_cv_path_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { echo "$as_me:$LINENO: result: $LD" >&5 echo "${ECHO_T}$LD" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { echo "$as_me:$LINENO: checking for shared library run path origin" >&5 echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6; } if test "${acl_cv_rpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 echo "${ECHO_T}$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) { echo "$as_me:$LINENO: checking for 64-bit host" >&5 echo $ECHO_N "checking for 64-bit host... $ECHO_C" >&6; } if test "${gl_cv_solaris_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef _LP64 sixtyfour bits #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "sixtyfour bits" >/dev/null 2>&1; then gl_cv_solaris_64bit=yes else gl_cv_solaris_64bit=no fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $gl_cv_solaris_64bit" >&5 echo "${ECHO_T}$gl_cv_solaris_64bit" >&6; } if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= HAVE_LIBICONV= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'iconv'; then LIBICONV_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi gt_INTL_MACOSX LIBINTL= LTLIBINTL= POSUB= case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi { echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libc; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$gt_func_gnugettext_libc=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$gt_func_gnugettext_libc=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$gt_func_gnugettext_libc'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { echo "$as_me:$LINENO: checking for working iconv" >&5 echo $ECHO_N "checking for working iconv... $ECHO_C" >&6; } if test "${am_cv_func_iconv_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv_works=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) am_cv_func_iconv_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { echo "$as_me:$LINENO: result: $am_cv_func_iconv_works" >&5 echo "${ECHO_T}$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { echo "$as_me:$LINENO: checking how to link with libiconv" >&5 echo $ECHO_N "checking how to link with libiconv... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBICONV" >&5 echo "${ECHO_T}$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libintl-prefix was given. if test "${with_libintl_prefix+set}" = set; then withval=$with_libintl_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi fi LIBINTL= LTLIBINTL= INCINTL= LIBINTL_PREFIX= HAVE_LIBINTL= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='intl ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a" else LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = 'intl'; then LIBINTL_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBINTL; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBINTL="${LIBINTL}${LIBINTL:+ }$dep" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep" ;; esac done fi else LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name" LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBINTL="${LIBINTL}${LIBINTL:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir" done fi { echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6; } if { as_var=$gt_func_gnugettext_libintl; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$gt_func_gnugettext_libintl=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$gt_func_gnugettext_libintl=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); int main () { bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS" fi ac_res=`eval echo '${'$gt_func_gnugettext_libintl'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else LIBINTL= LTLIBINTL= INCINTL= fi if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF else USE_NLS=no fi fi { echo "$as_me:$LINENO: checking whether to use NLS" >&5 echo $ECHO_N "checking whether to use NLS... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6; } if test "$USE_NLS" = "yes"; then { echo "$as_me:$LINENO: checking where the gettext function comes from" >&5 echo $ECHO_N "checking where the gettext function comes from... $ECHO_C" >&6; } if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi { echo "$as_me:$LINENO: result: $gt_source" >&5 echo "${ECHO_T}$gt_source" >&6; } fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then { echo "$as_me:$LINENO: checking how to link with libintl" >&5 echo $ECHO_N "checking how to link with libintl... $ECHO_C" >&6; } { echo "$as_me:$LINENO: result: $LIBINTL" >&5 echo "${ECHO_T}$LIBINTL" >&6; } for element in $INCINTL; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done fi cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define HAVE_DCGETTEXT 1 _ACEOF fi POSUB=po fi INTLLIBS="$LIBINTL" LDFLAGS="$LDFLAGS $LIBINTL" ############################################################################ # Check if debug mode was requested. ############################################################################ # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; fi if test "$enable_debug" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF CFLAGS="$CFLAGS -Wall -g -DDEBUG" LDFLAGS="$LDFLAGS -g" else enable_debug="no" fi ############################################################################ # Create the output files. ############################################################################ if test "$prefix" = "NONE" ; then PREFIX="$ac_default_prefix" prefix="$ac_default_prefix" else PREFIX="$prefix" fi if test "$exec_prefix" = "NONE" ; then exec_prefix="$PREFIX" fi if test "$sysconfdir" = "" ; then sysconfdir="$ac_default_sysconfdir" fi if test "$mandir" = "" ; then mandir="$ac_default_mandir" fi if test "$LOCALEDIR" = "" ; then localedir=`eval echo \""$datadir"/locale\"` localedir=`eval echo \""$localedir"\"` CFLAGS="$CFLAGS -DLOCALEDIR=\\\"$localedir\\\"" fi BINDIR=`eval echo \""$bindir"\"` SYSCONF=`eval echo \""$sysconfdir"\"` MANDIR=`eval echo \""$mandir"\"` MANDIR=`eval echo \""$MANDIR"\"` cat >>confdefs.h <<_ACEOF #define SYSTEM_CONFIG "$SYSCONF/system.jwmrc" _ACEOF VERSION="$PACKAGE_VERSION" INSTVERSION=`echo $PACKAGE_VERSION | tr -d .` BINDIR="$BINDIR" MANDIR="$MANDIR" DATE=`date "+%Y-%m-%d"` SYSCONF="$SYSCONF" PACKAGE="$PACKAGE" ac_config_files="$ac_config_files po/Makefile.in Makefile src/Makefile jwm.1" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { echo "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by jwm $as_me svn-579, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ jwm config.status svn-579 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "jwm.1") CONFIG_FILES="$CONFIG_FILES jwm.1" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim CPP!$CPP$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim XMKMF!$XMKMF$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim SET_MAKE!$SET_MAKE$ac_delim USE_NLS!$USE_NLS$ac_delim GETTEXT_MACRO_VERSION!$GETTEXT_MACRO_VERSION$ac_delim MSGFMT!$MSGFMT$ac_delim GMSGFMT!$GMSGFMT$ac_delim MSGFMT_015!$MSGFMT_015$ac_delim GMSGFMT_015!$GMSGFMT_015$ac_delim XGETTEXT!$XGETTEXT$ac_delim XGETTEXT_015!$XGETTEXT_015$ac_delim MSGMERGE!$MSGMERGE$ac_delim XGETTEXT_EXTRA_OPTIONS!$XGETTEXT_EXTRA_OPTIONS$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim LIBICONV!$LIBICONV$ac_delim LTLIBICONV!$LTLIBICONV$ac_delim INTLLIBS!$INTLLIBS$ac_delim LIBINTL!$LIBINTL$ac_delim LTLIBINTL!$LTLIBINTL$ac_delim POSUB!$POSUB$ac_delim VERSION!$VERSION$ac_delim INSTVERSION!$INSTVERSION$ac_delim BINDIR!$BINDIR$ac_delim MANDIR!$MANDIR$ac_delim DATE!$DATE$ac_delim SYSCONF!$SYSCONF$ac_delim PACKAGE!$PACKAGE$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :H) # # CONFIG_HEADER # _ACEOF # Transform confdefs.h into a sed script `conftest.defines', that # substitutes the proper values into config.h.in to produce config.h. rm -f conftest.defines conftest.tail # First, append a space to every undef/define line, to ease matching. echo 's/$/ /' >conftest.defines # Then, protect against being on the right side of a sed subst, or in # an unquoted here document, in config.status. If some macros were # called several times there might be several #defines for the same # symbol, which is useless. But do not sort them, since the last # AC_DEFINE must be honored. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* # These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where # NAME is the cpp macro being defined, VALUE is the value it is being given. # PARAMS is the parameter list in the macro definition--in most cases, it's # just an empty string. ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' ac_dD=' ,' uniq confdefs.h | sed -n ' t rset :rset s/^[ ]*#[ ]*define[ ][ ]*// t ok d :ok s/[\\&,]/\\&/g s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p ' >>conftest.defines # Remove the space that was appended to ease matching. # Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. # (The regexp can be short, since the line contains either #define or #undef.) echo 's/ $// s,^[ #]*u.*,/* & */,' >>conftest.defines # Break up conftest.defines: ac_max_sed_lines=50 # First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" # Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" # Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" # et cetera. ac_in='$ac_file_inputs' ac_out='"$tmp/out1"' ac_nxt='"$tmp/out2"' while : do # Write a here document: cat >>$CONFIG_STATUS <<_ACEOF # First, check the format of the line: cat >"\$tmp/defines.sed" <<\\CEOF /^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def /^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def b :def _ACEOF sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines conftest.tail echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then echo "/* $configure_input */" >"$tmp/config.h" cat "$ac_result" >>"$tmp/config.h" if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else rm -f $ac_file mv "$tmp/config.h" $ac_file fi else echo "/* $configure_input */" cat "$ac_result" fi rm -f "$tmp/out12" ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "po-directories":C) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi ############################################################################ # Display the status. ############################################################################ echo "Compiler: $CC" echo "Compile flags: $CFLAGS" echo "Link flags: $LDFLAGS" echo echo "Options" echo echo " Confirm: $enable_confirm" echo " Icon: $enable_icons" echo " PNG: $enable_png" echo " JPEG: $enable_jpeg" echo " XPM: $enable_xpm" echo " XFT: $enable_xft" echo " XRender: $enable_xrender" echo " FriBidi: $enable_fribidi" echo " Shape: $enable_shape" echo " Xmu: $enable_xmu" echo " Xinerama: $enable_xinerama" echo " Debug: $enable_debug" echo jwm-2.1.0+svn579/Doxyfile0000644000000000000000000014403411710374020013563 0ustar rootroot# Doxyfile 1.4.6 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "JWM" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = "doc" # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, # Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, # Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, # Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, # Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = YES # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = "src" # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = "*.h" # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .shtml # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = doc-header.shtml # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = doc-footer.shtml # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = USE_FRIBID USE_ICONS USE_PNG USE_SHAPE USE_XFT USE_XINERAMA USE_XPM USE_XRENDER # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = NO # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = NO # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = NO # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = NO # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that a graph may be further truncated if the graph's # image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH # and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), # the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO jwm-2.1.0+svn579/jwm.1.in0000644000000000000000000007551111710374020013344 0ustar rootroot.\" .\" groff -man -Tascii jwm.1 .\" .TH jwm 1 "@DATE@" "v@VERSION@" .SH NAME JWM - Joe's Window Manager .SH SYNOPSIS .BR jwm " [options]" .SH DESCRIPTION JWM is a window manager for the X11 Window System. .SH OPTIONS \fB\-display\fP \fIdisplay\fP .RS This option specifies the display to use; see \fBX\fP(1). .RE .P .B "-exit" .RS Exit JWM by sending _JWM_EXIT to the root window. .RE .P .B "-h" .RS Display a help message and exit. .RE .P .B "-p" .RS Parse the configuration file and exit. It is a good idea to use this after making modifications to the configuration file to ensure there are no errors. .RE .P .B "-restart" .RS Restart JWM by sending _JWM_RESTART to the root window. .RE .P .B "-v" .RS Display version information and exit. .RE .SH FILES .IP "@SYSCONF@/system.jwmrc" The default JWM configuration file. .IP "~/.jwmrc" Local configuration file. Copy the default configuration file to this location to make user-specific changes. .SH CONFIGURATION .B OVERVIEW .RS Configuration of JWM is done by editing ".jwmrc". This file is XML making it easy to edit, either by hand or programmatically. The example.jwmrc gives an example configuration file. Before restarting JWM, it is a good idea to run "jwm \-p" to make sure the configuration file is free of errors. Otherwise you may end up without a root menu. .RE .P .B "ROOT MENU" .RS The root menu in JWM is the primary way of starting programs. It also provides a way to restart or exit the window manager. The outer most tag is \fBRootMenu\fP. The following attributes are supported: .P \fBonroot\fP \fIlist\fP .RS Determine which buttons on the root window activate the menu. This is a list of integers specifying buttons. The default is "123". Note that multiple root menus may be specified by using different buttons for different menus. The range of possible button values is \fB0\fP to \fB9\fP inclusive. .RE .P \fBheight\fP \fIint\fP .RS Height of each menu item in pixels. 0 indicates the largest menu item will determine the height. The default is 0. .RE .P \fBlabeled\fP \fIbool\fP .RS Determines if a label appears at the top of the menu. Default is false. .RE .P \fBlabel\fP \fIstring\fP .RS The label to display at the top of the menu. Default is "JWM". .RE .P Within the \fBRootMenu\fP tag, the following tags are supported: .P .B Menu .RS This tag creates a submenu item. Any of the tags allowed within the \fBRootMenu\fP tag, including the \fBMenu\fP tag are allowed within this element. The following attributes are supported: .P \fBheight\fP \fIint\fP .RS Height of each menu item in pixels. 0 indicates the largest menu item will determine the height. The default is inherited from the parent menu. .RE .P \fBlabel\fP \fIstring\fP .RS The label to use. No default. .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this menu. No default. .RE .P \fBlabeled\fP \fIbool\fP .RS Determines if a label appears at the top of the menu. Default is false. .RE .RE .P .B Include .RS Include the contents of a file into the menu structure. The file must start with a "JWM" tag. The file is specified by the text of the tag. If the text starts with "exec:" then the output of a program is used. .RE .P .B Program .RS The \fBProgram\fP tag provides a way to start an external program. The text in this tag is the command used to start the program. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to display. Default is the text of the tag. .RE .P \fBicon\fP \fIstring\fP .RS The icon to use. No default. .RE .RE .P .B Separator .RS This tag simply puts a line in the menu allowing menu divisions. No text or attributes are used. .RE .P .B Desktops .RS Add a desktop menu. This will add a submenu with a list of desktops that can be used to change the current desktop. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use for the menu. The default is "Desktops". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B SendTo .RS Add a "send to" menu to the menu. After selecting an item from this menu, a window may be selected to send that window to the selected desktop. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "SendTo". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Stick .RS Add a stick/unstick window operation to the menu. After selecting this item a window may be selected to toggle the sticky state of that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Stick". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Maximize .RS Add a maximize window operation to the menu. After selecting this item a window may be selected to toggle the maximized state of that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Maximize". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Minimize .RS Add a minimize window operation to the menu. After selecting this item a window may be selected to minimize that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Minimize". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Shade .RS Add a shade/unshade window operation to the menu. After selecting this item a window may be selected to toggle the shaded status of that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Shade". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Move .RS Add a move window operation to the menu. After selecting this item a window may be selected to move that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Move". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Resize .RS Add a resize window operation to the menu. After selecting this item a window may be selected to resize that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Resize". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Kill .RS Add a kill window operation to the menu. After selecting this item a window may be selected to kill that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Kill". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Close .RS Add a close window operation to the menu. After selecting this item a window may be selected to close that window. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Close". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use for this item. No default. .RE .RE .P .B Restart .RS This tag adds a menu item to restart the window manager. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Restart". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use. No default. .RE .RE .P .B Exit .RS This tag adds a menu item to exit the window manager. If text is present within this tag, it is interpreted as a command to run when JWM exits. This can be used to start another window manager. The following attributes are supported: .P \fBlabel\fP \fIstring\fP .RS The label to use. The default is "Exit". .RE .P \fBicon\fP \fIstring\fP .RS The icon to use. No default. .RE .P \fBconfirm\fP \fIbool\fP .RS Determine if a confirm dialog appears before exiting. Default is true. .RE .P Note that confirm dialogs can be disabled completely at the compile-time. .RE .RE .B TRAYS .RS One or more trays may be created via the \fBTray\fP tag. This tag supports the following attributes: .P \fBautohide\fP \fIbool\fP .RS Allows this tray to hide itself when not activated. Default is false. .RE .P \fBx\fP \fIint\fP .RS The x-coordinate of the tray. This may be negative to indicate an offset from the right of the screen. .RE .P \fBy\fP \fIint\fP .RS The y-coordinate of the tray. This may be negative to indicate an offset from the bottom of the screen. .RE .P \fBwidth\fP \fIint\fP .RS The width of the tray. 0 indicates that the tray should compute an optimal width depending on what it contains and the layout. 0 is the default. .RE .P \fBheight\fP \fIint\fP .RS The height of the tray. 0 indicates that the tray should compute an optimal height depending on what it contains and the layout. 0 is the default. .RE .P \fBborder\fP \fIint\fP .RS The width of the border. The default is 1. Valid values are between 0 and 32 inclusive. .RE .P \fBlayer\fP \fIint\fP .RS The layer of the tray. The default is 8. Valid values are between 0 and 12 inclusive. .RE .P \fBlayout\fP { \fBvertical\fP | \fBhorizontal\fP } .RS The layout of the tray. The default is horizontal. .RE .P \fBvalign\fP { \fBfixed\fP | \fBtop\fP | \fBcenter\fP | \fBbottom\fP } .RS The vertical alignment of the tray. The default is \fBfixed\fP. .RE .P \fBhalign\fP { \fBfixed\fP | \fBleft\fP | \fBcenter\fP | \fBright\fP } .RS The horizontal alignment of the tray. The default is \fBfixed\fP. .RE .P Within this tag the following tags are supported: .P .B Clock .RS Add a clock to the tray. The text of this tag is a command to run when the clock is clicked. This tag supports the following attributes: .P \fBformat\fP \fIstring\fP .RS The format of the clock. See \fBstrftime\fP(3). .RE .P \fBzone\fP \fIstring\fP .RS The time zone of the clock. See \fBtzset\fP(3). .RE .P \fBwidth\fP \fIint\fP .RS The width of the clock. 0 indicates that the width should be determined from the length of the text to be displayed. .RE .P \fBheight\fP \fIint\fP .RS The height of the clock. 0 indicates that the height should be determined from the font used. .RE .RE .P .B Dock .RS Add a dock for system notifications. This can be used by those programs that use the _NET_SYSTEM_TRAY_Sn selection. The size of the Dock is dynamic based on the size of the tray and the number of items contained. Only one Dock is allowed per instance of JWM. This tag supports the following attribute: .P \fBwidth\fP \fIint\fP .RS The maximum width of an item contained in the dock. This defaults to the width or height of the tray (whichever is smaller). .RE .RE .P .B Pager .RS Add a pager to the tray. A pager shows a miniature representation of a desktop. When over the pager, the scroll wheel will switch desktops. Holding down the right mouse button allows you to drag a window around in the pager which changes its position on the real desktop. You can also drag a window in the pager from one desktop to another. This tag supports the following attributes: .P \fBlabeled\fP \fIbool\fP .RS Determines if the pager has text labels. Default is false. .RE .P Also see the \fBPAGER STYLE\fP section for more information. .RE .P .B Spacer .RS Add empty space to the tray. This tag supports the following attributes: .P \fBwidth\fP \fIint\fP .RS The width of the spacer (0 to fill all available space). 0 is the default. .RE .P \fBheight\fP \fIint\fP .RS The height of the spacer (0 to fill all available space). 0 is the default. .RE .RE .P .B Swallow .RS Swallow a program into the tray. The text of this tag gives the command to run. This tag supports the following attributes: .P \fBname\fP \fIstring\fP .RS The name of the program to swallow. This attribute is required. .RE .P \fBwidth\fP \fIint\fP .RS The width of the swallowed program. 0 indicates that the width should be determined from the tray and size requested from the program. 0 is the default. .RE .P \fBheight\fP \fIint\fP .RS The height of the swallowed program. 0 indicates that the height should be determined from the tray and the size requested from the program. 0 is the default. .RE .RE .P .B TaskList .RS Add a task list to the tray. This tag supports the following attribute: .P \fBmaxwidth\fP \fIint\fP .RS The maximum width of an item in the task list. 0 indicates no maximum. The default is 0. .RE .RE .P .B TrayButton .RS Add a button to the tray. The text of this tag determines what action to take when the button is clicked. The following actions are supported: .P \fBroot:\fP\fIn\fP .RS Show root menu \fIn\fP. Note that the default TrayButton action is \fBroot:1\fP. .RE .P \fBexec:\fP \fIstring\fP .RS Execute a command. .RE .P \fBshowdesktop\fP .RS Minimize all windows on the current desktop. .RE .P This tag supports the following attributes: .P \fBlabel\fP \fIstring\fP .RS A label to display. No default. .RE .P \fBpopup\fP \fIstring\fP .RS A string to be displayed for a popup. This will default to the value specified for \fBlabel\fP, if provided. If neither \fBpopup\fP nor \fBlabel\fP are specified no popup will be shown. .RE .P \fBicon\fP \fIstring\fP .RS An icon to display. No default. .RE .RE .RE .B INCLUDES .RS Other configuration files may be included under the JWM tag via the \fBInclude\fP tag. The text of this tag specifies the location of an additional configuration file. The path may be relative to the loacation JWM was started, an absolute path, or a path referencing an environment variable (using '$'). The format of the configuration file is the same as the main configuration file. .RE .B "GROUP SETTINGS" .RS Program groups allow one to specify options which apply to a group of programs by name and/or class. A program group is created with the \fBGroup\fP tag. As many program groups can be created as desired. If one or more \fBName\fP tags is specified, a name must be matched. Likewise, if one or more \fBClass\fP tags is specified, a class must be matched. Within the \fBGroup\fP tag the following tags are supported: .P .B Name .RS The title of a program to match to be in this group. This field is case sensitive. A wild card, \fB*\fP, may be used. .RE .B Class .RS The window class for a program to match to be in this group. This field is case sensitive. A wild card, \fB*\fP, may be used. .RE .B Option .RS An option for this group. Possible options are given below: .P .B border .RS Causes windows in this group to have a border. .RE .P \fBdesktop:\fP\fI#\fP .RS The desktop on which windows in this group will be started. .RE .P \fBicon:\fP\fIstring\fP .RS The icon to be used for windows in this group. .RE .P .B layer: .I # .RS The layer on which windows in this group will be started. .RE .P .B maximized .RS Make windows in this group initially maximized. .RE .P .B hmax .RS Make windows in this group maximize horizontally. .RE .P .B vmax .RS Make windows in this group maximize vertically. .RE .P .B minimized .RS Make windows in this group initially minimized. .RE .P .B noborder .RS Causes windows in this group to be displayed without a border. .RE .P .B nofocus .RS Prevents windows in the group from grabbing the focus when mapped. .RE .P .B nolist .RS Causes the tray to ignore windows in this group. .RE .P .B notitle .RS Causes windows in this group to be displayed without a title bar. .RE .P .B pignore .RS Ignore initial window position requested by program. .RE .P .B shaded .RS Make windows in this group initially shaded. .RE .P .B sticky .RS Make windows in this group sticky. .RE .P \fBopacity:\fP\fI#\fP .RS Set the opacity for windows in this group. The value is a number between 0.0 and 1.0 inclusive. .RE .P .B title .RS Causes windows in this group to have a title bar. .RE .RE .RE .B "WINDOW STYLE" .RS The \fBWindowStyle\fP tag controls the look of window borders. Within this tag, the following tags are supported: .P .B Font .RS The font used for title bars. See the \fBFONTS\fP section for more information. .RE .P .B Width .RS The width of window borders in pixels. The default is 4, the minimum is 1, and the maximum is 32. .RE .P .B Height .RS The height of window title bars in pixels. The default is 20, the minimum is 2, and the maximum is 64. .RE .P .P .B Active .RS The colors/opacity used for the active window. See the \fBCOLORS\fP section for more information on colors. The following tags are supported: .P .B Text .RS The color of text on the title bar. The default is black. .RE .P .B Title .RS The color of the title bar (gradients are supported). The default is red:red. .RE .P .B Opacity .RS The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE .P .B Outline .RS The color of the window outline. The default is black. .RE .RE .P .B Inactive .RS The colors used for inactive windows. See the \fBCOLORS\fP section for more information on colors. The following tags are supported: .P .B Text .RS The color of text on the title bar. The default is black. .RE .P .B Title .RS The color of the title bar (gradients are supported). The default is gray:gray. .RE .P .B Opacity .RS The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE .P .B Outline .RS The color of the window outline. The default is black. .RE .RE .RE .B "TRAY STYLE" .RS The \fBTrayStyle\fP tag controls the look of trays. Within this tag the following tag is supported: .P .B Font .RS The default tray font to use. See the \fBFONTS\fP section for more information. .RE .P .B Foreground .RS The default foreground color. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The default background color. See the \fBCOLORS\fP section for more information. .RE .P .B Opacity .RS The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE .RE .B "TASK LIST STYLE" .RS The \fBTaskListStyle\fP tag controls the look of task lists. This tag supports the following attribute: .P \fBinsert\fP \fImode\fP .RS This determines how new items are added to the task list. Valid options are \fBleft\fP and \fBright\fP. The default is \fBright\fP. .RE .P Within this tag the following tags are supported: .P .B Font .RS The font used for program names. See the \fBFONTS\fP section for more information. .RE .P .B Foreground .RS The foreground color of the task list items. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The background color of the task list items (gradients are supported). See the \fBCOLORS\fP section for more information. .RE .P .B ActiveForeground .RS The foreground color of an active item on the task list. See the \fBCOLORS\fP section for more information. .RE .P .B ActiveBackground .RS The background color of an active item on the task list (gradients are supported). See the \fBCOLORS\fP section for more information. .RE .RE .B "CLOCK STYLE" .RS The \fBClockStyle\fP tag controls the look of clocks. Within this tag, the following tags are supported. .P .B Font .RS The font used. See the \fBFONTS\fP section for more information. .RE .P .B Foreground .RS The color of the text. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The background color. See the \fBCOLORS\fP section for more information. .RE .RE .B "PAGER STYLE" .RS The \fBPagerStyle\fP tag controls the look of pagers. Within this tag, the following tags are supported: .P .B Outline .RS The color of the outline around windows shown in the pager. See the \fBCOLORS\fP section for more information. .RE .P .B Foreground .RS The color of inactive windows shown in the pager. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The background color of inactive desktops shown in the pager. See the \fBCOLORS\fP section for more information. .RE .P .B ActiveForeground .RS The color of active windows shown in the pager. See the \fBCOLORS\fP section for more information. .RE .P .B ActiveBackground .RS The background color of active desktops shown in the pager. See the \fBCOLORS\fP section for more information. .RE .P .B Text .RS The color to use for pager labels. See the \fBCOLORS\fP section for more information. .RE .P .B Font .RS The font to use for pager labels. See the \fBCOLORS\fP section for more information. .RE .RE .B "MENU STYLE" .RS The \fBMenuStyle\fP tag controls the look of the menus in JWM (this includes the root menu and window menus). Within this tag the following tags are supported: .P .B Font .RS The font used on menus See the \fBFONTS\fP section for more information. .RE .P .B Foreground .RS The text color of inactive menu items. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The background color of inactive menu items. See the \fBCOLORS\fPsection for more information. .RE .P .B ActiveForeground .RS The text color of active menu items. See the \fBCOLORS\fP section for more information. .RE .P .B ActiveBackground .RS Text background color of active menu items (gradients are supported). See the \fBCOLORS\fP section for more information. .RE .P .B Opacity .RS The opacity of the window. This is a floating point value between 0.0 and 1.0. Note that a composite manager, such as xcompmgr, is required for this. .RE .RE .B "POPUP STYLE" .RS The \fBPopupStyle\fP tag controls the look of popup windows such as those shown when the mouse sits over a task list item. This tag supports the following attributes: .P \fBdelay\fP \fIint\fP .RS The delay in milliseconds before popups activate. The default is 600. .RE .P \fBenabled\fP \fIbool\fP .RS Determine if popups are shown. Default is true. .RE .P Within this tag the following tags are supported: .P .B Font .RS The font to use. See the \fBFONTS\fP section for more information. .RE .P .B Outline .RS The color of the window outline. See the \fBCOLORS\fP section for more information. .RE .P .B Foreground .RS The text color. See the \fBCOLORS\fP section for more information. .RE .P .B Background .RS The background color. See the \fBCOLORS\fP section for more information. .RE .RE .B FONTS .RS Fonts for various parts of JWM are specified within a \fBFont\fP tag. The text of this tag determines the font to use. This can be either a standard X font string or, if compiled with XFT support, an XFT font string. .RE .B COLORS .RS Colors for various parts of JWM are specified within specific tags (discribed above). Colors may either be hex triplets in RGB format (for example, #FF0000 is red) or by a name recognized by the X server. For components that support gradients, two colors may be specified separated by a colon. .RE .B ICONS .RS Icons for windows that don't supply an icon via the _NET_WM_ICON hint are located by searching the icon search path(s) for an icon whose name (minus the ".xpm" or ".png" extension) matches the instance name of the window as returned in the WM_CLASS hint. If this lookup fails, a default icon is supplied. This icon will be displayed for the window on it's title bar and on the task list. Icons that are not an appropriate size will be scaled. Square icons work best. .P For menu items, the icon path is searched for a match. the icon specified for a menu item must be the exact name of the icon file with the extension. If no match is found, a blank area will appear where the icon should appear. If an icon is not specified for any menu item in a menu, no space will be allocated for icons. .P Zero or more \fBIconPath\fP tags may be specified. The text of this tag is assumed to be an absolute directory path to a directory containing XPM, PNG, and/or JPEG icons. When searching for icons, if multiple paths are provided, they will be searched in order until a match is made. Note that icon, PNG, JPEG, and XPM support are compile-time options. .RE .B "KEY BINDINGS" .RS Keyboard bindings in JWM are specified in \fBKey\fP tags. Either the \fBkey\fP or \fBkeycode\fP attributes must be specified to determine which key will cause an action. The optional attribute, \fBmask\fP, specifies what key mask, if any, must be in effect for the binding to match. Finally, the text of the \fBKey\fP tag is the action to perform. .P One or more of the following key masks may be specified for \fBmask\fP (see \fBxmodmap\fP(1)): .RS .IP \fBA\fP The "Alt" key (mod1). .IP \fBC\fP Control .IP \fBS\fP Shift .IP \fB1\fP mod1 .IP \fB2\fP mod2 .IP \fB3\fP mod3 .IP \fB4\fP mod4 .IP \fB5\fP mod5 .RE .P The key specified in the \fBkey\fP attribute must contain a valid key string for \fBXStringToKeysym\fP(3). These values are usually what one would expect (for example, the escape key is called "Escape"). .P Valid actions for a key binding are: .RS .IP \fBup\fP Move up. Not grabbed. .IP \fBdown\fP Move down. Not grabbed. .IP \fBright\fP Move right. Not grabbed. .IP \fBleft\fP Move left. Not grabbed. .IP \fBescape\fP Stop a move/resize or exit a menu. Not grabbed. .IP \fBselect\fP Make a menu selection. Not grabbed. .IP \fBnext\fP Move to the next window in the task list. Grabbed. .IP \fBnextstacked\fP Move to the next window in the stacking order. Grabbed. .IP \fBprev\fP Move to the previous window in the task list. Grabbed. .IP \fBprevstacked\fP Move to the previous window in the stacking order. Grabbed. .IP \fBclose\fP Close the active window. Grabbed. .IP \fBminimize\fP Minimize the active window. Grabbed. .IP \fBmaximize\fP Maximize the active window. Grabbed. .IP \fBshade\fP Shade the active window. Grabbed. .IP \fBstick\fP Stick/unstick the active window. Grabbed. .IP \fBmove\fP Move the active window. Grabbed. .IP \fBresize\fP Resize the active window. Grabbed. .IP \fBroot:\fP\fIn\fP Show root menu \fIn\fP. Grabbed. .IP \fBwindow\fP Show the window menu for the active window. Grabbed. .IP \fBdesktop#\fP Switch to a specific desktop. To use this, "#" must be specified in the key section. The number 1 to the number of desktops configured are then substituted for "#". Grabbed. .IP \fBrdesktop\fP Move one desktop to the right. Grabbed. .IP \fBldesktop\fP Move one desktop to the left. Grabbed. .IP \fBudesktop\fP Move up one desktop. Grabbed. .IP \fBddesktop\fP Move down one desktop. Grabbed. .IP \fBshowdesktop\fP Show/hide the desktop (maximize/minimize all windows). Grabbed. .IP \fBshowtray\fP Unhide the tray (when using autohide). Grabbed. .IP \fBexec:\fP\fIcommand\fP Execute \fIcommand\fP. Grabbed. .IP \fBrestart\fP Restart JWM. Grabbed. .RE .P Note that keys that are grabbed will not be available to applications other than JWM since JWM will interpret these. Also note that there are no default key bindings. Finally, it is possible to bind multiple key combinations to the same action. .RE .B "MOUSE BINDINGS" .RS Any button (other than the scroll wheel) on the root window will bring up the root menu unless otherwise specified via the \fBonroot\fP attribute of \fBRootMenu\fP. Scrolling up on the root window switches to the previous desktop and scrolling down switches to the next desktop. .RE .P .RS The right button will show the window menu on the frame. .RE .P .RS The left button will resize if on the border or move if in the title bar. .RE .P .RS The middle button will move anywhere on the frame. .RE .P .RS A double click on the title bar of a window will toggle the maximized state of the window. Scrolling up over the title bar will shade the window and scrolling down will unshade the window. When a menu is open, the scroll wheel will move through menus. When over the pager, the scroll wheel will switch desktops. When over a task list, the scroll wheel will switch windows. .RE .B DESKTOPS .RS Virtual desktops are controlled with the \fBDesktops\fP tag. Within this tag the following attribute is supported: .P \fBwidth\fP \fIint\fP .RS The number of virtual desktops in the horizontal direction. The default is 4. .RE .P \fBheight\fP \fIint\fP .RS The number of virtual desktops in the vertical direction. The default is 1. .RE .P Within the \fBDesktops\fP tag the following tags are supported: .P .B Background .RS The default background for desktops. The \fBtype\fP attribute determines the type of background and the text contained within this tag is the value. Valid types are: .P .B solid .RS A solid color. See the \fBCOLORS\fP section for more information. This is the default. .RE .B gradient .RS A gradient color. See the \fBCOLORS\fP section for more information. .RE .B image .RS A stretched image. This may be an XPM, PNG, or JPEG image. Note that support for XPM, PNG, and JPEG images must be compiled in and icon support is required. .RE .B tile .RS A tiled image. Like \fIimage\fP, but the image is tiled instead of stretched. .RE .B command .RS A command to run for setting the background. .RE .RE .P .B Desktop .RS Desktop-specific data. The \fBname\fP attribute may be specified to name the desktop (the default is the desktop number). Within this tag a \fBBackground\fP tag may be specified for a desktop-specific background. See \fBBackground\fP above for more information. .RE .RE .B "OTHER SETTINGS" .P .RS The following tags may also be supplied: .P .B DoubleClickDelta .RS The number of pixels the mouse can move during a double click. The default is 2. Valid values are between 0 and 32 inclusive. .RE .P .B DoubleClickSpeed .RS The maximum number of milliseconds between clicks for a double click. The default is 400. Valid values are between 1 and 2000 inclusive. .RE .P .B FocusModel .RS The focus model to be used. The default is "sloppy". Valid values are "click" (click to focus) and "sloppy" (focus follows mouse). .RE .P .B MoveMode .RS The move mode. The default is "opaque". Valid values are "opaque" and "outline". The optional \fBcoordinates\fP attribute determines the location of the move status window. Possible values are: .RS .P .B off .RS Disable the status window. .RE .P .B corner .RS Place the status window in the corner of the screen. .RE .P .B window .RS Center the status window on the window being moved. .RE .P .B screen .RS Center the status window on the screen. .RE .RE .RE .P .B ResizeMode .RS The resize mode. The default is "opaque". Valid values are "opaque" and "outline". The optional \fBcoordinates\fP attribute determines the location of the move status window. Possible values are: .RS .P .B off .RS Disable the status window. .RE .P .B corner .RS Place the status window in the corner of the screen. .RE .P .B window .RS Center the status window on the window being resized. .RE .P .B screen .RS Center the status window on the screen. .RE .RE .RE .P .B SnapMode .RS The snap mode. The default is "border". Valid values are "none" (for no snapping), "screen" (for snapping to the edge of the screen), and "border" (for snapping to the borders of windows and the screen). An optional attribute, \fBdistance\fP, specifies the distance for snapping. The default is 5. Valid values are between 1 and 32 inclusive. .RE .P .B StartupCommand .RS A command to run when JWM starts. .RE .P .B ShutdownCommand .RS A command to run when JWM exits. .RE .P .B RestartCommand .RS A command to run when JWM restarts. .RE .P .B ButtonClose .RS Path to a bitmask for the close button on windows. .RE .P .B ButtonMax .RS Path to a bitmask for the maximize button on inactive windows. .RE .P .B ButtonMaxActive .RS Path to a bitmask for the maximize button on active windows. .RE .P .B ButtonMin .RS Path to a bitmask for the minimize button on windows. .RE .RE .P .SH AUTHOR Joe Wingbermuehle .SH "SEE ALSO" .BR X (1) jwm-2.1.0+svn579/doc-footer.shtml0000644000000000000000000000006311710374020015160 0ustar rootroot jwm-2.1.0+svn579/src/0000755000000000000000000000000011710374021012637 5ustar rootrootjwm-2.1.0+svn579/src/error.h0000644000000000000000000000153111710374021014141 0ustar rootroot/** * @file error.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the error functions. * */ #ifndef ERROR_H #define ERROR_H /** Display and error message and terminate the program. * @param str The format of the message to display. */ void FatalError(const char *str, ...); /** Display a warning message. * @param str The format of the message to display. */ void Warning(const char *str, ...); /** Display a warning message. * @param part A section identifier for the message. * @param str The format string of the message to display. * @param ap The argument list. */ void WarningVA(const char *part, const char *str, va_list ap); /** Handle an XError event. * @param d The display on which the event occurred. * @param e The error event. * @return 0 */ int ErrorHandler(Display *d, XErrorEvent *e); #endif jwm-2.1.0+svn579/src/render.h0000644000000000000000000000165011710374021014271 0ustar rootroot/** * @file render.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Functions to render icons using the XRender extension. * */ #ifndef RENDER_H #define RENDER_H struct IconNode; struct ScaledIconNode; /** Put a scaled icon. * @param icon The icon. * @param node The scaled icon data. * @param d The drawable on which to render the icon. * @param x The x-coordinate to place the icon. * @param y The y-coordinate to place the icon. * @return 1 if the icon was successfully rendered, 0 otherwise. */ int PutScaledRenderIcon(struct IconNode *icon, struct ScaledIconNode *node, Drawable d, int x, int y); /** Create a scaled icon. * @param icon The icon. * @param width The width of the icon to create. * @param height The height of the icon to create. * @return The scaled icon. */ struct ScaledIconNode *CreateScaledRenderIcon(struct IconNode *icon, int width, int height); #endif /* RENDER_H */ jwm-2.1.0+svn579/src/icon.c0000644000000000000000000003736711710374021013753 0ustar rootroot/** * @file icon.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Icon functions. * */ #include "jwm.h" #include "icon.h" #include "client.h" #include "render.h" #include "main.h" #include "image.h" #include "misc.h" #include "hint.h" #include "color.h" IconNode emptyIcon; #ifdef USE_ICONS #include "x.xpm" /* Must be a power of two. */ #define HASH_SIZE 128 /** Linked list of icon paths. */ typedef struct IconPathNode { char *path; struct IconPathNode *next; } IconPathNode; static int iconSize = 0; static IconNode **iconHash; static IconPathNode *iconPaths; static IconPathNode *iconPathsTail; static GC iconGC; static void SetIconSize(); static void DoDestroyIcon(int index, IconNode *icon); static void ReadNetWMIcon(ClientNode *np); static IconNode *GetDefaultIcon(); static IconNode *CreateIconFromData(const char *name, char **data); static IconNode *CreateIconFromFile(const char *fileName); static IconNode *CreateIconFromBinary(const unsigned long *data, unsigned int length); static IconNode *LoadNamedIconHelper(const char *name, const char *path); static IconNode *LoadSuffixedIcon(const char *path, const char *name, const char *suffix); static ScaledIconNode *GetScaledIcon(IconNode *icon, int width, int height); static void InsertIcon(IconNode *icon); static IconNode *FindIcon(const char *name); static int GetHash(const char *str); /** Initialize icon data. * This must be initialized before parsing the configuration. */ void InitializeIcons() { int x; iconPaths = NULL; iconPathsTail = NULL; iconHash = Allocate(sizeof(IconNode*) * HASH_SIZE); for(x = 0; x < HASH_SIZE; x++) { iconHash[x] = NULL; } memset(&emptyIcon, 0, sizeof(emptyIcon)); } /** Startup icon support. */ void StartupIcons() { XGCValues gcValues; unsigned long gcMask; gcMask = GCGraphicsExposures; gcValues.graphics_exposures = False; iconGC = JXCreateGC(display, rootWindow, gcMask, &gcValues); } /** Shutdown icon support. */ void ShutdownIcons() { int x; for(x = 0; x < HASH_SIZE; x++) { while(iconHash[x]) { DoDestroyIcon(x, iconHash[x]); } } JXFreeGC(display, iconGC); } /** Destroy icon data. */ void DestroyIcons() { IconPathNode *pn; while(iconPaths) { pn = iconPaths->next; Release(iconPaths->path); Release(iconPaths); iconPaths = pn; } iconPathsTail = NULL; if(iconHash) { Release(iconHash); iconHash = NULL; } } /** Set the preferred icon sizes on the root window. */ void SetIconSize() { XIconSize size; if(!iconSize) { /* FIXME: compute values based on the sizes we can actually use. */ iconSize = 32; size.min_width = iconSize; size.min_height = iconSize; size.max_width = iconSize; size.max_height = iconSize; size.width_inc = iconSize; size.height_inc = iconSize; JXSetIconSizes(display, rootWindow, &size, 1); } } /** Add an icon search path. */ void AddIconPath(char *path) { IconPathNode *ip; int length; int addSep; if(!path) { return; } Trim(path); length = strlen(path); if(path[length - 1] != '/') { addSep = 1; } else { addSep = 0; } ip = Allocate(sizeof(IconPathNode)); ip->path = Allocate(length + addSep + 1); strcpy(ip->path, path); if(addSep) { ip->path[length] = '/'; ip->path[length + 1] = 0; } ExpandPath(&ip->path); ip->next = NULL; if(iconPathsTail) { iconPathsTail->next = ip; } else { iconPaths = ip; } iconPathsTail = ip; } /** Draw an icon. */ void PutIcon(IconNode *icon, Drawable d, int x, int y, int width, int height) { ScaledIconNode *node; int ix, iy; Assert(icon); if(icon == &emptyIcon) { return; } /* Scale the icon. */ node = GetScaledIcon(icon, width, height); if(node) { ix = x + (width - node->width) / 2; iy = y + (height - node->height) / 2; /* If we support xrender, use it. */ if(PutScaledRenderIcon(icon, node, d, ix, iy)) { return; } /* Draw the icon the old way. */ if(node->image != None) { /* Set the clip mask. */ if(node->mask != None) { JXSetClipOrigin(display, iconGC, ix, iy); JXSetClipMask(display, iconGC, node->mask); } /* Draw the icon. */ JXCopyArea(display, node->image, d, iconGC, 0, 0, node->width, node->height, ix, iy); /* Reset the clip mask. */ if(node->mask != None) { JXSetClipMask(display, iconGC, None); JXSetClipOrigin(display, iconGC, 0, 0); } } } } /** Load the icon for a client. */ void LoadIcon(ClientNode *np) { IconPathNode *ip; Assert(np); SetIconSize(); /* If client already has an icon, destroy it first. */ DestroyIcon(np->icon); np->icon = NULL; /* Attempt to read _NET_WM_ICON for an icon */ ReadNetWMIcon(np); if(np->icon) { return; } /* Attempt to find an icon for this program in the icon directory */ if(np->instanceName) { for(ip = iconPaths; ip; ip = ip->next) { #ifdef USE_PNG np->icon = LoadSuffixedIcon(ip->path, np->instanceName, ".png"); if(np->icon) { return; } #endif #ifdef USE_XPM np->icon = LoadSuffixedIcon(ip->path, np->instanceName, ".xpm"); if(np->icon) { return; } #endif #ifdef USE_JPEG np->icon = LoadSuffixedIcon(ip->path, np->instanceName, ".jpg"); if(np->icon) { return; } #endif } } /* Load the default icon */ np->icon = GetDefaultIcon(); } /** Load an icon given a name, path, and suffix. */ IconNode *LoadSuffixedIcon(const char *path, const char *name, const char *suffix) { IconNode *result; ImageNode *image; char *iconName; Assert(path); Assert(name); Assert(suffix); iconName = Allocate(strlen(name) + strlen(path) + strlen(suffix) + 1); strcpy(iconName, path); strcat(iconName, name); strcat(iconName, suffix); result = FindIcon(iconName); if(result) { Release(iconName); return result; } image = LoadImage(iconName); if(image) { result = CreateIcon(); result->name = iconName; result->image = image; InsertIcon(result); return result; } else { Release(iconName); return NULL; } } /** Load an icon from a file. */ IconNode *LoadNamedIcon(const char *name) { IconPathNode *ip; IconNode *icon; Assert(name); SetIconSize(); if(name[0] == '/') { return CreateIconFromFile(name); } else { for(ip = iconPaths; ip; ip = ip->next) { icon = LoadNamedIconHelper(name, ip->path); if(icon) { return icon; } } return NULL; } } /** Helper for loading icons by name. */ IconNode *LoadNamedIconHelper(const char *name, const char *path) { IconNode *result; char *temp; temp = AllocateStack(strlen(name) + strlen(path) + 1); strcpy(temp, path); strcat(temp, name); result = CreateIconFromFile(temp); ReleaseStack(temp); return result; } /** Read the icon property from a client. */ void ReadNetWMIcon(ClientNode *np) { unsigned long count; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *data; status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_ICON], 0, 256 * 256 * 4, False, XA_CARDINAL, &realType, &realFormat, &count, &extra, &data); if(status == Success && data) { np->icon = CreateIconFromBinary((unsigned long*)data, count); JXFree(data); } } /** Create the default icon. */ IconNode *GetDefaultIcon() { return CreateIconFromData("default", x_xpm); } /** Create an icon from XPM image data. */ IconNode *CreateIconFromData(const char *name, char **data) { ImageNode *image; IconNode *result; Assert(name); Assert(data); /* Check if this icon has already been loaded */ result = FindIcon(name); if(result) { return result; } image = LoadImageFromData(data); if(image) { result = CreateIcon(); result->name = CopyString(name); result->image = image; InsertIcon(result); return result; } else { return NULL; } } /** Create an icon from the specified file. */ IconNode *CreateIconFromFile(const char *fileName) { ImageNode *image; IconNode *result; if(!fileName) { return NULL; } /* Check if this icon has already been loaded */ result = FindIcon(fileName); if(result) { return result; } image = LoadImage(fileName); if(image) { result = CreateIcon(); result->name = CopyString(fileName); result->image = image; InsertIcon(result); return result; } else { return NULL; } } /** Get a scaled icon. */ ScaledIconNode *GetScaledIcon(IconNode *icon, int rwidth, int rheight) { XColor color; XImage *image; ScaledIconNode *np; GC maskGC; int x, y; int index, yindex; int scalex, scaley; /* Fixed point. */ int srcx, srcy; /* Fixed point. */ int ratio; /* Fixed point. */ int nwidth, nheight; unsigned char *data; Assert(icon); Assert(icon->image); if(rwidth == 0) { rwidth = icon->image->width; } if(rheight == 0) { rheight = icon->image->height; } ratio = (icon->image->width << 16) / icon->image->height; nwidth = Min(rwidth, (rheight * ratio) >> 16); nheight = Min(rheight, (nwidth << 16) / ratio); nwidth = (nheight * ratio) >> 16; if(nwidth < 1) { nwidth = 1; } if(nheight < 1) { nheight = 1; } /* Check if this size already exists. * Note that XRender scales on the fly. */ for(np = icon->nodes; np; np = np->next) { #ifdef USE_XRENDER if(np->imagePicture != None) { np->width = nwidth; np->height = nheight; return np; } #endif if(np->width == nwidth && np->height == nheight) { return np; } } /* See if we can use XRender to create the icon. */ np = CreateScaledRenderIcon(icon, nwidth, nheight); if(np) { return np; } /* Create a new ScaledIconNode the old-fashioned way. */ np = Allocate(sizeof(ScaledIconNode)); np->width = nwidth; np->height = nheight; np->next = icon->nodes; #ifdef USE_XRENDER np->imagePicture = None; #endif icon->nodes = np; /* Create a mask. */ np->mask = JXCreatePixmap(display, rootWindow, nwidth, nheight, 1); maskGC = JXCreateGC(display, np->mask, 0, NULL); JXSetForeground(display, maskGC, 0); JXFillRectangle(display, np->mask, maskGC, 0, 0, nwidth, nheight); JXSetForeground(display, maskGC, 1); /* Create a temporary XImage for scaling. */ image = JXCreateImage(display, rootVisual, rootDepth, ZPixmap, 0, NULL, nwidth, nheight, 8, 0); image->data = Allocate(sizeof(unsigned long) * nwidth * nheight); /* Determine the scale factor. */ scalex = (icon->image->width << 16) / nwidth; scaley = (icon->image->height << 16) / nheight; data = icon->image->data; srcy = 0; for(y = 0; y < nheight; y++) { srcx = 0; yindex = (srcy >> 16) * icon->image->width; for(x = 0; x < nwidth; x++) { index = 4 * (yindex + (srcx >> 16)); color.red = data[index + 1]; color.red |= color.red << 8; color.green = data[index + 2]; color.green |= color.green << 8; color.blue = data[index + 3]; color.blue |= color.blue << 8; GetColor(&color); XPutPixel(image, x, y, color.pixel); if(data[index] >= 128) { JXDrawPoint(display, np->mask, maskGC, x, y); } srcx += scalex; } srcy += scaley; } /* Release the mask GC. */ JXFreeGC(display, maskGC); /* Create the color data pixmap. */ np->image = JXCreatePixmap(display, rootWindow, nwidth, nheight, rootDepth); /* Render the image to the color data pixmap. */ JXPutImage(display, np->image, rootGC, image, 0, 0, 0, 0, nwidth, nheight); /* Release the XImage. */ Release(image->data); image->data = NULL; JXDestroyImage(image); return np; } /** Create an icon from binary data (as specified via window properties). */ IconNode *CreateIconFromBinary(const unsigned long *input, unsigned int length) { unsigned long height, width; IconNode *result; unsigned char *data; unsigned int x, index; if(!input) { return NULL; } width = input[0]; height = input[1]; if(JUNLIKELY(width * height + 2 > length)) { Debug("invalid image size: %d x %d + 2 > %d", width, height, length); return NULL; } else if(JUNLIKELY(width == 0 || height == 0)) { Debug("invalid image size: %d x %d", width, height); return NULL; } result = CreateIcon(); result->image = Allocate(sizeof(ImageNode)); result->image->width = width; result->image->height = height; result->image->data = Allocate(4 * width * height); data = result->image->data; /* Note: the data types here might be of different sizes. */ index = 0; for(x = 0; x < width * height; x++) { data[index++] = input[x + 2] >> 24; data[index++] = (input[x + 2] >> 16) & 0xFF; data[index++] = (input[x + 2] >> 8) & 0xFF; data[index++] = input[x + 2] & 0xFF; } /* Don't insert this icon since it is transient. */ return result; } /** Create an empty icon node. */ IconNode *CreateIcon() { IconNode *icon; icon = Allocate(sizeof(IconNode)); icon->name = NULL; icon->image = NULL; icon->nodes = NULL; icon->useRender = 1; icon->next = NULL; icon->prev = NULL; return icon; } /** Helper method for destroy icons. */ void DoDestroyIcon(int index, IconNode *icon) { ScaledIconNode *np; if(icon) { while(icon->nodes) { np = icon->nodes->next; #ifdef USE_XRENDER if(icon->nodes->imagePicture != None) { JXRenderFreePicture(display, icon->nodes->imagePicture); } #endif if(icon->nodes->image != None) { JXFreePixmap(display, icon->nodes->image); } if(icon->nodes->mask != None) { JXFreePixmap(display, icon->nodes->mask); } Release(icon->nodes); icon->nodes = np; } if(icon->name) { Release(icon->name); } DestroyImage(icon->image); if(icon->prev) { icon->prev->next = icon->next; } else { iconHash[index] = icon->next; } if(icon->next) { icon->next->prev = icon->prev; } Release(icon); } } /** Destroy an icon. */ void DestroyIcon(IconNode *icon) { int index; if(icon && !icon->name) { index = GetHash(icon->name); DoDestroyIcon(index, icon); } } /** Insert an icon to the icon hash table. */ void InsertIcon(IconNode *icon) { int index; Assert(icon); Assert(icon->name); index = GetHash(icon->name); icon->prev = NULL; if(iconHash[index]) { iconHash[index]->prev = icon; } icon->next = iconHash[index]; iconHash[index] = icon; } /** Find a icon in the icon hash table. */ IconNode *FindIcon(const char *name) { IconNode *icon; int index; index = GetHash(name); icon = iconHash[index]; while(icon) { if(!strcmp(icon->name, name)) { return icon; } icon = icon->next; } return NULL; } /** Get the hash for a string. */ int GetHash(const char *str) { int x; unsigned int hash = 0; if(str) { for(x = 0; str[x]; x++) { hash = (hash + (hash << 5)) ^ (unsigned int)str[x]; } hash &= (HASH_SIZE - 1); } return hash; } #endif /* USE_ICONS */ jwm-2.1.0+svn579/src/background.h0000644000000000000000000000160311710374021015127 0ustar rootroot/** * @file background.h * @author Joe Wingbermuehle * @date 2007 * * @brief Background control functions. * */ #ifndef BACKGROUND_H #define BACKGROUND_H /** Initialize any data needed for background support. */ void InitializeBackgrounds(); /** Startup background support. */ void StartupBackgrounds(); /** Shutdown background support. */ void ShutdownBackgrounds(); /** Release any data needed for background support. */ void DestroyBackgrounds(); /** Set the background to use for the specified desktops. * @param desktop The desktop whose background to set (-1 for the default). * @param type The type of background. * @param value The background. */ void SetBackground(int desktop, const char *type, const char *value); /** Load the background for the specified desktop. * @param desktop The current desktop. */ void LoadBackground(int desktop); #endif /* BACKGROUND_H */ jwm-2.1.0+svn579/src/key.c0000644000000000000000000002352711710374021013604 0ustar rootroot/** * @file key.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Key binding functions. * */ #include "jwm.h" #include "key.h" #include "client.h" #include "clientlist.h" #include "command.h" #include "error.h" #include "main.h" #include "misc.h" #include "root.h" #include "tray.h" #define MASK_NONE 0 #define MASK_SHIFT (1 << ShiftMapIndex) #define MASK_LOCK (1 << LockMapIndex) #define MASK_CTRL (1 << ControlMapIndex) #define MASK_MOD1 (1 << Mod1MapIndex) #define MASK_MOD2 (1 << Mod2MapIndex) #define MASK_MOD3 (1 << Mod3MapIndex) #define MASK_MOD4 (1 << Mod4MapIndex) #define MASK_MOD5 (1 << Mod5MapIndex) typedef struct ModifierNode { char name; unsigned int mask; } ModifierNode; static ModifierNode modifiers[] = { { 'C', MASK_CTRL }, { 'S', MASK_SHIFT }, { 'A', MASK_MOD1 }, { '1', MASK_MOD1 }, { '2', MASK_MOD2 }, { '3', MASK_MOD3 }, { '4', MASK_MOD4 }, { '5', MASK_MOD5 }, { 0, MASK_NONE } }; typedef struct KeyNode { /* These are filled in when the configuration file is parsed */ int key; unsigned int state; KeySym symbol; char *command; struct KeyNode *next; /* This is filled in by StartupKeys if it isn't already set. */ KeyCode code; } KeyNode; typedef struct LockNode { KeySym symbol; unsigned int mask; } LockNode; static LockNode lockMods[] = { { XK_Caps_Lock, 0 }, { XK_Num_Lock, 0 } }; static KeyNode *bindings; static unsigned int lockMask; static unsigned int GetModifierMask(XModifierKeymap *modmap, KeySym key); static unsigned int ParseModifierString(const char *str); static KeySym ParseKeyString(const char *str); static int ShouldGrab(KeyType key); static void GrabKey(KeyNode *np, Window win); /** Initialize key data. */ void InitializeKeys() { bindings = NULL; lockMask = 0; } /** Startup key bindings. */ void StartupKeys() { XModifierKeymap *modmap; KeyNode *np; TrayType *tp; int x; /* Get the keys that we don't care about (num lock, etc). */ modmap = JXGetModifierMapping(display); for(x = 0; x < sizeof(lockMods) / sizeof(lockMods[0]); x++) { lockMods[x].mask = GetModifierMask(modmap, lockMods[x].symbol); lockMask |= lockMods[x].mask; } JXFreeModifiermap(modmap); /* Look up and grab the keys. */ for(np = bindings; np; np = np->next) { /* Determine the key code. */ if(!np->code) { np->code = JXKeysymToKeycode(display, np->symbol); } /* Grab the key if needed. */ if(ShouldGrab(np->key)) { /* Grab on the root. */ GrabKey(np, rootWindow); /* Grab on the trays. */ for(tp = GetTrays(); tp; tp = tp->next) { GrabKey(np, tp->window); } } } } /** Shutdown key bindings. */ void ShutdownKeys() { ClientNode *np; TrayType *tp; int layer; /* Ungrab keys on client windows. */ for(layer = 0; layer < LAYER_COUNT; layer++) { for(np = nodes[layer]; np; np = np->next) { JXUngrabKey(display, AnyKey, AnyModifier, np->window); } } /* Ungrab keys on trays, only really needed if we are restarting. */ for(tp = GetTrays(); tp; tp = tp->next) { JXUngrabKey(display, AnyKey, AnyModifier, tp->window); } /* Ungrab keys on the root. */ JXUngrabKey(display, AnyKey, AnyModifier, rootWindow); } /** Destroy key data. */ void DestroyKeys() { KeyNode *np; while(bindings) { np = bindings->next; if(bindings->command) { Release(bindings->command); } Release(bindings); bindings = np; } } /** Grab a key. */ void GrabKey(KeyNode *np, Window win) { int x; int index, maxIndex; unsigned int mask; /* Don't attempt to grab if there is nothing to grab. */ if(!np->code) { return; } /* Grab for each lock modifier. */ maxIndex = 1 << (sizeof(lockMods) / sizeof(lockMods[0])); for(index = 0; index < maxIndex; index++) { /* Compute the modifier mask. */ mask = 0; for(x = 0; x < sizeof(lockMods) / sizeof(lockMods[0]); x++) { if(index & (1 << x)) { mask |= lockMods[x].mask; } } mask |= np->state; /* Grab the key. */ JXGrabKey(display, np->code, mask, win, True, GrabModeAsync, GrabModeAsync); } } /** Get the key action from an event. */ KeyType GetKey(const XKeyEvent *event) { KeyNode *np; unsigned int state; /* Remove modifiers we don't care about from the state. */ state = event->state & ~lockMask; /* Loop looking for a matching key binding. */ for(np = bindings; np; np = np->next) { if(np->state == state && np->code == event->keycode) { return np->key; } } return KEY_NONE; } /** Run a command invoked from a key binding. */ void RunKeyCommand(const XKeyEvent *event) { KeyNode *np; unsigned int state; /* Remove the lock key modifiers. */ state = event->state & ~lockMask; for(np = bindings; np; np = np->next) { if(np->state == state && np->code == event->keycode) { RunCommand(np->command); return; } } } /** Show a root menu caused by a key binding. */ void ShowKeyMenu(const XKeyEvent *event) { KeyNode *np; int button; unsigned int state; /* Remove the lock key modifiers. */ state = event->state & ~lockMask; for(np = bindings; np; np = np->next) { if(np->state == state && np->code == event->keycode) { button = atoi(np->command); if(button >= 0 && button <= 9) { ShowRootMenu(button, 0, 0); } return; } } } /** Determine if a key should be grabbed on client windows. */ int ShouldGrab(KeyType key) { switch(key & 0xFF) { case KEY_NEXT: case KEY_NEXTSTACK: case KEY_PREV: case KEY_PREVSTACK: case KEY_CLOSE: case KEY_MIN: case KEY_MAX: case KEY_SHADE: case KEY_STICK: case KEY_MOVE: case KEY_RESIZE: case KEY_ROOT: case KEY_WIN: case KEY_DESKTOP: case KEY_RDESKTOP: case KEY_LDESKTOP: case KEY_DDESKTOP: case KEY_UDESKTOP: case KEY_SHOWDESK: case KEY_SHOWTRAY: case KEY_EXEC: case KEY_RESTART: case KEY_EXIT: case KEY_FULLSCREEN: return 1; default: return 0; } } /** Grab keys on a client window. */ void GrabKeys(ClientNode *np) { KeyNode *kp; for(kp = bindings; kp; kp = kp->next) { if(ShouldGrab(kp->key)) { GrabKey(kp, np->window); } } } /** Get the modifier mask for a key. */ unsigned int GetModifierMask(XModifierKeymap *modmap, KeySym key) { KeyCode temp; int x; temp = JXKeysymToKeycode(display, key); if(JUNLIKELY(temp == 0)) { Warning(_("Specified KeySym is not defined for any KeyCode")); } for(x = 0; x < 8 * modmap->max_keypermod; x++) { if(modmap->modifiermap[x] == temp) { return 1 << (x / modmap->max_keypermod); } } Warning(_("modifier not found for keysym 0x%0x"), key); return 0; } /** Parse a modifier mask string. */ unsigned int ParseModifierString(const char *str) { unsigned int mask; int x, y; int found; if(!str) { return MASK_NONE; } mask = MASK_NONE; for(x = 0; str[x]; x++) { found = 0; for(y = 0; modifiers[y].name; y++) { if(modifiers[y].name == str[x]) { mask |= modifiers[y].mask; found = 1; break; } } if(JUNLIKELY(!found)) { Warning(_("invalid modifier: \"%c\""), str[x]); } } return mask; } /** Parse a key string. */ KeySym ParseKeyString(const char *str) { KeySym symbol; symbol = JXStringToKeysym(str); if(JUNLIKELY(symbol == NoSymbol)) { Warning(_("invalid key symbol: \"%s\""), str); } return symbol; } /** Insert a key binding. */ void InsertBinding(KeyType key, const char *modifiers, const char *stroke, const char *code, const char *command) { KeyNode *np; unsigned int mask; char *temp; int offset; KeySym sym; mask = ParseModifierString(modifiers); if(stroke && strlen(stroke) > 0) { for(offset = 0; stroke[offset]; offset++) { if(stroke[offset] == '#') { temp = CopyString(stroke); for(temp[offset] = '1'; temp[offset] <= '9'; temp[offset]++) { sym = ParseKeyString(temp); if(sym == NoSymbol) { Release(temp); return; } np = Allocate(sizeof(KeyNode)); np->next = bindings; bindings = np; np->key = key | ((temp[offset] - '1' + 1) << 8); np->state = mask; np->symbol = sym; np->command = NULL; np->code = 0; } Release(temp); return; } } sym = ParseKeyString(stroke); if(sym == NoSymbol) { return; } np = Allocate(sizeof(KeyNode)); np->next = bindings; bindings = np; np->key = key; np->state = mask; np->symbol = sym; np->command = CopyString(command); np->code = 0; } else if(code && strlen(code) > 0) { np = Allocate(sizeof(KeyNode)); np->next = bindings; bindings = np; np->key = key; np->state = mask; np->symbol = NoSymbol; np->command = CopyString(command); np->code = atoi(code); } else { Warning(_("neither key nor keycode specified for Key")); np = NULL; } } /** Validate key bindings. */ void ValidateKeys() { KeyNode *kp; int bindex; for(kp = bindings; kp; kp = kp->next) { if((kp->key & 0xFF) == KEY_ROOT && kp->command) { bindex = atoi(kp->command); if(JUNLIKELY(!IsRootMenuDefined(bindex))) { Warning(_("key binding: root menu %d not defined"), bindex); } } } } jwm-2.1.0+svn579/src/hint.h0000644000000000000000000001257211710374021013761 0ustar rootroot/** * @file hint.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for reading and writing X properties. * */ #ifndef HINT_H #define HINT_H struct ClientNode; /** Enumeration of atoms. */ typedef enum { /* Misc */ ATOM_COMPOUND_TEXT, ATOM_UTF8_STRING, ATOM_XSETROOT_ID, /* Standard atoms */ ATOM_WM_STATE, ATOM_WM_PROTOCOLS, ATOM_WM_DELETE_WINDOW, ATOM_WM_TAKE_FOCUS, ATOM_WM_LOCALE_NAME, ATOM_WM_CHANGE_STATE, ATOM_WM_COLORMAP_WINDOWS, /* WM Spec atoms */ ATOM_NET_SUPPORTED, ATOM_NET_NUMBER_OF_DESKTOPS, ATOM_NET_DESKTOP_NAMES, ATOM_NET_DESKTOP_GEOMETRY, ATOM_NET_DESKTOP_VIEWPORT, ATOM_NET_CURRENT_DESKTOP, ATOM_NET_ACTIVE_WINDOW, ATOM_NET_WORKAREA, ATOM_NET_SUPPORTING_WM_CHECK, ATOM_NET_SHOWING_DESKTOP, ATOM_NET_FRAME_EXTENTS, ATOM_NET_WM_DESKTOP, ATOM_NET_WM_STATE, ATOM_NET_WM_STATE_STICKY, ATOM_NET_WM_STATE_MAXIMIZED_VERT, ATOM_NET_WM_STATE_MAXIMIZED_HORZ, ATOM_NET_WM_STATE_SHADED, ATOM_NET_WM_STATE_FULLSCREEN, ATOM_NET_WM_STATE_HIDDEN, ATOM_NET_WM_STATE_SKIP_TASKBAR, ATOM_NET_WM_STATE_BELOW, ATOM_NET_WM_STATE_ABOVE, ATOM_NET_WM_ALLOWED_ACTIONS, ATOM_NET_WM_ACTION_MOVE, ATOM_NET_WM_ACTION_RESIZE, ATOM_NET_WM_ACTION_MINIMIZE, ATOM_NET_WM_ACTION_SHADE, ATOM_NET_WM_ACTION_STICK, ATOM_NET_WM_ACTION_MAXIMIZE_HORZ, ATOM_NET_WM_ACTION_MAXIMIZE_VERT, ATOM_NET_WM_ACTION_CHANGE_DESKTOP, ATOM_NET_WM_ACTION_CLOSE, ATOM_NET_WM_ACTION_BELOW, ATOM_NET_WM_ACTION_ABOVE, ATOM_NET_CLOSE_WINDOW, ATOM_NET_MOVERESIZE_WINDOW, ATOM_NET_WM_NAME, ATOM_NET_WM_ICON, ATOM_NET_WM_WINDOW_TYPE, ATOM_NET_WM_WINDOW_TYPE_DESKTOP, ATOM_NET_WM_WINDOW_TYPE_DOCK, ATOM_NET_WM_WINDOW_TYPE_SPLASH, ATOM_NET_WM_WINDOW_TYPE_DIALOG, ATOM_NET_WM_WINDOW_TYPE_NORMAL, ATOM_NET_CLIENT_LIST, ATOM_NET_CLIENT_LIST_STACKING, ATOM_NET_WM_STRUT_PARTIAL, ATOM_NET_WM_STRUT, ATOM_NET_SYSTEM_TRAY_OPCODE, ATOM_NET_WM_WINDOW_OPACITY, /* MWM atoms */ ATOM_MOTIF_WM_HINTS, /* JWM-specific atoms. */ ATOM_JWM_RESTART, ATOM_JWM_EXIT, ATOM_JWM_RELOAD, ATOM_COUNT } AtomType; #define FIRST_NET_ATOM ATOM_NET_SUPPORTED #define LAST_NET_ATOM ATOM_NET_SYSTEM_TRAY_OPCODE #define FIRST_MWM_ATOM ATOM_MOTIF_WM_HINTS #define LAST_MWM_ATOM ATOM_MOTIF_WM_HINTS /** Enumeration of window layers. */ typedef enum { LAYER_BOTTOM = 0, LAYER_BELOW = 2, LAYER_NORMAL = 4, LAYER_ABOVE = 6, DEFAULT_TRAY_LAYER = 8, LAYER_TOP = 12, LAYER_COUNT = 13 } WinLayerType; /** Client state information. */ typedef struct ClientState { unsigned int status; /**< Status bit mask. */ unsigned int border; /**< Border bit mask. */ unsigned int layer; /**< Window layer. */ unsigned int desktop; /**< Desktop. */ unsigned int opacity; /**< Opacity (0 - 0xFFFFFFFF). */ } ClientState; /** Client protocols (to be used as a bit mask). */ typedef enum { PROT_NONE = 0, PROT_DELETE = 1, PROT_TAKE_FOCUS = 2 } ClientProtocolType; extern Atom atoms[ATOM_COUNT]; void InitializeHints(); void StartupHints(); void ShutdownHints(); void DestroyHints(); /** Determine the current desktop. */ void ReadCurrentDesktop(); /** Read client protocols * @param np The client. */ void ReadClientProtocols(struct ClientNode *np); /** Read a client's name. * @param np The client. */ void ReadWMName(struct ClientNode *np); /** Read a client's class. * @param np The client. */ void ReadWMClass(struct ClientNode *np); /** Read normal hints for a client. * @param np The client. */ void ReadWMNormalHints(struct ClientNode *np); /** Read the WM_PROTOCOLS property for a window. * @param w The window. * @return The protocols. */ ClientProtocolType ReadWMProtocols(Window w); /** Read colormap information for a client. * @param np The client. */ void ReadWMColormaps(struct ClientNode *np); /** Determine the layer of a client. * @param np The client. */ void ReadWinLayer(struct ClientNode *np); /** Read the current state of a window. * @param win The window. * @return The window state. */ ClientState ReadWindowState(Window win); /** Set the state of a client window. * @param np The client. */ void WriteState(struct ClientNode *np); /** Read a cardinal atom. * @param window The window. * @param atom The atom to read. * @param value A pointer to the location to save the atom. * @return 1 on success, 0 on failure. */ int GetCardinalAtom(Window window, AtomType atom, unsigned long *value); /** Read a window atom. * @param window The window. * @param atom The atom to read. * @param value A pointer to the location to save the atom. * @return 1 on success, 0 on failure. */ int GetWindowAtom(Window window, AtomType atom, Window *value); /** Set a cardinal atom. * @param window The window. * @param atom The atom to set. * @param value The value. */ void SetCardinalAtom(Window window, AtomType atom, unsigned long value); /** Set a window atom. * @param window The window. * @param atom The atom to set. * @param value The value. */ void SetWindowAtom(Window window, AtomType atom, unsigned long value); /** Set a pixmap atom. * @param window The window. * @param atom The atom to set. * @param value The value. */ void SetPixmapAtom(Window window, AtomType atom, Pixmap value); #endif /* HINT_H */ jwm-2.1.0+svn579/src/debug.c0000644000000000000000000001363711710374021014103 0ustar rootroot/** * @file debug.h * @author Joe Wingbermuehle * @date 2003-2006 * * @brief Debug functions. * */ #include "debug.h" /** Emit a message (if compiled with -DDEBUG). */ void Debug(const char *str, ...) { #ifdef DEBUG va_list ap; va_start(ap, str); Assert(str); fprintf(stderr, "DEBUG: "); vfprintf(stderr, str, ap); fprintf(stderr, "\n"); va_end(ap); #endif /* DEBUG */ } #ifdef DEBUG #define CHECKPOINT_LIST_SIZE 8 typedef struct MemoryType { const char *file; unsigned int line; size_t size; void *pointer; struct MemoryType *next; } MemoryType; static MemoryType *allocations = NULL; static const char *checkpointFile[CHECKPOINT_LIST_SIZE]; static unsigned int checkpointLine[CHECKPOINT_LIST_SIZE]; static int checkpointOffset; /** Start the debugger. */ void DEBUG_StartDebug(const char *file, unsigned int line) { int x; Debug("%s[%u]: debug mode started", file, line); checkpointOffset = 0; for(x = 0; x < CHECKPOINT_LIST_SIZE; x++) { checkpointFile[x] = NULL; checkpointLine[x] = 0; } } /** Stop the debugger. */ void DEBUG_StopDebug(const char *file, unsigned int line) { MemoryType *mp; unsigned int count = 0; Debug("%s[%u]: debug mode stopped", file, line); if(allocations) { Debug("MEMORY: memory leaks follow"); for(mp = allocations; mp; mp = mp->next) { Debug(" %u bytes in %s at line %u", mp->size, mp->file, mp->line); ++count; } if(count == 1) { Debug("MEMORY: 1 memory leak"); } else { Debug("MEMORY: %u memory leaks", count); } } else { Debug("MEMORY: no memory leaks"); } } /** Set a checkpoint. */ void DEBUG_SetCheckpoint(const char *file, unsigned int line) { checkpointFile[checkpointOffset] = file; checkpointLine[checkpointOffset] = line; checkpointOffset = (checkpointOffset + 1) % CHECKPOINT_LIST_SIZE; } /** Display the location of the last checkpoint. */ void DEBUG_ShowCheckpoint() { int x, offset; Debug("CHECKPOINT LIST (oldest)"); offset = checkpointOffset; for(x = 0; x < CHECKPOINT_LIST_SIZE; x++) { if(checkpointFile[offset]) { Debug(" %s[%u]", checkpointFile[offset], checkpointLine[offset]); } offset = (offset + 1) % CHECKPOINT_LIST_SIZE; } Debug("END OF CHECKPOINT LIST (most recent)"); } /** Allocate memory and log. */ void *DEBUG_Allocate(size_t size, const char *file, unsigned int line) { MemoryType *mp; if(size <= 0) { Debug("MEMORY: %s[%u]: Attempt to allocate %d bytes of memory", file, line, size); } mp = (MemoryType*)malloc(sizeof(MemoryType)); Assert(mp); mp->file = file; mp->line = line; mp->size = size; mp->pointer = malloc(size + sizeof(char)); if(!mp->pointer) { Debug("MEMORY: %s[%u]: Memory allocation failed (%d bytes)", file, line, size); Assert(0); } /* Make uninitialized accesses easy to find. */ memset(mp->pointer, 85, size); /* Canary value for buffer overflow checking. */ ((char*)mp->pointer)[size] = 42; mp->next = allocations; allocations = mp; return mp->pointer; } /** Reallocate memory and log. */ void *DEBUG_Reallocate(void *ptr, size_t size, const char *file, unsigned int line) { MemoryType *mp; if(size <= 0) { Debug("MEMORY: %s[%u]: Attempt to reallocate %d bytes of memory", file, line, size); } if(!ptr) { Debug("MEMORY: %s[%u]: Attempt to reallocate NULL pointer. " "Calling Allocate...", file, line); return DEBUG_Allocate(size, file, line); } else { for(mp = allocations; mp; mp = mp->next) { if(mp->pointer == ptr) { if(((char*)ptr)[mp->size] != 42) { Debug("MEMORY: %s[%u]: The canary is dead.", file, line); } mp->file = file; mp->line = line; mp->size = size; mp->pointer = realloc(ptr, size + sizeof(char)); if(!mp->pointer) { Debug("MEMORY: %s[%u]: Failed to reallocate %d bytes.", file, line, size); Assert(0); } ((char*)mp->pointer)[size] = 42; return mp->pointer; } } Debug("MEMORY: %s[%u]: Attempt to reallocate unallocated pointer", file, line); mp = malloc(sizeof(MemoryType)); Assert(mp); mp->file = file; mp->line = line; mp->size = size; mp->pointer = malloc(size + sizeof(char)); if(!mp->pointer) { Debug("MEMORY: %s[%u]: Failed to reallocate %d bytes.", file, line, size); Assert(0); } memset(mp->pointer, 85, size); ((char*)mp->pointer)[size] = 42; mp->next = allocations; allocations = mp; return mp->pointer; } } /** Release memory and log. */ void DEBUG_Release(void **ptr, const char *file, unsigned int line) { MemoryType *mp, *last; if(!ptr) { Debug("MEMORY: %s[%u]: Invalid attempt to release", file, line); } else if(!*ptr) { Debug("MEMORY: %s[%u]: Attempt to delete NULL pointer", file, line); } else { last = NULL; for(mp = allocations; mp; mp = mp->next) { if(mp->pointer == *ptr) { if(last) { last->next = mp->next; } else { allocations = mp->next; } if(((char*)*ptr)[mp->size] != 42) { Debug("MEMORY: %s[%u]: The canary is dead.", file, line); } memset(*ptr, 0xFF, mp->size); free(mp); free(*ptr); *ptr = NULL; return; } last = mp; } Debug("MEMORY: %s[%u]: Attempt to delete unallocated pointer", file, line); memset(*ptr, 0xFF, mp->size); free(*ptr); /* This address should cause a segfault or bus error. */ *ptr = (void*)1; } } #undef CHECKPOINT_LIST_SIZE #endif jwm-2.1.0+svn579/src/Makefile.in0000644000000000000000000000151211710374021014703 0ustar rootroot CC = @CC@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ BINDIR = $(DESTDIR)@BINDIR@ VPATH=.:os OBJECTS = background.o border.o button.o client.o clientlist.o clock.o \ color.o command.o confirm.o cursor.o debug.o desktop.o dock.o event.o \ error.o font.o gradient.o group.o help.o hint.o icon.o image.o \ key.o lex.o main.o match.o menu.o misc.o move.o outline.o pager.o \ parse.o place.o popup.o render.o resize.o root.o screen.o spacer.o \ status.o swallow.o taskbar.o timing.o tray.o traybutton.o winmenu.o EXE = jwm .SUFFIXES: .o .h .c all: $(EXE) install: all install -d $(BINDIR) install $(EXE) $(BINDIR)/$(EXE) strip $(BINDIR)/$(EXE) depend: makedepend -m -DMAKE_DEPEND -- $(CFLAGS) -- *.c $(EXE): $(OBJECTS) $(CC) -o $(EXE) $(OBJECTS) $(LDFLAGS) .c.o: $(CC) -c $(CFLAGS) $< clean: rm -f $(OBJECTS) $(EXE) core jwm-2.1.0+svn579/src/color.c0000644000000000000000000003553611710374021014135 0ustar rootroot/** * @file color.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle loading colors. * */ #include "jwm.h" #include "main.h" #include "color.h" #include "error.h" #include "misc.h" typedef struct { ColorType type; const char *value; } DefaultColorNode; unsigned long colors[COLOR_COUNT]; static unsigned long rgbColors[COLOR_COUNT]; /* Map a linear 8-bit RGB space to pixel values. */ static unsigned long *map; /* Map 8-bit pixel values to a 24-bit linear RGB space. */ static unsigned long *rmap; #ifdef USE_XFT static XftColor *xftColors[COLOR_COUNT] = { NULL }; #endif static DefaultColorNode DEFAULT_COLORS[] = { { COLOR_TITLE_FG, "black" }, { COLOR_TITLE_ACTIVE_FG, "black" }, { COLOR_TITLE_BG1, "gray" }, { COLOR_TITLE_BG2, "gray" }, { COLOR_TITLE_ACTIVE_BG1, "red" }, { COLOR_TITLE_ACTIVE_BG2, "red" }, { COLOR_BORDER_LINE, "black" }, { COLOR_BORDER_ACTIVE_LINE, "black" }, { COLOR_TRAY_BG, "gray" }, { COLOR_TRAY_FG, "black" }, { COLOR_TASK_FG, "black" }, { COLOR_TASK_BG1, "gray" }, { COLOR_TASK_BG2, "gray" }, { COLOR_TASK_ACTIVE_FG, "white" }, { COLOR_TASK_ACTIVE_BG1, "red" }, { COLOR_TASK_ACTIVE_BG2, "red" }, { COLOR_PAGER_BG, "black" }, { COLOR_PAGER_FG, "gray" }, { COLOR_PAGER_ACTIVE_BG, "red" }, { COLOR_PAGER_ACTIVE_FG, "red" }, { COLOR_PAGER_OUTLINE, "black" }, { COLOR_PAGER_TEXT, "black" }, { COLOR_MENU_BG, "gray" }, { COLOR_MENU_FG, "black" }, { COLOR_MENU_ACTIVE_BG1, "red" }, { COLOR_MENU_ACTIVE_BG2, "red" }, { COLOR_MENU_ACTIVE_FG, "white" }, { COLOR_MENU_ACTIVE_OL, "black" }, { COLOR_POPUP_BG, "yellow" }, { COLOR_POPUP_FG, "black" }, { COLOR_POPUP_OUTLINE, "black" }, { COLOR_TRAYBUTTON_FG, "black" }, { COLOR_TRAYBUTTON_BG, "gray" }, { COLOR_CLOCK_FG, "black" }, { COLOR_CLOCK_BG, "gray" }, { COLOR_COUNT, NULL } }; static char **names = NULL; static unsigned long redShift; static unsigned long greenShift; static unsigned long blueShift; static unsigned long redMask; static unsigned long greenMask; static unsigned long blueMask; static void ComputeShiftMask(unsigned long maskIn, unsigned long *shiftOut, unsigned long *maskOut); static void GetDirectPixel(XColor *c); static void GetMappedPixel(XColor *c); static void SetDefaultColor(ColorType type); static unsigned long ReadHex(const char *hex); static unsigned long GetRGBFromXColor(const XColor *c); static XColor GetXColorFromRGB(unsigned long rgb); static int GetColorByName(const char *str, XColor *c); static void InitializeNames(); static void LightenColor(ColorType oldColor, ColorType newColor); static void DarkenColor(ColorType oldColor, ColorType newColor); /** Initialize color data. */ void InitializeColors() { } /** Startup color support. */ void StartupColors() { int x; int red, green, blue; XColor c; /* Determine how to convert between RGB triples and pixels. */ Assert(rootVisual); switch(rootVisual->class) { case DirectColor: case TrueColor: ComputeShiftMask(rootVisual->red_mask, &redShift, &redMask); ComputeShiftMask(rootVisual->green_mask, &greenShift, &greenMask); ComputeShiftMask(rootVisual->blue_mask, &blueShift, &blueMask); map = NULL; break; default: /* Attempt to get 256 colors, pretend it worked. */ redMask = 0xE0; greenMask = 0x1C; blueMask = 0x03; ComputeShiftMask(redMask, &redShift, &redMask); ComputeShiftMask(greenMask, &greenShift, &greenMask); ComputeShiftMask(blueMask, &blueShift, &blueMask); map = Allocate(sizeof(unsigned long) * 256); /* RGB: 3, 3, 2 */ x = 0; for(red = 0; red < 8; red++) { for(green = 0; green < 8; green++) { for(blue = 0; blue < 4; blue++) { c.red = (unsigned short)(74898 * red / 8); c.green = (unsigned short)(74898 * green / 8); c.blue = (unsigned short)(87381 * blue / 4); c.flags = DoRed | DoGreen | DoBlue; JXAllocColor(display, rootColormap, &c); map[x] = c.pixel; ++x; } } } /* Compute the reverse pixel mapping (pixel -> 24-bit RGB). */ rmap = Allocate(sizeof(unsigned long) * 256); for(x = 0; x < 256; x++) { c.pixel = x; JXQueryColor(display, rootColormap, &c); GetDirectPixel(&c); rmap[x] = c.pixel; } break; } /* Inherit unset colors from the tray for tray items. */ if(names) { if(!names[COLOR_TASK_BG1]) { names[COLOR_TASK_BG1] = CopyString(names[COLOR_TRAY_BG]); } if(!names[COLOR_TASK_BG2]) { names[COLOR_TASK_BG2] = CopyString(names[COLOR_TRAY_BG]); } if(!names[COLOR_TRAYBUTTON_BG]) { names[COLOR_TRAYBUTTON_BG] = CopyString(names[COLOR_TRAY_BG]); } if(!names[COLOR_CLOCK_BG]) { names[COLOR_CLOCK_BG] = CopyString(names[COLOR_TRAY_BG]); } if(!names[COLOR_TASK_FG]) { names[COLOR_TASK_FG] = CopyString(names[COLOR_TRAY_FG]); } if(!names[COLOR_TRAYBUTTON_FG]) { names[COLOR_TRAYBUTTON_FG] = CopyString(names[COLOR_TRAY_FG]); } if(!names[COLOR_CLOCK_FG]) { names[COLOR_CLOCK_FG] = CopyString(names[COLOR_TRAY_FG]); } } /* Get color information used for JWM stuff. */ for(x = 0; x < COLOR_COUNT; x++) { if(names && names[x]) { if(ParseColor(names[x], &c)) { colors[x] = c.pixel; rgbColors[x] = GetRGBFromXColor(&c); } else { SetDefaultColor(x); } } else { SetDefaultColor(x); } } if(names) { for(x = 0; x < COLOR_COUNT; x++) { if(names[x]) { Release(names[x]); } } Release(names); names = NULL; } LightenColor(COLOR_TRAY_BG, COLOR_TRAY_UP); DarkenColor(COLOR_TRAY_BG, COLOR_TRAY_DOWN); LightenColor(COLOR_TASK_BG1, COLOR_TASK_UP); DarkenColor(COLOR_TASK_BG1, COLOR_TASK_DOWN); LightenColor(COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_UP); DarkenColor(COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_DOWN); LightenColor(COLOR_MENU_BG, COLOR_MENU_UP); DarkenColor(COLOR_MENU_BG, COLOR_MENU_DOWN); LightenColor(COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_UP); DarkenColor(COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_DOWN); } /** Shutdown color support. */ void ShutdownColors() { #ifdef USE_XFT int x; for(x = 0; x < COLOR_COUNT; x++) { if(xftColors[x]) { JXftColorFree(display, rootVisual, rootColormap, xftColors[x]); Release(xftColors[x]); xftColors[x] = NULL; } } #endif if(map != NULL) { JXFreeColors(display, rootColormap, map, 256, 0); Release(map); map = NULL; Release(rmap); rmap = NULL; } } /** Release color data. */ void DestroyColors() { int x; if(names) { for(x = 0; x < COLOR_COUNT; x++) { if(names[x]) { Release(names[x]); } } Release(names); names = NULL; } } /** Compute the mask for computing colors in a linear RGB colormap. */ void ComputeShiftMask(unsigned long maskIn, unsigned long *shiftOut, unsigned long *maskOut) { int shift; Assert(shiftOut); Assert(maskOut); /* Components are stored in 16 bits. * When computing pixels, we'll first shift left 16 bits * so to the shift will be an offset from that 32 bit entity. * shift = 16 - + */ shift = 0; *maskOut = maskIn; while(maskIn && (maskIn & (1 << 31)) == 0) { ++shift; maskIn <<= 1; } *shiftOut = shift; } /** Get an RGB value from an XColor. */ unsigned long GetRGBFromXColor(const XColor *c) { unsigned int red, green, blue; unsigned long rgb; Assert(c); red = Min((c->red + 0x80) >> 8, 0xFF); green = Min((c->green + 0x80) >> 8, 0xFF); blue = Min((c->blue + 0x80) >> 8, 0xFF); rgb = (unsigned long)red << 16; rgb |= (unsigned long)green << 8; rgb |= (unsigned long)blue; return rgb; } /** Convert an RGB value to an XColor. */ XColor GetXColorFromRGB(unsigned long rgb) { XColor ret = { 0 }; ret.flags = DoRed | DoGreen | DoBlue; ret.red = (unsigned short)(((rgb >> 16) & 0xFF) * 257); ret.green = (unsigned short)(((rgb >> 8) & 0xFF) * 257); ret.blue = (unsigned short)((rgb & 0xFF) * 257); return ret; } /** Set the color to use for a component. */ void SetColor(ColorType c, const char *value) { if(JUNLIKELY(!value)) { Warning("empty color tag"); return; } InitializeNames(); if(names[c]) { Release(names[c]); } names[c] = CopyString(value); } /** Parse a color for a component. */ int ParseColor(const char *value, XColor *c) { unsigned long rgb; if(JUNLIKELY(!value)) { return 0; } if(value[0] == '#' && strlen(value) == 7) { rgb = ReadHex(value + 1); c->red = ((rgb >> 16) & 0xFF) * 257; c->green = ((rgb >> 8) & 0xFF) * 257; c->blue = (rgb & 0xFF) * 257; c->flags = DoRed | DoGreen | DoBlue; GetColor(c); } else { if(JUNLIKELY(!GetColorByName(value, c))) { Warning("bad color: \"%s\"", value); return 0; } } return 1; } /** Set the specified color to its default. */ void SetDefaultColor(ColorType type) { XColor c; int x; for(x = 0; DEFAULT_COLORS[x].value; x++) { if(DEFAULT_COLORS[x].type == type) { ParseColor(DEFAULT_COLORS[x].value, &c); colors[type] = c.pixel; rgbColors[type] = GetRGBFromXColor(&c); return; } } } /** Initialize color names to NULL. */ void InitializeNames() { int x; if(names == NULL) { names = Allocate(sizeof(char*) * COLOR_COUNT); for(x = 0; x < COLOR_COUNT; x++) { names[x] = NULL; } } } /** Convert a hex value to an unsigned long. */ unsigned long ReadHex(const char *hex) { unsigned long value = 0; int x; Assert(hex); for(x = 0; hex[x]; x++) { value *= 16; if(hex[x] >= '0' && hex[x] <= '9') { value += hex[x] - '0'; } else if(hex[x] >= 'A' && hex[x] <= 'F') { value += hex[x] - 'A' + 10; } else if(hex[x] >= 'a' && hex[x] <= 'f') { value += hex[x] - 'a' + 10; } } return value; } /** Compute a color lighter than the input. */ void LightenColor(ColorType oldColor, ColorType newColor) { XColor temp; int red, green, blue; temp = GetXColorFromRGB(rgbColors[oldColor]); /* Convert to 0.0 to 1.0 in fixed point with 8 bits for the fraction. */ red = temp.red >> 8; green = temp.green >> 8; blue = temp.blue >> 8; /* Multiply by 1.45 which is 371. */ red = (red * 371) >> 8; green = (green * 371) >> 8; blue = (blue * 371) >> 8; /* Convert back to 0-65535. */ red |= red << 8; green |= green << 8; blue |= blue << 8; /* Cap at 65535. */ red = Min(65535, red); green = Min(65535, green); blue = Min(65535, blue); temp.red = red; temp.green = green; temp.blue = blue; GetColor(&temp); colors[newColor] = temp.pixel; rgbColors[newColor] = GetRGBFromXColor(&temp); } /** Compute a color darker than the input. */ void DarkenColor(ColorType oldColor, ColorType newColor) { XColor temp; int red, green, blue; temp = GetXColorFromRGB(rgbColors[oldColor]); /* Convert to 0.0 to 1.0 in fixed point with 8 bits for the fraction. */ red = temp.red >> 8; green = temp.green >> 8; blue = temp.blue >> 8; /* Multiply by 0.55 which is 141. */ red = (red * 141) >> 8; green = (green * 141) >> 8; blue = (blue * 141) >> 8; /* Convert back to 0-65535. */ red |= red << 8; green |= green << 8; blue |= blue << 8; temp.red = red; temp.green = green; temp.blue = blue; GetColor(&temp); colors[newColor] = temp.pixel; rgbColors[newColor] = GetRGBFromXColor(&temp); } /** Look up a color by name. */ int GetColorByName(const char *str, XColor *c) { Assert(str); Assert(c); if(!JXParseColor(display, rootColormap, str, c)) { return 0; } GetColor(c); return 1; } /** Compute the RGB components from an index into our RGB colormap. */ void GetColorFromIndex(XColor *c) { unsigned long red; unsigned long green; unsigned long blue; Assert(c); red = (c->pixel & redMask) << redShift; green = (c->pixel & greenMask) << greenShift; blue = (c->pixel & blueMask) << blueShift; c->red = red >> 16; c->green = green >> 16; c->blue = blue >> 16; } /** Compute the pixel value from RGB components. */ void GetDirectPixel(XColor *c) { unsigned long red; unsigned long green; unsigned long blue; Assert(c); /* Normalize. */ red = c->red << 16; green = c->green << 16; blue = c->blue << 16; /* Shift to the correct offsets and mask. */ red = (red >> redShift) & redMask; green = (green >> greenShift) & greenMask; blue = (blue >> blueShift) & blueMask; /* Combine. */ c->pixel = red | green | blue; } /** Compute the pixel value from RGB components. */ void GetMappedPixel(XColor *c) { Assert(c); GetDirectPixel(c); c->pixel = map[c->pixel]; } /** Compute the pixel value from RGB components. */ void GetColor(XColor *c) { Assert(c); Assert(rootVisual); switch(rootVisual->class) { case DirectColor: case TrueColor: GetDirectPixel(c); return; default: GetMappedPixel(c); return; } } /** Get the RGB components from a pixel value. */ void GetColorFromPixel(XColor *c) { Assert(c); switch(rootVisual->class) { case DirectColor: case TrueColor: /* Nothing to do. */ break; default: /* Convert from a pixel value to a linear RGB space. */ c->pixel = rmap[c->pixel & 255]; break; } /* Extract the RGB components from the linear RGB pixel value. */ GetColorFromIndex(c); } /** Get an RGB pixel value from RGB components. */ void GetColorIndex(XColor *c) { Assert(c); GetDirectPixel(c); } /** Get an XFT color for the specified component. */ #ifdef USE_XFT XftColor *GetXftColor(ColorType type) { unsigned long rgb; XRenderColor rcolor; if(!xftColors[type]) { rgb = rgbColors[type]; xftColors[type] = Allocate(sizeof(XftColor)); rcolor.alpha = 65535; rcolor.red = ((rgb >> 16) & 0xFF) * 257; rcolor.green = ((rgb >> 8) & 0xFF) * 257; rcolor.blue = (rgb & 0xFF) * 257; JXftColorAllocValue(display, rootVisual, rootColormap, &rcolor, xftColors[type]); } return xftColors[type]; } #endif jwm-2.1.0+svn579/src/command.h0000644000000000000000000000152611710374021014432 0ustar rootroot/** * @file command.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Handle running startup, shutdown, and restart commands. * */ #ifndef COMMAND_H #define COMMAND_H /*@{*/ void InitializeCommands(); void StartupCommands(); void ShutdownCommands(); void DestroyCommands(); /*@}*/ /** Add a command to be executed at startup. * @param command The command to execute. */ void AddStartupCommand(const char *command); /** Add a command to be executed at shutdown. * @param command The command to execute. */ void AddShutdownCommand(const char *command); /** Add a command to be executed after a restart. * @param command The command to execute. */ void AddRestartCommand(const char *command); /** Run a command. * @param command The command to run (run in sh). */ void RunCommand(const char *command); #endif /* COMMAND_H */ jwm-2.1.0+svn579/src/x.xpm0000644000000000000000000000202211710374021013630 0ustar rootroot/* XPM */ static char *x_xpm[]={ /* width height num_colors chars_per_pixel */ "28 28 2 1", /* colors */ ". c None", "# c #ff0000", /* pixels */ "............................", "............................", "............................", "............................", ".########..............##...", "..########............##....", "...########..........##.....", "....########........##......", ".....########......##.......", "......########....##........", ".......########..##.........", "........######..##..........", ".........####..##...........", "..........##..####..........", ".........##..######.........", "........##..########........", ".......##....########.......", "......##......########......", ".....##........########.....", "....##..........########....", "...##............########...", "..##..............########..", ".##................########.", "............................", "............................", "............................", "............................", "............................"}; jwm-2.1.0+svn579/src/main.h0000644000000000000000000000226611710374021013742 0ustar rootroot/** * @file main.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the main functions. * */ #ifndef MAIN_H #define MAIN_H /** Enumeration of focus models. */ typedef enum { FOCUS_SLOPPY = 0, FOCUS_CLICK = 1 } FocusModelType; extern Display *display; extern Window rootWindow; extern int rootWidth, rootHeight; extern int rootDepth; extern int rootScreen; extern Colormap rootColormap; extern Visual *rootVisual; extern GC rootGC; extern int colormapCount; extern char *exitCommand; extern unsigned int desktopWidth; extern unsigned int desktopHeight; extern unsigned int desktopCount; extern unsigned int currentDesktop; extern char shouldExit; extern char shouldRestart; extern char isRestarting; extern char shouldReload; extern char initializing; extern int borderWidth; extern int titleHeight; extern unsigned int doubleClickSpeed; extern unsigned int doubleClickDelta; extern FocusModelType focusModel; extern XContext clientContext; extern XContext frameContext; #ifdef USE_SHAPE extern int haveShape; extern int shapeEvent; #endif #ifdef USE_XRENDER extern int haveRender; #endif extern char *configPath; #endif /* MAIN_H */ jwm-2.1.0+svn579/src/menu.c0000644000000000000000000005014111710374021013750 0ustar rootroot/** * @file menu.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Menu display and handling functions. * */ #include "jwm.h" #include "menu.h" #include "font.h" #include "client.h" #include "color.h" #include "icon.h" #include "image.h" #include "main.h" #include "cursor.h" #include "key.h" #include "button.h" #include "event.h" #include "error.h" #include "root.h" #define BASE_ICON_OFFSET 3 typedef enum { MENU_NOSELECTION = 0, MENU_LEAVE = 1, MENU_SUBSELECT = 2 } MenuSelectionType; /** Submenu arrow, 4 x 7 pixels */ static char menu_bitmap[] = { 0x01, 0x03, 0x07, 0x0F, 0x07, 0x03, 0x01 }; static int ShowSubmenu(Menu *menu, Menu *parent, int x, int y); static void CreateMenu(Menu *menu, int x, int y); static void HideMenu(Menu *menu); static void DrawMenu(Menu *menu); static void RedrawMenuTree(Menu *menu); static int MenuLoop(Menu *menu); static MenuSelectionType UpdateMotion(Menu *menu, XEvent *event); static void UpdateMenu(Menu *menu); static void DrawMenuItem(Menu *menu, MenuItem *item, int index); static MenuItem *GetMenuItem(Menu *menu, int index); static int GetNextMenuIndex(Menu *menu); static int GetPreviousMenuIndex(Menu *menu); static int GetMenuIndex(Menu *menu, int index); static void SetPosition(Menu *tp, int index); static int IsMenuValid(const Menu *menu); static MenuAction *menuAction = NULL; static unsigned int menuOpacity = UINT_MAX; int menuShown = 0; /** Initialize a menu. */ void InitializeMenu(Menu *menu) { MenuItem *np; int index, temp; int userHeight; int hasSubmenu; char hasIcon; menu->textOffset = 0; menu->itemCount = 0; /* Compute the max size needed */ hasIcon = 0; userHeight = menu->itemHeight; if(userHeight < 0) { userHeight = 0; } menu->itemHeight = GetStringHeight(FONT_MENU); for(np = menu->items; np; np = np->next) { if(np->iconName) { np->icon = LoadNamedIcon(np->iconName); if(np->icon) { if(userHeight == 0) { if(menu->itemHeight < (int)np->icon->image->height) { menu->itemHeight = np->icon->image->height; } if(menu->textOffset < (int)np->icon->image->width + 4) { menu->textOffset = np->icon->image->width + 4; } } hasIcon = 1; } } else { np->icon = NULL; } menu->itemCount += 1; } menu->itemHeight += BASE_ICON_OFFSET * 2; if(userHeight) { menu->itemHeight = userHeight + BASE_ICON_OFFSET * 2; menu->textOffset = menu->itemHeight + BASE_ICON_OFFSET * 2; } menu->width = 5; menu->parent = NULL; menu->parentOffset = 0; /* Make sure the menu is wide enough for a label if it is labeled. */ if(menu->label) { temp = GetStringWidth(FONT_MENU, menu->label); if(temp > menu->width) { menu->width = temp; } } menu->height = 1; if(menu->label) { menu->height += menu->itemHeight; } /* Nothing else to do if there is nothing in the menu. */ if(JUNLIKELY(menu->itemCount == 0)) { return; } menu->offsets = Allocate(sizeof(int) * menu->itemCount); hasSubmenu = 0; index = 0; for(np = menu->items; np; np = np->next) { menu->offsets[index++] = menu->height; if(np->type == MENU_ITEM_SEPARATOR) { menu->height += 5; } else { menu->height += menu->itemHeight; } if(np->name) { temp = GetStringWidth(FONT_MENU, np->name); if(temp > menu->width) { menu->width = temp; } } if(hasIcon && !np->icon) { np->icon = &emptyIcon; } if(np->submenu) { hasSubmenu = 7; InitializeMenu(np->submenu); } } menu->height += 2; menu->width += 12 + hasSubmenu + menu->textOffset; } /** Show a menu. */ void ShowMenu(Menu *menu, RunMenuCommandType runner, int x, int y) { int mouseStatus, keyboardStatus; /* Don't show the menu if there isn't anything to show. */ if(JUNLIKELY(!IsMenuValid(menu))) { return; } mouseStatus = GrabMouse(rootWindow); keyboardStatus = JXGrabKeyboard(display, rootWindow, False, GrabModeAsync, GrabModeAsync, CurrentTime); if(JUNLIKELY(!mouseStatus || keyboardStatus != GrabSuccess)) { return; } ShowSubmenu(menu, NULL, x, y); JXUngrabKeyboard(display, CurrentTime); JXUngrabPointer(display, CurrentTime); RefocusClient(); if(menuAction) { (runner)(menuAction); menuAction = NULL; } if(shouldReload) { ReloadMenu(); } } /** Destroy a menu. */ void DestroyMenu(Menu *menu) { MenuItem *np; if(menu) { while(menu->items) { np = menu->items->next; if(menu->items->name) { Release(menu->items->name); } switch(menu->items->action.type) { case MA_EXECUTE: case MA_EXIT: if(menu->items->action.data.str) { Release(menu->items->action.data.str); } break; default: break; } if(menu->items->iconName) { Release(menu->items->iconName); } if(menu->items->submenu) { DestroyMenu(menu->items->submenu); } Release(menu->items); menu->items = np; } if(menu->label) { Release(menu->label); } if(menu->offsets) { Release(menu->offsets); } Release(menu); menu = NULL; } } /** Show a submenu. */ int ShowSubmenu(Menu *menu, Menu *parent, int x, int y) { int status; menu->parent = parent; CreateMenu(menu, x, y); menuShown += 1; status = MenuLoop(menu); menuShown -= 1; HideMenu(menu); return status; } /** Menu process loop. * Returns 0 if no selection was made or 1 if a selection was made. */ int MenuLoop(Menu *menu) { XEvent event; MenuItem *ip; int count; int hadMotion; int pressx, pressy; hadMotion = 0; GetMousePosition(&pressx, &pressy); for(;;) { WaitForEvent(&event); switch(event.type) { case Expose: RedrawMenuTree(menu); break; case ButtonPress: pressx = -100; pressy = -100; case KeyPress: case MotionNotify: hadMotion = 1; switch(UpdateMotion(menu, &event)) { case MENU_NOSELECTION: /* no selection */ break; case MENU_LEAVE: /* mouse left the menu */ JXPutBackEvent(display, &event); return 0; case MENU_SUBSELECT: /* selection made */ return 1; } break; case ButtonRelease: if(event.xbutton.button == Button4) { break; } if(event.xbutton.button == Button5) { break; } if(!hadMotion) { break; } if(abs(event.xbutton.x_root - pressx) < doubleClickDelta) { if(abs(event.xbutton.y_root - pressy) < doubleClickDelta) { break; } } if(menu->currentIndex >= 0) { count = 0; for(ip = menu->items; ip; ip = ip->next) { if(count == menu->currentIndex) { menuAction = &ip->action; break; } ++count; } } return 1; default: break; } } } /** Create and map a menu. */ void CreateMenu(Menu *menu, int x, int y) { XSetWindowAttributes attr; unsigned long attrMask; int temp; menu->lastIndex = -1; menu->currentIndex = -1; if(x + menu->width > rootWidth) { if(menu->parent) { x = menu->parent->x - menu->width; } else { x = rootWidth - menu->width; } } temp = y; if(y + menu->height > rootHeight) { y = rootHeight - menu->height; } if(y < 0) { y = 0; } menu->x = x; menu->y = y; menu->parentOffset = temp - y; attrMask = 0; attrMask |= CWEventMask; attr.event_mask = ExposureMask; attrMask |= CWBackPixel; attr.background_pixel = colors[COLOR_MENU_BG]; attrMask |= CWSaveUnder; attr.save_under = True; menu->window = JXCreateWindow(display, rootWindow, x, y, menu->width, menu->height, 0, CopyFromParent, InputOutput, CopyFromParent, attrMask, &attr); if(menuOpacity < UINT_MAX) { SetCardinalAtom(menu->window, ATOM_NET_WM_WINDOW_OPACITY, menuOpacity); JXSync(display, False); } JXMapRaised(display, menu->window); } /** Hide a menu. */ void HideMenu(Menu *menu) { JXDestroyWindow(display, menu->window); } /** Redraw a menu and its submenus. */ void RedrawMenuTree(Menu *menu) { if(menu->parent) { RedrawMenuTree(menu->parent); } DrawMenu(menu); UpdateMenu(menu); } /** Draw a menu. */ void DrawMenu(Menu *menu) { MenuItem *np; int x; XSegment segments[4]; if(menu->label) { DrawMenuItem(menu, NULL, -1); } x = 0; for(np = menu->items; np; np = np->next) { DrawMenuItem(menu, np, x); ++x; } JXSetForeground(display, rootGC, colors[COLOR_MENU_UP]); segments[0].x1 = 0; segments[0].y1 = 0; segments[0].x2 = menu->width - 1; segments[0].y2 = 0; segments[1].x1 = 0; segments[1].y1 = 1; segments[1].x2 = menu->width - 2; segments[1].y2 = 1; segments[2].x1 = 0; segments[2].y1 = 2; segments[2].x2 = 0; segments[2].y2 = menu->height - 1; segments[3].x1 = 1; segments[3].y1 = 2; segments[3].x2 = 1; segments[3].y2 = menu->height - 2; JXDrawSegments(display, menu->window, rootGC, segments, 4); JXSetForeground(display, rootGC, colors[COLOR_MENU_DOWN]); segments[0].x1 = 1; segments[0].y1 = menu->height - 1; segments[0].x2 = menu->width - 1; segments[0].y2 = menu->height - 1; segments[1].x1 = 2; segments[1].y1 = menu->height - 2; segments[1].x2 = menu->width - 1; segments[1].y2 = menu->height - 2; segments[2].x1 = menu->width - 1; segments[2].y1 = 1; segments[2].x2 = menu->width - 1; segments[2].y2 = menu->height - 3; segments[3].x1 = menu->width - 2; segments[3].y1 = 2; segments[3].x2 = menu->width - 2; segments[3].y2 = menu->height - 3; JXDrawSegments(display, menu->window, rootGC, segments, 4); } /** Determine the action to take given an event. */ MenuSelectionType UpdateMotion(Menu *menu, XEvent *event) { MenuItem *ip; Menu *tp; Window subwindow; int x, y; if(event->type == MotionNotify) { SetMousePosition(event->xmotion.x_root, event->xmotion.y_root); DiscardMotionEvents(event, menu->window); x = event->xmotion.x_root - menu->x; y = event->xmotion.y_root - menu->y; subwindow = event->xmotion.subwindow; } else if(event->type == ButtonPress) { if(menu->currentIndex >= 0 || !menu->parent) { tp = menu; } else { tp = menu->parent; } y = -1; if(event->xbutton.button == Button4) { y = GetPreviousMenuIndex(tp); } else if(event->xbutton.button == Button5) { y = GetNextMenuIndex(tp); } if(y >= 0) { SetPosition(tp, y); } return MENU_NOSELECTION; } else if(event->type == KeyPress) { if(menu->currentIndex >= 0 || !menu->parent) { tp = menu; } else { tp = menu->parent; } y = -1; switch(GetKey(&event->xkey) & 0xFF) { case KEY_UP: y = GetPreviousMenuIndex(tp); break; case KEY_DOWN: y = GetNextMenuIndex(tp); break; case KEY_RIGHT: tp = menu; y = 0; break; case KEY_LEFT: if(tp->parent) { tp = tp->parent; if(tp->currentIndex >= 0) { y = tp->currentIndex; } else { y = 0; } } break; case KEY_ESC: return MENU_SUBSELECT; case KEY_ENTER: if(tp->currentIndex >= 0) { x = 0; for(ip = tp->items; ip; ip = ip->next) { if(x == tp->currentIndex) { menuAction = &ip->action; break; } ++x; } } return MENU_SUBSELECT; default: break; } if(y >= 0) { SetPosition(tp, y); } return MENU_NOSELECTION; } else { Debug("invalid event type in menu.c:UpdateMotion"); return MENU_SUBSELECT; } /* Update the selection on the current menu */ if(x > 0 && y > 0 && x < menu->width && y < menu->height) { menu->currentIndex = GetMenuIndex(menu, y); } else if(menu->parent && subwindow != menu->parent->window) { /* Leave if over a menu window. */ for(tp = menu->parent->parent; tp; tp = tp->parent) { if(tp->window == subwindow) { return MENU_LEAVE; } } menu->currentIndex = -1; } else { /* Leave if over the parent, but not on this selection. */ tp = menu->parent; if(tp && subwindow == tp->window) { if(y < menu->parentOffset || y > tp->itemHeight + menu->parentOffset) { return MENU_LEAVE; } } menu->currentIndex = -1; } /* Move the menu if needed. */ if(menu->height > rootHeight && menu->currentIndex >= 0) { /* If near the top, shift down. */ if(y + menu->y <= 0) { if(menu->currentIndex > 0) { --menu->currentIndex; SetPosition(menu, menu->currentIndex); } } /* If near the bottom, shift up. */ if(y + menu->y + menu->itemHeight / 2 >= rootHeight) { if(menu->currentIndex + 1 < menu->itemCount) { ++menu->currentIndex; SetPosition(menu, menu->currentIndex); } } } if(menu->lastIndex != menu->currentIndex) { UpdateMenu(menu); menu->lastIndex = menu->currentIndex; } /* If the selected item is a submenu, show it. */ ip = GetMenuItem(menu, menu->currentIndex); if(ip && IsMenuValid(ip->submenu)) { if(ShowSubmenu(ip->submenu, menu, menu->x + menu->width, menu->y + menu->offsets[menu->currentIndex])) { /* Item selected; destroy the menu tree. */ return MENU_SUBSELECT; } else { /* No selection made. */ UpdateMenu(menu); } } return MENU_NOSELECTION; } /** Update the menu selection. */ void UpdateMenu(Menu *menu) { ButtonNode button; Pixmap pixmap; MenuItem *ip; /* Clear the old selection. */ ip = GetMenuItem(menu, menu->lastIndex); DrawMenuItem(menu, ip, menu->lastIndex); /* Highlight the new selection. */ ip = GetMenuItem(menu, menu->currentIndex); if(ip) { if(ip->type == MENU_ITEM_SEPARATOR) { return; } ResetButton(&button, menu->window, rootGC); button.type = BUTTON_MENU_ACTIVE; button.font = FONT_MENU; button.width = menu->width - 5; button.height = menu->itemHeight - 2; button.icon = ip->icon; button.text = ip->name; button.x = 2; button.y = menu->offsets[menu->currentIndex] + 1; DrawButton(&button); if(ip->submenu) { pixmap = JXCreateBitmapFromData(display, menu->window, menu_bitmap, 4, 7); JXSetForeground(display, rootGC, colors[COLOR_MENU_ACTIVE_FG]); JXSetClipMask(display, rootGC, pixmap); JXSetClipOrigin(display, rootGC, menu->width - 9, menu->offsets[menu->currentIndex] + menu->itemHeight / 2 - 4); JXFillRectangle(display, menu->window, rootGC, menu->width - 9, menu->offsets[menu->currentIndex] + menu->itemHeight / 2 - 4, 4, 7); JXSetClipMask(display, rootGC, None); JXFreePixmap(display, pixmap); } } } /** Draw a menu item. */ void DrawMenuItem(Menu *menu, MenuItem *item, int index) { ButtonNode button; Pixmap pixmap; Assert(menu); if(!item) { if(index == -1 && menu->label) { ResetButton(&button, menu->window, rootGC); button.x = 2; button.y = 2; button.width = menu->width - 5; button.height = menu->itemHeight - 2; button.font = FONT_MENU; button.type = BUTTON_LABEL; button.text = menu->label; button.alignment = ALIGN_CENTER; DrawButton(&button); } return; } if(item->type != MENU_ITEM_SEPARATOR) { ResetButton(&button, menu->window, rootGC); button.x = 2; button.y = 1 + menu->offsets[index]; button.font = FONT_MENU; button.type = BUTTON_LABEL; button.width = menu->width - 5; button.height = menu->itemHeight - 2; button.text = item->name; button.icon = item->icon; DrawButton(&button); } else { JXSetForeground(display, rootGC, colors[COLOR_MENU_DOWN]); JXDrawLine(display, menu->window, rootGC, 4, menu->offsets[index] + 2, menu->width - 6, menu->offsets[index] + 2); JXSetForeground(display, rootGC, colors[COLOR_MENU_UP]); JXDrawLine(display, menu->window, rootGC, 4, menu->offsets[index] + 3, menu->width - 6, menu->offsets[index] + 3); } if(item->submenu) { pixmap = JXCreatePixmapFromBitmapData(display, menu->window, menu_bitmap, 4, 7, colors[COLOR_MENU_FG], colors[COLOR_MENU_BG], rootDepth); JXCopyArea(display, pixmap, menu->window, rootGC, 0, 0, 4, 7, menu->width - 9, menu->offsets[index] + menu->itemHeight / 2 - 4); JXFreePixmap(display, pixmap); } } /** Get the next item in the menu. */ int GetNextMenuIndex(Menu *menu) { MenuItem *item; int x; for(x = menu->currentIndex + 1; x < menu->itemCount; x++) { item = GetMenuItem(menu, x); if(item->type != MENU_ITEM_SEPARATOR) { return x; } } return 0; } /** Get the previous item in the menu. */ int GetPreviousMenuIndex(Menu *menu) { MenuItem *item; int x; for(x = menu->currentIndex - 1; x >= 0; x--) { item = GetMenuItem(menu, x); if(item->type != MENU_ITEM_SEPARATOR) { return x; } } return menu->itemCount - 1; } /** Get the item in the menu given a y-coordinate. */ int GetMenuIndex(Menu *menu, int y) { int x; if(y < menu->offsets[0]) { return -1; } for(x = 0; x < menu->itemCount - 1; x++) { if(y >= menu->offsets[x] && y < menu->offsets[x + 1]) { return x; } } return x; } /** Get the menu item associated with an index. */ MenuItem *GetMenuItem(Menu *menu, int index) { MenuItem *ip; if(index >= 0) { for(ip = menu->items; ip; ip = ip->next) { if(!index) { return ip; } --index; } } else { ip = NULL; } return ip; } /** Set the active menu item. */ void SetPosition(Menu *tp, int index) { int y; int updated; y = tp->offsets[index] + tp->itemHeight / 2; if(tp->height > rootHeight) { updated = 0; while(y + tp->y < tp->itemHeight / 2) { tp->y += tp->itemHeight; updated = tp->itemHeight; } while(y + tp->y >= rootHeight) { tp->y -= tp->itemHeight; updated = -tp->itemHeight; } if(updated) { JXMoveWindow(display, tp->window, tp->x, tp->y); y += updated; } } /* We need to do this twice so the event gets registered * on the submenu if one exists. */ MoveMouse(tp->window, 6, y); MoveMouse(tp->window, 6, y); } /** Determine if a menu is valid (and can be shown). */ int IsMenuValid(const Menu *menu) { MenuItem *ip; if(menu) { for(ip = menu->items; ip; ip = ip->next) { if(ip->type != MENU_ITEM_SEPARATOR) { return 1; } } } return 0; } /** Set the Menu transparency level. */ void SetMenuOpacity(const char *str) { double temp; Assert(str); temp = atof(str); if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { Warning(_("invalid menu opacity: %s"), str); temp = 1.0; } menuOpacity = (unsigned int)(temp * UINT_MAX); } jwm-2.1.0+svn579/src/dock.h0000644000000000000000000000276311710374021013740 0ustar rootroot/** * @file dock.h * @author Joe Wingbermuehle * @date 2006 * * @brief Dock tray component (used for system notifications). * */ #ifndef DOCK_H #define DOCK_H struct TrayComponentType; /*@{*/ void InitializeDock(); void StartupDock(); void ShutdownDock(); void DestroyDock(); /*@}*/ /** Create a dock to be used for notifications. * Note that only one dock can be created. * @param width The width of an item in the dock. */ struct TrayComponentType *CreateDock(int width); /** Handle a client message sent to the dock window. * @param event The event. */ void HandleDockEvent(const XClientMessageEvent *event); /** Handle a destroy event. * @param win The window that was destroyed. * @return 1 if handled, 0 otherwise. */ int HandleDockDestroy(Window win); /** Handle a selection clear event. * @param event The selection clear event. * @return 1 if handled, 0 otherwise. */ int HandleDockSelectionClear(const XSelectionClearEvent *event); /** Handle a resize request. * @param event The resize request event. * @return 1 if handled, 0 otherwise. */ int HandleDockResizeRequest(const XResizeRequestEvent *event); /** Handle a configure request. * @param event The configure request event. * @return 1 if handled, 0 otherwise. */ int HandleDockConfigureRequest(const XConfigureRequestEvent *event); /** Handle a reparent notify event. * @param event The reparent notify event. * @return 1 if handled, 0 otherwise. */ int HandleDockReparentNotify(const XReparentEvent *event); #endif jwm-2.1.0+svn579/src/place.h0000644000000000000000000000453211710374021014100 0ustar rootroot/** * @file place.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for client placement functions. * */ #ifndef PLACE_H #define PLACE_H struct ClientNode; struct ScreenType; struct TrayType; /** Bounding box. */ typedef struct BoundingBox { int x; /**< x-coordinate of the bounding box. */ int y; /**< y-coordinate of the bounding box. */ int width; /**< Width of the bounding box. */ int height; /**< Height of the bounding box. */ } BoundingBox; /*@{*/ void InitializePlacement(); void StartupPlacement(); void ShutdownPlacement(); void DestroyPlacement(); /*@}*/ /** Remove struts associated with a client. * @param np The client. */ void RemoveClientStrut(struct ClientNode *np); /** Read struts associated with a client. * @param np The client. */ void ReadClientStrut(struct ClientNode *np); /** Place a client on the screen. * @param np The client to place. * @param alreadyMapped 1 if already mapped, 0 if unmapped. */ void PlaceClient(struct ClientNode *np, int alreadyMapped); /** Place a maximized client on the screen. * @param np The client to place. * @param horiz Set if maximizing horizontally. * @param vert Set if maximizing vertically. */ void PlaceMaximizedClient(struct ClientNode *np, int horiz, int vert); /** Move a client window for a border. * @param np The client. * @param negate 0 to gravitate for a border, 1 to gravitate for no border. */ void GravitateClient(struct ClientNode *np, int negate); /** Get the x and y deltas for gravitating a client. * @param np The client. * @param x Location to store the x delta. * @param y Location to store the y delta. */ void GetGravityDelta(const struct ClientNode *np, int *x, int *y); /** Constrain the size of a client to available screen space. * @param np The client. */ void ConstrainSize(struct ClientNode *np); /** Get the bounding box for the screen. * @param sp A pointer to the screen whose bounds to get. * @param box The bounding box for the screen. */ void GetScreenBounds(const struct ScreenType *sp, BoundingBox *box); /** Subtract bounds for the configured trays. * @param tp The first tray to consider. * @param box The bounding box. * @param layer The maximum layer of the tray bounds. */ void SubtractTrayBounds(const struct TrayType *tp, BoundingBox *box, unsigned int layer); #endif /* PLACE_H */ jwm-2.1.0+svn579/src/move.c0000644000000000000000000004552411710374021013763 0ustar rootroot/** * @file move.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Client window move functions. * */ #include "jwm.h" #include "move.h" #include "border.h" #include "client.h" #include "clientlist.h" #include "cursor.h" #include "error.h" #include "event.h" #include "key.h" #include "main.h" #include "outline.h" #include "pager.h" #include "screen.h" #include "status.h" #include "tray.h" #include "desktop.h" typedef struct { int valid; int left, right; int top, bottom; } RectangleType; static char shouldStopMove; static SnapModeType snapMode = SNAP_BORDER; static int snapDistance = DEFAULT_SNAP_DISTANCE; static MoveModeType moveMode = MOVE_OPAQUE; static void StopMove(ClientNode *np, int doMove, int oldx, int oldy, int hmax, int vmax); static void MoveController(int wasDestroyed); static void DoSnap(ClientNode *np); static void DoSnapScreen(ClientNode *np); static void DoSnapBorder(ClientNode *np); static int ShouldSnap(const ClientNode *np); static void GetClientRectangle(const ClientNode *np, RectangleType *r); static int CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b); static int CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b); static int CheckLeftValid(const RectangleType *client, const RectangleType *other, const RectangleType *left); static int CheckRightValid(const RectangleType *client, const RectangleType *other, const RectangleType *right); static int CheckTopValid(const RectangleType *client, const RectangleType *other, const RectangleType *top); static int CheckBottomValid(const RectangleType *client, const RectangleType *other, const RectangleType *bottom); /** Set the snap mode to use. */ void SetSnapMode(SnapModeType mode) { snapMode = mode; } /** Set the move mode to use. */ void SetMoveMode(MoveModeType mode) { moveMode = mode; } /** Set the snap distance. */ void SetSnapDistance(const char *value) { int temp; Assert(value); temp = atoi(value); if(JUNLIKELY(temp > MAX_SNAP_DISTANCE || temp < MIN_SNAP_DISTANCE)) { snapDistance = DEFAULT_SNAP_DISTANCE; Warning(_("invalid snap distance specified: %d"), temp); } else { snapDistance = temp; } } /** Restore the default snap distance. */ void SetDefaultSnapDistance() { snapDistance = DEFAULT_SNAP_DISTANCE; } /** Callback for stopping moves. */ void MoveController(int wasDestroyed) { if(moveMode == MOVE_OUTLINE) { ClearOutline(); } JXUngrabPointer(display, CurrentTime); JXUngrabKeyboard(display, CurrentTime); DestroyMoveWindow(); shouldStopMove = 1; } /** Move a client window. */ int MoveClient(ClientNode *np, int startx, int starty, int snap) { XEvent event; int oldx, oldy; int doMove; int north, south, east, west; int height; int hmax, vmax; Assert(np); if(!(np->state.border & BORDER_MOVE)) { return 0; } GrabMouseForMove(); np->controller = MoveController; shouldStopMove = 0; oldx = np->x; oldy = np->y; vmax = 0; hmax = 0; if(!(GetMouseMask() & (Button1Mask | Button2Mask))) { StopMove(np, 0, oldx, oldy, 0, 0); return 0; } GetBorderSize(np, &north, &south, &east, &west); startx -= west; starty -= north; doMove = 0; for(;;) { WaitForEvent(&event); if(shouldStopMove) { np->controller = NULL; SetDefaultCursor(np->parent); return doMove; } switch(event.type) { case ButtonRelease: if(event.xbutton.button == Button1 || event.xbutton.button == Button2) { StopMove(np, doMove, oldx, oldy, hmax, vmax); return doMove; } break; case MotionNotify: DiscardMotionEvents(&event, np->window); np->x = event.xmotion.x_root - startx; np->y = event.xmotion.y_root - starty; if(event.xmotion.x_root == 0) { if(LeftDesktop()) { SetClientDesktop(np, currentDesktop); RestackClients(); np->x = rootWidth - 2 - startx; np->y = event.xmotion.y_root - starty; MoveMouse(rootWindow, np->x + startx, np->y + starty); DiscardMotionEvents(&event, np->window); } } else if(event.xmotion.x_root == rootWidth - 1) { if(RightDesktop()) { SetClientDesktop(np, currentDesktop); RestackClients(); np->x = 1 - startx; np->y = event.xmotion.y_root - starty; MoveMouse(rootWindow, np->x + startx, np->y + starty); DiscardMotionEvents(&event, np->window); } } else if(event.xmotion.y_root == 0) { if(AboveDesktop()) { SetClientDesktop(np, currentDesktop); RestackClients(); np->x = event.xmotion.x_root - startx; np->y = rootHeight - 2 - starty; MoveMouse(rootWindow, np->x + startx, np->y + starty); DiscardMotionEvents(&event, np->window); } } else if(event.xmotion.y_root == rootHeight - 1) { if(BelowDesktop()) { SetClientDesktop(np, currentDesktop); RestackClients(); np->x = event.xmotion.x_root - startx; np->y = 1 - starty; MoveMouse(rootWindow, np->x + startx, np->y + starty); DiscardMotionEvents(&event, np->window); } } if(snap) { DoSnap(np); } if(!doMove && (abs(np->x - oldx) > MOVE_DELTA || abs(np->y - oldy) > MOVE_DELTA)) { if(np->state.status & (STAT_HMAX | STAT_VMAX)) { if(np->state.status & STAT_HMAX) { hmax = 1; } if(np->state.status & STAT_VMAX) { vmax = 1; } MaximizeClient(np, 0, 0); startx = np->width / 2; starty = -north / 2; MoveMouse(np->parent, startx, starty); } CreateMoveWindow(np); doMove = 1; } if(doMove) { if(moveMode == MOVE_OUTLINE) { ClearOutline(); height = north + south; if(!(np->state.status & STAT_SHADED)) { height += np->height; } DrawOutline(np->x - west, np->y - north, np->width + west + east, height); } else { JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); } UpdateMoveWindow(np); UpdatePager(); } break; default: break; } } } /** Move a client window (keyboard or menu initiated). */ int MoveClientKeyboard(ClientNode *np) { XEvent event; int oldx, oldy; int moved; int height; int north, south, east, west; int hmax, vmax; Assert(np); if(!(np->state.border & BORDER_MOVE)) { return 0; } hmax = 0; if(np->state.status & STAT_HMAX) { hmax = 1; } vmax = 0; if(np->state.status & STAT_VMAX) { vmax = 1; } if(vmax || hmax) { MaximizeClient(np, 0, 0); } GrabMouseForMove(); if(JUNLIKELY(JXGrabKeyboard(display, np->window, True, GrabModeAsync, GrabModeAsync, CurrentTime) != GrabSuccess)) { Debug("could not grab keyboard for client move"); return 0; } GetBorderSize(np, &north, &south, &east, &west); oldx = np->x; oldy = np->y; np->controller = MoveController; shouldStopMove = 0; CreateMoveWindow(np); UpdateMoveWindow(np); MoveMouse(rootWindow, np->x, np->y); DiscardMotionEvents(&event, np->window); if(np->state.status & STAT_SHADED) { height = 0; } else { height = np->height; } for(;;) { WaitForEvent(&event); if(shouldStopMove) { np->controller = NULL; SetDefaultCursor(np->parent); return 1; } moved = 0; if(event.type == KeyPress) { while(JXCheckTypedWindowEvent(display, np->window, KeyPress, &event)); UpdateTime(&event); switch(GetKey(&event.xkey) & 0xFF) { case KEY_UP: if(np->y + height > 0) { np->y -= 10; } break; case KEY_DOWN: if(np->y < rootHeight) { np->y += 10; } break; case KEY_RIGHT: if(np->x < rootWidth) { np->x += 10; } break; case KEY_LEFT: if(np->x + np->width > 0) { np->x -= 10; } break; default: StopMove(np, 1, oldx, oldy, hmax, vmax); return 1; } MoveMouse(rootWindow, np->x, np->y); JXCheckTypedWindowEvent(display, np->window, MotionNotify, &event); UpdateTime(&event); moved = 1; } else if(event.type == MotionNotify) { while(JXCheckTypedWindowEvent(display, np->window, MotionNotify, &event)); UpdateTime(&event); np->x = event.xmotion.x; np->y = event.xmotion.y; moved = 1; } else if(event.type == ButtonRelease) { StopMove(np, 1, oldx, oldy, hmax, vmax); return 1; } if(moved) { if(moveMode == MOVE_OUTLINE) { ClearOutline(); DrawOutline(np->x - west, np->y - west, np->width + west + east, height + north + west); } else { JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); } UpdateMoveWindow(np); UpdatePager(); } } } /** Stop move. */ void StopMove(ClientNode *np, int doMove, int oldx, int oldy, int hmax, int vmax) { int north, south, east, west; Assert(np); Assert(np->controller); (np->controller)(0); np->controller = NULL; SetDefaultCursor(np->parent); if(!doMove) { np->x = oldx; np->y = oldy; /* Restore maximized status if only maximized in one direction. */ if((hmax || vmax) && !(hmax && vmax)) { MaximizeClient(np, hmax, vmax); } return; } GetBorderSize(np, &north, &south, &east, &west); JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); /* Restore maximized status. */ if((hmax || vmax) && !(hmax && vmax)) { MaximizeClient(np, hmax, vmax); } } /** Snap to the screen and/or neighboring windows. */ void DoSnap(ClientNode *np) { switch(snapMode) { case SNAP_BORDER: DoSnapBorder(np); DoSnapScreen(np); break; case SNAP_SCREEN: DoSnapScreen(np); break; default: break; } } /** Snap to the screen. */ void DoSnapScreen(ClientNode *np) { RectangleType client; int screen; const ScreenType *sp; int screenCount; int north, south, east, west; GetClientRectangle(np, &client); GetBorderSize(np, &north, &south, &east, &west); screenCount = GetScreenCount(); for(screen = 0; screen < screenCount; screen++) { sp = GetScreen(screen); if(abs(client.right - sp->width - sp->x) <= snapDistance) { np->x = sp->x + sp->width - west - np->width; } if(abs(client.left - sp->x) <= snapDistance) { np->x = sp->x + east; } if(abs(client.bottom - sp->height - sp->y) <= snapDistance) { np->y = sp->y + sp->height - south; if(!(np->state.status & STAT_SHADED)) { np->y -= np->height; } } if(abs(client.top - sp->y) <= snapDistance) { np->y = north + sp->y; } } } /** Snap to window borders. */ void DoSnapBorder(ClientNode *np) { const ClientNode *tp; const TrayType *tray; RectangleType client, other; RectangleType left = { 0 }; RectangleType right = { 0 }; RectangleType top = { 0 }; RectangleType bottom = { 0 }; int layer; int north, south, east, west; GetClientRectangle(np, &client); GetBorderSize(np, &north, &south, &east, &west); other.valid = 1; /* Work from the bottom of the window stack to the top. */ for(layer = 0; layer < LAYER_COUNT; layer++) { /* Check tray windows. */ for(tray = GetTrays(); tray; tray = tray->next) { if(tray->hidden) { continue; } other.left = tray->x; other.right = tray->x + tray->width; other.top = tray->y; other.bottom = tray->y + tray->height; left.valid = CheckLeftValid(&client, &other, &left); right.valid = CheckRightValid(&client, &other, &right); top.valid = CheckTopValid(&client, &other, &top); bottom.valid = CheckBottomValid(&client, &other, &bottom); if(CheckOverlapTopBottom(&client, &other)) { if(abs(client.left - other.right) <= snapDistance) { left = other; } if(abs(client.right - other.left) <= snapDistance) { right = other; } } if(CheckOverlapLeftRight(&client, &other)) { if(abs(client.top - other.bottom) <= snapDistance) { top = other; } if(abs(client.bottom - other.top) <= snapDistance) { bottom = other; } } } /* Check client windows. */ for(tp = nodeTail[layer]; tp; tp = tp->prev) { if(tp == np || !ShouldSnap(tp)) { continue; } GetClientRectangle(tp, &other); /* Check if this border invalidates any previous value. */ left.valid = CheckLeftValid(&client, &other, &left); right.valid = CheckRightValid(&client, &other, &right); top.valid = CheckTopValid(&client, &other, &top); bottom.valid = CheckBottomValid(&client, &other, &bottom); /* Compute the new snap values. */ if(CheckOverlapTopBottom(&client, &other)) { if(abs(client.left - other.right) <= snapDistance) { left = other; } if(abs(client.right - other.left) <= snapDistance) { right = other; } } if(CheckOverlapLeftRight(&client, &other)) { if(abs(client.top - other.bottom) <= snapDistance) { top = other; } if(abs(client.bottom - other.top) <= snapDistance) { bottom = other; } } } } if(right.valid) { np->x = right.left - np->width - west; } if(left.valid) { np->x = left.right + east; } if(bottom.valid) { np->y = bottom.top - south; if(!(np->state.status & STAT_SHADED)) { np->y -= np->height; } } if(top.valid) { np->y = top.bottom + north; } } /** Determine if we should snap to the specified client. */ int ShouldSnap(const ClientNode *np) { if(np->state.status & STAT_HIDDEN) { return 0; } else if(np->state.status & STAT_MINIMIZED) { return 0; } else { return 1; } } /** Get a rectangle to represent a client window. */ void GetClientRectangle(const ClientNode *np, RectangleType *r) { int north, south, east, west; GetBorderSize(np, &north, &south, &east, &west); r->left = np->x - west; r->right = np->x + np->width + east; r->top = np->y - north; if(np->state.status & STAT_SHADED) { r->bottom = np->y + south; } else { r->bottom = np->y + np->height + south; } r->valid = 1; } /** Check for top/bottom overlap. */ int CheckOverlapTopBottom(const RectangleType *a, const RectangleType *b) { if(a->top >= b->bottom) { return 0; } else if(a->bottom <= b->top) { return 0; } else { return 1; } } /** Check for left/right overlap. */ int CheckOverlapLeftRight(const RectangleType *a, const RectangleType *b) { if(a->left >= b->right) { return 0; } else if(a->right <= b->left) { return 0; } else { return 1; } } /** Check if the current left snap position is valid. * @param client The window being moved. * @param other A window higher in stacking order than * previously check windows. * @param left The top/bottom of the current left snap window. * @return 1 if the current left snap position is still valid, otherwise 0. */ int CheckLeftValid(const RectangleType *client, const RectangleType *other, const RectangleType *left) { if(!left->valid) { return 0; } if(left->right > other->right) { return 1; } /* If left and client go higher than other then still valid. */ if(left->top < other->top && client->top < other->top) { return 1; } /* If left and client go lower than other then still valid. */ if(left->bottom > other->bottom && client->bottom > other->bottom) { return 1; } if(other->left >= left->right) { return 1; } return 0; } /** Check if the current right snap position is valid. */ int CheckRightValid(const RectangleType *client, const RectangleType *other, const RectangleType *right) { if(!right->valid) { return 0; } if(right->left < other->left) { return 1; } /* If right and client go higher than other then still valid. */ if(right->top < other->top && client->top < other->top) { return 1; } /* If right and client go lower than other then still valid. */ if(right->bottom > other->bottom && client->bottom > other->bottom) { return 1; } if(other->right <= right->left) { return 1; } return 0; } /** Check if the current top snap position is valid. */ int CheckTopValid(const RectangleType *client, const RectangleType *other, const RectangleType *top) { if(!top->valid) { return 0; } if(top->bottom > other->bottom) { return 1; } /* If top and client are to the left of other then still valid. */ if(top->left < other->left && client->left < other->left) { return 1; } /* If top and client are to the right of other then still valid. */ if(top->right > other->right && client->right > other->right) { return 1; } if(other->top >= top->bottom) { return 1; } return 0; } /** Check if the current bottom snap position is valid. */ int CheckBottomValid(const RectangleType *client, const RectangleType *other, const RectangleType *bottom) { if(!bottom->valid) { return 0; } if(bottom->top < other->top) { return 1; } /* If bottom and client are to the left of other then still valid. */ if(bottom->left < other->left && client->left < other->left) { return 1; } /* If bottom and client are to the right of other then still valid. */ if(bottom->right > other->right && client->right > other->right) { return 1; } if(other->bottom <= bottom->top) { return 1; } return 0; } jwm-2.1.0+svn579/src/swallow.c0000644000000000000000000001431111710374021014473 0ustar rootroot/** * @file swallow.c * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Swallow tray component. * */ #include "jwm.h" #include "swallow.h" #include "main.h" #include "tray.h" #include "error.h" #include "command.h" #include "color.h" #include "client.h" #include "event.h" #include "misc.h" typedef struct SwallowNode { TrayComponentType *cp; char *name; char *command; int border; int userWidth; int userHeight; struct SwallowNode *next; } SwallowNode; static SwallowNode *swallowNodes; static void Destroy(TrayComponentType *cp); static void Resize(TrayComponentType *cp); /** Initialize swallow data. */ void InitializeSwallow() { swallowNodes = NULL; } /** Start swallow processing. */ void StartupSwallow() { SwallowNode *np; for(np = swallowNodes; np; np = np->next) { if(np->command) { RunCommand(np->command); } } } /** Stop swallow processing. */ void ShutdownSwallow() { } /** Destroy swallow data. */ void DestroySwallow() { SwallowNode *np; while(swallowNodes) { np = swallowNodes->next; Assert(swallowNodes->name); Release(swallowNodes->name); if(swallowNodes->command) { Release(swallowNodes->command); } Release(swallowNodes); swallowNodes = np; } } /** Create a swallowed application tray component. */ TrayComponentType *CreateSwallow(const char *name, const char *command, int width, int height) { TrayComponentType *cp; SwallowNode *np; if(JUNLIKELY(!name)) { Warning(_("cannot swallow a client with no name")); return NULL; } /* Make sure this name isn't already used. */ for(np = swallowNodes; np; np = np->next) { if(JUNLIKELY(!strcmp(np->name, name))) { Warning(_("cannot swallow the same client multiple times")); return NULL; } } np = Allocate(sizeof(SwallowNode)); np->name = CopyString(name); np->command = CopyString(command); np->next = swallowNodes; swallowNodes = np; cp = CreateTrayComponent(); np->cp = cp; cp->object = np; cp->Destroy = Destroy; cp->Resize = Resize; if(width) { cp->requestedWidth = width; np->userWidth = 1; } else { cp->requestedWidth = 1; np->userWidth = 0; } if(height) { cp->requestedHeight = height; np->userHeight = 1; } else { cp->requestedHeight = 1; np->userHeight = 0; } return cp; } /** Process an event on a swallowed window. */ int ProcessSwallowEvent(const XEvent *event) { SwallowNode *np; int width, height; for(np = swallowNodes; np; np = np->next) { if(event->xany.window == np->cp->window) { switch(event->type) { case DestroyNotify: np->cp->window = None; np->cp->requestedWidth = 1; np->cp->requestedHeight = 1; ResizeTray(np->cp->tray); break; case ResizeRequest: np->cp->requestedWidth = event->xresizerequest.width + np->border * 2; np->cp->requestedHeight = event->xresizerequest.height + np->border * 2; ResizeTray(np->cp->tray); break; case ConfigureNotify: /* I don't think this should be necessary, but somehow * resize requests slip by sometimes... */ width = event->xconfigure.width + np->border * 2; height = event->xconfigure.height + np->border * 2; if( width != np->cp->requestedWidth && height != np->cp->requestedHeight) { np->cp->requestedWidth = width; np->cp->requestedHeight = height; ResizeTray(np->cp->tray); } break; default: break; } return 1; } } return 0; } /** Handle a tray resize. */ void Resize(TrayComponentType *cp) { int width, height; SwallowNode *np = (SwallowNode*)cp->object; if(cp->window != None) { width = cp->width - np->border * 2; height = cp->height - np->border * 2; JXResizeWindow(display, cp->window, width, height); } } /** Destroy a swallow tray component. */ void Destroy(TrayComponentType *cp) { ClientProtocolType protocols; /* Destroy the window if there is one. */ if(cp->window) { JXReparentWindow(display, cp->window, rootWindow, 0, 0); JXRemoveFromSaveSet(display, cp->window); protocols = ReadWMProtocols(cp->window); if(protocols & PROT_DELETE) { SendClientMessage(cp->window, ATOM_WM_PROTOCOLS, ATOM_WM_DELETE_WINDOW); } else { JXKillClient(display, cp->window); } } } /** Determine if this is a window to be swallowed, if it is, swallow it. */ int CheckSwallowMap(const XMapEvent *event) { SwallowNode *np; XClassHint hint; XWindowAttributes attr; for(np = swallowNodes; np; np = np->next) { if(np->cp->window != None) { continue; } Assert(np->cp->tray->window != None); if(JXGetClassHint(display, event->window, &hint)) { if(!strcmp(hint.res_name, np->name)) { /* Swallow the window. */ JXSelectInput(display, event->window, StructureNotifyMask | ResizeRedirectMask); JXAddToSaveSet(display, event->window); JXSetWindowBorder(display, event->window, colors[COLOR_TRAY_BG]); JXReparentWindow(display, event->window, np->cp->tray->window, 0, 0); JXMapRaised(display, event->window); JXFree(hint.res_name); JXFree(hint.res_class); np->cp->window = event->window; /* Update the size. */ JXGetWindowAttributes(display, event->window, &attr); np->border = attr.border_width; if(!np->userWidth) { np->cp->requestedWidth = attr.width + 2 * np->border; } if(!np->userHeight) { np->cp->requestedHeight = attr.height + 2 * np->border; } ResizeTray(np->cp->tray); return 1; } else { JXFree(hint.res_name); JXFree(hint.res_class); } } } return 0; } jwm-2.1.0+svn579/src/group.h0000644000000000000000000000453111710374021014147 0ustar rootroot/** * @file group.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for handling window groups. * */ #ifndef GROUP_H #define GROUP_H struct ClientNode; struct GroupType; /** Enumeration of group options. */ typedef enum { OPTION_INVALID = 0, OPTION_STICKY = 1, /**< Start in the sticky state. */ OPTION_LAYER = 2, /**< Start on a specific layer. */ OPTION_DESKTOP = 3, /**< Start on a specific desktop. */ OPTION_ICON = 4, /**< Set the icon to use. */ OPTION_NOLIST = 5, /**< Don't display in the task list. */ OPTION_BORDER = 6, /**< Force a window border. */ OPTION_NOBORDER = 7, /**< Don't draw a window border. */ OPTION_TITLE = 8, /**< Force a window title bar. */ OPTION_NOTITLE = 9, /**< Don't draw a window title bar. */ OPTION_PIGNORE = 10, /**< Ignore program-specified location. */ OPTION_MAXIMIZED = 11, /**< Start maximized. */ OPTION_MINIMIZED = 12, /**< Start minimized. */ OPTION_SHADED = 13, /**< Start shaded. */ OPTION_OPACITY = 14, /**< Set the opacity. */ OPTION_MAX_H = 15, /**< Use horizontal maximization. */ OPTION_MAX_V = 16, /**< Use vertical maximization. */ OPTION_NOFOCUS = 17 /**< Don't focus on map. */ } OptionType; void InitializeGroups(); void StartupGroups(); void ShutdownGroups(); void DestroyGroups(); /** Create an empty group. * @return An empty group. */ struct GroupType *CreateGroup(); /** Add a window class to a group. * @param gp The group. * @param pattern A pattern to match with the window class. */ void AddGroupClass(struct GroupType *gp, const char *pattern); /** Add a window name to a group. * @param gp The group. * @param pattern A pattern to match with the window name. */ void AddGroupName(struct GroupType *gp, const char *pattern); /** Add a group option that doesn't take a value. * @param gp The group. * @param option The option. */ void AddGroupOption(struct GroupType *gp, OptionType option); /** Add a group option that takes a value. * @param gp The group. * @param option The option. * @param value The option value. */ void AddGroupOptionValue(struct GroupType *gp, OptionType option, const char *value); /** Apply any matching groups to a client. * @param np The client. */ void ApplyGroups(struct ClientNode *np); #endif /* GROUP_H */ jwm-2.1.0+svn579/src/move.h0000644000000000000000000000314211710374021013756 0ustar rootroot/** * @file move.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for client window move functions. * */ #ifndef MOVE_H #define MOVE_H struct ClientNode; /** Window snap modes. */ typedef enum { SNAP_NONE = 0, /**< Don't snap. */ SNAP_SCREEN = 1, /**< Snap to the edges of the screen. */ SNAP_BORDER = 2 /**< Snap to all borders. */ } SnapModeType; /** Window move modes. */ typedef enum { MOVE_OPAQUE, /**< Show window contents while moving. */ MOVE_OUTLINE /**< Show an outline while moving. */ } MoveModeType; /** Move a client window. * @param np The client to move. * @param startx The starting mouse x-coordinate (window relative). * @param starty The starting mouse y-coordinate (window relative). * @param snap 1 to do edge snapping, 0 otherwise. * @return 1 if the client moved, 0 otherwise. */ int MoveClient(struct ClientNode *np, int startx, int starty, int snap); /** Move a client window using the keyboard (mouse optional). * @param np The client to move. * @return 1 if the client moved, 0 otherwise. */ int MoveClientKeyboard(struct ClientNode *np); /** Set the snap mode to use. * @param mode The snap mode to use. */ void SetSnapMode(SnapModeType mode); /** Set the snap distance to use. * @param value A string representation of the distance to use. */ void SetSnapDistance(const char *value); /** Set the snap distance to the default. */ void SetDefaultSnapDistance(); /** Set the move mode to use. * @param mode The move mode to use. */ void SetMoveMode(MoveModeType mode); #endif /* MOVE_H */ jwm-2.1.0+svn579/src/desktop.c0000644000000000000000000001510711710374021014460 0ustar rootroot/** * @file desktop.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the desktop management functions. * */ #include "jwm.h" #include "desktop.h" #include "main.h" #include "client.h" #include "clientlist.h" #include "hint.h" #include "pager.h" #include "taskbar.h" #include "error.h" #include "menu.h" #include "misc.h" #include "background.h" char **desktopNames = NULL; int showingDesktop; /** Initialize desktop data. */ void InitializeDesktops() { } /** Startup desktop support. */ void StartupDesktops() { unsigned int x; if(desktopNames == NULL) { desktopNames = Allocate(desktopCount * sizeof(char*)); for(x = 0; x < desktopCount; x++) { desktopNames[x] = NULL; } } for(x = 0; x < desktopCount; x++) { if(desktopNames[x] == NULL) { desktopNames[x] = Allocate(4 * sizeof(char)); snprintf(desktopNames[x], 4, "%d", x + 1); } } showingDesktop = 0; } /** Shutdown desktop support. */ void ShutdownDesktops() { } /** Release desktop data. */ void DestroyDesktops() { unsigned int x; if(desktopNames) { for(x = 0; x < desktopCount; x++) { Release(desktopNames[x]); } Release(desktopNames); desktopNames = NULL; } } /** Change to the desktop to the right. */ int RightDesktop() { int x, y; if(desktopWidth > 1) { y = currentDesktop / desktopWidth; x = (currentDesktop + 1) % desktopWidth; ChangeDesktop(y * desktopWidth + x); return 1; } else { return 0; } } /** Change to the desktop to the left. */ int LeftDesktop() { int x, y; if(desktopWidth > 1) { y = currentDesktop / desktopWidth; x = currentDesktop % desktopWidth; x = x > 0 ? x - 1 : desktopWidth - 1; ChangeDesktop(y * desktopWidth + x); return 1; } else { return 0; } } /** Change to the desktop above. */ int AboveDesktop() { if(desktopHeight > 1) { if(currentDesktop >= desktopWidth) { ChangeDesktop(currentDesktop - desktopWidth); } else { ChangeDesktop(currentDesktop + (desktopHeight - 1) * desktopWidth); } return 1; } else { return 0; } } /** Change to the desktop below. */ int BelowDesktop() { if(desktopHeight > 1) { ChangeDesktop((currentDesktop + desktopWidth) % desktopCount); return 1; } else { return 0; } } /** Change to the specified desktop. */ void ChangeDesktop(unsigned int desktop) { ClientNode *np; unsigned int x; if(JUNLIKELY(desktop >= desktopCount)) { return; } if(currentDesktop == desktop && !initializing) { return; } /* Hide clients from the old desktop. * Note that we show clients in a separate loop to prevent an issue * with clients losing focus. */ for(x = 0; x < LAYER_COUNT; x++) { for(np = nodes[x]; np; np = np->next) { if(np->state.status & STAT_STICKY) { continue; } if(np->state.desktop == currentDesktop) { HideClient(np); } } } /* Show clients on the new desktop. */ for(x = 0; x < LAYER_COUNT; x++) { for(np = nodes[x]; np; np = np->next) { if(np->state.status & STAT_STICKY) { continue; } if(np->state.desktop == desktop) { ShowClient(np); } } } currentDesktop = desktop; SetCardinalAtom(rootWindow, ATOM_NET_CURRENT_DESKTOP, currentDesktop); RestackClients(); UpdatePager(); UpdateTaskBar(); LoadBackground(desktop); } /** Create a desktop menu. */ Menu *CreateDesktopMenu(unsigned int mask) { Menu *menu; MenuItem *item; int x; menu = Allocate(sizeof(Menu)); menu->itemHeight = 0; menu->items = NULL; menu->label = NULL; for(x = desktopCount - 1; x >= 0; x--) { item = Allocate(sizeof(MenuItem)); item->type = MENU_ITEM_NORMAL; item->iconName = NULL; item->submenu = NULL; item->next = menu->items; menu->items = item; item->action.type = MA_DESKTOP; item->action.data.i = x; item->name = Allocate(strlen(desktopNames[x]) + 3); if(mask & (1 << x)) { strcpy(item->name, "["); strcat(item->name, desktopNames[x]); strcat(item->name, "]"); } else { strcpy(item->name, " "); strcat(item->name, desktopNames[x]); strcat(item->name, " "); } } return menu; } /** Toggle the "show desktop" state. */ void ShowDesktop() { ClientNode *np; int layer; for(layer = 0; layer < LAYER_COUNT; layer++) { for(np = nodes[layer]; np; np = np->next) { /* Skip "nolist" items. */ if(np->state.status & STAT_NOLIST) { continue; } if(showingDesktop) { if(np->state.status & STAT_SDESKTOP) { RestoreClient(np, 0); } } else if(np->state.desktop == currentDesktop || (np->state.status & STAT_STICKY)) { if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { MinimizeClient(np); np->state.status |= STAT_SDESKTOP; } } } } showingDesktop = !showingDesktop; SetCardinalAtom(rootWindow, ATOM_NET_SHOWING_DESKTOP, showingDesktop); RestackClients(); } /** Set the number of desktops to use. */ void SetDesktopCount(const char *width, const char *height) { if(width) { desktopWidth = atoi(width); } else { desktopWidth = DEFAULT_DESKTOP_WIDTH; } if(height) { desktopHeight = atoi(height); } else { desktopHeight = DEFAULT_DESKTOP_HEIGHT; } desktopCount = desktopWidth * desktopHeight; if(JUNLIKELY(desktopCount == 0)) { Warning(_("invalid desktop count")); desktopWidth = DEFAULT_DESKTOP_WIDTH; desktopHeight = DEFAULT_DESKTOP_HEIGHT; desktopCount = desktopWidth * desktopHeight; } } /** Set the name for a desktop. */ void SetDesktopName(unsigned int desktop, const char *str) { unsigned int x; if(JUNLIKELY(!str)) { Warning(_("empty Desktops Name tag")); return; } Assert(desktop >= 0); Assert(desktop < desktopCount); if(!desktopNames) { desktopNames = Allocate(desktopCount * sizeof(char*)); for(x = 0; x < desktopCount; x++) { desktopNames[x] = NULL; } } Assert(desktopNames[desktop] == NULL); desktopNames[desktop] = CopyString(str); } /** Get the name of a desktop. */ const char *GetDesktopName(unsigned int desktop) { if(desktopNames && desktopNames[desktop]) { return desktopNames[desktop]; } else { return ""; } } jwm-2.1.0+svn579/src/debug.h0000644000000000000000000000536511710374021014107 0ustar rootroot/** * @file debug.h * @author Joe Wingbermuehle * @date 2003-2006 * * @brief Header for the debug functions. * */ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef DEBUG_H #define DEBUG_H #ifndef MAKE_DEPEND # include # include # include # include # ifdef HAVE_ALLOCA_H # include # endif #endif /* MAKE_DEPEND */ void Debug(const char *str, ...); #ifdef HAVE_ALLOCA_H # define AllocateStack( x ) alloca( x ) # define ReleaseStack( x ) ((void)0) #else # define AllocateStack( x ) Allocate( x ) # define ReleaseStack( x ) Release( x ) #endif #ifdef DEBUG # define Assert( x ) \ if(!( x )) { \ Debug("ASSERT FAILED: %s[%u]", __FILE__, __LINE__ ); \ abort(); \ } # define SetCheckpoint() \ DEBUG_SetCheckpoint( __FILE__, __LINE__ ) # define ShowCheckpoint() \ DEBUG_ShowCheckpoint() # define StartDebug() \ DEBUG_StartDebug( __FILE__, __LINE__ ) # define StopDebug() \ DEBUG_StopDebug( __FILE__, __LINE__ ) # define Allocate( x ) \ DEBUG_Allocate( (x), __FILE__, __LINE__ ) # define Reallocate( x, y ) \ DEBUG_Reallocate( (x), (y), __FILE__, __LINE__ ) # define Release( x ) \ DEBUG_Release( (void*)(& x), __FILE__, __LINE__ ) void DEBUG_SetCheckpoint(const char*, unsigned int); void DEBUG_ShowCheckpoint(); void DEBUG_StartDebug(const char*, unsigned int); void DEBUG_StopDebug(const char*, unsigned int); void *DEBUG_Allocate(size_t, const char*, unsigned int); void *DEBUG_Reallocate(void*, size_t, const char*, unsigned int); void DEBUG_Release(void**, const char*, unsigned int); #else /* DEBUG */ # define Assert( x ) ((void)0) # define SetCheckpoint() ((void)0) # define ShowCheckpoint() ((void)0) # define StartDebug() ((void)0) # define StopDebug() ((void)0) # define Allocate( x ) malloc( (x) ) # define Reallocate( x, y ) realloc( (x), (y) ) # define Release( x ) free( (x) ) #endif /* DEBUG */ #endif /* DEBUG_H */ jwm-2.1.0+svn579/src/lex.c0000644000000000000000000003065511710374021013604 0ustar rootroot/** * @file lex.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief XML lexer functions. * */ #include "jwm.h" #include "lex.h" #include "error.h" #include "misc.h" /** Amount to increase allocations by when reading text. */ static const int BLOCK_SIZE = 16; /** Literal names for tokens. * This order is important. It must match the order of the enumeration * in lex.h. */ static const char *TOKEN_MAP[] = { "[invalid]", "Active", "ActiveBackground", "ActiveForeground", "Background", "Border", "ButtonClose", "ButtonMax", "ButtonMaxActive", "ButtonMin", "Class", "Clock", "ClockStyle", "Close", "Desktops", "Desktop", "Dock", "DoubleClickSpeed", "DoubleClickDelta", "Exit", "FocusModel", "Font", "Foreground", "Group", "Height", "IconPath", "Inactive", "Include", "JWM", "Key", "Kill", "Layer", "Maximize", "Menu", "MenuStyle", "Minimize", "Move", "MoveMode", "Name", "Opacity", "Option", "Outline", "Pager", "PagerStyle", "Popup", "PopupStyle", "Program", "Resize", "ResizeMode", "Restart", "RestartCommand", "RootMenu", "SendTo", "Separator", "Shade", "ShutdownCommand", "SnapMode", "Spacer", "StartupCommand", "Stick", "Swallow", "TaskListStyle", "TaskList", "Text", "Title", "Tray", "TrayButton", "TrayButtonStyle", "TrayStyle", "Width", "WindowStyle" }; static TokenNode *head, *current; static TokenNode *CreateNode(TokenNode *parent, const char *file, int line); static AttributeNode *CreateAttribute(TokenNode *np); static int IsElementEnd(char ch); static int IsValueEnd(char ch); static int IsAttributeEnd(char ch); static int IsSpace(char ch, int *lineNumber); static char *ReadElementName(const char *line); static char *ReadElementValue(const char *line, const char *file, int *lineNumber); static char *ReadAttributeValue(const char *line, const char *file, int *lineNumber); static int ParseEntity(const char *entity, char *ch, const char *file, int line); static TokenType LookupType(const char *name, TokenNode *np); /** Tokenize a data. */ TokenNode *Tokenize(const char *line, const char *fileName) { TokenNode *np; AttributeNode *ap; char *temp; int inElement; int x; int found; int lineNumber; head = NULL; current = NULL; inElement = 0; lineNumber = 1; x = 0; /* Skip any initial white space */ while(IsSpace(line[x], &lineNumber)) ++x; /* Skip any XML stuff */ if(!strncmp(line + x, "", 2)) { x += 2; break; } ++x; } } while(line[x]) { do { while(IsSpace(line[x], &lineNumber)) ++x; /* Skip comments */ found = 0; if(!strncmp(line + x, "", 3)) { x += 3; found = 1; break; } ++x; } } } while(found); switch(line[x]) { case '<': ++x; if(line[x] == '/') { ++x; temp = ReadElementName(line + x); if(current) { if(JLIKELY(temp)) { if(JUNLIKELY(current->type != LookupType(temp, NULL))) { Warning(_("%s[%d]: close tag \"%s\" does not " "match open tag \"%s\""), fileName, lineNumber, temp, GetTokenName(current)); } } else { Warning(_("%s[%d]: unexpected and invalid close tag"), fileName, lineNumber); } current = current->parent; } else { if(temp) { Warning(_("%s[%d]: close tag \"%s\" without open tag"), fileName, lineNumber, temp); } else { Warning(_("%s[%d]: invalid close tag"), fileName, lineNumber); } } if(temp) { x += strlen(temp); Release(temp); } } else { np = current; current = NULL; np = CreateNode(np, fileName, lineNumber); temp = ReadElementName(line + x); if(JLIKELY(temp)) { x += strlen(temp); LookupType(temp, np); Release(temp); } else { Warning(_("%s[%d]: invalid open tag"), fileName, lineNumber); } } inElement = 1; break; case '/': if(inElement) { ++x; if(JLIKELY(line[x] == '>' && current)) { ++x; current = current->parent; inElement = 0; } else { Warning(_("%s[%d]: invalid tag"), fileName, lineNumber); } } else { goto ReadDefault; } break; case '>': ++x; inElement = 0; break; default: ReadDefault: if(inElement) { ap = CreateAttribute(current); ap->name = ReadElementName(line + x); if(ap->name) { x += strlen(ap->name); if(line[x] == '=') { ++x; } if(line[x] == '\"') { ++x; } ap->value = ReadAttributeValue(line + x, fileName, &lineNumber); if(ap->value) { x += strlen(ap->value); } if(line[x] == '\"') { ++x; } } } else { temp = ReadElementValue(line + x, fileName, &lineNumber); if(temp) { x += strlen(temp); if(current) { if(current->value) { current->value = Reallocate(current->value, strlen(current->value) + strlen(temp) + 1); strcat(current->value, temp); Release(temp); } else { current->value = temp; } } else { if(JUNLIKELY(temp[0])) { Warning(_("%s[%d]: unexpected text: \"%s\""), fileName, lineNumber, temp); } Release(temp); } } } break; } } return head; } /** Parse an entity reference. * The entity value is returned in ch and the length of the entity * is returned as the value of the function. */ int ParseEntity(const char *entity, char *ch, const char *file, int line) { char *temp; int x; if(!strncmp(""", entity, 6)) { *ch = '\"'; return 6; } else if(!strncmp("<", entity, 4)) { *ch = '<'; return 4; } else if(!strncmp(">", entity, 4)) { *ch = '>'; return 4; } else if(!strncmp("&", entity, 5)) { *ch = '&'; return 5; } else if(!strncmp("'", entity, 6)) { *ch = '\''; return 6; } else { for(x = 0; entity[x]; x++) { if(entity[x] == ';') { break; } } temp = AllocateStack(x + 2); strncpy(temp, entity, x + 1); temp[x + 1] = 0; Warning(_("%s[%d]: invalid entity: \"%.8s\""), file, line, temp); ReleaseStack(temp); *ch = '&'; return 1; } } /** Determine if ch is the end of a tag/attribute name. */ int IsElementEnd(char ch) { switch(ch) { case ' ': case '\t': case '\n': case '\r': case '\"': case '>': case '<': case '/': case '=': case 0: return 1; default: return 0; } } /** Determine if ch is the end of an attribute value. */ int IsAttributeEnd(char ch) { switch(ch) { case 0: case '\"': return 1; default: return 0; } } /** Determine if ch is the end of tag data. */ int IsValueEnd(char ch) { switch(ch) { case 0: case '<': return 1; default: return 0; } } /** Determine if ch is a space character. */ int IsSpace(char ch, int *lineNumber) { switch(ch) { case ' ': case '\t': case '\r': return 1; case '\n': ++*lineNumber; return 1; default: return 0; } } /** Get the name of the next element. */ char *ReadElementName(const char *line) { char *buffer; int len; /* Get the length of the element. */ for (len = 0; !IsElementEnd(line[len]); len++); /* Allocate space for the element. */ buffer = Allocate(len + 1); memcpy(buffer, line, len); buffer[len] = 0; return buffer; } /** Get the value of the current element. */ char *ReadElementValue(const char *line, const char *file, int *lineNumber) { char *buffer; char ch; int len, max; int x; len = 0; max = BLOCK_SIZE; buffer = Allocate(max + 1); for(x = 0; !IsValueEnd(line[x]); x++) { if(line[x] == '&') { x += ParseEntity(line + x, &ch, file, *lineNumber) - 1; if(ch) { buffer[len] = ch; } else { buffer[len] = line[x]; } } else { if(line[x] == '\n') { ++*lineNumber; } buffer[len] = line[x]; } ++len; if(len >= max) { max += BLOCK_SIZE; buffer = Reallocate(buffer, max + 1); } } buffer[len] = 0; Trim(buffer); return buffer; } /** Get the value of the current attribute. */ char *ReadAttributeValue(const char *line, const char *file, int *lineNumber) { char *buffer; char ch; int len, max; int x; len = 0; max = BLOCK_SIZE; buffer = Allocate(max + 1); for(x = 0; !IsAttributeEnd(line[x]); x++) { if(line[x] == '&') { x += ParseEntity(line + x, &ch, file, *lineNumber) - 1; if(ch) { buffer[len] = ch; } else { buffer[len] = line[x]; } } else { if(line[x] == '\n') { ++*lineNumber; } buffer[len] = line[x]; } ++len; if(len >= max) { max += BLOCK_SIZE; buffer = Reallocate(buffer, max + 1); } } buffer[len] = 0; return buffer; } /** Get the token for a tag name. */ TokenType LookupType(const char *name, TokenNode *np) { unsigned int x; Assert(name); for(x = 0; x < sizeof(TOKEN_MAP) / sizeof(char*); x++) { if(!strcmp(name, TOKEN_MAP[x])) { if(np) { np->type = x; } return x; } } if(JUNLIKELY(np)) { np->type = TOK_INVALID; np->invalidName = CopyString(name); } return TOK_INVALID; } /** Get a string representation of a token. */ const char *GetTokenName(const TokenNode *tp) { if(tp->invalidName) { return tp->invalidName; } else if(tp->type >= sizeof(TOKEN_MAP) / sizeof(const char*)) { return "[invalid]"; } else { return TOKEN_MAP[tp->type]; } } /** Get the string representation of a token. */ const char *GetTokenTypeName(TokenType type) { return TOKEN_MAP[type]; } /** Create an empty XML tag node. */ TokenNode *CreateNode(TokenNode *parent, const char *file, int line) { TokenNode *np; np = Allocate(sizeof(TokenNode)); np->type = TOK_INVALID; np->value = NULL; np->attributes = NULL; np->subnodeHead = NULL; np->subnodeTail = NULL; np->parent = parent; np->next = NULL; np->fileName = Allocate(strlen(file) + 1); strcpy(np->fileName, file); np->line = line; np->invalidName = NULL; if(!head) { head = np; } if(parent) { if(parent->subnodeHead) { parent->subnodeTail->next = np; } else { parent->subnodeHead = np; } parent->subnodeTail = np; } else if(current) { current->next = np; } current = np; return np; } /** Create an empty XML attribute node. */ AttributeNode *CreateAttribute(TokenNode *np) { AttributeNode *ap; ap = Allocate(sizeof(AttributeNode)); ap->name = NULL; ap->value = NULL; ap->next = np->attributes; np->attributes = ap; return ap; } jwm-2.1.0+svn579/src/command.c0000644000000000000000000000610011710374021014416 0ustar rootroot/** * @file command.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Handle running startup, shutdown, and restart commands. * */ #include "jwm.h" #include "command.h" #include "misc.h" #include "main.h" #include "error.h" /** Structure to represent a list of commands. */ typedef struct CommandNode { char *command; /**< The command. */ struct CommandNode *next; /**< The next command in the list. */ } CommandNode; static CommandNode *startupCommands; static CommandNode *shutdownCommands; static CommandNode *restartCommands; static void RunCommands(CommandNode *commands); static void ReleaseCommands(CommandNode **commands); static void AddCommand(CommandNode **commands, const char *command); /** Initialize the command lists. */ void InitializeCommands() { startupCommands = NULL; shutdownCommands = NULL; restartCommands = NULL; } /** Process startup/restart commands. */ void StartupCommands() { if(isRestarting) { RunCommands(restartCommands); } else { RunCommands(startupCommands); } } /** Process shutdown commands. */ void ShutdownCommands() { if(!shouldRestart) { RunCommands(shutdownCommands); } } /** Destroy the command lists. */ void DestroyCommands() { ReleaseCommands(&startupCommands); ReleaseCommands(&shutdownCommands); ReleaseCommands(&restartCommands); } /** Run the commands in a command list. */ void RunCommands(CommandNode *commands) { CommandNode *cp; for(cp = commands; cp; cp = cp->next) { RunCommand(cp->command); } } /** Release a command list. */ void ReleaseCommands(CommandNode **commands) { CommandNode *cp; Assert(commands); while(*commands) { cp = (*commands)->next; Release((*commands)->command); Release(*commands); *commands = cp; } } /** Add a command to a command list. */ void AddCommand(CommandNode **commands, const char *command) { CommandNode *cp; Assert(commands); if(!command) { return; } cp = Allocate(sizeof(CommandNode)); cp->next = *commands; *commands = cp; cp->command = CopyString(command); } /** Add a startup command. */ void AddStartupCommand(const char *command) { AddCommand(&startupCommands, command); } /** Add a shutdown command. */ void AddShutdownCommand(const char *command) { AddCommand(&shutdownCommands, command); } /** Add a restart command. */ void AddRestartCommand(const char *command) { AddCommand(&restartCommands, command); } /** Execute an external program. */ void RunCommand(const char *command) { const char *displayString; char *str; if(JUNLIKELY(!command)) { return; } displayString = DisplayString(display); if(!fork()) { close(ConnectionNumber(display)); if(displayString && displayString[0]) { str = malloc(strlen(displayString) + 9); sprintf(str, "DISPLAY=%s", displayString); putenv(str); } setsid(); execl(SHELL_NAME, SHELL_NAME, "-c", command, NULL); Warning(_("exec failed: (%s) %s"), SHELL_NAME, command); exit(EXIT_SUCCESS); } } jwm-2.1.0+svn579/src/outline.h0000644000000000000000000000111311710374021014463 0ustar rootroot/** * @file outline.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Outlines for moving and resizing client windows. * */ #ifndef OUTLINE_H #define OUTLINE_H /*@{*/ void InitializeOutline(); void StartupOutline(); void ShutdownOutline(); void DestroyOutline(); /*@}*/ /** Draw an outline. * @param x The x-coordinate. * @param y The y-coordinate. * @param width The width of the outline. * @param height The height of the outline. */ void DrawOutline(int x, int y, int width, int height); /** Clear an outline. */ void ClearOutline(); #endif /* OUTLINE_H */ jwm-2.1.0+svn579/src/screen.h0000644000000000000000000000240311710374021014266 0ustar rootroot/** * @file screen.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Header for screen functions. * * Note that screen here refers to physical monitors. Screens are * determined using the xinerama extension (if available). There will * always be at least one screen. * */ #ifndef SCREEN_H #define SCREEN_H /** Structure to contain information about a screen. */ typedef struct ScreenType { int index; /**< The index of this screen. */ int x, y; /**< The location of this screen. */ int width, height; /**< The size of this screen. */ } ScreenType; void InitializeScreens(); void StartupScreens(); void ShutdownScreens(); void DestroyScreens(); /** Get the screen of the specified coordinates. * @param x The x-coordinate. * @param y The y-coordinate. * @return The screen. */ const ScreenType *GetCurrentScreen(int x, int y); /** Get the screen containing the mouse. * @return The screen containing the mouse. */ const ScreenType *GetMouseScreen(); /** Get the screen of the specified index. * @param index The screen index (0 based). * @return The screen. */ const ScreenType *GetScreen(int index); /** Get the number of screens. * @return The number of screens. */ int GetScreenCount(); #endif /* SCREEN_H */ jwm-2.1.0+svn579/src/client.h0000644000000000000000000002356111710374021014275 0ustar rootroot/** * @file client.h * @author Joe Wingbermuehle * @date 2004-2007 * * @brief Header file client window functions. * */ #ifndef CLIENT_H #define CLIENT_H #include "border.h" #include "hint.h" /** Window border flags. */ typedef enum { BORDER_NONE = 0, BORDER_OUTLINE = 1 << 0, /**< Window has a border. */ BORDER_TITLE = 1 << 1, /**< Window has a title bar. */ BORDER_MIN = 1 << 2, /**< Window supports minimize. */ BORDER_MAX = 1 << 3, /**< Window supports maximize. */ BORDER_CLOSE = 1 << 4, /**< Window supports close. */ BORDER_RESIZE = 1 << 5, /**< Window supports resizing. */ BORDER_MOVE = 1 << 6, /**< Window supports moving. */ BORDER_MAX_V = 1 << 7, /**< Maximize vertically. */ BORDER_MAX_H = 1 << 8 /**< Maximize horizontally. */ } BorderFlags; /** The default border flags. */ #define BORDER_DEFAULT ( \ BORDER_OUTLINE \ | BORDER_TITLE \ | BORDER_MIN \ | BORDER_MAX \ | BORDER_CLOSE \ | BORDER_RESIZE \ | BORDER_MOVE \ | BORDER_MAX_V \ | BORDER_MAX_H ) /** Window status flags. */ typedef enum { STAT_NONE = 0, STAT_ACTIVE = 1 << 0, /**< This client has focus. */ STAT_MAPPED = 1 << 1, /**< This client is shown (on some desktop). */ STAT_HMAX = 1 << 2, /**< This client is maximized horizonatally. */ STAT_VMAX = 1 << 3, /**< This client is maximized vertically. */ STAT_HIDDEN = 1 << 4, /**< This client is not on the current desktop. */ STAT_STICKY = 1 << 5, /**< This client is on all desktops. */ STAT_NOLIST = 1 << 6, /**< Skip this client in the task list. */ STAT_MINIMIZED = 1 << 7, /**< This client is minimized. */ STAT_SHADED = 1 << 8, /**< This client is shaded. */ STAT_WMDIALOG = 1 << 9, /**< This is a JWM dialog window. */ STAT_PIGNORE = 1 << 10, /**< Ignore the program-specified position. */ STAT_SHAPE = 1 << 11, /**< This client uses the shape extension. */ STAT_SDESKTOP = 1 << 12, /**< This client was minimized to show desktop. */ STAT_FULLSCREEN = 1 << 13, /**< This client wants to be full screen. */ STAT_OPACITY = 1 << 14, /**< This client has a fixed opacity. */ STAT_NOFOCUS = 1 << 15 /**< Don't focus on map. */ } StatusFlags; /** Colormap window linked list. */ typedef struct ColormapNode { Window window; /**< A window containing a colormap. */ struct ColormapNode *next; /**< Next value in the linked list. */ } ColormapNode; /** The aspect ratio of a window. */ typedef struct AspectRatio { int minx; /**< The x component of the minimum aspect ratio. */ int miny; /**< The y component of the minimum aspect ratio. */ int maxx; /**< The x component of the maximum aspect ratio. */ int maxy; /**< The y component of the maximum aspect ratio. */ } AspectRatio; /** Struture to store information about a client window. */ typedef struct ClientNode { Window window; /**< The client window. */ Window parent; /**< The frame window. */ Window owner; /**< The owner window (for transients). */ int x, y; /**< The location of the window. */ int width; /**< The width of the window. */ int height; /**< The height of the window. */ int oldx; /**< The old x coordinate (for maximize). */ int oldy; /**< The old y coordinate (for maximize). */ int oldWidth; /**< The old width (for maximize). */ int oldHeight; /**< The old height (for maximize). */ long sizeFlags; /**< Size flags from XGetWMNormalHints. */ int baseWidth; /**< Base width for resizing. */ int baseHeight; /**< Base height for resizing. */ int minWidth; /**< Minimum width of this window. */ int minHeight; /**< Minimum height of this window. */ int maxWidth; /**< Maximum width of this window. */ int maxHeight; /**< Maximum height of this window. */ int xinc; /**< Resize x increment. */ int yinc; /**< Resize y increment. */ AspectRatio aspect; /**< Aspect ratio. */ int gravity; /**< Gravity for reparenting. */ Colormap cmap; /**< This window's colormap. */ ColormapNode *colormaps; /**< Colormaps assigned to this window. */ char *name; /**< Name of this window for display. */ char *instanceName; /**< Name of this window for properties. */ char *className; /**< Name of the window class. */ ClientState state; /**< Window state. */ BorderActionType borderAction; struct IconNode *icon; /**< Icon assigned to this window. */ /** Callback to stop move/resize. */ void (*controller)(int wasDestroyed); struct ClientNode *prev; /**< The previous client in this layer. */ struct ClientNode *next; /**< The next client in this layer. */ } ClientNode; /** Find a client by window or parent window. * @param w The window. * @return The client (NULL if not found). */ ClientNode *FindClientByWindow(Window w); /** Find a client by its parent window. * @param p The parent window. * @return The client (NULL if not found). */ ClientNode *FindClientByParent(Window p); /** Get the active client. * @return The active client (NULL if no client is active). */ ClientNode *GetActiveClient(); void InitializeClients(); void StartupClients(); void ShutdownClients(); void DestroyClients(); /** Add a window to management. * @param w The client window. * @param alreadyMapped 1 if the window is mapped, 0 if not. * @param notOwner 1 if JWM doesn't own this window, 0 if JWM is the owner. * @return The client window data. */ ClientNode *AddClientWindow(Window w, char alreadyMapped, char notOwner); /** Remove a client from management. * @param np The client to remove. */ void RemoveClient(ClientNode *np); /** Minimize a client. * @param np The client to minimize. */ void MinimizeClient(ClientNode *np); /** Shade a client. * @param np The client to shade. */ void ShadeClient(ClientNode *np); /** Unshade a client. * @param np The client to unshade. */ void UnshadeClient(ClientNode *np); /** Set a client's status to withdrawn. * A withdrawn client is a client that is not visible in any way to the * user. This may be a window that an application keeps around so that * it can be reused at a later time. * @param np The client whose status to change. */ void SetClientWithdrawn(ClientNode *np); /** Restore a client from minimized state. * @param np The client to restore. * @param raise 1 to raise the client, 0 to leave stacking unchanged. */ void RestoreClient(ClientNode *np, char raise); /** Maximize a client. * @param np The client to maximize. * @param horiz Set to maximize the client horizontally. * @param vert Set to maximize the client vertically. */ void MaximizeClient(ClientNode *np, char horiz, char vert); /** Maximize a client using the default maximize settings. * @param np The client to maximize. */ void MaximizeClientDefault(ClientNode *np); /** Set the full screen status of a client. * @param np The client. * @param fullScreen 1 to make full screen, 0 to make not full screen. */ void SetClientFullScreen(ClientNode *np, char fullScreen); /** Set the keyboard focus to a client. * @param np The client to focus. */ void FocusClient(ClientNode *np); /** Set the keyboard focus back to the active client. */ void RefocusClient(); /** Tell a client to exit. * @param np The client to delete. */ void DeleteClient(ClientNode *np); /** Force a client to exit. * @param np The client to kill. */ void KillClient(ClientNode *np); /** Raise a client to the top of its layer. * @param np The client to raise. */ void RaiseClient(ClientNode *np); /** Lower a client to the bottom of its layer. * @param np The client to lower. */ void LowerClient(ClientNode *np); /** Restack the clients. * This is used when a client is mapped so that the stacking order * remains consistent. */ void RestackClients(); /** Set the layer of a client. * @param np The client whose layer to set. * @param layer the layer to assign to the client. */ void SetClientLayer(ClientNode *np, unsigned int layer); /** Set the desktop for a client. * @param np The client. * @param desktop The desktop to be assigned to the client. */ void SetClientDesktop(ClientNode *np, unsigned int desktop); /** Set the sticky status of a client. * A sticky client will appear on all desktops. * @param np The client. * @param isSticky 1 to make the client sticky, 0 to make it not sticky. */ void SetClientSticky(ClientNode *np, char isSticky); /** Hide a client. * This is used for changing desktops. * @param np The client to hide. */ void HideClient(ClientNode *np); /** Show a client. * This is used for changing desktops. * @param np The client to show. */ void ShowClient(ClientNode *np); /** Update a client's colormap. * @param np The client. */ void UpdateClientColormap(ClientNode *np); /** Update the shape of a client using the shape extension. * @param np The client to update. */ void SetShape(ClientNode *np); /** Send a configure event to a client. * This will send updated location and size information to a client. * @param np The client to get the event. */ void SendConfigureEvent(ClientNode *np); /** Send a message to a client. * @param w The client window. * @param type The type of message to send. * @param message The message to send. */ void SendClientMessage(Window w, AtomType type, AtomType message); /** Set the opacity for active clients. * @param str The opacity to use. */ void SetActiveClientOpacity(const char *str); /** Set the opacity range for inactive clients. * @param str The opacity range to use. */ void SetInactiveClientOpacity(const char *str); #endif /* CLIENT_H */ jwm-2.1.0+svn579/src/confirm.h0000644000000000000000000000132011710374021014441 0ustar rootroot/** * @file confirm.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the confirm dialog functions. * */ #ifndef CONFIRM_H #define CONFIRM_H struct ClientNode; /*@{*/ void InitializeDialogs(); void StartupDialogs(); void ShutdownDialogs(); void DestroyDialogs(); /*@}*/ /** Handle an event on a dialog window. * @param event The event. * @return 1 if handled, 0 if not handled. */ int ProcessDialogEvent(const XEvent *event); /** Show a confirm dialog. * @param np A client window associated with the dialog. * @param action A callback to run if "OK" is clicked. */ void ShowConfirmDialog(struct ClientNode *np, void (*action)(struct ClientNode*), ...); #endif /* CONFIRM_H */ jwm-2.1.0+svn579/src/traybutton.c0000644000000000000000000002567111710374021015231 0ustar rootroot/** * @file traybutton.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Button tray component. * */ #include "jwm.h" #include "traybutton.h" #include "tray.h" #include "icon.h" #include "image.h" #include "error.h" #include "root.h" #include "main.h" #include "color.h" #include "font.h" #include "button.h" #include "misc.h" #include "screen.h" #include "desktop.h" #include "popup.h" #include "timing.h" #include "command.h" #include "cursor.h" #define BUTTON_SIZE 4 typedef struct TrayButtonType { TrayComponentType *cp; char *label; char *popup; char *iconName; IconNode *icon; char *action; int mousex; int mousey; TimeType mouseTime; struct TrayButtonType *next; } TrayButtonType; static TrayButtonType *buttons; static void Create(TrayComponentType *cp); static void Destroy(TrayComponentType *cp); static void SetSize(TrayComponentType *cp, int width, int height); static void Resize(TrayComponentType *cp); static void Draw(TrayComponentType *cp, int active); static void ProcessButtonPress(TrayComponentType *cp, int x, int y, int mask); static void ProcessButtonRelease(TrayComponentType *cp, int x, int y, int mask); static void ProcessMotionEvent(TrayComponentType *cp, int x, int y, int mask); /** Initialize tray button data. */ void InitializeTrayButtons() { buttons = NULL; } /** Startup tray buttons. */ void StartupTrayButtons() { TrayButtonType *bp; for(bp = buttons; bp; bp = bp->next) { if(bp->label) { bp->cp->requestedWidth = GetStringWidth(FONT_TRAYBUTTON, bp->label) + 4; bp->cp->requestedHeight = GetStringHeight(FONT_TRAYBUTTON); } else { bp->cp->requestedWidth = 0; bp->cp->requestedHeight = 0; } if(bp->iconName) { bp->icon = LoadNamedIcon(bp->iconName); if(JLIKELY(bp->icon)) { bp->cp->requestedWidth += bp->icon->image->width; bp->cp->requestedHeight += bp->icon->image->height; } else { Warning(_("could not load tray icon: \"%s\""), bp->iconName); } } bp->cp->requestedWidth += 2 * BUTTON_SIZE; bp->cp->requestedHeight += 2 * BUTTON_SIZE; } } /** Shutdown tray buttons. */ void ShutdownTrayButtons() { } /** Release tray button data. */ void DestroyTrayButtons() { TrayButtonType *bp; while(buttons) { bp = buttons->next; if(buttons->label) { Release(buttons->label); } if(buttons->iconName) { Release(buttons->iconName); } if(buttons->action) { Release(buttons->action); } if(buttons->popup) { Release(buttons->popup); } Release(buttons); buttons = bp; } } /** Create a button tray component. */ TrayComponentType *CreateTrayButton(const char *iconName, const char *label, const char *action, const char *popup, int width, int height) { TrayButtonType *bp; TrayComponentType *cp; if(JUNLIKELY((label == NULL || strlen(label) == 0) && (iconName == NULL || strlen(iconName) == 0))) { Warning(_("no icon or label for TrayButton")); return NULL; } if(JUNLIKELY(width < 0)) { Warning(_("invalid TrayButton width: %d"), width); width = 0; } if(JUNLIKELY(height < 0)) { Warning(_("invalid TrayButton height: %d"), height); height = 0; } bp = Allocate(sizeof(TrayButtonType)); bp->next = buttons; buttons = bp; bp->icon = NULL; bp->iconName = CopyString(iconName); bp->label = CopyString(label); bp->action = CopyString(action); bp->popup = CopyString(popup); cp = CreateTrayComponent(); cp->object = bp; bp->cp = cp; cp->requestedWidth = width; cp->requestedHeight = height; bp->mousex = -POPUP_DELTA; bp->mousey = -POPUP_DELTA; cp->Create = Create; cp->Destroy = Destroy; cp->SetSize = SetSize; cp->Resize = Resize; cp->ProcessButtonPress = ProcessButtonPress; cp->ProcessButtonRelease = ProcessButtonRelease; if(popup || label) { cp->ProcessMotionEvent = ProcessMotionEvent; } return cp; } /** Set the size of a button tray component. */ void SetSize(TrayComponentType *cp, int width, int height) { TrayButtonType *bp; int labelWidth, labelHeight; int iconWidth, iconHeight; int ratio; bp = (TrayButtonType*)cp->object; if(bp->icon) { if(bp->label) { labelWidth = GetStringWidth(FONT_TRAYBUTTON, bp->label) + 4; labelHeight = GetStringHeight(FONT_TRAYBUTTON); } else { labelWidth = 0; labelHeight = 0; } iconWidth = bp->icon->image->width; iconHeight = bp->icon->image->height; /* Fixed point with 16 bit fraction. */ ratio = (iconWidth << 16) / iconHeight; if(width > 0) { /* Compute height from width. */ iconWidth = width - labelWidth - 2 * BUTTON_SIZE; iconHeight = (iconWidth << 16) / ratio; height = Max(iconHeight, labelHeight) + 2 * BUTTON_SIZE; } else if(height > 0) { /* Compute width from height. */ iconHeight = height - 2 * BUTTON_SIZE; iconWidth = (iconHeight * ratio) >> 16; width = iconWidth + labelWidth + 2 * BUTTON_SIZE; } cp->width = width; cp->height = height; } } /** Initialize a button tray component. */ void Create(TrayComponentType *cp) { TrayButtonType *bp; bp = (TrayButtonType*)cp->object; /* Validate the action for this tray button. */ if(bp->action && strlen(bp->action) > 0) { if(!strncmp(bp->action, "exec:", 5)) { /* Valid. */ } else if(!strncmp(bp->action, "root:", 5)) { /* Valid. However, the specified root menu may not exist. * This case is handled in ValidateTrayButtons. */ } else if(!strcmp(bp->action, "showdesktop")) { /* Valid. */ } else { Warning(_("invalid TrayButton action: \"%s\""), bp->action); } } else { /* Valid. However, root menu 1 may not exist. * This case is handled in ValidateTrayButtons. */ } cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, rootDepth); Draw(cp, 0); } /** Resize a button tray component. */ void Resize(TrayComponentType *cp) { Destroy(cp); Create(cp); } /** Destroy a button tray component. */ void Destroy(TrayComponentType *cp) { if(cp->pixmap != None) { JXFreePixmap(display, cp->pixmap); } } /** Draw a tray button. */ void Draw(TrayComponentType *cp, int active) { ButtonNode button; TrayButtonType *bp; int labelx; bp = (TrayButtonType*)cp->object; JXSetForeground(display, rootGC, colors[COLOR_TRAYBUTTON_BG]); JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); ResetButton(&button, cp->pixmap, rootGC); if(active) { button.type = BUTTON_TASK_ACTIVE; } else { button.type = BUTTON_TASK; } button.width = cp->width - 3; button.height = cp->height - 3; button.x = 1; button.y = 1; DrawButton(&button); /* Compute the offset of the text. */ if(bp->label) { if(!bp->icon) { labelx = 2 + cp->width / 2; labelx -= GetStringWidth(FONT_TRAYBUTTON, bp->label) / 2; } else { labelx = cp->width; labelx -= GetStringWidth(FONT_TRAYBUTTON, bp->label) + 4; } } else { labelx = cp->width; } labelx -= BUTTON_SIZE; if(bp->icon) { PutIcon(bp->icon, cp->pixmap, BUTTON_SIZE, BUTTON_SIZE, labelx - BUTTON_SIZE, cp->height - BUTTON_SIZE * 2); } if(bp->label) { RenderString(cp->pixmap, FONT_TRAYBUTTON, COLOR_TRAYBUTTON_FG, labelx + 2, cp->height / 2 - GetStringHeight(FONT_TRAYBUTTON) / 2, cp->width - labelx, NULL, bp->label); } } /** Process a button press. */ void ProcessButtonPress(TrayComponentType *cp, int x, int y, int mask) { const ScreenType *sp; int mwidth, mheight; int button; TrayButtonType *bp = (TrayButtonType*)cp->object; Assert(bp); if(bp->action && strlen(bp->action) > 0) { if(strncmp(bp->action, "root:", 5)) { GrabMouse(cp->tray->window); cp->grabbed = 1; Draw(cp, 1); UpdateSpecificTray(cp->tray, cp); return; } else { button = atoi(bp->action + 5); } } else { button = 1; } GetRootMenuSize(button, &mwidth, &mheight); sp = GetCurrentScreen(cp->screenx, cp->screeny); if(cp->tray->layout == LAYOUT_HORIZONTAL) { x = cp->screenx; if(cp->screeny + cp->height / 2 < sp->y + sp->height / 2) { y = cp->screeny + cp->height; } else { y = cp->screeny - mheight; } } else { y = cp->screeny; if(cp->screenx + cp->width / 2 < sp->x + sp->width / 2) { x = cp->screenx + cp->width; } else { x = cp->screenx - mwidth; } } Draw(cp, 1); UpdateSpecificTray(cp->tray, cp); ShowRootMenu(button, x, y); Draw(cp, 0); UpdateSpecificTray(cp->tray, cp); } /** Process a button release. */ void ProcessButtonRelease(TrayComponentType *cp, int x, int y, int mask) { TrayButtonType *bp = (TrayButtonType*)cp->object; Assert(bp); Draw(cp, 0); UpdateSpecificTray(cp->tray, cp); // Since we grab the mouse, make sure the mouse is actually // over the button. if(x < 0 || x >= cp->width) { return; } if(y < 0 || y >= cp->height) { return; } // Run the tray button action (if any). if(bp->action && strlen(bp->action) > 0) { if(!strncmp(bp->action, "exec:", 5)) { RunCommand(bp->action + 5); return; } else if(!strcmp(bp->action, "showdesktop")) { ShowDesktop(); return; } } } /** Process a motion event. */ void ProcessMotionEvent(TrayComponentType *cp, int x, int y, int mask) { TrayButtonType *bp = (TrayButtonType*)cp->object; bp->mousex = cp->screenx + x; bp->mousey = cp->screeny + y; GetCurrentTime(&bp->mouseTime); } /** Signal (needed for popups). */ void SignalTrayButton(const TimeType *now, int x, int y) { TrayButtonType *bp; const char *popup; for(bp = buttons; bp; bp = bp->next) { if(bp->popup) { popup = bp->popup; } else if(bp->label) { popup = bp->label; } else { continue; } if(abs(bp->mousex - x) < POPUP_DELTA && abs(bp->mousey - y) < POPUP_DELTA) { if(GetTimeDifference(now, &bp->mouseTime) >= popupDelay) { ShowPopup(x, y, popup); } } } } /** Validate tray buttons. */ void ValidateTrayButtons() { TrayButtonType *bp; int bindex; for(bp = buttons; bp; bp = bp->next) { if(bp->action && !strncmp(bp->action, "root:", 5)) { bindex = atoi(bp->action + 5); if(JUNLIKELY(!IsRootMenuDefined(bindex))) { Warning(_("tray button: root menu %d not defined"), bindex); } } } } jwm-2.1.0+svn579/src/spacer.h0000644000000000000000000000062111710374021014264 0ustar rootroot/** * @file spacer.h * @author Joe Wingbermuehle * @date 2011 * * @brief Spacer tray component. * */ #ifndef SPACER_H #define SPACER_H struct TrayComponentType; /** Create a spacer tray component. * @param width Minimum width. * @param height Minimum height. * @return A new spacer tray component. */ struct TrayComponentType *CreateSpacer(int width, int height); #endif /* SPACER_H */ jwm-2.1.0+svn579/src/parse.c0000644000000000000000000012211211710374021014114 0ustar rootroot/** * @file parse.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief JWM configuration parser. * */ #include "jwm.h" #include "parse.h" #include "lex.h" #include "menu.h" #include "root.h" #include "client.h" #include "tray.h" #include "group.h" #include "desktop.h" #include "move.h" #include "resize.h" #include "misc.h" #include "swallow.h" #include "pager.h" #include "error.h" #include "key.h" #include "cursor.h" #include "main.h" #include "font.h" #include "color.h" #include "icon.h" #include "command.h" #include "button.h" #include "event.h" #include "taskbar.h" #include "traybutton.h" #include "clock.h" #include "dock.h" #include "popup.h" #include "status.h" #include "background.h" #include "spacer.h" /** Structure to map key names to key types. */ typedef struct KeyMapType { const char *name; KeyType key; } KeyMapType; /** Mapping of key names to key types. */ static const KeyMapType KEY_MAP[] = { { "up", KEY_UP }, { "down", KEY_DOWN }, { "right", KEY_RIGHT }, { "left", KEY_LEFT }, { "escape", KEY_ESC }, { "select", KEY_ENTER }, { "next", KEY_NEXT }, { "nextstacked", KEY_NEXTSTACK }, { "prev", KEY_PREV }, { "prevstacked", KEY_PREVSTACK }, { "close", KEY_CLOSE }, { "minimize", KEY_MIN }, { "maximize", KEY_MAX }, { "shade", KEY_SHADE }, { "stick", KEY_STICK }, { "move", KEY_MOVE }, { "resize", KEY_RESIZE }, { "window", KEY_WIN }, { "restart", KEY_RESTART }, { "exit", KEY_EXIT }, { "desktop#", KEY_DESKTOP }, { "rdesktop", KEY_RDESKTOP }, { "ldesktop", KEY_LDESKTOP }, { "udesktop", KEY_UDESKTOP }, { "ddesktop", KEY_DDESKTOP }, { "showdesktop", KEY_SHOWDESK }, { "showtray", KEY_SHOWTRAY }, { "fullscreen", KEY_FULLSCREEN }, { NULL, KEY_NONE } }; /** Structure to map names to group options. */ typedef struct OptionMapType { const char *name; OptionType option; } OptionMapType; /** Mapping of names to group options. */ static const OptionMapType OPTION_MAP[] = { { "sticky", OPTION_STICKY }, { "nolist", OPTION_NOLIST }, { "border", OPTION_BORDER }, { "noborder", OPTION_NOBORDER }, { "title", OPTION_TITLE }, { "notitle", OPTION_NOTITLE }, { "pignore", OPTION_PIGNORE }, { "maximized", OPTION_MAXIMIZED }, { "minimized", OPTION_MINIMIZED }, { "hmax", OPTION_MAX_H }, { "vmax", OPTION_MAX_V }, { "nofocus", OPTION_NOFOCUS }, { NULL, OPTION_INVALID } }; static const char *DEFAULT_TITLE = "JWM"; static const char *LABEL_ATTRIBUTE = "label"; static const char *ICON_ATTRIBUTE = "icon"; static const char *CONFIRM_ATTRIBUTE = "confirm"; static const char *LABELED_ATTRIBUTE = "labeled"; static const char *ONROOT_ATTRIBUTE = "onroot"; static const char *LAYER_ATTRIBUTE = "layer"; static const char *LAYOUT_ATTRIBUTE = "layout"; static const char *AUTOHIDE_ATTRIBUTE = "autohide"; static const char *X_ATTRIBUTE = "x"; static const char *Y_ATTRIBUTE = "y"; static const char *WIDTH_ATTRIBUTE = "width"; static const char *HEIGHT_ATTRIBUTE = "height"; static const char *NAME_ATTRIBUTE = "name"; static const char *BORDER_ATTRIBUTE = "border"; static const char *DISTANCE_ATTRIBUTE = "distance"; static const char *INSERT_ATTRIBUTE = "insert"; static const char *MAX_WIDTH_ATTRIBUTE = "maxwidth"; static const char *FORMAT_ATTRIBUTE = "format"; static const char *ZONE_ATTRIBUTE = "zone"; static const char *VALIGN_ATTRIBUTE = "valign"; static const char *HALIGN_ATTRIBUTE = "halign"; static const char *POPUP_ATTRIBUTE = "popup"; static const char *DELAY_ATTRIBUTE = "delay"; static const char *ENABLED_ATTRIBUTE = "enabled"; static const char *COORDINATES_ATTRIBUTE = "coordinates"; static const char *TYPE_ATTRIBUTE = "type"; static const char *FALSE_VALUE = "false"; static const char *TRUE_VALUE = "true"; static int ParseFile(const char *fileName, int depth); static char *ReadFile(FILE *fd); /* Misc. */ static void Parse(const TokenNode *start, int depth); static void ParseInclude(const TokenNode *tp, int depth); static void ParseDesktops(const TokenNode *tp); static void ParseDesktop(int desktop, const TokenNode *tp); static void ParseDesktopBackground(int desktop, const TokenNode *tp); /* Menus. */ static void ParseRootMenu(const TokenNode *start); static MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu, MenuItem *last); static MenuItem *ParseMenuInclude(const TokenNode *tp, Menu *menu, MenuItem *last); static MenuItem *InsertMenuItem(MenuItem *last); /* Tray. */ static void ParseTray(const TokenNode *tp); static void ParsePager(const TokenNode *tp, TrayType *tray); static void ParseTaskList(const TokenNode *tp, TrayType *tray); static void ParseSwallow(const TokenNode *tp, TrayType *tray); static void ParseTrayButton(const TokenNode *tp, TrayType *tray); static void ParseClock(const TokenNode *tp, TrayType *tray); static void ParseDock(const TokenNode *tp, TrayType *tray); static void ParseSpacer(const TokenNode *tp, TrayType *tray); /* Groups. */ static void ParseGroup(const TokenNode *tp); static void ParseGroupOption(const TokenNode *tp, struct GroupType *group, const char *option); /* Style. */ static void ParseWindowStyle(const TokenNode *start); static void ParseActiveWindowStyle(const TokenNode *tp); static void ParseInactiveWindowStyle(const TokenNode *tp); static void ParseTaskListStyle(const TokenNode *start); static void ParseTrayStyle(const TokenNode *start); static void ParsePagerStyle(const TokenNode *start); static void ParseMenuStyle(const TokenNode *start); static void ParsePopupStyle(const TokenNode *start); static void ParseClockStyle(const TokenNode *start); static void ParseTrayButtonStyle(const TokenNode *start); /* Feel. */ static void ParseKey(const TokenNode *tp); static void ParseSnapMode(const TokenNode *tp); static void ParseMoveMode(const TokenNode *tp); static void ParseResizeMode(const TokenNode *tp); static void ParseFocusModel(const TokenNode *tp); static void ParseGradient(const char *value, ColorType a, ColorType b); static char *FindAttribute(AttributeNode *ap, const char *name); static void ReleaseTokens(TokenNode *np); static void InvalidTag(const TokenNode *tp, TokenType parent); static void ParseError(const TokenNode *tp, const char *str, ...); /** Parse the JWM configuration. */ void ParseConfig(const char *fileName) { if(!ParseFile(fileName, 0)) { if(JUNLIKELY(!ParseFile(SYSTEM_CONFIG, 0))) { ParseError(NULL, "could not open %s or %s", fileName, SYSTEM_CONFIG); } } ValidateTrayButtons(); ValidateKeys(); } /** * Parse a specific file. * @return 1 on success and 0 on failure. */ int ParseFile(const char *fileName, int depth) { TokenNode *tokens; FILE *fd; char *buffer; ++depth; if(JUNLIKELY(depth > MAX_INCLUDE_DEPTH)) { ParseError(NULL, "include depth (%d) exceeded", MAX_INCLUDE_DEPTH); return 0; } fd = fopen(fileName, "r"); if(!fd) { return 0; } buffer = ReadFile(fd); fclose(fd); tokens = Tokenize(buffer, fileName); Release(buffer); Parse(tokens, depth); ReleaseTokens(tokens); return 1; } /** Release a token list. */ void ReleaseTokens(TokenNode *np) { AttributeNode *ap; TokenNode *tp; while(np) { tp = np->next; while(np->attributes) { ap = np->attributes->next; if(np->attributes->name) { Release(np->attributes->name); } if(np->attributes->value) { Release(np->attributes->value); } Release(np->attributes); np->attributes = ap; } if(np->subnodeHead) { ReleaseTokens(np->subnodeHead); } if(np->value) { Release(np->value); } if(np->invalidName) { Release(np->invalidName); } if(np->fileName) { Release(np->fileName); } Release(np); np = tp; } } /** Parse a token list. */ void Parse(const TokenNode *start, int depth) { TokenNode *tp; if(!start) { return; } if(JLIKELY(start->type == TOK_JWM)) { for(tp = start->subnodeHead; tp; tp = tp->next) { if(shouldReload) { switch(tp->type) { case TOK_ROOTMENU: ParseRootMenu(tp); break; case TOK_INCLUDE: ParseInclude(tp, depth); break; default: break; } } else { switch(tp->type) { case TOK_DESKTOPS: ParseDesktops(tp); break; case TOK_DOUBLECLICKSPEED: SetDoubleClickSpeed(tp->value); break; case TOK_DOUBLECLICKDELTA: SetDoubleClickDelta(tp->value); break; case TOK_FOCUSMODEL: ParseFocusModel(tp); break; case TOK_GROUP: ParseGroup(tp); break; case TOK_ICONPATH: AddIconPath(tp->value); break; case TOK_INCLUDE: ParseInclude(tp, depth); break; case TOK_KEY: ParseKey(tp); break; case TOK_MENUSTYLE: ParseMenuStyle(tp); break; case TOK_MOVEMODE: ParseMoveMode(tp); break; case TOK_PAGERSTYLE: ParsePagerStyle(tp); break; case TOK_POPUPSTYLE: ParsePopupStyle(tp); break; case TOK_RESIZEMODE: ParseResizeMode(tp); break; case TOK_RESTARTCOMMAND: AddRestartCommand(tp->value); break; case TOK_ROOTMENU: ParseRootMenu(tp); break; case TOK_SHUTDOWNCOMMAND: AddShutdownCommand(tp->value); break; case TOK_SNAPMODE: ParseSnapMode(tp); break; case TOK_STARTUPCOMMAND: AddStartupCommand(tp->value); break; case TOK_TASKLISTSTYLE: ParseTaskListStyle(tp); break; case TOK_TRAY: ParseTray(tp); break; case TOK_TRAYSTYLE: ParseTrayStyle(tp); break; case TOK_TRAYBUTTONSTYLE: ParseTrayButtonStyle(tp); break; case TOK_CLOCKSTYLE: ParseClockStyle(tp); break; case TOK_WINDOWSTYLE: ParseWindowStyle(tp); break; case TOK_BUTTONCLOSE: SetButtonMask(BP_CLOSE, tp->value); break; case TOK_BUTTONMIN: SetButtonMask(BP_MINIMIZE, tp->value); break; case TOK_BUTTONMAX: SetButtonMask(BP_MAXIMIZE, tp->value); break; case TOK_BUTTONMAXACTIVE: SetButtonMask(BP_MAXIMIZE_ACTIVE, tp->value); break; default: InvalidTag(tp, TOK_JWM); break; } } } } else { ParseError(start, "invalid start tag: %s", GetTokenName(start)); } } /** Parse focus model. */ void ParseFocusModel(const TokenNode *tp) { if(JLIKELY(tp->value)) { if(!strcmp(tp->value, "sloppy")) { focusModel = FOCUS_SLOPPY; } else if(!strcmp(tp->value, "click")) { focusModel = FOCUS_CLICK; } else { ParseError(tp, "invalid focus model: \"%s\"", tp->value); } } else { ParseError(tp, "focus model not specified"); } } /** Parse snap mode for moving windows. */ void ParseSnapMode(const TokenNode *tp) { const char *distance; distance = FindAttribute(tp->attributes, DISTANCE_ATTRIBUTE); if(distance) { SetSnapDistance(distance); } else { SetDefaultSnapDistance(); } if(JLIKELY(tp->value)) { if(!strcmp(tp->value, "none")) { SetSnapMode(SNAP_NONE); } else if(!strcmp(tp->value, "screen")) { SetSnapMode(SNAP_SCREEN); } else if(!strcmp(tp->value, "border")) { SetSnapMode(SNAP_BORDER); } else { ParseError(tp, "invalid snap mode: %s", tp->value); } } else { ParseError(tp, "snap mode not specified"); } } /** Parse move mode. */ void ParseMoveMode(const TokenNode *tp) { const char *str; str = FindAttribute(tp->attributes, COORDINATES_ATTRIBUTE); SetMoveStatusType(str); if(JLIKELY(tp->value)) { if(!strcmp(tp->value, "outline")) { SetMoveMode(MOVE_OUTLINE); } else if(!strcmp(tp->value, "opaque")) { SetMoveMode(MOVE_OPAQUE); } else { ParseError(tp, "invalid move mode: %s", tp->value); } } else { ParseError(tp, "move mode not specified"); } } /** Parse resize mode. */ void ParseResizeMode(const TokenNode *tp) { const char *str; str = FindAttribute(tp->attributes, COORDINATES_ATTRIBUTE); SetResizeStatusType(str); if(JLIKELY(tp->value)) { if(!strcmp(tp->value, "outline")) { SetResizeMode(RESIZE_OUTLINE); } else if(!strcmp(tp->value, "opaque")) { SetResizeMode(RESIZE_OPAQUE); } else { ParseError(tp, "invalid resize mode: %s", tp->value); } } else { ParseError(tp, "resize mode not specified"); } } /** Parse a root menu. */ void ParseRootMenu(const TokenNode *start) { const char *value; Menu *menu; menu = Allocate(sizeof(Menu)); value = FindAttribute(start->attributes, HEIGHT_ATTRIBUTE); if(value) { menu->itemHeight = atoi(value); } else { menu->itemHeight = 0; } value = FindAttribute(start->attributes, LABELED_ATTRIBUTE); if(value && !strcmp(value, TRUE_VALUE)) { value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); if(!value) { value = DEFAULT_TITLE; } menu->label = CopyString(value); } else { menu->label = NULL; } menu->items = NULL; ParseMenuItem(start->subnodeHead, menu, NULL); value = FindAttribute(start->attributes, ONROOT_ATTRIBUTE); if(!value) { value = "123"; } SetRootMenu(value, menu); } /** Insert a new menu item into a menu. */ MenuItem *InsertMenuItem(MenuItem *last) { MenuItem *item; item = Allocate(sizeof(MenuItem)); item->name = NULL; item->type = MENU_ITEM_NORMAL; item->iconName = NULL; item->action.type = MA_NONE; item->action.data.str = NULL; item->submenu = NULL; item->next = NULL; if(last) { last->next = item; } return item; } /** Parse a menu item. */ MenuItem *ParseMenuItem(const TokenNode *start, Menu *menu, MenuItem *last) { Menu *child; const char *value; Assert(menu); menu->offsets = NULL; while(start) { switch(start->type) { case TOK_INCLUDE: last = ParseMenuInclude(start, menu, last); break; case TOK_MENU: last = InsertMenuItem(last); last->type = MENU_ITEM_SUBMENU; if(!menu->items) { menu->items = last; } value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); last->name = CopyString(value); value = FindAttribute(start->attributes, ICON_ATTRIBUTE); last->iconName = CopyString(value); last->submenu = Allocate(sizeof(Menu)); child = last->submenu; value = FindAttribute(start->attributes, HEIGHT_ATTRIBUTE); if(value) { child->itemHeight = atoi(value); } else { child->itemHeight = menu->itemHeight; } value = FindAttribute(start->attributes, LABELED_ATTRIBUTE); if(value && !strcmp(value, TRUE_VALUE)) { if(last->name) { child->label = CopyString(last->name); } else { child->label = CopyString(DEFAULT_TITLE); } } else { child->label = NULL; } last->submenu->items = NULL; ParseMenuItem(start->subnodeHead, last->submenu, NULL); break; case TOK_PROGRAM: last = InsertMenuItem(last); if(!menu->items) { menu->items = last; } value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); if(value) { last->name = CopyString(value); } else if(start->value) { last->name = CopyString(start->value); } value = FindAttribute(start->attributes, ICON_ATTRIBUTE); last->iconName = CopyString(value); last->action.type = MA_EXECUTE; last->action.data.str = CopyString(start->value); break; case TOK_SEPARATOR: last = InsertMenuItem(last); last->type = MENU_ITEM_SEPARATOR; if(!menu->items) { menu->items = last; } break; case TOK_DESKTOPS: case TOK_STICK: case TOK_MAXIMIZE: case TOK_MINIMIZE: case TOK_SHADE: case TOK_MOVE: case TOK_RESIZE: case TOK_KILL: case TOK_CLOSE: last = InsertMenuItem(last); if(!menu->items) { menu->items = last; } value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); if(!value) { value = GetTokenName(start); } last->name = CopyString(value); value = FindAttribute(start->attributes, ICON_ATTRIBUTE); last->iconName = CopyString(value); switch(start->type) { case TOK_DESKTOPS: last->action.type = MA_DESKTOP; break; case TOK_STICK: last->action.type = MA_STICK; break; case TOK_MAXIMIZE: last->action.type = MA_MAXIMIZE; break; case TOK_MINIMIZE: last->action.type = MA_MINIMIZE; break; case TOK_SHADE: last->action.type = MA_SHADE; break; case TOK_MOVE: last->action.type = MA_MOVE; break; case TOK_RESIZE: last->action.type = MA_RESIZE; break; case TOK_KILL: last->action.type = MA_KILL; break; case TOK_CLOSE: last->action.type = MA_CLOSE; break; default: break; } break; case TOK_EXIT: last = InsertMenuItem(last); if(!menu->items) { menu->items = last; } value = FindAttribute(start->attributes, CONFIRM_ATTRIBUTE); if(value && !strcmp(value, FALSE_VALUE)) { SetShowExitConfirmation(0); } else { SetShowExitConfirmation(1); } value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); if(!value) { value = GetTokenName(start); } last->name = CopyString(value); value = FindAttribute(start->attributes, ICON_ATTRIBUTE); last->iconName = CopyString(value); last->action.type = MA_EXIT; last->action.data.str = CopyString(start->value); break; case TOK_RESTART: last = InsertMenuItem(last); if(!menu->items) { menu->items = last; } value = FindAttribute(start->attributes, LABEL_ATTRIBUTE); if(!value) { value = GetTokenName(start); } last->name = CopyString(value); value = FindAttribute(start->attributes, ICON_ATTRIBUTE); last->iconName = CopyString(value); last->action.type = MA_RESTART; break; default: InvalidTag(start, TOK_MENU); break; } start = start->next; } return last; } /** Parse a menu include. */ MenuItem *ParseMenuInclude(const TokenNode *tp, Menu *menu, MenuItem *last) { FILE *fd; char *path; char *buffer = NULL; TokenNode *start; Assert(tp); if(!strncmp(tp->value, "exec:", 5)) { path = Allocate(strlen(tp->value) - 5 + 1); strcpy(path, tp->value + 5); ExpandPath(&path); fd = popen(path, "r"); if(JLIKELY(fd)) { buffer = ReadFile(fd); pclose(fd); } else { ParseError(tp, "could not execute included program: %s", path); } } else { path = CopyString(tp->value); ExpandPath(&path); fd = fopen(path, "r"); if(JLIKELY(fd)) { buffer = ReadFile(fd); fclose(fd); } else { ParseError(tp, "could not open include: %s", path); } } if(!buffer) { Release(path); return last; } start = Tokenize(buffer, path); Release(buffer); Release(path); if(JUNLIKELY(!start || start->type != TOK_JWM)) { ParseError(tp, "invalid included menu: %s", tp->value); } else { last = ParseMenuItem(start->subnodeHead, menu, last); } if(start) { ReleaseTokens(start); } return last; } /** Parse a key binding. */ void ParseKey(const TokenNode *tp) { const char *key; const char *code; const char *mask; const char *action; const char *command; KeyType k; int x; Assert(tp); mask = FindAttribute(tp->attributes, "mask"); key = FindAttribute(tp->attributes, "key"); code = FindAttribute(tp->attributes, "keycode"); action = tp->value; if(JUNLIKELY(action == NULL)) { ParseError(tp, "no action specified for Key"); return; } command = NULL; k = KEY_NONE; if(!strncmp(action, "exec:", 5)) { k = KEY_EXEC; command = action + 5; } else if(!strncmp(action, "root:", 5)) { k = KEY_ROOT; command = action + 5; } else { for(x = 0; KEY_MAP[x].name; x++) { if(!strcmp(action, KEY_MAP[x].name)) { k = KEY_MAP[x].key; break; } } } /* Insert the binding if it's valid. */ if(JUNLIKELY(k == KEY_NONE)) { ParseError(tp, "invalid Key action: \"%s\"", action); } else { InsertBinding(k, mask, key, code, command); } } /** Parse window style. */ void ParseWindowStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_BORDER, np->value); break; case TOK_WIDTH: SetBorderWidth(np->value); break; case TOK_HEIGHT: SetTitleHeight(np->value); break; case TOK_ACTIVE: ParseActiveWindowStyle(np); break; case TOK_INACTIVE: ParseInactiveWindowStyle(np); break; default: InvalidTag(np, TOK_WINDOWSTYLE); break; } } } /** Parse active window style information. */ void ParseActiveWindowStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_TEXT: SetColor(COLOR_TITLE_ACTIVE_FG, np->value); break; case TOK_TITLE: ParseGradient(np->value, COLOR_TITLE_ACTIVE_BG1, COLOR_TITLE_ACTIVE_BG2); break; case TOK_OUTLINE: SetColor(COLOR_BORDER_ACTIVE_LINE, np->value); break; case TOK_OPACITY: SetActiveClientOpacity(np->value); break; default: InvalidTag(np, TOK_ACTIVE); } } } /** Parse inactive window style information. */ void ParseInactiveWindowStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_TEXT: SetColor(COLOR_TITLE_FG, np->value); break; case TOK_TITLE: ParseGradient(np->value, COLOR_TITLE_BG1, COLOR_TITLE_BG2); break; case TOK_OUTLINE: SetColor(COLOR_BORDER_LINE, np->value); break; case TOK_OPACITY: SetInactiveClientOpacity(np->value); break; default: InvalidTag(np, TOK_INACTIVE); } } } /** Parse an include. */ void ParseInclude(const TokenNode *tp, int depth) { char *temp; Assert(tp); if(JUNLIKELY(!tp->value)) { ParseError(tp, "no include file specified"); } else { temp = CopyString(tp->value); ExpandPath(&temp); if(JUNLIKELY(!ParseFile(temp, depth))) { ParseError(tp, "could not open included file %s", temp); } Release(temp); } } /** Parse desktop configuration. */ void ParseDesktops(const TokenNode *tp) { TokenNode *np; const char *width; const char *height; int x; int desktop; Assert(tp); width = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); height = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); SetDesktopCount(width, height); desktop = 0; for(x = 0, np = tp->subnodeHead; np; np = np->next, x++) { if(desktop >= desktopCount) { break; } switch(np->type) { case TOK_BACKGROUND: ParseDesktopBackground(-1, np); break; case TOK_DESKTOP: ParseDesktop(desktop, np); ++desktop; break; default: InvalidTag(np, TOK_DESKTOPS); break; } } } /** Parse a configuration for a specific desktop. */ void ParseDesktop(int desktop, const TokenNode *tp) { TokenNode *np; const char *attr; attr = FindAttribute(tp->attributes, NAME_ATTRIBUTE); if(attr) { SetDesktopName(desktop, attr); } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_BACKGROUND: ParseDesktopBackground(desktop, np); break; default: InvalidTag(np, TOK_DESKTOP); break; } } } /** Parse a background for a desktop. */ void ParseDesktopBackground(int desktop, const TokenNode *tp) { const char *type; type = FindAttribute(tp->attributes, TYPE_ATTRIBUTE); SetBackground(desktop, type, tp->value); } /** Parse task list style. */ void ParseTaskListStyle(const TokenNode *tp) { const char *temp; TokenNode *np; temp = FindAttribute(tp->attributes, INSERT_ATTRIBUTE); if(temp) { SetTaskBarInsertMode(temp); } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_TASK, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_TASK_FG, np->value); break; case TOK_BACKGROUND: ParseGradient(np->value, COLOR_TASK_BG1, COLOR_TASK_BG2); break; case TOK_ACTIVEFOREGROUND: SetColor(COLOR_TASK_ACTIVE_FG, np->value); break; case TOK_ACTIVEBACKGROUND: ParseGradient(np->value, COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_BG2); break; default: InvalidTag(np, TOK_TASKLISTSTYLE); break; } } } /** Parse tray style. */ void ParseTrayStyle(const TokenNode *tp) { const TokenNode *np; for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_TRAY, np->value); break; case TOK_BACKGROUND: SetColor(COLOR_TRAY_BG, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_TRAY_FG, np->value); break; case TOK_OPACITY: SetTrayOpacity(np->value); break; default: InvalidTag(np, TOK_TRAYSTYLE); break; } } } /** Parse tray. */ void ParseTray(const TokenNode *tp) { const TokenNode *np; const char *attr; TrayType *tray; Assert(tp); tray = CreateTray(); attr = FindAttribute(tp->attributes, AUTOHIDE_ATTRIBUTE); if(attr && !strcmp(attr, TRUE_VALUE)) { SetAutoHideTray(tray, 1); } else { SetAutoHideTray(tray, 0); } attr = FindAttribute(tp->attributes, X_ATTRIBUTE); if(attr) { SetTrayX(tray, attr); } attr = FindAttribute(tp->attributes, Y_ATTRIBUTE); if(attr) { SetTrayY(tray, attr); } attr = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(attr) { SetTrayWidth(tray, attr); } attr = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(attr) { SetTrayHeight(tray, attr); } attr = FindAttribute(tp->attributes, VALIGN_ATTRIBUTE); SetTrayVerticalAlignment(tray, attr); attr = FindAttribute(tp->attributes, HALIGN_ATTRIBUTE); SetTrayHorizontalAlignment(tray, attr); attr = FindAttribute(tp->attributes, LAYOUT_ATTRIBUTE); SetTrayLayout(tray, attr); attr = FindAttribute(tp->attributes, LAYER_ATTRIBUTE); if(attr) { SetTrayLayer(tray, attr); } attr = FindAttribute(tp->attributes, BORDER_ATTRIBUTE); if(attr) { SetTrayBorder(tray, attr); } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_PAGER: ParsePager(np, tray); break; case TOK_TASKLIST: ParseTaskList(np, tray); break; case TOK_SWALLOW: ParseSwallow(np, tray); break; case TOK_TRAYBUTTON: ParseTrayButton(np, tray); break; case TOK_CLOCK: ParseClock(np, tray); break; case TOK_DOCK: ParseDock(np, tray); break; case TOK_SPACER: ParseSpacer(np, tray); break; default: InvalidTag(np, TOK_TRAY); break; } } } /** Parse a pager tray component. */ void ParsePager(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; const char *temp; int labeled; Assert(tp); Assert(tray); labeled = 0; temp = FindAttribute(tp->attributes, LABELED_ATTRIBUTE); if(temp && !strcmp(temp, TRUE_VALUE)) { labeled = 1; } cp = CreatePager(labeled); AddTrayComponent(tray, cp); } /** Parse a task list tray component. */ void ParseTaskList(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; const char *temp; Assert(tp); Assert(tray); cp = CreateTaskBar(); AddTrayComponent(tray, cp); temp = FindAttribute(tp->attributes, MAX_WIDTH_ATTRIBUTE); if(temp) { SetMaxTaskBarItemWidth(cp, temp); } } /** Parse a swallow tray component. */ void ParseSwallow(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; const char *name; const char *temp; int width, height; Assert(tp); Assert(tray); name = FindAttribute(tp->attributes, NAME_ATTRIBUTE); if(name == NULL) { name = tp->value; } temp = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(temp) { width = atoi(temp); } else { width = 0; } temp = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(temp) { height = atoi(temp); } else { height = 0; } cp = CreateSwallow(name, tp->value, width, height); if(cp) { AddTrayComponent(tray, cp); } } /** Parse a button tray component. */ void ParseTrayButton(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; const char *icon; const char *label; const char *popup; const char *temp; int width, height; Assert(tp); Assert(tray); icon = FindAttribute(tp->attributes, ICON_ATTRIBUTE); label = FindAttribute(tp->attributes, LABEL_ATTRIBUTE); popup = FindAttribute(tp->attributes, POPUP_ATTRIBUTE); temp = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(temp) { width = atoi(temp); } else { width = 0; } temp = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(temp) { height = atoi(temp); } else { height = 0; } cp = CreateTrayButton(icon, label, tp->value, popup, width, height); if(cp) { AddTrayComponent(tray, cp); } } /** Parse a clock tray component. */ void ParseClock(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; const char *format; const char *zone; const char *command; const char *temp; int width, height; Assert(tp); Assert(tray); format = FindAttribute(tp->attributes, FORMAT_ATTRIBUTE); zone = FindAttribute(tp->attributes, ZONE_ATTRIBUTE); if(tp->value && strlen(tp->value) > 0) { command = tp->value; } else { command = NULL; } temp = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(temp) { width = atoi(temp); } else { width = 0; } temp = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(temp) { height = atoi(temp); } else { height = 0; } cp = CreateClock(format, zone, command, width, height); if(JLIKELY(cp)) { AddTrayComponent(tray, cp); } } /** Parse a dock tray component. */ void ParseDock(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; int width; char *str; Assert(tp); Assert(tray); str = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(str) { width = atoi(str); } else { width = 0; } cp = CreateDock(width); if(JLIKELY(cp)) { AddTrayComponent(tray, cp); } } /** Parse a spacer tray component. */ void ParseSpacer(const TokenNode *tp, TrayType *tray) { TrayComponentType *cp; int width; int height; char *str; Assert(tp); Assert(tray); /* Get the width. */ str = FindAttribute(tp->attributes, WIDTH_ATTRIBUTE); if(str) { width = atoi(str); } else { width = 0; } /* Get the height. */ str = FindAttribute(tp->attributes, HEIGHT_ATTRIBUTE); if(str) { height = atoi(str); } else { height = 0; } /* Create the spacer. */ cp = CreateSpacer(width, height); if(JLIKELY(cp)) { AddTrayComponent(tray, cp); } } /** Parse pager style. */ void ParsePagerStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_OUTLINE: SetColor(COLOR_PAGER_OUTLINE, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_PAGER_FG, np->value); break; case TOK_BACKGROUND: SetColor(COLOR_PAGER_BG, np->value); break; case TOK_ACTIVEFOREGROUND: SetColor(COLOR_PAGER_ACTIVE_FG, np->value); break; case TOK_ACTIVEBACKGROUND: SetColor(COLOR_PAGER_ACTIVE_BG, np->value); break; case TOK_FONT: SetFont(FONT_PAGER, np->value); break; case TOK_TEXT: SetColor(COLOR_PAGER_TEXT, np->value); break; default: InvalidTag(np, TOK_PAGERSTYLE); break; } } } /** Parse popup style. */ void ParsePopupStyle(const TokenNode *tp) { const TokenNode *np; const char *str; Assert(tp); str = FindAttribute(tp->attributes, ENABLED_ATTRIBUTE); if(str) { if(!strcmp(str, TRUE_VALUE)) { SetPopupEnabled(1); } else if(!strcmp(str, FALSE_VALUE)) { SetPopupEnabled(0); } else { ParseError(tp, "invalid enabled value: \"%s\"", str); } } str = FindAttribute(tp->attributes, DELAY_ATTRIBUTE); if(str) { SetPopupDelay(str); } for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_POPUP, np->value); break; case TOK_OUTLINE: SetColor(COLOR_POPUP_OUTLINE, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_POPUP_FG, np->value); break; case TOK_BACKGROUND: SetColor(COLOR_POPUP_BG, np->value); break; default: InvalidTag(np, TOK_POPUPSTYLE); break; } } } /** Parse menu style. */ void ParseMenuStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_MENU, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_MENU_FG, np->value); break; case TOK_BACKGROUND: SetColor(COLOR_MENU_BG, np->value); break; case TOK_ACTIVEFOREGROUND: SetColor(COLOR_MENU_ACTIVE_FG, np->value); break; case TOK_ACTIVEBACKGROUND: ParseGradient(np->value, COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_BG2); break; case TOK_OUTLINE: SetColor(COLOR_MENU_ACTIVE_OL, np->value); break; case TOK_OPACITY: SetMenuOpacity(np->value); break; default: InvalidTag(np, TOK_MENUSTYLE); break; } } } /** Parse clock style. */ void ParseClockStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_CLOCK, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_CLOCK_FG, np->value); break; case TOK_BACKGROUND: SetColor(COLOR_CLOCK_BG, np->value); break; default: InvalidTag(np, TOK_CLOCKSTYLE); break; } } } /** Parse tray button style. */ void ParseTrayButtonStyle(const TokenNode *tp) { const TokenNode *np; Assert(tp); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_FONT: SetFont(FONT_TRAYBUTTON, np->value); break; case TOK_FOREGROUND: SetColor(COLOR_TRAYBUTTON_FG, np->value); break; case TOK_BACKGROUND: SetColor(COLOR_TRAYBUTTON_BG, np->value); break; default: InvalidTag(np, TOK_TRAYBUTTONSTYLE); break; } } } /** Parse an option group. */ void ParseGroup(const TokenNode *tp) { const TokenNode *np; struct GroupType *group; Assert(tp); group = CreateGroup(); for(np = tp->subnodeHead; np; np = np->next) { switch(np->type) { case TOK_CLASS: AddGroupClass(group, np->value); break; case TOK_NAME: AddGroupName(group, np->value); break; case TOK_OPTION: ParseGroupOption(np, group, np->value); break; default: InvalidTag(np, TOK_GROUP); break; } } } /** Parse a option group option. */ void ParseGroupOption(const TokenNode *tp, struct GroupType *group, const char *option) { int x; if(!option) { return; } for(x = 0; OPTION_MAP[x].name; x++) { if(!strcmp(option, OPTION_MAP[x].name)) { AddGroupOption(group, OPTION_MAP[x].option); return; } } /* These options have arguments and so we handled them separately. */ if(!strncmp(option, "layer:", 6)) { AddGroupOptionValue(group, OPTION_LAYER, option + 6); } else if(!strncmp(option, "desktop:", 8)) { AddGroupOptionValue(group, OPTION_DESKTOP, option + 8); } else if(!strncmp(option, "icon:", 5)) { AddGroupOptionValue(group, OPTION_ICON, option + 5); } else if(!strncmp(option, "opacity:", 8)) { AddGroupOptionValue(group, OPTION_OPACITY, option + 8); } else { ParseError(tp, "invalid Group Option: %s", option); } } /** Parse a color which may be a gradient. */ void ParseGradient(const char *value, ColorType a, ColorType b) { const char *sep; char *temp; int len; /* Find the separator. */ sep = strchr(value, ':'); if(!sep) { /* Only one color given - use the same color for both. */ SetColor(a, value); SetColor(b, value); } else { /* Two colors. */ /* Get the first color. */ len = (int)(sep - value); temp = AllocateStack(len + 1); memcpy(temp, value, len); temp[len] = 0; SetColor(a, temp); ReleaseStack(temp); /* Get the second color. */ len = strlen(sep + 1); temp = AllocateStack(len + 1); memcpy(temp, sep + 1, len); temp[len] = 0; SetColor(b, temp); ReleaseStack(temp); } } /** Find an attribute in a list of attributes. */ char *FindAttribute(AttributeNode *ap, const char *name) { while(ap) { if(!strcmp(name, ap->name)) { return ap->value; } ap = ap->next; } return NULL; } /** Read a file. */ char *ReadFile(FILE *fd) { const int BLOCK_SIZE = 8192; char *buffer; int len, max; int ch; len = 0; max = BLOCK_SIZE; buffer = Allocate(max + 1); for(;;) { ch = fgetc(fd); if(ch == EOF) { break; } buffer[len++] = ch; if(len >= max) { max += BLOCK_SIZE; buffer = Reallocate(buffer, max + 1); } } buffer[len] = 0; return buffer; } /** Display an invalid tag error message. */ void InvalidTag(const TokenNode *tp, TokenType parent) { ParseError(tp, _("invalid tag in %s: %s"), GetTokenTypeName(parent), GetTokenName(tp)); } /** Display a parser error. */ void ParseError(const TokenNode *tp, const char *str, ...) { va_list ap; static const char *FILE_MESSAGE = "%s[%d]"; char *msg; va_start(ap, str); if(tp) { msg = Allocate(strlen(FILE_MESSAGE) + strlen(tp->fileName) + 1); sprintf(msg, FILE_MESSAGE, tp->fileName, tp->line); } else { msg = CopyString(_("configuration error")); } WarningVA(msg, str, ap); Release(msg); va_end(ap); } jwm-2.1.0+svn579/src/font.h0000644000000000000000000000303111710374021013753 0ustar rootroot/** * @file font.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the font functions. * */ #ifndef FONT_H #define FONT_H #include "color.h" /** Enumeration of different components that use fonts. */ typedef enum { FONT_BORDER, FONT_MENU, FONT_TASK, FONT_POPUP, FONT_CLOCK, FONT_TRAY, FONT_TRAYBUTTON, FONT_PAGER, FONT_COUNT } FontType; void InitializeFonts(); void StartupFonts(); void ShutdownFonts(); void DestroyFonts(); /** Set the font to use for a component. * @param type The font component. * @param value The font to use. */ void SetFont(FontType type, const char *value); /** Render a string. * @param d The drawable on which to render the string. * @param font The font to use. * @param color The text color to use. * @param x The x-coordinate at which to render. * @param y The y-coordinate at which to render. * @param width The maximum width allowed. * @param region A clip region (may be None). * @param str The string to render. */ void RenderString(Drawable d, FontType font, ColorType color, int x, int y, int width, Region region, const char *str); /** Get the width of a string. * @param type The font used to determine the width. * @param str The string whose width to get. * @return The width of the string in pixels. */ int GetStringWidth(FontType type, const char *str); /** Get the height of a string. * @param type The font used to determine the height. * @return The height in pixels. */ int GetStringHeight(FontType type); #endif /* FONT_H */ jwm-2.1.0+svn579/src/key.h0000644000000000000000000000355411710374021013607 0ustar rootroot/** * @file key.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the key binding functions. * */ #ifndef KEY_H #define KEY_H struct ClientNode; /** Enumeration of key binding types. */ typedef enum { KEY_NONE, KEY_UP, KEY_DOWN, KEY_RIGHT, KEY_LEFT, KEY_ESC, KEY_ENTER, KEY_NEXT, KEY_NEXTSTACK, KEY_PREV, KEY_PREVSTACK, KEY_CLOSE, KEY_MIN, KEY_MAX, KEY_SHADE, KEY_STICK, KEY_MOVE, KEY_RESIZE, KEY_ROOT, KEY_WIN, KEY_DESKTOP, KEY_RDESKTOP, KEY_LDESKTOP, KEY_UDESKTOP, KEY_DDESKTOP, KEY_SHOWDESK, KEY_SHOWTRAY, KEY_EXEC, KEY_RESTART, KEY_EXIT, KEY_FULLSCREEN } KeyType; void InitializeKeys(); void StartupKeys(); void ShutdownKeys(); void DestroyKeys(); /** Get the action to take from a key event. * @param event The event. */ KeyType GetKey(const XKeyEvent *event); /** Grab keys on a client window. * @param np The client. */ void GrabKeys(struct ClientNode *np); /** Insert a key binding. * @param key The key binding type. * @param modifiers The modifier mask. * @param stroke The key stroke (not needed if code given). * @param code The key code (not needed if stroke given). * @param command Extra parameter needed for some key binding types. */ void InsertBinding(KeyType key, const char *modifiers, const char *stroke, const char *code, const char *command); /** Run a command caused by a key binding. * @param event The event causing the command to be run. */ void RunKeyCommand(const XKeyEvent *event); /** Show a root menu caused by a key binding. * @param event The event that caused the menu to be shown. */ void ShowKeyMenu(const XKeyEvent *event); /** Validate key bindings. * This will log an error if an invalid key binding is found. * This is called after parsing the configuration file. */ void ValidateKeys(); #endif /* KEY_H */ jwm-2.1.0+svn579/src/client.c0000644000000000000000000010756211710374021014274 0ustar rootroot/** * @file client.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle client windows. * */ #include "jwm.h" #include "client.h" #include "clientlist.h" #include "main.h" #include "icon.h" #include "hint.h" #include "group.h" #include "tray.h" #include "confirm.h" #include "key.h" #include "cursor.h" #include "taskbar.h" #include "screen.h" #include "pager.h" #include "color.h" #include "error.h" #include "place.h" #include "event.h" static ClientNode *activeClient; static int clientCount; static void LoadFocus(); static void ReparentClient(ClientNode *np, char notOwner); static void MinimizeTransients(ClientNode *np); static void CheckShape(ClientNode *np); static void RestoreTransients(ClientNode *np, char raise); static void KillClientHandler(ClientNode *np); static unsigned int activeOpacity; static unsigned int maxInactiveOpacity; static unsigned int minInactiveOpacity; static unsigned int deltaInactiveOpacity; /** Initialize client data. */ void InitializeClients() { activeOpacity = (unsigned int)(1.0 * UINT_MAX); maxInactiveOpacity = (unsigned int)(0.9 * UINT_MAX); minInactiveOpacity = (unsigned int)(0.5 * UINT_MAX); deltaInactiveOpacity = (unsigned int)(0.1 * UINT_MAX); } /** Load windows that are already mapped. */ void StartupClients() { XWindowAttributes attr; Window rootReturn, parentReturn, *childrenReturn; unsigned int childrenCount; unsigned int x; clientCount = 0; activeClient = NULL; currentDesktop = 0; /* Clear out the client lists. */ for(x = 0; x < LAYER_COUNT; x++) { nodes[x] = NULL; nodeTail[x] = NULL; } /* Query client windows. */ JXQueryTree(display, rootWindow, &rootReturn, &parentReturn, &childrenReturn, &childrenCount); /* Add each client. */ for(x = 0; x < childrenCount; x++) { if(JXGetWindowAttributes(display, childrenReturn[x], &attr)) { if(attr.override_redirect == False && attr.map_state == IsViewable) { AddClientWindow(childrenReturn[x], 1, 1); } } } JXFree(childrenReturn); LoadFocus(); UpdateTaskBar(); UpdatePager(); } /** Release client windows. */ void ShutdownClients() { int x; for(x = 0; x < LAYER_COUNT; x++) { while(nodeTail[x]) { RemoveClient(nodeTail[x]); } } } /** Destroy client data. */ void DestroyClients() { } /** Set the focus to the window currently under the mouse pointer. */ void LoadFocus() { ClientNode *np; Window rootReturn, childReturn; int rootx, rooty; int winx, winy; unsigned int mask; JXQueryPointer(display, rootWindow, &rootReturn, &childReturn, &rootx, &rooty, &winx, &winy, &mask); np = FindClientByWindow(childReturn); if(np) { FocusClient(np); } } /** Add a window to management. */ ClientNode *AddClientWindow(Window w, char alreadyMapped, char notOwner) { XWindowAttributes attr; ClientNode *np; Assert(w != None); /* Get window attributes. */ if(JXGetWindowAttributes(display, w, &attr) == 0) { return NULL; } /* Determine if we should care about this window. */ if(attr.override_redirect == True) { return NULL; } if(attr.class == InputOnly) { return NULL; } /* Prepare a client node for this window. */ np = Allocate(sizeof(ClientNode)); memset(np, 0, sizeof(ClientNode)); np->window = w; np->owner = None; np->state.desktop = currentDesktop; np->controller = NULL; np->name = NULL; np->colormaps = NULL; np->x = attr.x; np->y = attr.y; np->width = attr.width; np->height = attr.height; np->cmap = attr.colormap; np->colormaps = NULL; np->state.status = STAT_NONE; np->state.layer = LAYER_NORMAL; np->state.border = BORDER_DEFAULT; np->borderAction = BA_NONE; ReadClientProtocols(np); if(!notOwner) { np->state.border = BORDER_OUTLINE | BORDER_TITLE | BORDER_MOVE; np->state.status |= STAT_WMDIALOG | STAT_STICKY; } /* We now know the layer, so insert */ np->prev = NULL; np->next = nodes[np->state.layer]; if(np->next) { np->next->prev = np; } else { nodeTail[np->state.layer] = np; } nodes[np->state.layer] = np; LoadIcon(np); ApplyGroups(np); SetDefaultCursor(np->window); ReparentClient(np, notOwner); PlaceClient(np, alreadyMapped); /* If one of these fails we are SOL, so who cares. */ XSaveContext(display, np->window, clientContext, (void*)np); XSaveContext(display, np->parent, frameContext, (void*)np); if(np->state.status & STAT_MAPPED) { JXMapWindow(display, np->window); JXMapWindow(display, np->parent); } DrawBorder(np, NULL); AddClientToTaskBar(np); if(!alreadyMapped) { RaiseClient(np); } ++clientCount; if(np->state.status & STAT_STICKY) { SetCardinalAtom(np->window, ATOM_NET_WM_DESKTOP, ~0UL); } else { SetCardinalAtom(np->window, ATOM_NET_WM_DESKTOP, np->state.desktop); } /* Shade the client if requested. */ if(np->state.status & STAT_SHADED) { ShadeClient(np); } /* Minimize the client if requested. */ if(np->state.status & STAT_MINIMIZED) { np->state.status &= ~STAT_MINIMIZED; MinimizeClient(np); } /* Maximize the client if requested. */ if(np->state.status & (STAT_HMAX | STAT_VMAX)) { np->state.status &= ~(STAT_HMAX | STAT_VMAX); MaximizeClientDefault(np); } /* Make sure we're still in sync */ WriteState(np); SendConfigureEvent(np); /* Hide the client if we're not on the right desktop. */ if(np->state.desktop != currentDesktop && !(np->state.status & STAT_STICKY)) { HideClient(np); } ReadClientStrut(np); /* Focus transients if their parent has focus. */ if(np->owner != None) { if(activeClient && np->owner == activeClient->window) { FocusClient(np); } } /* Make the client fullscreen if requested. */ if(np->state.status & STAT_FULLSCREEN) { np->state.status &= ~STAT_FULLSCREEN; SetClientFullScreen(np, 1); } return np; } /** Minimize a client window and all of its transients. */ void MinimizeClient(ClientNode *np) { Assert(np); if(focusModel == FOCUS_CLICK && np == activeClient) { FocusNextStacked(np); } MinimizeTransients(np); UpdateTaskBar(); UpdatePager(); } /** Minimize all transients as well as the specified client. */ void MinimizeTransients(ClientNode *np) { ClientNode *tp; int x; Assert(np); /* A minimized client can't be active. */ if(activeClient == np) { activeClient = NULL; np->state.status &= ~STAT_ACTIVE; } /* Unmap the window and update its state. */ if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { JXUnmapWindow(display, np->window); JXUnmapWindow(display, np->parent); } np->state.status |= STAT_MINIMIZED; np->state.status &= ~STAT_MAPPED; WriteState(np); /* Minimize transient windows. */ for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp->owner == np->window && (tp->state.status & (STAT_MAPPED | STAT_SHADED)) && !(tp->state.status & STAT_MINIMIZED)) { MinimizeTransients(tp); } } } } /** Shade a client. */ void ShadeClient(ClientNode *np) { int north, south, east, west; Assert(np); if(!(np->state.border & BORDER_TITLE)) { return; } GetBorderSize(np, &north, &south, &east, &west); ResetRoundedRectWindow(np->parent); if(np->state.status & STAT_MAPPED) { JXUnmapWindow(display, np->window); } np->state.status |= STAT_SHADED; np->state.status &= ~STAT_MINIMIZED; np->state.status &= ~STAT_SDESKTOP; np->state.status &= ~STAT_MAPPED; ShapeRoundedRectWindow(np->parent, np->width + west + east, north); JXResizeWindow(display, np->parent, np->width + east + west, north); WriteState(np); #ifdef USE_SHAPE if(np->state.status & STAT_SHAPE) { SetShape(np); } #endif } /** Unshade a client. */ void UnshadeClient(ClientNode *np) { int north, south, east, west; Assert(np); if(!(np->state.border & BORDER_TITLE)) { return; } if(np->state.status & STAT_SHADED) { JXMapWindow(display, np->window); np->state.status |= STAT_MAPPED; np->state.status &= ~STAT_SHADED; } GetBorderSize(np, &north, &south, &east, &west); ResetRoundedRectWindow(np->parent); ShapeRoundedRectWindow(np->parent, np->width + west + east, np->height + north + south); JXResizeWindow(display, np->parent, np->width + west + east, np->height + north + south); WriteState(np); #ifdef USE_SHAPE if(np->state.status & STAT_SHAPE) { SetShape(np); } #endif RefocusClient(); RestackClients(); } /** Set a client's state to withdrawn. */ void SetClientWithdrawn(ClientNode *np) { Assert(np); if(activeClient == np) { activeClient = NULL; np->state.status &= ~STAT_ACTIVE; FocusNextStacked(np); } if(np->state.status & STAT_MAPPED) { JXUnmapWindow(display, np->window); JXUnmapWindow(display, np->parent); } else if(np->state.status & STAT_SHADED) { JXUnmapWindow(display, np->parent); } np->state.status &= ~STAT_SHADED; np->state.status &= ~STAT_MAPPED; np->state.status &= ~STAT_MINIMIZED; np->state.status &= ~STAT_SDESKTOP; WriteState(np); UpdateTaskBar(); UpdatePager(); } /** Restore a window with its transients (helper method). */ void RestoreTransients(ClientNode *np, char raise) { ClientNode *tp; int x; Assert(np); /* Restore this window. */ if(!(np->state.status & STAT_MAPPED)) { if(np->state.status & STAT_SHADED) { JXMapWindow(display, np->parent); } else { JXMapWindow(display, np->window); JXMapWindow(display, np->parent); np->state.status |= STAT_MAPPED; } } np->state.status &= ~STAT_MINIMIZED; np->state.status &= ~STAT_SDESKTOP; WriteState(np); /* Restore transient windows. */ for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp->owner == np->window && !(tp->state.status & (STAT_MAPPED | STAT_SHADED)) && (tp->state.status & STAT_MINIMIZED)) { RestoreTransients(tp, raise); } } } if(raise) { RaiseClient(np); } } /** Restore a client window and its transients. */ void RestoreClient(ClientNode *np, char raise) { Assert(np); RestoreTransients(np, raise); RestackClients(); UpdateTaskBar(); UpdatePager(); } /** Set the client layer. This will affect transients. */ void SetClientLayer(ClientNode *np, unsigned int layer) { ClientNode *tp, *next; int x; Assert(np); if(JUNLIKELY(layer > LAYER_TOP)) { Warning(_("Client %s requested an invalid layer: %d"), np->name, layer); return; } if(np->state.layer != layer) { /* Loop through all clients so we get transients. */ for(x = 0; x < LAYER_COUNT; x++) { tp = nodes[x]; while(tp) { if(tp == np || tp->owner == np->window) { next = tp->next; /* Remove from the old node list */ if(next) { next->prev = tp->prev; } else { nodeTail[tp->state.layer] = tp->prev; } if(tp->prev) { tp->prev->next = next; } else { nodes[tp->state.layer] = next; } /* Insert into the new node list */ tp->prev = NULL; tp->next = nodes[layer]; if(nodes[layer]) { nodes[layer]->prev = tp; } else { nodeTail[layer] = tp; } nodes[layer] = tp; /* Set the new layer */ tp->state.layer = layer; /* Make sure we continue on the correct layer list. */ tp = next; } else { tp = tp->next; } } } RestackClients(); } } /** Set a client's sticky status. This will update transients. */ void SetClientSticky(ClientNode *np, char isSticky) { ClientNode *tp; int x; char old; Assert(np); /* Get the old sticky status. */ if(np->state.status & STAT_STICKY) { old = 1; } else { old = 0; } if(isSticky && !old) { /* Change from non-sticky to sticky. */ for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp == np || tp->owner == np->window) { tp->state.status |= STAT_STICKY; SetCardinalAtom(tp->window, ATOM_NET_WM_DESKTOP, ~0UL); WriteState(tp); } } } } else if(!isSticky && old) { /* Change from sticky to non-sticky. */ for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp == np || tp->owner == np->window) { tp->state.status &= ~STAT_STICKY; WriteState(tp); } } } /* Since this client is no longer sticky, we need to assign * a desktop. Here we use the current desktop. * Note that SetClientDesktop updates transients (which is good). */ SetClientDesktop(np, currentDesktop); } } /** Set a client's desktop. This will update transients. */ void SetClientDesktop(ClientNode *np, unsigned int desktop) { ClientNode *tp; int x; Assert(np); if(JUNLIKELY(desktop >= desktopWidth * desktopHeight)) { return; } if(!(np->state.status & STAT_STICKY)) { for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp == np || tp->owner == np->window) { tp->state.desktop = desktop; if(desktop == currentDesktop) { ShowClient(tp); } else { HideClient(tp); } SetCardinalAtom(tp->window, ATOM_NET_WM_DESKTOP, tp->state.desktop); } } } UpdatePager(); UpdateTaskBar(); } } /** Hide a client without unmapping. This will not update transients. */ void HideClient(ClientNode *np) { Assert(np); if(activeClient == np) { activeClient = NULL; } np->state.status |= STAT_HIDDEN; if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { JXUnmapWindow(display, np->parent); } } /** Show a hidden client. This will not update transients. */ void ShowClient(ClientNode *np) { Assert(np); if(np->state.status & STAT_HIDDEN) { np->state.status &= ~STAT_HIDDEN; if(np->state.status & (STAT_MAPPED | STAT_SHADED)) { JXMapWindow(display, np->parent); if(np->state.status & STAT_ACTIVE) { FocusClient(np); } } } } /** Maximize a client window. */ void MaximizeClient(ClientNode *np, char horiz, char vert) { int north, south, east, west; Assert(np); /* We don't want to mess with full screen clients. */ if(np->state.status & STAT_FULLSCREEN) { return; } if(np->state.status & STAT_SHADED) { UnshadeClient(np); } ResetRoundedRectWindow(np->parent); GetBorderSize(np, &north, &south, &east, &west); if(np->state.status & (STAT_HMAX | STAT_VMAX)) { np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; np->state.status &= ~(STAT_HMAX | STAT_VMAX); } else { PlaceMaximizedClient(np, horiz, vert); } ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->window, west, north, np->width, np->height); WriteState(np); SendConfigureEvent(np); } /** Maximize a client using its default maximize settings. */ void MaximizeClientDefault(ClientNode *np) { int hmax, vmax; Assert(np); hmax = (np->state.border & BORDER_MAX_H) ? 1 : 0; vmax = (np->state.border & BORDER_MAX_V) ? 1 : 0; MaximizeClient(np, hmax, vmax); } /** Set a client's full screen state. */ void SetClientFullScreen(ClientNode *np, char fullScreen) { XEvent event; int north, south, east, west; BoundingBox box; const ScreenType *sp; Assert(np); /* Make sure there's something to do. */ if(!fullScreen == !(np->state.status & STAT_FULLSCREEN)) { return; } if(np->state.status & STAT_SHADED) { UnshadeClient(np); } ResetRoundedRectWindow(np->parent); if(fullScreen) { np->state.status |= STAT_FULLSCREEN; np->state.border &= ~BORDER_MOVE; SetClientLayer(np, LAYER_TOP); np->oldx = np->x; np->oldy = np->y; np->oldWidth = np->width; np->oldHeight = np->height; sp = GetCurrentScreen(np->x, np->y); GetScreenBounds(sp, &box); GetBorderSize(np, &north, &south, &east, &west); box.x += west; box.y += north; box.width -= east + west; box.height -= north + south; np->x = box.x; np->y = box.y; np->width = box.width; np->height = box.height; ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->window, west, north, np->width, np->height); } else { np->state.status &= ~STAT_FULLSCREEN; np->state.border |= BORDER_MOVE; np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; GetBorderSize(np, &north, &south, &east, &west); ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->window, west, north, np->width, np->height); event.type = MapRequest; event.xmaprequest.send_event = True; event.xmaprequest.display = display; event.xmaprequest.parent = np->parent; event.xmaprequest.window = np->window; JXSendEvent(display, rootWindow, False, SubstructureRedirectMask, &event); SetClientLayer(np, LAYER_NORMAL); } WriteState(np); SendConfigureEvent(np); } /** Set the active client. */ void FocusClient(ClientNode *np) { ClientProtocolType protocols; Assert(np); if(np->state.status & STAT_HIDDEN) { return; } if(activeClient != np || !(np->state.status & STAT_ACTIVE)) { if(activeClient) { activeClient->state.status &= ~STAT_ACTIVE; DrawBorder(activeClient, NULL); } np->state.status |= STAT_ACTIVE; activeClient = np; DrawBorder(np, NULL); UpdatePager(); UpdateTaskBar(); } if(np->state.status & STAT_MAPPED) { UpdateClientColormap(np); SetWindowAtom(rootWindow, ATOM_NET_ACTIVE_WINDOW, np->window); protocols = ReadWMProtocols(np->window); JXSetInputFocus(display, np->window, RevertToPointerRoot, eventTime); if(protocols & PROT_TAKE_FOCUS) { SendClientMessage(np->window, ATOM_WM_PROTOCOLS, ATOM_WM_TAKE_FOCUS); } } else { JXSetInputFocus(display, rootWindow, RevertToPointerRoot, eventTime); } } /** Refocus the active client (if there is one). */ void RefocusClient() { if(activeClient) { FocusClient(activeClient); } } /** Send a delete message to a client. */ void DeleteClient(ClientNode *np) { ClientProtocolType protocols; Assert(np); protocols = ReadWMProtocols(np->window); if(protocols & PROT_DELETE) { SendClientMessage(np->window, ATOM_WM_PROTOCOLS, ATOM_WM_DELETE_WINDOW); } else { KillClient(np); } } /** Callback to kill a client after a confirm dialog. */ void KillClientHandler(ClientNode *np) { Assert(np); if(np == activeClient) { FocusNextStacked(np); } JXGrabServer(display); JXSync(display, False); JXKillClient(display, np->window); JXSync(display, True); JXUngrabServer(display); RemoveClient(np); } /** Kill a client window. */ void KillClient(ClientNode *np) { Assert(np); ShowConfirmDialog(np, KillClientHandler, _("Kill this window?"), _("This may cause data to be lost!"), NULL); } /** Raise the client. This will affect transients. */ void RaiseClient(ClientNode *np) { ClientNode *tp, *next; int x; Assert(np); if(nodes[np->state.layer] != np) { /* Raise the window */ Assert(np->prev); np->prev->next = np->next; if(np->next) { np->next->prev = np->prev; } else { nodeTail[np->state.layer] = np->prev; } np->next = nodes[np->state.layer]; nodes[np->state.layer]->prev = np; np->prev = NULL; nodes[np->state.layer] = np; /* Place any transient windows on top of the owner */ for(x = 0; x < LAYER_COUNT; x++) { for(tp = nodes[x]; tp; tp = tp->next) { if(tp->owner == np->window && tp->prev) { next = tp->next; tp->prev->next = tp->next; if(tp->next) { tp->next->prev = tp->prev; } else { nodeTail[tp->state.layer] = tp->prev; } tp->next = nodes[tp->state.layer]; nodes[tp->state.layer]->prev = tp; tp->prev = NULL; nodes[tp->state.layer] = tp; tp = next; } /* tp will be tp->next if the above code is executed. */ /* Thus, if it is NULL, we are done with this layer. */ if(!tp) { break; } } } RestackClients(); } } /** Lower the client. This will not affect transients. */ void LowerClient(ClientNode *np) { ClientNode *tp; Assert(np); if(nodeTail[np->state.layer] != np) { Assert(np->next); /* Take the client out of the list. */ if(np->prev) { np->prev->next = np->next; } else { nodes[np->state.layer] = np->next; } np->next->prev = np->prev; /* Place the client at the end of the list. */ tp = nodeTail[np->state.layer]; nodeTail[np->state.layer] = np; tp->next = np; np->prev = tp; np->next = NULL; RestackClients(); } } /** Restack the clients according the way we want them. */ void RestackClients() { TrayType *tp; ClientNode *np; unsigned int layer, index; int trayCount; Window *stack; unsigned int opacity; unsigned int temp; int isFirst; /* Allocate memory for restacking. */ trayCount = GetTrayCount(); stack = AllocateStack((clientCount + trayCount) * sizeof(Window)); /* Prepare the stacking array. */ index = 0; layer = LAYER_TOP; isFirst = 1; opacity = maxInactiveOpacity; for(;;) { for(np = nodes[layer]; np; np = np->next) { if((np->state.status & (STAT_MAPPED | STAT_SHADED)) && !(np->state.status & STAT_HIDDEN)) { stack[index++] = np->parent; if(isFirst) { if( !(np->state.status & STAT_OPACITY) && np->state.opacity != activeOpacity) { np->state.opacity = activeOpacity; WriteState(np); } isFirst = 0; } else if(!(np->state.status & STAT_OPACITY)) { if(np->state.opacity != opacity) { np->state.opacity = opacity; WriteState(np); } temp = opacity - deltaInactiveOpacity; if(temp < minInactiveOpacity || temp > opacity) { opacity = minInactiveOpacity; } else { opacity = temp; } } } } for(tp = GetTrays(); tp; tp = tp->next) { if(layer == tp->layer) { stack[index++] = tp->window; } } if(layer == 0) { break; } --layer; } JXRestackWindows(display, stack, index); ReleaseStack(stack); UpdateNetClientList(); } /** Send a client message to a window. */ void SendClientMessage(Window w, AtomType type, AtomType message) { XEvent event; int status; memset(&event, 0, sizeof(event)); event.xclient.type = ClientMessage; event.xclient.window = w; event.xclient.message_type = atoms[type]; event.xclient.format = 32; event.xclient.data.l[0] = atoms[message]; event.xclient.data.l[1] = eventTime; status = JXSendEvent(display, w, False, 0, &event); if(JUNLIKELY(status == False)) { Debug("SendClientMessage failed"); } } /** Set the border shape for windows using the shape extension. */ #ifdef USE_SHAPE void SetShape(ClientNode *np) { XRectangle rect[4]; int north, south, east, west; Assert(np); np->state.status |= STAT_SHAPE; GetBorderSize(np, &north, &south, &east, &west); /* Shaded windows are a special case. */ if(np->state.status & STAT_SHADED) { rect[0].x = 0; rect[0].y = 0; rect[0].width = np->width + east + west; rect[0].height = north + south; JXShapeCombineRectangles(display, np->parent, ShapeBounding, 0, 0, rect, 1, ShapeSet, Unsorted); return; } /* Add the shape of window. */ JXShapeCombineShape(display, np->parent, ShapeBounding, west, north, np->window, ShapeBounding, ShapeSet); /* Add the shape of the border. */ if(north > 0) { /* Top */ rect[0].x = 0; rect[0].y = 0; rect[0].width = np->width + east + west; rect[0].height = north; /* Left */ rect[1].x = 0; rect[1].y = 0; rect[1].width = west; rect[1].height = np->height + north + south; /* Right */ rect[2].x = np->width + east; rect[2].y = 0; rect[2].width = west; rect[2].height = np->height + north + south; /* Bottom */ rect[3].x = 0; rect[3].y = np->height + north; rect[3].width = np->width + east + west; rect[3].height = south; JXShapeCombineRectangles(display, np->parent, ShapeBounding, 0, 0, rect, 4, ShapeUnion, Unsorted); } } #endif /* USE_SHAPE */ /** Remove a client window from management. */ void RemoveClient(ClientNode *np) { ColormapNode *cp; Assert(np); Assert(np->window != None); Assert(np->parent != None); JXGrabServer(display); /* Remove this client from the client list */ if(np->next) { np->next->prev = np->prev; } else { nodeTail[np->state.layer] = np->prev; } if(np->prev) { np->prev->next = np->next; } else { nodes[np->state.layer] = np->next; } --clientCount; XDeleteContext(display, np->window, clientContext); XDeleteContext(display, np->parent, frameContext); /* Make sure this client isn't active */ if(activeClient == np && !shouldExit) { FocusNextStacked(np); } if(activeClient == np) { /* Must be the last client. */ SetWindowAtom(rootWindow, ATOM_NET_ACTIVE_WINDOW, None); activeClient = NULL; JXSetInputFocus(display, rootWindow, RevertToPointerRoot, eventTime); } /* If the window manager is exiting (ie, not the client), then * reparent etc. */ if(shouldExit && !(np->state.status & STAT_WMDIALOG)) { if(np->state.status & (STAT_VMAX | STAT_HMAX)) { np->x = np->oldx; np->y = np->oldy; np->width = np->oldWidth; np->height = np->oldHeight; JXMoveResizeWindow(display, np->window, np->x, np->y, np->width, np->height); } GravitateClient(np, 1); if(!(np->state.status & STAT_MAPPED) && (np->state.status & (STAT_MINIMIZED | STAT_SHADED))) { JXMapWindow(display, np->window); } JXUngrabButton(display, AnyButton, AnyModifier, np->window); JXReparentWindow(display, np->window, rootWindow, np->x, np->y); JXRemoveFromSaveSet(display, np->window); } /* Destroy the parent */ if(np->parent) { JXDestroyWindow(display, np->parent); } if(np->name) { JXFree(np->name); } if(np->instanceName) { JXFree(np->instanceName); } if(np->className) { JXFree(np->className); } RemoveClientFromTaskBar(np); RemoveClientStrut(np); UpdatePager(); while(np->colormaps) { cp = np->colormaps->next; Release(np->colormaps); np->colormaps = cp; } DestroyIcon(np->icon); Release(np); JXUngrabServer(display); RestackClients(); } /** Get the active client (possibly NULL). */ ClientNode *GetActiveClient() { return activeClient; } /** Find a client given a window (searches frame windows too). */ ClientNode *FindClientByWindow(Window w) { ClientNode *np; if(!XFindContext(display, w, clientContext, (void*)&np)) { return np; } else { return FindClientByParent(w); } } /** Find a client by its frame window. */ ClientNode *FindClientByParent(Window p) { ClientNode *np; if(!XFindContext(display, p, frameContext, (void*)&np)) { return np; } else { return NULL; } } /** Reparent a client window. */ void ReparentClient(ClientNode *np, char notOwner) { XSetWindowAttributes attr; int attrMask; int x, y, width, height; int north, south, east, west; Assert(np); if(notOwner) { JXAddToSaveSet(display, np->window); attr.event_mask = EnterWindowMask | ColormapChangeMask | PropertyChangeMask | KeyReleaseMask | StructureNotifyMask; attr.do_not_propagate_mask = NoEventMask; XChangeWindowAttributes(display, np->window, CWEventMask | CWDontPropagate, &attr); } JXGrabButton(display, AnyButton, AnyModifier, np->window, True, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None); GrabKeys(np); attrMask = 0; attrMask |= CWBackPixmap; attr.background_pixmap = ParentRelative; /* We can't use PointerMotionHint mask here since the exact location * of the mouse on the frame is important. */ attrMask |= CWEventMask; attr.event_mask = ButtonPressMask | ButtonReleaseMask | ExposureMask | PointerMotionMask | SubstructureRedirectMask | SubstructureNotifyMask | EnterWindowMask | LeaveWindowMask | KeyPressMask | KeyReleaseMask; attrMask |= CWDontPropagate; attr.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask; attrMask |= CWBackPixel; attr.background_pixel = colors[COLOR_TITLE_BG2]; x = np->x; y = np->y; width = np->width; height = np->height; GetBorderSize(np, &north, &south, &east, &west); x -= west; y -= north; width += east + west; height += north + south; /* Create the frame window. */ np->parent = JXCreateWindow(display, rootWindow, x, y, width, height, 0, rootDepth, InputOutput, rootVisual, attrMask, &attr); /* Update the window to get only the events we want. */ attrMask = CWDontPropagate; attr.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask | KeyPressMask | KeyReleaseMask; JXChangeWindowAttributes(display, np->window, attrMask, &attr); JXSetWindowBorderWidth(display, np->window, 0); /* Reparent the client window. */ JXReparentWindow(display, np->window, np->parent, west, north); #ifdef USE_SHAPE if(haveShape) { JXShapeSelectInput(display, np->window, ShapeNotifyMask); CheckShape(np); } #endif } /** Determine if a window uses the shape extension. */ #ifdef USE_SHAPE void CheckShape(ClientNode *np) { int xb, yb; int xc, yc; unsigned int wb, hb; unsigned int wc, hc; Bool boundingShaped, clipShaped; JXShapeQueryExtents(display, np->window, &boundingShaped, &xb, &yb, &wb, &hb, &clipShaped, &xc, &yc, &wc, &hc); if(boundingShaped == True) { SetShape(np); } } #endif /** Send a configure event to a client window. */ void SendConfigureEvent(ClientNode *np) { XConfigureEvent event; const ScreenType *sp; Assert(np); event.type = ConfigureNotify; event.event = np->window; event.window = np->window; if(np->state.status & STAT_FULLSCREEN) { sp = GetCurrentScreen(np->x, np->y); event.x = sp->x; event.y = sp->y; event.width = sp->width; event.height = sp->height; } else { event.x = np->x; event.y = np->y; event.width = np->width; event.height = np->height; } event.border_width = 0; event.above = None; event.override_redirect = False; JXSendEvent(display, np->window, False, StructureNotifyMask, (XEvent*)&event); } /** Update a window's colormap. * A call to this function indicates that the colormap(s) for the given * client changed. This will change the active colormap(s) if the given * client is active. */ void UpdateClientColormap(ClientNode *np) { XWindowAttributes attr; ColormapNode *cp; int wasInstalled; Assert(np); if(np == activeClient) { wasInstalled = 0; cp = np->colormaps; while(cp) { if(JXGetWindowAttributes(display, cp->window, &attr)) { if(attr.colormap != None) { if(attr.colormap == np->cmap) { wasInstalled = 1; } JXInstallColormap(display, attr.colormap); } } cp = cp->next; } if(!wasInstalled && np->cmap != None) { JXInstallColormap(display, np->cmap); } } } /** Set the opacity for active clients. */ void SetActiveClientOpacity(const char *str) { double temp; Assert(str); temp = atof(str); if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { Warning(_("invalid active client opacity: %s"), str); activeOpacity = UINT_MAX; } else { activeOpacity = (unsigned int)(1.0 * UINT_MAX); } } /** Set the opacity range for inactive clients. */ void SetInactiveClientOpacity(const char *str) { double temp; const char *str_u; const char *str_d; unsigned int first; unsigned int second; Assert(str); /* Reset in case there's a problem. */ maxInactiveOpacity = (unsigned int)(0.9 * UINT_MAX); minInactiveOpacity = (unsigned int)(0.5 * UINT_MAX); deltaInactiveOpacity = (unsigned int)(0.1 * UINT_MAX); /* Read the first (or only) bound of the range. */ temp = atof(str); if(JUNLIKELY(temp < 0.0 || temp > 1.0)) { Warning(_("invalid inactive client opacity: %s"), str); return; } first = (unsigned int)(temp * UINT_MAX); second = first; /* Check for a range. */ str_u = strchr(str, ':'); if(str_u) { /* A range was specified. */ temp = atof(str_u + 1); if(JUNLIKELY(temp < 0.0 || temp > 1.0)) { Warning(_("invalid inactive client opacity: %s"), str); return; } second = (unsigned int)(temp * UINT_MAX); /* Check for a delta. */ str_d = strchr(str_u + 1, ':'); if(str_d) { temp = atof(str_d + 1); if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { Warning(_("invalid inactive client opacity delta: %s"), str); return; } deltaInactiveOpacity = (unsigned int)(temp * UINT_MAX); } } /* Set the min/max opacities. */ if(first > second) { minInactiveOpacity = second; maxInactiveOpacity = first; } else { minInactiveOpacity = first; maxInactiveOpacity = second; } } jwm-2.1.0+svn579/src/outline.c0000644000000000000000000000267011710374021014467 0ustar rootroot/** * @file outline.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Outlines for moving and resizing client windows. * */ #include "jwm.h" #include "outline.h" #include "main.h" static GC outlineGC; static int lastX, lastY; static int lastWidth, lastHeight; static char outlineDrawn; /** Initialize outline data. */ void InitializeOutline() { } /** Startup outlines. */ void StartupOutline() { XGCValues gcValues; gcValues.function = GXinvert; gcValues.subwindow_mode = IncludeInferiors; gcValues.line_width = 2; outlineGC = JXCreateGC(display, rootWindow, GCFunction | GCSubwindowMode | GCLineWidth, &gcValues); outlineDrawn = 0; } /** Shutdown outlines. */ void ShutdownOutline() { JXFreeGC(display, outlineGC); } /** Release outline data. */ void DestroyOutline() { } /** Draw an outline. */ void DrawOutline(int x, int y, int width, int height) { if(!outlineDrawn) { JXSync(display, False); JXGrabServer(display); JXDrawRectangle(display, rootWindow, outlineGC, x, y, width, height); lastX = x; lastY = y; lastWidth = width; lastHeight = height; outlineDrawn = 1; } } /** Clear the last outline. */ void ClearOutline() { if(outlineDrawn) { JXDrawRectangle(display, rootWindow, outlineGC, lastX, lastY, lastWidth, lastHeight); outlineDrawn = 0; JXUngrabServer(display); JXSync(display, False); } } jwm-2.1.0+svn579/src/cursor.c0000644000000000000000000001467011710374021014330 0ustar rootroot/** * @file cursor.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Cursor functions. * */ #include "jwm.h" #include "cursor.h" #include "main.h" #include "error.h" static Cursor defaultCursor; static Cursor moveCursor; static Cursor northCursor; static Cursor southCursor; static Cursor eastCursor; static Cursor westCursor; static Cursor northEastCursor; static Cursor northWestCursor; static Cursor southEastCursor; static Cursor southWestCursor; static Cursor chooseCursor; static Cursor GetResizeCursor(BorderActionType action); static Cursor CreateCursor(unsigned int shape); static int mousex; static int mousey; /** Initialize cursor data. */ void InitializeCursors() { } /** Startup cursor support. */ void StartupCursors() { Window win1, win2; int winx, winy; unsigned int mask; defaultCursor = CreateCursor(XC_left_ptr); moveCursor = CreateCursor(XC_fleur); northCursor = CreateCursor(XC_top_side); southCursor = CreateCursor(XC_bottom_side); eastCursor = CreateCursor(XC_right_side); westCursor = CreateCursor(XC_left_side); northEastCursor = CreateCursor(XC_ur_angle); northWestCursor = CreateCursor(XC_ul_angle); southEastCursor = CreateCursor(XC_lr_angle); southWestCursor = CreateCursor(XC_ll_angle); chooseCursor = CreateCursor(XC_tcross); JXQueryPointer(display, rootWindow, &win1, &win2, &mousex, &mousey, &winx, &winy, &mask); } /** Create a cursor for the specified shape. */ Cursor CreateCursor(unsigned int shape) { return JXCreateFontCursor(display, shape); } /** Shutdown cursor support. */ void ShutdownCursors() { JXFreeCursor(display, defaultCursor); JXFreeCursor(display, moveCursor); JXFreeCursor(display, northCursor); JXFreeCursor(display, southCursor); JXFreeCursor(display, eastCursor); JXFreeCursor(display, westCursor); JXFreeCursor(display, northEastCursor); JXFreeCursor(display, northWestCursor); JXFreeCursor(display, southEastCursor); JXFreeCursor(display, southWestCursor); JXFreeCursor(display, chooseCursor); } /** Destroy cursor data. */ void DestroyCursors() { } /** Get the cursor for the specified location on the frame. */ Cursor GetFrameCursor(BorderActionType action) { switch(action & 0x0F) { case BA_RESIZE: return GetResizeCursor(action); case BA_CLOSE: break; case BA_MAXIMIZE: break; case BA_MINIMIZE: break; case BA_MOVE: break; default: break; } return defaultCursor; } /** Get the cursor for resizing on the specified frame location. */ Cursor GetResizeCursor(BorderActionType action) { if(action & BA_RESIZE_N) { if(action & BA_RESIZE_E) { return northEastCursor; } else if(action & BA_RESIZE_W) { return northWestCursor; } else { return northCursor; } } else if(action & BA_RESIZE_S) { if(action & BA_RESIZE_E) { return southEastCursor; } else if(action & BA_RESIZE_W) { return southWestCursor; } else { return southCursor; } } else { if(action & BA_RESIZE_E) { return eastCursor; } else { return westCursor; } } } /** Grab the mouse for resizing a window. */ int GrabMouseForResize(BorderActionType action) { Cursor cur; int result; cur = GetFrameCursor(action); result = JXGrabPointer(display, rootWindow, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, GrabModeAsync, GrabModeAsync, None, cur, CurrentTime); if(JLIKELY(result == GrabSuccess)) { return 1; } else { return 0; } } /** Grab the mouse for moving a window. */ int GrabMouseForMove() { int result; result = JXGrabPointer(display, rootWindow, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, GrabModeAsync, GrabModeAsync, None, moveCursor, CurrentTime); if(JLIKELY(result == GrabSuccess)) { return 1; } else { return 0; } } /** Grab the mouse. */ int GrabMouse(Window w) { int result; result = JXGrabPointer(display, w, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, GrabModeAsync, GrabModeAsync, None, defaultCursor, CurrentTime); if(JLIKELY(result == GrabSuccess)) { return 1; } else { return 0; } } /** Grab the mouse for choosing a window. */ int GrabMouseForChoose() { int result; result = JXGrabPointer(display, rootWindow, False, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, GrabModeAsync, GrabModeAsync, None, chooseCursor, CurrentTime); if(JLIKELY(result == GrabSuccess)) { return 1; } else { return 0; } } /** Set the default cursor for a window. */ void SetDefaultCursor(Window w) { JXDefineCursor(display, w, defaultCursor); } /** Move the mouse to the specified coordinates on a window. */ void MoveMouse(Window win, int x, int y) { Window win1, win2; int winx, winy; unsigned int mask; JXWarpPointer(display, None, win, 0, 0, 0, 0, x, y); JXQueryPointer(display, rootWindow, &win1, &win2, &mousex, &mousey, &winx, &winy, &mask); } /** Set the current mouse position. */ void SetMousePosition(int x, int y) { mousex = x; mousey = y; } /** Get the current mouse position. */ void GetMousePosition(int *x, int *y) { Assert(x); Assert(y); *x = mousex; *y = mousey; } /** Get the current mouse buttons pressed. */ unsigned int GetMouseMask() { Window win1, win2; int winx, winy; unsigned int mask; JXQueryPointer(display, rootWindow, &win1, &win2, &mousex, &mousey, &winx, &winy, &mask); return mask; } /** Set the double click speed to use. */ void SetDoubleClickSpeed(const char *str) { int speed; if(str) { speed = atoi(str); if(JUNLIKELY(speed < MIN_DOUBLE_CLICK_SPEED || speed > MAX_DOUBLE_CLICK_SPEED)) { Warning(_("invalid DoubleClickSpeed: %d"), speed); doubleClickSpeed = DEFAULT_DOUBLE_CLICK_SPEED; } else { doubleClickSpeed = speed; } } } /** Set the double click delta to use. */ void SetDoubleClickDelta(const char *str) { int delta; if(str) { delta = atoi(str); if(JUNLIKELY(delta < MIN_DOUBLE_CLICK_DELTA || delta > MAX_DOUBLE_CLICK_DELTA)) { Warning(_("invalid DoubleClickDelta: %d"), delta); doubleClickDelta = DEFAULT_DOUBLE_CLICK_DELTA; } else { doubleClickDelta = delta; } } } jwm-2.1.0+svn579/src/clientlist.c0000644000000000000000000001135711710374021015164 0ustar rootroot/** * @file clientlist.c * @author Joe Wingbermuehle * @date 2007 * * @brief Functions to manage lists of clients. * */ #include "jwm.h" #include "clientlist.h" #include "client.h" #include "main.h" #include "key.h" ClientNode *nodes[LAYER_COUNT]; ClientNode *nodeTail[LAYER_COUNT]; static Window *windowStack = NULL; /**< Image of the window stack. */ static int windowStackSize = 0; /**< Size of the image. */ static int windowStackCurrent = 0; /**< Current location in the image. */ /** Determine if a client is allowed focus. */ int ShouldFocus(const ClientNode *np) { /* Only display clients on the current desktop or clients that are sticky. */ if(np->state.desktop != currentDesktop && !(np->state.status & STAT_STICKY)) { return 0; } /* Don't display a client if it doesn't want to be displayed. */ if(np->state.status & STAT_NOLIST) { return 0; } /* Don't display a client on the tray if it has an owner. */ if(np->owner != None) { return 0; } if( !(np->state.status & STAT_MAPPED) && !(np->state.status & (STAT_MINIMIZED | STAT_SHADED))) { return 0; } return 1; } /** Start walking the window stack. */ void StartWindowStackWalk() { /* Get an image of the window stack. * Here we get the Window IDs rather than client pointers so * clients can be added/removed without disrupting the stack walk. */ ClientNode *np; int layer; int count; /* If we are already walking the stack, just return. */ if(windowStack != NULL) { return; } /* First determine how much space to allocate for windows. */ count = 0; for(layer = LAYER_TOP; layer >= LAYER_BOTTOM; layer--) { for(np = nodes[layer]; np; np = np->next) { if(ShouldFocus(np)) { ++count; } } } /* If there were no windows to walk, don't even start. */ if(count == 0) { return; } /* Allocate space for the windows. */ windowStack = Allocate(sizeof(Window) * count); /* Copy windows into the array. */ windowStackSize = 0; for(layer = LAYER_TOP; layer >= LAYER_BOTTOM; layer--) { for(np = nodes[layer]; np; np = np->next) { if(ShouldFocus(np)) { windowStack[windowStackSize++] = np->window; } } } Assert(windowStackSize == count); windowStackCurrent = 0; JXGrabKeyboard(display, rootWindow, False, GrabModeAsync, GrabModeAsync, CurrentTime); } /** Move to the next window in the window stack. */ void WalkWindowStack(int forward) { ClientNode *np; int x; if(windowStack != NULL) { /* Loop until we either raise a window or go through them all. */ for(x = 0; x < windowStackSize; x++) { /* Move to the next/previous window (wrap if needed). */ if(forward) { windowStackCurrent = (windowStackCurrent + 1) % windowStackSize; } else { if(windowStackCurrent == 0) { windowStackCurrent = windowStackSize; } --windowStackCurrent; } /* Look up the window. */ np = FindClientByWindow(windowStack[windowStackCurrent]); /* Skip this window if it no longer exists or is currently in * a state that doesn't allow focus. */ if(np == NULL || !ShouldFocus(np)) { continue; } /* Focus the window. We only raise the client when the * stack walk completes. */ FocusClient(np); break; } } } /** Stop walking the window stack. */ void StopWindowStackWalk() { ClientNode *np; /* Raise the selected window and free the window array. */ if(windowStack != NULL) { /* Look up the current window. */ np = FindClientByWindow(windowStack[windowStackCurrent]); if(np) { if(np->state.status & STAT_MINIMIZED) { RestoreClient(np, 1); } else { RaiseClient(np); } } Release(windowStack); windowStack = NULL; windowStackSize = 0; windowStackCurrent = 0; JXUngrabKeyboard(display, CurrentTime); } } /** Focus the next client in the stacking order. */ void FocusNextStacked(ClientNode *np) { int x; ClientNode *tp; Assert(np); for(tp = np->next; tp; tp = tp->next) { if((tp->state.status & (STAT_MAPPED | STAT_SHADED)) && !(tp->state.status & STAT_HIDDEN)) { FocusClient(tp); return; } } for(x = np->state.layer - 1; x >= LAYER_BOTTOM; x--) { for(tp = nodes[x]; tp; tp = tp->next) { if((tp->state.status & (STAT_MAPPED | STAT_SHADED)) && !(tp->state.status & STAT_HIDDEN)) { FocusClient(tp); return; } } } } jwm-2.1.0+svn579/src/border.c0000644000000000000000000005322311710374021014265 0ustar rootroot/** * Functions for dealing with window borders. * Copyright (C) 2004 Joe Wingbermuehle * */ #include "jwm.h" #include "border.h" #include "client.h" #include "clientlist.h" #include "color.h" #include "main.h" #include "icon.h" #include "font.h" #include "error.h" #include "misc.h" typedef unsigned char BorderPixmapDataType[32]; static BorderPixmapDataType bitmaps[BP_COUNT] = { /* Close */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x06, 0x70, 0x07, 0xE0, 0x03, 0xC0, 0x01, 0xE0, 0x03, 0x70, 0x07, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Minimize */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x07, 0xF8, 0x07, 0x00, 0x00, 0x00, 0x00 }, /* Maximize */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x1F, 0xF8, 0x1F, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0xF8, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, /* Maximize Active */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x0F, 0xC0, 0x0F, 0x00, 0x08, 0xF0, 0x0B, 0xF0, 0x0B, 0x10, 0x0A, 0x10, 0x0A, 0x10, 0x02, 0xF0, 0x03, 0x00, 0x00, 0x00, 0x00 } }; static Pixmap pixmaps[BP_COUNT]; static char *bmpFiles[BP_COUNT]; static Region borderRegion = NULL; static GC borderGC; #ifdef USE_SHAPE static Pixmap shapePixmap; static int shapePixmapWidth; static int shapePixmapHeight; static GC shapeGC; #endif static void DrawBorderHelper(const ClientNode *np, int drawIcon); static void DrawBorderButtons(const ClientNode *np, Pixmap canvas, GC gc); static int GetButtonCount(const ClientNode *np); /** Initialize non-server resources. */ void InitializeBorders() { memset(bmpFiles, 0, sizeof(bmpFiles)); } /** Initialize server resources. */ void StartupBorders() { XGCValues gcValues; unsigned long gcMask; int x, hotx, hoty; unsigned int bmpHeight, bmpWidth; int found; for(x = 0; x < BP_COUNT; x++) { found = bmpFiles[x] ? 1 : 0; if(found) { found = XReadBitmapFile(display, rootWindow, bmpFiles[x], &bmpWidth, &bmpHeight, &pixmaps[x], &hotx, &hoty) == BitmapSuccess; if(JUNLIKELY(!found)) { Warning(_("bitmap could not be loaded: %s"), bmpFiles[x]); } } if(!found) { pixmaps[x] = JXCreateBitmapFromData(display, rootWindow, (char*)bitmaps[x], 16, 16); } } gcMask = GCGraphicsExposures; gcValues.graphics_exposures = False; borderGC = JXCreateGC(display, rootWindow, gcMask, &gcValues); #if defined(USE_SHAPE) && defined(USE_XMU) shapePixmap = None; shapeGC = None; shapePixmapWidth = 0; shapePixmapHeight = 0; #endif } /** Release server resources. */ void ShutdownBorders() { int x; JXFreeGC(display, borderGC); for(x = 0; x < BP_COUNT; x++) { JXFreePixmap(display, pixmaps[x]); } #if defined(USE_SHAPE) && defined(USE_XMU) if(shapePixmap != None) { JXFreePixmap(display, shapePixmap); shapePixmap = None; } if(shapeGC != None) { JXFreeGC(display, shapeGC); shapeGC = None; } #endif } /** Release non-server resources. */ void DestroyBorders() { int x; for(x = 0; x < BP_COUNT; x++) { if(bmpFiles[x]) { Release(bmpFiles[x]); bmpFiles[x] = NULL; } } } /** Get the size of the icon to display on a window. */ int GetBorderIconSize() { return titleHeight - 6; } /** Determine the border action to take given coordinates. */ BorderActionType GetBorderActionType(const ClientNode *np, int x, int y) { int north, south, east, west; int offset; Assert(np); GetBorderSize(np, &north, &south, &east, &west); /* Check title bar actions. */ if(np->state.border & BORDER_TITLE) { /* Check buttons on the title bar. */ if(y >= south && y <= titleHeight) { /* Menu button. */ if(np->icon && np->width >= titleHeight) { if(x > 0 && x <= titleHeight) { return BA_MENU; } } /* Close button. */ offset = np->width + west + east - titleHeight; if((np->state.border & BORDER_CLOSE) && offset > titleHeight) { if(x > offset && x < offset + titleHeight) { return BA_CLOSE; } offset -= titleHeight; } /* Maximize button. */ if((np->state.border & BORDER_MAX) && offset > titleHeight) { if(x > offset && x < offset + titleHeight) { return BA_MAXIMIZE; } offset -= titleHeight; } /* Minimize button. */ if((np->state.border & BORDER_MIN) && offset > titleHeight) { if(x > offset && x < offset + titleHeight) { return BA_MINIMIZE; } } } /* Check for move. */ if(y >= south && y <= titleHeight) { if(x > 0 && x < np->width + east + west) { if(np->state.border & BORDER_MOVE) { return BA_MOVE; } else { return BA_NONE; } } } } /* Now we check resize actions. * There is no need to go further if resizing isn't allowed. */ if(!(np->state.border & BORDER_RESIZE)) { return BA_NONE; } /* Check south east/west and north east/west resizing. */ if(np->width >= titleHeight * 2 && np->height >= titleHeight * 2) { if(y > np->height + north - titleHeight) { if(x < titleHeight) { return BA_RESIZE_S | BA_RESIZE_W | BA_RESIZE; } else if(x > np->width + west - titleHeight) { return BA_RESIZE_S | BA_RESIZE_E | BA_RESIZE; } } else if(y < titleHeight) { if(x < titleHeight) { return BA_RESIZE_N | BA_RESIZE_W | BA_RESIZE; } else if(x > np->width + west - titleHeight) { return BA_RESIZE_N | BA_RESIZE_E | BA_RESIZE; } } } /* Check east, west, north, and south resizing. */ if(x <= west) { return BA_RESIZE_W | BA_RESIZE; } else if(x >= np->width + west) { return BA_RESIZE_E | BA_RESIZE; } else if(y >= np->height + north) { return BA_RESIZE_S | BA_RESIZE; } else if(y <= south) { return BA_RESIZE_N | BA_RESIZE; } else { return BA_NONE; } } /** Draw a client border. */ void DrawBorder(const ClientNode *np, const XExposeEvent *expose) { XRectangle rect; int drawIcon; int temp; Assert(np); /* Don't draw any more if we are shutting down. */ if(JUNLIKELY(shouldExit)) { return; } /* Must be either mapped or shaded to have a border. */ if(!(np->state.status & (STAT_MAPPED | STAT_SHADED))) { return; } /* Hidden and fullscreen windows don't get borders. */ if(np->state.status & (STAT_HIDDEN | STAT_FULLSCREEN)) { return; } /* Return if there is no border. */ if(!(np->state.border & (BORDER_TITLE | BORDER_OUTLINE))) { return; } if(expose) { /* An expose event caused this draw. * Only draw what needs to be drawn to reduce flicker. */ /* Create the region to use if needed. */ if(!borderRegion) { borderRegion = XCreateRegion(); } /* Add the exposed area to the region. */ rect.x = (short)expose->x; rect.y = (short)expose->y; rect.width = (unsigned short)expose->width; rect.height = (unsigned short)expose->height; XUnionRectWithRegion(&rect, borderRegion, borderRegion); /* We return now if there are more expose events coming. */ if(expose->count) { return; } /* Determine if the icon should be redrawn. This is needed * since icons need a separate GC for applying shape masks. * Note that if the icon were naively redrawn, icons with * alpha channels would acquire artifacts since the area under * them would not be cleared. So if any part of the icon needs * to be redrawn, we clear the area and redraw the whole icon. */ drawIcon = 0; if(np->icon && (np->state.border & BORDER_TITLE)) { temp = GetBorderIconSize(); rect.x = 6; rect.y = (short)((titleHeight - temp) / 2); rect.width = (unsigned short)temp; rect.height = (unsigned short)temp; if(XRectInRegion(borderRegion, rect.x, rect.y, rect.width, rect.height) != RectangleOut) { drawIcon = 1; XUnionRectWithRegion(&rect, borderRegion, borderRegion); } } /* Time to redraw the border. Set the clip mask. */ XSetRegion(display, borderGC, borderRegion); } else { /* An expose event did not occur. Redraw everything. */ drawIcon = 1; XSetClipMask(display, borderGC, None); } /* Do the actual drawing. */ DrawBorderHelper(np, drawIcon); /* We no longer need the region, release it. */ if(expose) { XDestroyRegion(borderRegion); borderRegion = NULL; } } /** Helper method for drawing borders. */ void DrawBorderHelper(const ClientNode *np, int drawIcon) { ColorType borderTextColor; long titleColor1, titleColor2; long outlineColor; int north, south, east, west; unsigned int width, height; int iconSize; int buttonCount, titleWidth; Pixmap canvas; GC gc; Assert(np); iconSize = GetBorderIconSize(); GetBorderSize(np, &north, &south, &east, &west); width = np->width + east + west; height = np->height + north + south; /* Determine the colors and gradients to use. */ if(np->state.status & STAT_ACTIVE) { borderTextColor = COLOR_TITLE_ACTIVE_FG; titleColor1 = colors[COLOR_TITLE_ACTIVE_BG1]; titleColor2 = colors[COLOR_TITLE_ACTIVE_BG2]; outlineColor = colors[COLOR_BORDER_ACTIVE_LINE]; } else { borderTextColor = COLOR_TITLE_FG; titleColor1 = colors[COLOR_TITLE_BG1]; titleColor2 = colors[COLOR_TITLE_BG2]; outlineColor = colors[COLOR_BORDER_LINE]; } canvas = np->parent; gc = borderGC; /* Shape window corners */ if(np->state.status & STAT_SHADED) { ShapeRoundedRectWindow(np->parent, width, north); } else { ShapeRoundedRectWindow(np->parent, width, height); } /* Set the window background color (to reduce flickering). */ JXSetWindowBackground(display, canvas, titleColor2); /* Draw the outside border (clear the window with the right color). */ JXSetForeground(display, gc, titleColor2); JXFillRectangle(display, canvas, gc, 0, 0, width, height); /* Determine how many pixels may be used for the title. */ buttonCount = GetButtonCount(np); titleWidth = width; titleWidth -= titleHeight * buttonCount; titleWidth -= iconSize + 7 + 6; /* Draw the top part (either a title or north border. */ if(np->state.border & BORDER_TITLE) { /* Draw a title bar. */ DrawHorizontalGradient(canvas, gc, titleColor1, titleColor2, 1, 1, width - 2, titleHeight - 2); /* Draw the icon. */ if(np->icon && np->width >= titleHeight && drawIcon) { PutIcon(np->icon, canvas, 6, (titleHeight - iconSize) / 2, iconSize, iconSize); } if(np->name && np->name[0] && titleWidth > 0) { RenderString(canvas, FONT_BORDER, borderTextColor, iconSize + 6 + 4, (titleHeight - GetStringHeight(FONT_BORDER)) / 2, titleWidth, borderRegion, np->name); } } /* Window outline. */ JXSetForeground(display, gc, outlineColor); #ifdef USE_SHAPE if(np->state.status & STAT_SHADED) { DrawRoundedRectangle(canvas, gc, 0, 0, width - 1, north - 1, CORNER_RADIUS); } else { DrawRoundedRectangle(canvas, gc, 0, 0, width - 1, height - 1, CORNER_RADIUS); } #else if(np->state.status & STAT_SHADED) { JXDrawRectangle(display, canvas, gc, 0, 0, width - 1, north - 1); } else { JXDrawRectangle(display, canvas, gc, 0, 0, width - 1, height - 1); } #endif DrawBorderButtons(np, canvas, gc); } /** Determine the number of buttons to be displayed for a client. */ int GetButtonCount(const ClientNode *np) { int north, south, east, west; int count; int offset; if(!(np->state.border & BORDER_TITLE)) { return 0; } GetBorderSize(np, &north, &south, &east, &west); offset = np->width + east + west - titleHeight; if(offset <= titleHeight) { return 0; } count = 0; if(np->state.border & BORDER_CLOSE) { offset -= titleHeight; ++count; if(offset <= titleHeight) { return count; } } if(np->state.border & BORDER_MAX) { offset -= titleHeight; ++count; if(offset <= titleHeight) { return count; } } if(np->state.border & BORDER_MIN) { ++count; } return count; } /** Draw the buttons on a client frame. */ void DrawBorderButtons(const ClientNode *np, Pixmap canvas, GC gc) { Pixmap pixmap; long color; int offset; int yoffset; int north, south, east, west; Assert(np); if(!(np->state.border & BORDER_TITLE)) { return; } GetBorderSize(np, &north, &south, &east, &west); offset = np->width + east + west - titleHeight; if(offset <= titleHeight) { return; } yoffset = titleHeight / 2 - 16 / 2; /* Determine the colors to use. */ if(np->state.status & STAT_ACTIVE) { color = colors[COLOR_TITLE_ACTIVE_FG]; } else { color = colors[COLOR_TITLE_FG]; } /* Close button. */ if(np->state.border & BORDER_CLOSE) { pixmap = pixmaps[BP_CLOSE]; JXSetForeground(display, gc, color); JXSetClipMask(display, gc, pixmap); JXSetClipOrigin(display, gc, offset + yoffset, yoffset); JXFillRectangle(display, canvas, gc, offset + yoffset, yoffset, 16, 16); JXSetClipMask(display, gc, None); offset -= titleHeight; if(offset <= titleHeight) { return; } } /* Maximize button. */ if(np->state.border & BORDER_MAX) { if(np->state.status & (STAT_HMAX | STAT_VMAX)) { pixmap = pixmaps[BP_MAXIMIZE_ACTIVE]; } else { pixmap = pixmaps[BP_MAXIMIZE]; } JXSetForeground(display, gc, color); JXSetClipMask(display, gc, pixmap); JXSetClipOrigin(display, gc, offset + yoffset, yoffset); JXFillRectangle(display, canvas, gc, offset + yoffset, yoffset, 16, 16); JXSetClipMask(display, gc, None); offset -= titleHeight; if(offset <= titleHeight) { return; } } /* Minimize button. */ if(np->state.border & BORDER_MIN) { pixmap = pixmaps[BP_MINIMIZE]; JXSetForeground(display, gc, color); JXSetClipMask(display, gc, pixmap); JXSetClipOrigin(display, gc, offset + yoffset, yoffset); JXFillRectangle(display, canvas, gc, offset + yoffset, yoffset, 16, 16); JXSetClipMask(display, gc, None); } } /** Redraw the borders on the current desktop. * This should be done after loading clients since the stacking order * may cause borders on the current desktop to become visible after moving * clients to their assigned desktops. */ void ExposeCurrentDesktop() { ClientNode *np; int layer; for(layer = 0; layer < LAYER_COUNT; layer++) { for(np = nodes[layer]; np; np = np->next) { if(!(np->state.status & (STAT_HIDDEN | STAT_MINIMIZED))) { DrawBorder(np, NULL); } } } } /** Get the size of the borders for a client. */ void GetBorderSize(const ClientNode *np, int *north, int *south, int *east, int *west) { Assert(np); Assert(north); Assert(south); Assert(east); Assert(west); /* Full screen is a special case. */ if(np->state.status & STAT_FULLSCREEN) { *north = 0; *south = 0; *east = 0; *west = 0; return; } if(np->state.border & BORDER_OUTLINE) { *north = borderWidth; *south = borderWidth; *east = borderWidth; *west = borderWidth; } else { *north = 0; *south = 0; *east = 0; *west = 0; } if(np->state.border & BORDER_TITLE) { *north = titleHeight; } if(np->state.status & STAT_SHADED) { *south = 0; } } /** Set the size of window borders. */ void SetBorderWidth(const char *str) { int width; if(JLIKELY(str)) { width = atoi(str); if(JUNLIKELY(width < MIN_BORDER_WIDTH || width > MAX_BORDER_WIDTH)) { borderWidth = DEFAULT_BORDER_WIDTH; Warning(_("invalid border width specified: %d"), width); } else { borderWidth = width; } } } /** Set the height of the title bar. */ void SetTitleHeight(const char *str) { int height; if(JLIKELY(str)) { height = atoi(str); if(JUNLIKELY(height < MIN_TITLE_HEIGHT || height > MAX_TITLE_HEIGHT)) { titleHeight = DEFAULT_TITLE_HEIGHT; Warning(_("invalid title height specified: %d"), height); } else { titleHeight = height; } } } /** Set the bitmask to use for a button. */ void SetButtonMask(BorderPixmapType pt, const char *filename) { if(bmpFiles[pt]) { Release(bmpFiles[pt]); bmpFiles[pt] = NULL; } if(JLIKELY(filename)) { bmpFiles[pt] = CopyString(filename); ExpandPath(&bmpFiles[pt]); } } /** Draw a rounded rectangle. */ void DrawRoundedRectangle(Drawable d, GC gc, int x, int y, int width, int height, int radius) { #ifdef USE_XMU XmuDrawRoundedRectangle(display, d, gc, x, y, width, height, radius, radius); #else XSegment segments[4]; XArc arcs[4]; segments[0].x1 = x + radius; segments[0].y1 = y; segments[0].x2 = x + width - radius; segments[0].y2 = y; segments[1].x1 = x + radius; segments[1].y1 = y + height; segments[1].x2 = x + width - radius; segments[1].y2 = y + height; segments[2].x1 = x; segments[2].y1 = y + radius; segments[2].x2 = x; segments[2].y2 = y + height - radius; segments[3].x1 = x + width; segments[3].y1 = y + radius; segments[3].x2 = x + width; segments[3].y2 = y + height - radius; JXDrawSegments(display, d, gc, segments, 4); arcs[0].x = x; arcs[0].y = y; arcs[0].width = radius * 2; arcs[0].height = radius * 2; arcs[0].angle1 = 90 * 64; arcs[0].angle2 = 90 * 64; arcs[1].x = x + width - radius * 2; arcs[1].y = y; arcs[1].width = radius * 2; arcs[1].height = radius * 2; arcs[1].angle1 = 0 * 64; arcs[1].angle2 = 90 * 64; arcs[2].x = x; arcs[2].y = y + height - radius * 2; arcs[2].width = radius * 2; arcs[2].height = radius * 2; arcs[2].angle1 = 180 * 64; arcs[2].angle2 = 90 * 64; arcs[3].x = x + width - radius * 2; arcs[3].y = y + height - radius * 2; arcs[3].width = radius * 2; arcs[3].height = radius * 2; arcs[3].angle1 = 270 * 64; arcs[3].angle2 = 90 * 64; JXDrawArcs(display, d, gc, arcs, 4); #endif } /** Fill a rounded rectangle. */ void FillRoundedRectangle(Drawable d, GC gc, int x, int y, int width, int height, int radius) { #ifdef USE_XMU XmuFillRoundedRectangle(display, d, gc, x, y, width, height, radius, radius); #else XRectangle rects[3]; XArc arcs[4]; rects[0].x = x + radius; rects[0].y = y; rects[0].width = width - radius * 2; rects[0].height = radius; rects[1].x = x; rects[1].y = radius; rects[1].width = width; rects[1].height = height - radius * 2; rects[2].x = x + radius; rects[2].y = y + height - radius; rects[2].width = width - radius * 2; rects[2].height = radius; JXFillRectangles(display, d, gc, rects, 3); arcs[0].x = x; arcs[0].y = y; arcs[0].width = radius * 2; arcs[0].height = radius * 2; arcs[0].angle1 = 90 * 64; arcs[0].angle2 = 90 * 64; arcs[1].x = x + width - radius * 2 - 1; arcs[1].y = y; arcs[1].width = radius * 2; arcs[1].height = radius * 2; arcs[1].angle1 = 0 * 64; arcs[1].angle2 = 90 * 64; arcs[2].x = x; arcs[2].y = y + height - radius * 2 - 1; arcs[2].width = radius * 2; arcs[2].height = radius * 2; arcs[2].angle1 = 180 * 64; arcs[2].angle2 = 90 * 64; arcs[3].x = x + width - radius * 2 - 1; arcs[3].y = y + height - radius * 2 -1; arcs[3].width = radius * 2; arcs[3].height = radius * 2; arcs[3].angle1 = 270 * 64; arcs[3].angle2 = 90 * 64; JXFillArcs(display, d, gc, arcs, 4); #endif } /** Clear the shape mask of a window. */ void ResetRoundedRectWindow(Window w) { #ifdef USE_SHAPE JXShapeCombineMask(display, w, ShapeBounding, 0, 0, None, ShapeSet); #endif } /** Set the shape mask on a window to give a rounded boarder. */ void ShapeRoundedRectWindow(Window w, int width, int height) { #ifdef USE_SHAPE if(width > shapePixmapWidth || height > shapePixmapHeight) { if(shapePixmap != None) { JXFreePixmap(display, shapePixmap); } shapePixmap = JXCreatePixmap(display, w, width, height, 1); if(shapeGC == None) { shapeGC = JXCreateGC(display, shapePixmap, 0, NULL); } shapePixmapWidth = width; shapePixmapHeight = height; } JXSetForeground(display, shapeGC, 0); JXFillRectangle(display, shapePixmap, shapeGC, 0, 0, width + 1, height + 1); /* Corner bound radius -1 to allow slightly better outline drawing */ JXSetForeground(display, shapeGC, 1); FillRoundedRectangle(shapePixmap, shapeGC, 0, 0, width, height, CORNER_RADIUS - 1); JXShapeCombineMask(display, w, ShapeBounding, 0, 0, shapePixmap, ShapeSet); #endif } jwm-2.1.0+svn579/src/swallow.h0000644000000000000000000000210311710374021014474 0ustar rootroot/** * @file swallow.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Swallow tray component. * */ #ifndef SWALLOW_H #define SWALLOW_H /*@{*/ void InitializeSwallow(); void StartupSwallow(); void ShutdownSwallow(); void DestroySwallow(); /*@}*/ /** Create a swallowed application tray component. * @param name The name of the application to swallow. * @param command The command used to start the swallowed application. * @param width The width to use (0 for default). * @param height the height to use (0 for default). */ struct TrayComponentType *CreateSwallow( const char *name, const char *command, int width, int height); /** Determine if a map event was for a window that should be swallowed. * @param event The map event. * @return 1 if this window should be swallowed, 0 if not. */ int CheckSwallowMap(const XMapEvent *event); /** Process an event on a swallowed window. * @param event The event to process. * @return 1 if the event was for a swallowed window, 0 if not. */ int ProcessSwallowEvent(const XEvent *event); #endif /* SWALLOW_H */ jwm-2.1.0+svn579/src/match.h0000644000000000000000000000063611710374021014111 0ustar rootroot/** * @file match.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Expression matching. * */ #ifndef MATCH_H #define MATCH_H /** Check if an expression matches a pattern. * @param pattern The pattern to match against. * @param expression The expression to check. * @return 1 if there is a match, 0 otherwise. */ int Match(const char *pattern, const char *expression); #endif /* MATCH_H */ jwm-2.1.0+svn579/src/button.h0000644000000000000000000000313411710374021014324 0ustar rootroot/** * @file button.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header file for button functions. * */ #ifndef BUTTON_H #define BUTTON_H #include "font.h" struct IconNode; /** Button types. */ typedef enum { BUTTON_LABEL, /**< Label. */ BUTTON_MENU, /**< Menu item. */ BUTTON_MENU_ACTIVE, /**< Active menu item. */ BUTTON_TASK, /**< Item in the task list. */ BUTTON_TASK_ACTIVE /**< Active item in the task list. */ } ButtonType; /** Alignment of content in a button. */ typedef enum { ALIGN_LEFT, /**< Left align. */ ALIGN_CENTER /**< Center align. */ } AlignmentType; /** Data used for drawing a button. */ typedef struct { ButtonType type; /**< The type of button to draw. */ Drawable drawable; /**< The place to put the button. */ GC gc; /**< Graphics context used for drawing. */ FontType font; /**< The font for button text. */ AlignmentType alignment; /**< Alignment of the button content. */ int x, y; /**< The coordinates to render the button. */ int width, height; /**< The size of the button. */ struct IconNode *icon; /**< Icon used in the button. */ const char *text; /**< Text used in the button. */ } ButtonNode; /** Draw a button. * @param bp The button to draw. */ void DrawButton(ButtonNode *bp); /** Reset the contents of a ButtonNode structure. * @param bp The structure to reset. * @param d The drawable to use. * @param g The graphics context to use. */ void ResetButton(ButtonNode *bp, Drawable d, GC g); #endif /* BUTTON_H */ jwm-2.1.0+svn579/src/desktop.h0000644000000000000000000000325211710374021014463 0ustar rootroot/** * @file desktop.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the desktop management functions. * */ #ifndef DESKTOP_H #define DESKTOP_H struct MenuType; extern int showingDesktop; /*@{*/ void InitializeDesktops(); void StartupDesktops(); void ShutdownDesktops(); void DestroyDesktops(); /*@}*/ /** Switch to the desktop to the right. */ int RightDesktop(); /** Switch to the desktop to the left. */ int LeftDesktop(); /** Switch to the desktop above. */ int AboveDesktop(); /** Switch to the desktop below. */ int BelowDesktop(); /** Switch to a specific desktop. * @param desktop The desktop to show (0 based). */ void ChangeDesktop(unsigned int desktop); /** Toggle the "show desktop" state. * This will either minimize or restore all items on the current desktop. */ void ShowDesktop(); /** Create a menu containing a list of desktops. * @param mask A bit mask of desktops to highlight. * @return A menu containing all the desktops. */ struct Menu *CreateDesktopMenu(unsigned int mask); /** Set the number of desktops. * This is called before startup. * @param width ASCII representation of number of horizontal desktops. * @param height ASCII representation of the number of vertical desktops. */ void SetDesktopCount(const char *width, const char *height); /** Set the name of a desktop. * This is called before startup. * @param desktop The desktop to name (0 based). * @param str The name to assign. */ void SetDesktopName(unsigned int desktop, const char *str); /** Get the name of a desktop. * @param desktop The desktop (0 based). * @return The name of the desktop. */ const char *GetDesktopName(unsigned int desktop); #endif jwm-2.1.0+svn579/src/misc.h0000644000000000000000000000145011710374021013743 0ustar rootroot/** * @file misc.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Miscellaneous functions and macros. * */ #ifndef MISC_H #define MISC_H /** Return the minimum of two values. */ #define Min( x, y ) ( (x) > (y) ? (y) : (x) ) /** Return the maximum of two values. */ #define Max( x, y ) ( (x) > (y) ? (x) : (y) ) /** Perform shell-like macro path expansion. * @param path The path to expand (possibly reallocated). */ void ExpandPath(char **path); /** Trim leading and trailing whitespace from a string. * @param str The string to trim. */ void Trim(char *str); /** Copy a string. * Note that NULL is accepted. When provided NULL, NULL will be returned. * @param str The string to copy. * @return A copy of the string. */ char *CopyString(const char *str); #endif /* MISC_H */ jwm-2.1.0+svn579/src/resize.h0000644000000000000000000000207411710374021014314 0ustar rootroot/** * @file resize.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Header for client window resize functions. * */ #ifndef RESIZE_H #define RESIZE_H #include "border.h" struct ClientNode; /** Enumeration of possible resize modes. */ typedef enum { RESIZE_OPAQUE, /**< Show window contents while resizing. */ RESIZE_OUTLINE /**< Show an outline while resizing. */ } ResizeModeType; /** Resize a client window. * @param np The client to resize. * @param action The location on the border where the move should take place. * @param startx The starting mouse x-coordinate (window relative). * @param starty The starting mouse y-coordinate (window relative). */ void ResizeClient(struct ClientNode *np, BorderActionType action, int startx, int starty); /** Resize a client window using the keyboard (mouse optional). * @param np The client to resize. */ void ResizeClientKeyboard(struct ClientNode *np); /** Set the resize mode to use. * @param mode The resize mode to use. */ void SetResizeMode(ResizeModeType mode); #endif /* RESIZE_H */ jwm-2.1.0+svn579/src/color.h0000644000000000000000000000575311710374021014140 0ustar rootroot/** * @file color.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the color functions. * */ #ifndef COLOR_H #define COLOR_H /** Enumeration of colors used for various JWM components. */ typedef enum { COLOR_TITLE_FG, COLOR_TITLE_ACTIVE_FG, COLOR_TITLE_BG1, COLOR_TITLE_BG2, COLOR_TITLE_ACTIVE_BG1, COLOR_TITLE_ACTIVE_BG2, COLOR_BORDER_LINE, COLOR_BORDER_ACTIVE_LINE, COLOR_TRAY_BG, COLOR_TRAY_FG, COLOR_TASK_FG, COLOR_TASK_BG1, COLOR_TASK_BG2, COLOR_TASK_ACTIVE_FG, COLOR_TASK_ACTIVE_BG1, COLOR_TASK_ACTIVE_BG2, COLOR_PAGER_BG, COLOR_PAGER_FG, COLOR_PAGER_ACTIVE_BG, COLOR_PAGER_ACTIVE_FG, COLOR_PAGER_OUTLINE, COLOR_PAGER_TEXT, COLOR_MENU_BG, COLOR_MENU_FG, COLOR_MENU_ACTIVE_BG1, COLOR_MENU_ACTIVE_BG2, COLOR_MENU_ACTIVE_FG, COLOR_MENU_ACTIVE_OL, /* Colors below this point are calculated from the above values. */ COLOR_TRAY_UP, COLOR_TRAY_DOWN, COLOR_TASK_UP, COLOR_TASK_DOWN, COLOR_TASK_ACTIVE_UP, COLOR_TASK_ACTIVE_DOWN, COLOR_MENU_UP, COLOR_MENU_DOWN, COLOR_MENU_ACTIVE_UP, COLOR_MENU_ACTIVE_DOWN, COLOR_POPUP_BG, COLOR_POPUP_FG, COLOR_POPUP_OUTLINE, COLOR_TRAYBUTTON_BG, COLOR_TRAYBUTTON_FG, COLOR_CLOCK_BG, COLOR_CLOCK_FG, COLOR_COUNT } ColorType; extern unsigned long colors[COLOR_COUNT]; /*@{*/ void InitializeColors(); void StartupColors(); void ShutdownColors(); void DestroyColors(); /*@}*/ /** Set the color to use for a component. * @param c The component whose color to set. * @param value The color to use. */ void SetColor(ColorType c, const char *value); /** Parse a color. * @param value The color name or hex value. * @param color The color return value (with pixel and components filled). * @return 1 on success, 0 on failure. */ int ParseColor(const char *value, XColor *color); /** Get the color pixel from red, green, and blue values. * @param c The structure containing the rgb values and the pixel value. */ void GetColor(XColor *c); /** Get the RGB components from a color pixel. * This does the reverse of GetColor. * @param c The structure containing the rgb values and pixel value. */ void GetColorFromPixel(XColor *c); /** Get an RGB pixel value from RGB components. * This is used when loading images from external sources. When doing * this we need to know the color components even if we are using a * color map so we just pretend to have a linear RGB colormap. * This prevents calls to XQueryColor. * @param c The structure containing the rgb values and pixel value. */ void GetColorIndex(XColor *c); /** Extract the RGB components from a RGB linear pixel value. * This does the reverse of GetColorIndex. * @param c The structure containing the rgb values and pixel value. */ void GetColorFromIndex(XColor *c); #ifdef USE_XFT /** Get an XFT color. * @param type The color whose XFT color to get. * @return The XFT color. */ XftColor *GetXftColor(ColorType type); #endif #endif /* COLOR_H */ jwm-2.1.0+svn579/src/timing.h0000644000000000000000000000227411710374021014304 0ustar rootroot/** * @file timing.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Timing functions. * */ #ifndef TIMING_H #define TIMING_H /** Initializer for TimeType to indicate that it is not set. */ #define ZERO_TIME { 0, 0 } /** Structure to represent time since January 1, 1970 GMT. */ typedef struct TimeType { unsigned long seconds; /**< Seconds. */ int ms; /**< Milliseconds. */ } TimeType; /** Get the current time. * @param t The TimeType to fill. */ void GetCurrentTime(TimeType *t); /** Get the difference between two times. * Note that the times must be normalized. * @param t1 The first time. * @param t2 The second time. * @return The difference in milliseconds (maximum of 60000 ms). */ unsigned long GetTimeDifference(const TimeType *t1, const TimeType *t2); /** Get a time string. * Note that the string returned is a static value and should not be * deleted. Therefore, this function is not thread safe. * @param format The format to use for the string. * @param zone The timezone in tzset() format to use (defaults to local) * @return The time string. */ const char *GetTimeString(const char *format, const char *zone); #endif /* TIMING_H */ jwm-2.1.0+svn579/src/match.c0000644000000000000000000000113111710374021014073 0ustar rootroot/** * @file match.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Expression matching. * */ #include "jwm.h" #include "match.h" #include #include /** Determine if expression matches pattern. */ int Match(const char *pattern, const char *expression) { regex_t re; regmatch_t rm; int rc; if(!pattern && !expression) { return 1; } else if(!pattern || !expression) { return 0; } if(regcomp(&re, pattern, REG_EXTENDED) != 0) { return 0; } rc = regexec(&re, expression, 0, &rm, 0); regfree(&re); return rc == 0 ? 1 : 0; } jwm-2.1.0+svn579/src/misc.c0000644000000000000000000000677611710374021013756 0ustar rootroot/** * @file misc.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Miscellaneous functions and macros. * */ #include "jwm.h" #include "misc.h" static int IsSpace(char ch); static int IsSymbolic(char ch); static char *GetSymbolName(const char *str); static void ReplaceSymbol(char **str, const char *name, const char *value); /** Determine if a character is a space character. */ int IsSpace(char ch) { switch(ch) { case ' ': case '\t': case '\n': case '\r': return 1; default: return 0; } } /** Determine if a character is a valid for a shell variable. */ int IsSymbolic(char ch) { if(ch >= 'A' && ch <= 'Z') { return 1; } else if(ch >= 'a' && ch <= 'z') { return 1; } else if(ch >= '0' && ch <= '9') { return 1; } else if(ch == '_') { return 1; } else { return 0; } } /** Get the name of a shell variable (returns a copy). */ char *GetSymbolName(const char *str) { char *temp; int stop; if(*str == '$') { temp = Allocate(2); temp[0] = '$'; temp[1] = 0; } else { for(stop = 0; IsSymbolic(str[stop]); stop++); temp = Allocate(stop + 1); memcpy(temp, str, stop); temp[stop] = 0; } return temp; } /** Replace "name" with "value" in str (reallocates if needed). */ void ReplaceSymbol(char **str, const char *name, const char *value) { char *temp; int strLength; int nameLength; int valueLength; int x; Assert(str); Assert(name); strLength = strlen(*str); nameLength = strlen(name) + 1; if(value) { valueLength = strlen(value); } else { valueLength = 0; } if(valueLength > nameLength) { temp = Allocate(strLength - nameLength + valueLength + 1); strcpy(temp, *str); Release(*str); *str = temp; } temp = strstr(*str, name); Assert(temp); --temp; /* Account for the "$" */ if(nameLength > valueLength) { /* Move left */ for(x = 0; temp[x]; x++) { temp[x] = temp[x + nameLength - valueLength]; } temp[x] = temp[x + nameLength - valueLength]; } else if(nameLength < valueLength) { /* Move right */ for(x = strlen(temp); x >= 0; x--) { temp[x + valueLength - nameLength] = temp[x]; } } if(value) { memcpy(temp, value, valueLength); } } /** Perform shell-like macro path expansion. */ void ExpandPath(char **path) { char *name; char *value; int x; Assert(path); for(x = 0; (*path)[x]; x++) { if((*path)[x] == '$') { name = GetSymbolName(*path + x + 1); value = getenv(name); ReplaceSymbol(path, name, value); Release(name); if(value) { x += strlen(value) - 1; } } } } /** Trim leading and trailing whitespace from a string. */ void Trim(char *str) { int length; int start; int x; Assert(str); length = strlen(str); /* Determine how much to cut off of the left. */ for(start = 0; IsSpace(str[start]); start++); /* Trim the left. */ if(start > 0) { length -= start; for(x = 0; x < length + 1; x++) { str[x] = str[x + start]; } } /* Trim the right. */ while(length > 0 && IsSpace(str[length - 1])) { --length; str[length] = 0; } } /** Copy a string. */ char *CopyString(const char *str) { char *temp; int len; if(!str) { return NULL; } len = strlen(str) + 1; temp = Allocate(len); memcpy(temp, str, len); return temp; } jwm-2.1.0+svn579/src/popup.c0000644000000000000000000001160511710374021014151 0ustar rootroot/** * @file popup.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for displaying popup windows. * */ #include "jwm.h" #include "popup.h" #include "main.h" #include "color.h" #include "font.h" #include "screen.h" #include "cursor.h" #include "error.h" #include "timing.h" #include "misc.h" #include "border.h" #define DEFAULT_POPUP_DELAY 600 typedef struct PopupType { int isActive; int x, y; /* The coordinates of the upper-left corner of the popup. */ int mx, my; /* The mouse position when the popup was created. */ int width, height; char *text; Window window; } PopupType; static PopupType popup; static int popupEnabled; int popupDelay; static void DrawPopup(); /** Initialize popup data. */ void InitializePopup() { popupDelay = DEFAULT_POPUP_DELAY; popupEnabled = 1; } /** Startup popups. */ void StartupPopup() { popup.isActive = 0; popup.text = NULL; popup.window = None; } /** Shutdown popups. */ void ShutdownPopup() { if(popup.text) { Release(popup.text); popup.text = NULL; } if(popup.window != None) { JXDestroyWindow(display, popup.window); popup.window = None; } } /** Destroy popup data. */ void DestroyPopup() { } /** Show a popup window. */ void ShowPopup(int x, int y, const char *text) { unsigned long attrMask; XSetWindowAttributes attr; const ScreenType *sp; Assert(text); if(!popupEnabled) { return; } if(popup.text) { Release(popup.text); popup.text = NULL; } if(text[0] == 0) { return; } popup.text = CopyString(text); popup.height = GetStringHeight(FONT_POPUP) + 2; popup.width = GetStringWidth(FONT_POPUP, popup.text) + 9; sp = GetCurrentScreen(x, y); if(popup.width > sp->width) { popup.width = sp->width; } popup.x = x; popup.y = y - popup.height - 2; if(popup.width + popup.x >= sp->width) { popup.x = sp->width - popup.width - 2; } if(popup.height + popup.y >= sp->height) { popup.y = sp->height - popup.height - 2; } if (popup.x < 2) { popup.x = 2; } if (popup.y < 2) { popup.y = 2; } if(popup.window == None) { attrMask = 0; attrMask |= CWEventMask; attr.event_mask = ExposureMask | PointerMotionMask | PointerMotionHintMask; attrMask |= CWSaveUnder; attr.save_under = True; attrMask |= CWBackPixel; attr.background_pixel = colors[COLOR_POPUP_BG]; attrMask |= CWBorderPixel; attr.border_pixel = colors[COLOR_POPUP_OUTLINE]; attrMask |= CWDontPropagate; attr.do_not_propagate_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask; popup.window = JXCreateWindow(display, rootWindow, popup.x, popup.y, popup.width, popup.height, 1, CopyFromParent, InputOutput, CopyFromParent, attrMask, &attr); } else { JXMoveResizeWindow(display, popup.window, popup.x, popup.y, popup.width, popup.height); } ResetRoundedRectWindow(popup.window); ShapeRoundedRectWindow(popup.window, popup.width, popup.height); popup.mx = x; popup.my = y; if(!popup.isActive) { JXMapRaised(display, popup.window); popup.isActive = 1; } else { DrawPopup(); } } /** Set whether popups show be shown. */ void SetPopupEnabled(int e) { popupEnabled = e; } /** Set the popup delay. */ void SetPopupDelay(const char *str) { int temp; if(JUNLIKELY(str == NULL)) { return; } temp = atoi(str); if(JUNLIKELY(temp < 0)) { Warning(_("invalid popup delay specified: %s"), str); } else { popupDelay = temp; } } /** Signal popup (this is used to hide popups after awhile). */ void SignalPopup(const TimeType *now, int x, int y) { if(popup.isActive) { if(abs(popup.mx - x) > 2 || abs(popup.my - y) > 2) { JXUnmapWindow(display, popup.window); popup.isActive = 0; } } } /** Process an event on a popup window. */ int ProcessPopupEvent(const XEvent *event) { if(popup.isActive && event->xany.window == popup.window) { if(event->type == Expose) { DrawPopup(); return 1; } else if(event->type == MotionNotify) { JXUnmapWindow(display, popup.window); popup.isActive = 0; return 1; } } return 0; } /** Draw the popup window. */ void DrawPopup() { Assert(popup.isActive); JXClearWindow(display, popup.window); #ifdef USE_SHAPE JXSetForeground(display, rootGC, colors[COLOR_POPUP_OUTLINE]); DrawRoundedRectangle(popup.window, rootGC, 0, 0, popup.width - 1, popup.height - 1, CORNER_RADIUS); #endif RenderString(popup.window, FONT_POPUP, COLOR_POPUP_FG, 4, 1, popup.width, NULL, popup.text); } jwm-2.1.0+svn579/src/group.c0000644000000000000000000001573411710374021014151 0ustar rootroot/** * @file group.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for handling window groups. * */ #include "jwm.h" #include "group.h" #include "client.h" #include "icon.h" #include "error.h" #include "match.h" #include "desktop.h" #include "main.h" #include "misc.h" /** What part of the window to match. */ typedef enum { MATCH_NAME, /**< Match the window name. */ MATCH_CLASS /**< Match the window class. */ } MatchType; /** List of match patterns for a group. */ typedef struct PatternListType { char *pattern; MatchType match; struct PatternListType *next; } PatternListType; /** List of options for a group. */ typedef struct OptionListType { OptionType option; char *value; struct OptionListType *next; } OptionListType; /** List of groups. */ typedef struct GroupType { PatternListType *patterns; OptionListType *options; struct GroupType *next; } GroupType; static GroupType *groups = NULL; static void ReleasePatternList(PatternListType *lp); static void ReleaseOptionList(OptionListType *lp); static void AddPattern(PatternListType **lp, const char *pattern, MatchType match); static void ApplyGroup(const GroupType *gp, ClientNode *np); /** Initialize group data. */ void InitializeGroups() { } /** Startup group support. */ void StartupGroups() { } /** Shutdown group support. */ void ShutdownGroups() { } /** Destroy group data. */ void DestroyGroups() { GroupType *gp; while(groups) { gp = groups->next; ReleasePatternList(groups->patterns); ReleaseOptionList(groups->options); Release(groups); groups = gp; } } /** Release a group pattern list. */ void ReleasePatternList(PatternListType *lp) { PatternListType *tp; while(lp) { tp = lp->next; Release(lp->pattern); Release(lp); lp = tp; } } /** Release a group option list. */ void ReleaseOptionList(OptionListType *lp) { OptionListType *tp; while(lp) { tp = lp->next; if(lp->value) { Release(lp->value); } Release(lp); lp = tp; } } /** Create an empty group. */ GroupType *CreateGroup() { GroupType *tp; tp = Allocate(sizeof(GroupType)); tp->patterns = NULL; tp->options = NULL; tp->next = groups; groups = tp; return tp; } /** Add a window class to a group. */ void AddGroupClass(GroupType *gp, const char *pattern) { Assert(gp); if(JLIKELY(pattern)) { AddPattern(&gp->patterns, pattern, MATCH_CLASS); } else { Warning(_("invalid group class")); } } /** Add a window name to a group. */ void AddGroupName(GroupType *gp, const char *pattern) { Assert(gp); if(JLIKELY(pattern)) { AddPattern(&gp->patterns, pattern, MATCH_NAME); } else { Warning(_("invalid group name")); } } /** Add a pattern to a pattern list. */ void AddPattern(PatternListType **lp, const char *pattern, MatchType match) { PatternListType *tp; Assert(lp); Assert(pattern); tp = Allocate(sizeof(PatternListType)); tp->next = *lp; *lp = tp; tp->pattern = CopyString(pattern); tp->match = match; } /** Add an option to a group. */ void AddGroupOption(GroupType *gp, OptionType option) { OptionListType *lp; lp = Allocate(sizeof(OptionListType)); lp->option = option; lp->value = NULL; lp->next = gp->options; gp->options = lp; } /** Add an option (with value) to a group. */ void AddGroupOptionValue(GroupType *gp, OptionType option, const char *value) { OptionListType *lp; Assert(value); lp = Allocate(sizeof(OptionListType)); lp->option = option; lp->value = CopyString(value); lp->next = gp->options; gp->options = lp; } /** Apply groups to a client. */ void ApplyGroups(ClientNode *np) { PatternListType *lp; GroupType *gp; char hasClass; char hasName; char matchesClass; char matchesName; Assert(np); for(gp = groups; gp; gp = gp->next) { hasClass = 0; hasName = 0; matchesClass = 0; matchesName = 0; for(lp = gp->patterns; lp; lp = lp->next) { if(lp->match == MATCH_CLASS) { if(Match(lp->pattern, np->className)) { matchesClass = 1; } hasClass = 1; } else if(lp->match == MATCH_NAME) { if(Match(lp->pattern, np->instanceName)) { matchesName = 1; } hasName = 1; } else { Debug("invalid match in ApplyGroups: %d", lp->match); } } if(hasName == matchesName && hasClass == matchesClass) { ApplyGroup(gp, np); } } } /** Apply a group to a client. */ void ApplyGroup(const GroupType *gp, ClientNode *np) { OptionListType *lp; unsigned int temp; double tempf; Assert(gp); Assert(np); for(lp = gp->options; lp; lp = lp->next) { switch(lp->option) { case OPTION_STICKY: np->state.status |= STAT_STICKY; break; case OPTION_NOLIST: np->state.status |= STAT_NOLIST; break; case OPTION_BORDER: np->state.border |= BORDER_OUTLINE; break; case OPTION_NOBORDER: np->state.border &= ~BORDER_OUTLINE; break; case OPTION_TITLE: np->state.border |= BORDER_TITLE; break; case OPTION_NOTITLE: np->state.border &= ~BORDER_TITLE; break; case OPTION_LAYER: temp = atoi(lp->value); if(JLIKELY(temp <= LAYER_COUNT)) { SetClientLayer(np, temp); } else { Warning(_("invalid group layer: %s"), lp->value); } break; case OPTION_DESKTOP: temp = atoi(lp->value); if(JLIKELY(temp >= 1 && temp <= desktopCount)) { np->state.desktop = temp - 1; } else { Warning(_("invalid group desktop: %s"), lp->value); } break; case OPTION_ICON: DestroyIcon(np->icon); np->icon = LoadNamedIcon(lp->value); break; case OPTION_PIGNORE: np->state.status |= STAT_PIGNORE; break; case OPTION_MAXIMIZED: np->state.status |= STAT_HMAX | STAT_VMAX; break; case OPTION_MINIMIZED: np->state.status |= STAT_MINIMIZED; break; case OPTION_SHADED: np->state.status |= STAT_SHADED; break; case OPTION_OPACITY: tempf = atof(lp->value); if(JLIKELY(tempf > 0.0 && tempf <= 1.0)) { np->state.opacity = (unsigned int)(tempf * UINT_MAX); np->state.status |= STAT_OPACITY; } else { Warning(_("invalid group opacity: %s"), lp->value); } break; case OPTION_MAX_V: np->state.border &= ~BORDER_MAX_H; break; case OPTION_MAX_H: np->state.border &= ~BORDER_MAX_V; break; case OPTION_NOFOCUS: np->state.status |= STAT_NOFOCUS; break; default: Debug("invalid option: %d", lp->option); break; } } } jwm-2.1.0+svn579/src/icon.h0000644000000000000000000000555111710374021013746 0ustar rootroot/** * @file icon.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header file for icon functions. * */ #ifndef ICON_H #define ICON_H struct ClientNode; /** Structure to hold a scaled icon. */ typedef struct ScaledIconNode { int width; /**< The scaled width of the icon. */ int height; /**< The scaled height of the icon. */ Pixmap image; Pixmap mask; #ifdef USE_XRENDER Picture imagePicture; Picture alphaPicture; #endif struct ScaledIconNode *next; } ScaledIconNode; /** Structure to hold an icon. */ typedef struct IconNode { char *name; /**< The name of the icon. */ struct ImageNode *image; /**< The image data. */ struct ScaledIconNode *nodes; /**< Scaled versions of the icon. */ int useRender; /**< 1 if render can be used. */ struct IconNode *next; /**< The next icon in the list. */ struct IconNode *prev; /**< The previous icon in the list. */ } IconNode; extern IconNode emptyIcon; #ifdef USE_ICONS /*@{*/ void InitializeIcons(); void StartupIcons(); void ShutdownIcons(); void DestroyIcons(); /*@}*/ /** Add an icon path. * This adds a path to the list of icon search paths. * @param path The icon path to add. */ void AddIconPath(char *path); /** Render an icon. * This will scale an icon if necessary to fit the requested size. The * aspect ratio of the icon is preserved. * @param icon The icon to render. * @param d The drawable on which to place the icon. * @param x The x offset on the drawable to render the icon. * @param y The y offset on the drawable to render the icon. * @param width The width of the icon to display. * @param height The height of the icon to display. */ void PutIcon(IconNode *icon, Drawable d, int x, int y, int width, int height); /** Load an icon for a client. * @param np The client. */ void LoadIcon(struct ClientNode *np); /** Load an icon. * @param name The name of the icon to load. * @return A pointer to the icon (NULL if not found). */ IconNode *LoadNamedIcon(const char *name); /** Destroy an icon. * @param icon The icon to destroy. */ void DestroyIcon(IconNode *icon); /** Create and initialize a new icon structure. * @return The new icon structure. */ IconNode *CreateIcon(); #else #define ICON_DUMMY_FUNCTION 0 #define InitializeIcons() ICON_DUMMY_FUNCTION #define StartupIcons() ICON_DUMMY_FUNCTION #define ShutdownIcons() ICON_DUMMY_FUNCTION #define DestroyIcons() ICON_DUMMY_FUNCTION #define AddIconPath( a ) ICON_DUMMY_FUNCTION #define PutIcon( a, b, c, d, e, f ) ICON_DUMMY_FUNCTION #define LoadIcon( a ) ICON_DUMMY_FUNCTION #define LoadNamedIcon( a ) ICON_DUMMY_FUNCTION #define DestroyIcon( a ) ICON_DUMMY_FUNCTION #endif /* USE_ICONS */ #endif /* ICON_H */ jwm-2.1.0+svn579/src/render.c0000644000000000000000000001233211710374021014263 0ustar rootroot/** * @file render.c * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Functions to render icons using the XRender extension. * */ #include "jwm.h" #include "render.h" #include "icon.h" #include "image.h" #include "main.h" #include "color.h" #include "error.h" /** Draw a scaled icon. */ int PutScaledRenderIcon(IconNode *icon, ScaledIconNode *node, Drawable d, int x, int y) { #ifdef USE_XRENDER Picture dest; Picture source; Picture alpha; XRenderPictFormat *fp; XRenderPictureAttributes pa; XTransform xf; int width, height; int xscale, yscale; Assert(icon); if(!haveRender || !icon->useRender) { return 0; } source = node->imagePicture; alpha = node->alphaPicture; if(source != None) { fp = JXRenderFindVisualFormat(display, rootVisual); Assert(fp); pa.subwindow_mode = IncludeInferiors; dest = JXRenderCreatePicture(display, d, fp, CPSubwindowMode, &pa); if(node->width == 0) { width = icon->image->width; xscale = 65536; } else { width = node->width; xscale = (icon->image->width << 16) / width; } if(node->height == 0) { height = icon->image->height; yscale = 65536; } else { height = node->height; yscale = (icon->image->height << 16) / height; } memset(&xf, 0, sizeof(xf)); xf.matrix[0][0] = xscale; xf.matrix[1][1] = yscale; xf.matrix[2][2] = 65536; XRenderSetPictureTransform(display, source, &xf); XRenderSetPictureFilter(display, source, FilterBest, NULL, 0); XRenderSetPictureTransform(display, alpha, &xf); XRenderSetPictureFilter(display, alpha, FilterBest, NULL, 0); JXRenderComposite(display, PictOpOver, source, alpha, dest, 0, 0, 0, 0, x, y, width, height); JXRenderFreePicture(display, dest); } return 1; #else return 0; #endif } /** Create a scaled icon. */ ScaledIconNode *CreateScaledRenderIcon(IconNode *icon, int width, int height) { ScaledIconNode *result = NULL; #ifdef USE_XRENDER XRenderPictFormat *fp; XColor color; GC maskGC; XImage *destImage; XImage *destMask; unsigned long alpha; int index, yindex; int x, y; int imageLine; int maskLine; Assert(icon); if(!haveRender || !icon->useRender) { return NULL; } result = Allocate(sizeof(ScaledIconNode)); result->next = icon->nodes; icon->nodes = result; result->width = width; result->height = height; width = icon->image->width; height = icon->image->height; result->mask = JXCreatePixmap(display, rootWindow, width, height, 8); maskGC = JXCreateGC(display, result->mask, 0, NULL); result->image = JXCreatePixmap(display, rootWindow, width, height, rootDepth); destImage = JXCreateImage(display, rootVisual, rootDepth, ZPixmap, 0, NULL, width, height, 8, 0); destImage->data = Allocate(sizeof(unsigned long) * width * height); destMask = JXCreateImage(display, rootVisual, 8, ZPixmap, 0, NULL, width, height, 8, 0); destMask->data = Allocate(width * height); imageLine = 0; maskLine = 0; for(y = 0; y < height; y++) { yindex = y * icon->image->width; for(x = 0; x < width; x++) { index = 4 * (yindex + x); alpha = icon->image->data[index]; color.red = icon->image->data[index + 1]; color.red |= color.red << 8; color.green = icon->image->data[index + 2]; color.green |= color.green << 8; color.blue = icon->image->data[index + 3]; color.blue |= color.blue << 8; color.red = (color.red * alpha) >> 8; color.green = (color.green * alpha) >> 8; color.blue = (color.blue * alpha) >> 8; GetColor(&color); XPutPixel(destImage, x, y, color.pixel); destMask->data[maskLine + x] = alpha; } imageLine += destImage->bytes_per_line; maskLine += destMask->bytes_per_line; } /* Render the image data to the image pixmap. */ JXPutImage(display, result->image, rootGC, destImage, 0, 0, 0, 0, width, height); Release(destImage->data); destImage->data = NULL; JXDestroyImage(destImage); /* Render the alpha data to the mask pixmap. */ JXPutImage(display, result->mask, maskGC, destMask, 0, 0, 0, 0, width, height); Release(destMask->data); destMask->data = NULL; JXDestroyImage(destMask); JXFreeGC(display, maskGC); /* Create the alpha picture. */ fp = JXRenderFindStandardFormat(display, PictStandardA8); Assert(fp); result->alphaPicture = JXRenderCreatePicture(display, result->mask, fp, 0, NULL); /* Create the render picture. */ fp = JXRenderFindVisualFormat(display, rootVisual); Assert(fp); result->imagePicture = JXRenderCreatePicture(display, result->image, fp, 0, NULL); /* Free unneeded pixmaps. */ JXFreePixmap(display, result->image); result->image = None; JXFreePixmap(display, result->mask); result->mask = None; #endif return result; } jwm-2.1.0+svn579/src/popup.h0000644000000000000000000000307611710374021014161 0ustar rootroot/** * @file popup.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for popup functions. * */ #ifndef POPUP_H #define POPUP_H /** Number of pixels the mouse can move before the popup disappears. */ #define POPUP_DELTA 2 struct TimeType; /*@{*/ void InitializePopup(); void StartupPopup(); void ShutdownPopup(); void DestroyPopup(); /*@}*/ /** Calculate dimensions of a popup window given the popup text. * @param text The text to measure. * @param width The width output. * @param height The height output. */ void MeasurePopupText(const char *text, int *width, int *height); /** Show a popup window. * @param x The x coordinate of the left edge of the popup window. * @param y The y coordinate of the bottom edge of the popup window. * @param text The text to display in the popup. */ void ShowPopup(int x, int y, const char *text); /** Set whether or not popups are enabled. * @param e 1 to enable popups, 0 to disable popups. */ void SetPopupEnabled(int e); /** Set the delay before showing popups. * @param str The delay (ASCII, milliseconds). */ void SetPopupDelay(const char *str); /** Signal the popup window. * @param now The effective time of the signal. * @param x The x-coordinate of the mouse. * @param y The y-coordinate of the mouse. */ void SignalPopup(const struct TimeType *now, int x, int y); /** Process a popup event. * @param event The event to process. * @return 1 if handled, 0 otherwise. */ int ProcessPopupEvent(const XEvent *event); /** The popup delay in milliseconds. */ extern int popupDelay; #endif /* POPUP_H */ jwm-2.1.0+svn579/src/timing.c0000644000000000000000000000412211710374021014271 0ustar rootroot/** * @file timing.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Timing functions. * */ #include "jwm.h" #include "timing.h" static const unsigned long MAX_TIME_SECONDS = 60; /** Get the current time in milliseconds since midnight 1970-01-01 UTC. */ void GetCurrentTime(TimeType *t) { struct timeval val; gettimeofday(&val, NULL); t->seconds = val.tv_sec; t->ms = val.tv_usec / 1000; } /** Get the absolute difference between two times in milliseconds. * If the difference is larger than a MAX_TIME_SECONDS, then * MAX_TIME_SECONDS will be returned. * Note that the times must be normalized. */ unsigned long GetTimeDifference(const TimeType *t1, const TimeType *t2) { unsigned long deltaSeconds; int deltaMs; if(t1->seconds > t2->seconds) { deltaSeconds = t1->seconds - t2->seconds; deltaMs = t1->ms - t2->ms; } else if(t1->seconds < t2->seconds) { deltaSeconds = t2->seconds - t1->seconds; deltaMs = t2->ms - t1->ms; } else if(t1->ms > t2->ms) { deltaSeconds = 0; deltaMs = t1->ms - t2->ms; } else { deltaSeconds = 0; deltaMs = t2->ms - t1->ms; } if(deltaSeconds > MAX_TIME_SECONDS) { return MAX_TIME_SECONDS * 1000; } else { return deltaSeconds * 1000 + deltaMs; } } /** Get the current time. */ const char *GetTimeString(const char *format, const char *zone) { static char saveTZ[256]; static char newTZ[256]; static char str[80]; time_t t; Assert(format); time(&t); if(zone) { const char *oldTZ = getenv("TZ"); if(oldTZ) { snprintf(saveTZ, sizeof(saveTZ), "TZ=%s", oldTZ); #ifndef HAVE_UNSETENV } else { strcpy(saveTZ, "TZ="); #endif } snprintf(newTZ, sizeof(newTZ), "TZ=%s", zone); putenv(newTZ); tzset(); strftime(str, sizeof(str), format, localtime(&t)); #ifdef HAVE_UNSETENV if(oldTZ) { putenv(saveTZ); } else { unsetenv("TZ"); } #else putenv(saveTZ); #endif } else { strftime(str, sizeof(str), format, localtime(&t)); } return str; } jwm-2.1.0+svn579/src/clock.h0000644000000000000000000000200311710374021014076 0ustar rootroot/** * @file clock.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Clock tray component. * */ #ifndef CLOCK_H #define CLOCK_H struct TrayComponentType; struct TimeType; /*@{*/ void InitializeClock(); void StartupClock(); void ShutdownClock(); void DestroyClock(); /*@}*/ /** Create a clock component for the tray. * @param format The format of the clock. * @param zone The timezone of the clock (NULL for local time). * @param command The command to execute when the clock is clicked. * @param width The width of the clock (0 for auto). * @param height The height of the clock (0 for auto). */ struct TrayComponentType *CreateClock(const char *format, const char *zone, const char *command, int width, int height); /** Update clocks. * This is called on a regular basis to update the time. * @param now The current time. * @param x The x-coordinate of the mouse. * @param y The y-coordinate of the mouse. */ void SignalClock(const struct TimeType *now, int x, int y); #endif /* CLOCK_H */ jwm-2.1.0+svn579/src/taskbar.h0000644000000000000000000000245111710374021014441 0ustar rootroot/** * @file taskbar.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Task list tray component. * */ #ifndef TASKBAR_H #define TASKBAR_H struct ClientNode; struct TimeType; /*@{*/ void InitializeTaskBar(); void StartupTaskBar(); void ShutdownTaskBar(); void DestroyTaskBar(); /*@}*/ /** Create a new task bar tray component. */ struct TrayComponentType *CreateTaskBar(); /** Add a client to the task bar(s). * @param np The client to add. */ void AddClientToTaskBar(struct ClientNode *np); /** Remove a client from the task bar(s). * @param np The client to remove. */ void RemoveClientFromTaskBar(struct ClientNode *np); void UpdateTaskBar(); void SignalTaskbar(const struct TimeType *now, int x, int y); /** Focus the next client in the task bar. */ void FocusNext(); /** Focus the previous client in the task bar. */ void FocusPrevious(); /** Set the maximum width of task bar items. * @param cp The task bar component. * @param value The maximum width. */ void SetMaxTaskBarItemWidth(struct TrayComponentType *cp, const char *value); /** Set the insertion mode for task bars. * @param mode The insertion mode (either right or left). */ void SetTaskBarInsertMode(const char *mode); /** Update the _NET_CLIENT_LIST property. */ void UpdateNetClientList(); #endif /* TASKBAR_H */ jwm-2.1.0+svn579/src/error.c0000644000000000000000000000373111710374021014140 0ustar rootroot/** * @file error.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Error handling functions. * */ #include "jwm.h" #include "error.h" #include "main.h" /** Log a fatal error and exit. */ void FatalError(const char *str, ...) { va_list ap; va_start(ap, str); Assert(str); fprintf(stderr, "JWM: error: "); vfprintf(stderr, str, ap); fprintf(stderr, "\n"); va_end(ap); exit(1); } /** Log a warning. */ void Warning(const char *str, ...) { va_list ap; va_start(ap, str); Assert(str); WarningVA(NULL, str, ap); va_end(ap); } /** Log a warning. */ void WarningVA(const char *part, const char *str, va_list ap) { Assert(str); fprintf(stderr, "JWM: warning: "); if(part) { fprintf(stderr, "%s: ", part); } vfprintf(stderr, str, ap); fprintf(stderr, "\n"); } /** Callback to handle errors from Xlib. * Note that if debug output is directed to an X terminal, emitting too * much output can cause a dead lock (this happens on HP-UX). Therefore * ShowCheckpoint isn't used by default. */ int ErrorHandler(Display *d, XErrorEvent *e) { #ifdef DEBUG char buffer[64]; char code[32]; #endif if(initializing) { if(e->request_code == X_ChangeWindowAttributes && e->error_code == BadAccess) { FatalError("display is already managed"); } } #ifdef DEBUG if(!e) { fprintf(stderr, "XError: [no information]\n"); return 0; } XGetErrorText(display, e->error_code, buffer, sizeof(buffer)); Debug("XError: %s", buffer); snprintf(code, sizeof(code), "%d", e->request_code); XGetErrorDatabaseText(display, "XRequest", code, "?", buffer, sizeof(buffer)); Debug(" Request Code: %d (%s)", e->request_code, buffer); Debug(" Minor Code: %d", e->minor_code); Debug(" Resource ID: 0x%lx", (unsigned long)e->resourceid); Debug(" Error Serial: %lu", (unsigned long)e->serial); #if 1 ShowCheckpoint(); #endif #endif return 0; } jwm-2.1.0+svn579/src/gradient.c0000644000000000000000000000362611710374021014607 0ustar rootroot/** * @file gradient.c * @author Joe Wingbermuehle * @date 2006 * * @brief Gradient fill functions. * */ #include "jwm.h" #include "gradient.h" #include "color.h" #include "main.h" /** Draw a horizontal gradient. */ void DrawHorizontalGradient(Drawable d, GC g, long fromColor, long toColor, int x, int y, unsigned int width, unsigned int height) { const int shift = 15; unsigned int line; XColor temp; int red, green, blue; int ared, agreen, ablue; int bred, bgreen, bblue; int redStep, greenStep, blueStep; /* Return if there's nothing to do. */ if(width == 0 || height == 0) { return; } /* Here we assume that the background was filled elsewhere. */ if(fromColor == toColor) { return; } /* Load the "from" color. */ temp.pixel = fromColor; GetColorFromPixel(&temp); ared = (unsigned int)temp.red << shift; agreen = (unsigned int)temp.green << shift; ablue = (unsigned int)temp.blue << shift; /* Load the "to" color. */ temp.pixel = toColor; GetColorFromPixel(&temp); bred = (unsigned int)temp.red << shift; bgreen = (unsigned int)temp.green << shift; bblue = (unsigned int)temp.blue << shift; /* Determine the step. */ redStep = (bred - ared) / (int)height; greenStep = (bgreen - agreen) / (int)height; blueStep = (bblue - ablue) / (int)height; /* Loop over each line. */ red = ared; blue = ablue; green = agreen; for(line = 0; line < height; line++) { /* Determine the color for this line. */ temp.red = (unsigned short)(red >> shift); temp.green = (unsigned short)(green >> shift); temp.blue = (unsigned short)(blue >> shift); GetColor(&temp); /* Draw the line. */ JXSetForeground(display, g, temp.pixel); JXDrawLine(display, d, g, x, y + line, x + width, y + line); red += redStep; green += greenStep; blue += blueStep; } } jwm-2.1.0+svn579/src/root.h0000644000000000000000000000257411710374021014003 0ustar rootroot/** * @file root.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the root menu functions. * */ #ifndef ROOT_H #define ROOT_H struct Menu; /*@{*/ void InitializeRootMenu(); void StartupRootMenu(); void ShutdownRootMenu(); void DestroyRootMenu(); /*@}*/ /** Set the root menu to be used for the specified indexes. * @param indexes The indexes (ASCII string of '0' to '9'). * @param m The menu to use for the specified indexes. */ void SetRootMenu(const char *indexes, struct Menu *m); /** Set whether a confirmation dialog is displayed on exit. * @param v 1 to display confirmation, 0 to just exit. */ void SetShowExitConfirmation(char v); /** Determine if a root menu is defined for the specified index. * @return 1 if it is defined, 0 if not. */ int IsRootMenuDefined(int index); /** Get the size of a root menu. * @param index The root menu index. * @param width The width output. * @param height The height output. */ void GetRootMenuSize(int index, int *width, int *height); /** Show a root menu. * @param index The root menu index. * @param x The x-coordinate. * @param y The y-coordinate. * @return 1 if a menu was displayed, 0 if not. */ int ShowRootMenu(int index, int x, int y); /** Restart the window manager. */ void Restart(); /** Exit the window manager. */ void Exit(); /** Reload the menu. */ void ReloadMenu(); #endif /* ROOT_H */ jwm-2.1.0+svn579/src/help.h0000644000000000000000000000065511710374021013746 0ustar rootroot/** * @file help.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the help functions. * */ #ifndef HELP_H #define HELP_H /** Display program name, version, and compiled options . */ void DisplayAbout(); /** Display compiled options. */ void DisplayCompileOptions(); /** Display all help. */ void DisplayHelp(); /** Display program usage information. */ void DisplayUsage(); #endif /* HELP_H */ jwm-2.1.0+svn579/src/winmenu.c0000644000000000000000000001746411710374021014501 0ustar rootroot/** * @file winmenu.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for handling window menus. * */ #include "jwm.h" #include "winmenu.h" #include "client.h" #include "menu.h" #include "main.h" #include "desktop.h" #include "move.h" #include "resize.h" #include "event.h" #include "cursor.h" #include "misc.h" #include "root.h" static Menu *CreateWindowMenu(); static void RunWindowCommand(const MenuAction *action); static void CreateWindowLayerMenu(Menu *menu); static void CreateWindowSendToMenu(Menu *menu); static void AddWindowMenuItem(Menu *menu, const char *name, MenuActionType type, int value); static ClientNode *client = NULL; /** Get the size of a window menu. */ void GetWindowMenuSize(ClientNode *np, int *width, int *height) { Menu *menu; client = np; menu = CreateWindowMenu(); InitializeMenu(menu); *width = menu->width; *height = menu->height; DestroyMenu(menu); } /** Show a window menu. */ void ShowWindowMenu(ClientNode *np, int x, int y) { Menu *menu; client = np; menu = CreateWindowMenu(); InitializeMenu(menu); ShowMenu(menu, RunWindowCommand, x, y); DestroyMenu(menu); } /** Create a new window menu. */ Menu *CreateWindowMenu() { Menu *menu; menu = Allocate(sizeof(Menu)); menu->itemHeight = 0; menu->items = NULL; menu->label = NULL; /* Note that items are added in reverse order of display. */ if(!(client->state.status & STAT_WMDIALOG)) { AddWindowMenuItem(menu, _("Close"), MA_CLOSE, 0); AddWindowMenuItem(menu, _("Kill"), MA_KILL, 0); AddWindowMenuItem(menu, NULL, MA_NONE, 0); } if(client->state.status & (STAT_MAPPED | STAT_SHADED)) { if(client->state.border & BORDER_RESIZE) { AddWindowMenuItem(menu, _("Resize"), MA_RESIZE, 0); } if(client->state.border & BORDER_MOVE) { AddWindowMenuItem(menu, _("Move"), MA_MOVE, 0); } } if(client->state.border & BORDER_MIN) { if(client->state.status & STAT_MINIMIZED) { AddWindowMenuItem(menu, _("Restore"), MA_RESTORE, 0); } else { if(client->state.status & STAT_SHADED) { AddWindowMenuItem(menu, _("Unshade"), MA_SHADE, 0); } else { AddWindowMenuItem(menu, _("Shade"), MA_SHADE, 0); } AddWindowMenuItem(menu, _("Minimize"), MA_MINIMIZE, 0); } } if((client->state.border & BORDER_MAX) && (client->state.status & STAT_MAPPED)) { if(!(client->state.status & (STAT_HMAX | STAT_VMAX))) { AddWindowMenuItem(menu, _("Maximize-y"), MA_MAXIMIZE_V, 0); } if(!(client->state.status & (STAT_HMAX | STAT_VMAX))) { AddWindowMenuItem(menu, _("Maximize-x"), MA_MAXIMIZE_H, 0); } if((client->state.status & (STAT_HMAX | STAT_VMAX))) { AddWindowMenuItem(menu, _("Restore"), MA_MAXIMIZE, 0); } else { AddWindowMenuItem(menu, _("Maximize"), MA_MAXIMIZE, 0); } } if(!(client->state.status & STAT_WMDIALOG)) { if(client->state.status & STAT_STICKY) { AddWindowMenuItem(menu, _("Unstick"), MA_STICK, 0); } else { AddWindowMenuItem(menu, _("Stick"), MA_STICK, 0); } CreateWindowLayerMenu(menu); if(!(client->state.status & STAT_STICKY)) { CreateWindowSendToMenu(menu); } } return menu; } /** Create a window layer submenu. */ void CreateWindowLayerMenu(Menu *menu) { Menu *submenu; MenuItem *item; char str[10]; unsigned int x; item = Allocate(sizeof(MenuItem)); item->type = MENU_ITEM_SUBMENU; item->name = CopyString(_("Layer")); item->action.type = MA_NONE; item->action.data.str = NULL; item->iconName = NULL; item->next = menu->items; menu->items = item; submenu = Allocate(sizeof(Menu)); item->submenu = submenu; submenu->itemHeight = 0; submenu->items = NULL; submenu->label = NULL; if(client->state.layer == LAYER_TOP) { AddWindowMenuItem(submenu, _("[Top]"), MA_LAYER, LAYER_TOP); } else { AddWindowMenuItem(submenu, _("Top"), MA_LAYER, LAYER_TOP); } str[4] = 0; for(x = LAYER_TOP - 1; x > LAYER_BOTTOM; x--) { if(x == LAYER_NORMAL) { if(client->state.layer == x) { AddWindowMenuItem(submenu, _("[Normal]"), MA_LAYER, x); } else { AddWindowMenuItem(submenu, _("Normal"), MA_LAYER, x); } } else { if(client->state.layer == x) { str[0] = '['; str[3] = ']'; } else { str[0] = ' '; str[3] = ' '; } if(x < 10) { str[1] = ' '; } else { str[1] = (x / 10) + '0'; } str[2] = (x % 10) + '0'; AddWindowMenuItem(submenu, str, MA_LAYER, x); } } if(client->state.layer == LAYER_BOTTOM) { AddWindowMenuItem(submenu, _("[Bottom]"), MA_LAYER, LAYER_BOTTOM); } else { AddWindowMenuItem(submenu, _("Bottom"), MA_LAYER, LAYER_BOTTOM); } } /** Create a send to submenu. */ void CreateWindowSendToMenu(Menu *menu) { unsigned int mask; unsigned int x; mask = 0; for(x = 0; x < desktopCount; x++) { if(client->state.desktop == x || (client->state.status & STAT_STICKY)) { mask |= 1 << x; } } AddWindowMenuItem(menu, _("Send To"), MA_NONE, 0); /* Now the first item in the menu is for the desktop list. */ menu->items->submenu = CreateDesktopMenu(mask); } /** Add an item to the current window menu. */ void AddWindowMenuItem(Menu *menu, const char *name, MenuActionType type, int value) { MenuItem *item; item = Allocate(sizeof(MenuItem)); if(name) { item->type = MENU_ITEM_NORMAL; } else { item->type = MENU_ITEM_SEPARATOR; } item->name = CopyString(name); item->action.type = type; item->action.data.i = value; item->iconName = NULL; item->submenu = NULL; item->next = menu->items; menu->items = item; } /** Select a window for performing an action. */ void ChooseWindow(const MenuAction *action) { XEvent event; ClientNode *np; GrabMouseForChoose(); for(;;) { WaitForEvent(&event); if(event.type == ButtonPress) { if(event.xbutton.button == Button1) { np = FindClientByWindow(event.xbutton.subwindow); if(np) { client = np; RunWindowCommand(action); } } break; } else if(event.type == KeyPress) { break; } } JXUngrabPointer(display, CurrentTime); } /** Window menu action callback. */ void RunWindowCommand(const MenuAction *action) { switch(action->type) { case MA_STICK: if(client->state.status & STAT_STICKY) { SetClientSticky(client, 0); } else { SetClientSticky(client, 1); } break; case MA_MAXIMIZE: MaximizeClient(client, 1, 1); break; case MA_MAXIMIZE_H: MaximizeClient(client, 1, 0); break; case MA_MAXIMIZE_V: MaximizeClient(client, 0, 1); break; case MA_MINIMIZE: MinimizeClient(client); break; case MA_RESTORE: RestoreClient(client, 1); break; case MA_CLOSE: DeleteClient(client); break; case MA_SENDTO: case MA_DESKTOP: SetClientDesktop(client, action->data.i); break; case MA_SHADE: if(client->state.status & STAT_SHADED) { UnshadeClient(client); } else { ShadeClient(client); } break; case MA_MOVE: MoveClientKeyboard(client); break; case MA_RESIZE: ResizeClientKeyboard(client); break; case MA_KILL: KillClient(client); break; case MA_LAYER: SetClientLayer(client, action->data.i); break; default: Debug("unknown window command: %d", action->type); break; } } jwm-2.1.0+svn579/src/help.c0000644000000000000000000000312611710374021013735 0ustar rootroot/** * @file help.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for displaying information about JWM. * */ #include "jwm.h" #include "help.h" /** Display program name, version, and compiled options . */ void DisplayAbout() { printf("JWM v%s by Joe Wingbermuehle\n", PACKAGE_VERSION); DisplayCompileOptions(); } /** Display compiled options. */ void DisplayCompileOptions() { printf("compiled options: "); #ifndef DISABLE_CONFIRM printf("confirm "); #endif #ifdef DEBUG printf("debug "); #endif #ifdef USE_FRIBIDI printf("fribidi "); #endif #ifdef USE_ICONS printf("icons "); #endif #ifdef USE_PNG printf("png "); #endif #ifdef USE_SHAPE printf("shape "); #endif #ifdef USE_XFT printf("xft "); #endif #ifdef USE_XINERAMA printf("xinerama "); #endif #ifdef USE_XPM printf("xpm "); #endif #ifdef USE_XRENDER printf("xrender "); #endif printf("\nsystem configuration: %s\n", SYSTEM_CONFIG); } /** Display all help. */ void DisplayHelp() { DisplayUsage(); printf(" -display X Set the X display to use\n"); printf(" -exit Exit JWM (send _JWM_EXIT to the root)\n"); printf(" -h Display this help message\n"); printf(" -p Parse the configuration file and exit\n"); printf(" -reload Reload menu (send _JWM_RELOAD to the root)\n"); printf(" -restart Restart JWM (send _JWM_RESTART to the root)\n"); printf(" -v Display version information\n"); } /** Display program usage information. */ void DisplayUsage() { DisplayAbout(); printf("usage: jwm [ options ]\n"); } jwm-2.1.0+svn579/src/button.c0000644000000000000000000001203411710374021014316 0ustar rootroot/** * @file button.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle drawing buttons. * */ #include "jwm.h" #include "button.h" #include "border.h" #include "font.h" #include "color.h" #include "main.h" #include "icon.h" #include "image.h" #include "gradient.h" static void GetScaledIconSize(IconNode *ip, int maxsize, int *width, int *height); /** Draw a button. */ void DrawButton(ButtonNode *bp) { long outlinePixel; ColorType fg; long bg1, bg2; Drawable drawable; GC gc; int x, y; int width, height; int xoffset, yoffset; int iconWidth, iconHeight; int textWidth, textHeight; Assert(bp); drawable = bp->drawable; gc = bp->gc; x = bp->x; y = bp->y; width = bp->width; height = bp->height; /* Determine the colors to use. */ switch(bp->type) { case BUTTON_LABEL: fg = COLOR_MENU_FG; bg1 = colors[COLOR_MENU_BG]; bg2 = colors[COLOR_MENU_BG]; outlinePixel = colors[COLOR_MENU_BG]; break; case BUTTON_MENU_ACTIVE: fg = COLOR_MENU_ACTIVE_FG; bg1 = colors[COLOR_MENU_ACTIVE_BG1]; bg2 = colors[COLOR_MENU_ACTIVE_BG2]; if(bg1 == bg2) { outlinePixel = colors[COLOR_MENU_ACTIVE_OL]; } else { outlinePixel = colors[COLOR_MENU_ACTIVE_DOWN]; } break; case BUTTON_TASK: fg = COLOR_TASK_FG; bg1 = colors[COLOR_TASK_BG1]; bg2 = colors[COLOR_TASK_BG2]; outlinePixel = colors[COLOR_TASK_DOWN]; break; case BUTTON_TASK_ACTIVE: fg = COLOR_TASK_ACTIVE_FG; bg1 = colors[COLOR_TASK_ACTIVE_BG1]; bg2 = colors[COLOR_TASK_ACTIVE_BG2]; outlinePixel = colors[COLOR_TASK_ACTIVE_UP]; break; case BUTTON_MENU: default: fg = COLOR_MENU_FG; bg1 = colors[COLOR_MENU_BG]; bg2 = colors[COLOR_MENU_BG]; outlinePixel = colors[COLOR_MENU_DOWN]; break; } /* Draw the background. */ /* Flat taskbuttons for widths < 48 */ if(bp->type != BUTTON_TASK || width >= 48) { /* Draw the button background. */ JXSetForeground(display, gc, bg1); if(bg1 == bg2) { /* single color */ JXFillRectangle(display, drawable, gc, x + 1, y + 1, width - 1, height - 1); } else { /* gradient */ DrawHorizontalGradient(drawable, gc, bg1, bg2, x + 1, y + 1, width - 2, height - 1); } /* Draw the outline. */ JXSetForeground(display, gc, outlinePixel); DrawRoundedRectangle(drawable, gc, x, y, width, height, 3); } /* Determine the size of the icon (if any) to display. */ iconWidth = 0; iconHeight = 0; if(bp->icon) { if(width < height) { GetScaledIconSize(bp->icon, width - 5, &iconWidth, &iconHeight); } else { GetScaledIconSize(bp->icon, height - 5, &iconWidth, &iconHeight); } } /* Determine how much room is left for text. */ textWidth = 0; textHeight = 0; if(bp->text) { textWidth = GetStringWidth(bp->font, bp->text); textHeight = GetStringHeight(bp->font); if(textWidth + iconWidth + 8 > width) { textWidth = width - iconWidth - 8; if(textWidth < 0) { textWidth = 0; } } } /* Determine the offset of the text in the button. */ if(bp->alignment == ALIGN_CENTER) { xoffset = (width - iconWidth - textWidth + 1) / 2; if(xoffset < 0) { xoffset = 0; } } else { xoffset = 3; } /* Display the icon. */ if(bp->icon) { yoffset = (height - iconHeight + 1) / 2; PutIcon(bp->icon, drawable, x + xoffset, y + yoffset, iconWidth, iconHeight); xoffset += iconWidth + 2; } /* Display the label. */ if(bp->text && textWidth) { yoffset = (height - textHeight + 1) / 2; RenderString(drawable, bp->font, fg, x + xoffset, y + yoffset, textWidth, NULL, bp->text); } } /** Reset a button node with default values. */ void ResetButton(ButtonNode *bp, Drawable d, GC g) { Assert(bp); bp->type = BUTTON_MENU; bp->drawable = d; bp->gc = g; bp->font = FONT_TRAY; bp->alignment = ALIGN_LEFT; bp->x = 0; bp->y = 0; bp->width = 1; bp->height = 1; bp->icon = NULL; bp->text = NULL; } /** Get the scaled size of an icon for a button. */ void GetScaledIconSize(IconNode *ip, int maxsize, int *width, int *height) { int ratio; Assert(ip); Assert(width); Assert(height); if(ip == &emptyIcon) { *width = maxsize; *height = maxsize; return; } Assert(ip->image->height > 0); /* Fixed point with 16-bit fraction. */ ratio = (ip->image->width << 16) / ip->image->height; if(ip->image->width > ip->image->height) { /* Compute size wrt width */ *width = (maxsize * ratio) >> 16; *height = (*width << 16) / ratio; } else { /* Compute size wrt height */ *height = (maxsize << 16) / ratio; *width = (*height * ratio) >> 16; } } jwm-2.1.0+svn579/src/place.c0000644000000000000000000003475411710374021014104 0ustar rootroot/** * @file place.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Client placement functions. * */ #include "jwm.h" #include "place.h" #include "client.h" #include "screen.h" #include "border.h" #include "tray.h" #include "main.h" typedef struct Strut { ClientNode *client; BoundingBox box; struct Strut *prev; struct Strut *next; } Strut; static Strut *struts = NULL; static Strut *strutsTail = NULL; /* desktopCount x screenCount */ /* Note that we assume x and y are 0 based for all screens here. */ static int *cascadeOffsets = NULL; static void SubtractStrutBounds(BoundingBox *box); static void SubtractBounds(const BoundingBox *src, BoundingBox *dest); /** Initialize placement data. */ void InitializePlacement() { } /** Startup placement. */ void StartupPlacement() { int count; int x; count = desktopCount * GetScreenCount(); cascadeOffsets = Allocate(count * sizeof(int)); for(x = 0; x < count; x++) { cascadeOffsets[x] = borderWidth + titleHeight; } } /** Shutdown placement. */ void ShutdownPlacement() { Strut *sp; Release(cascadeOffsets); while(struts) { sp = struts->next; Release(struts); struts = sp; } strutsTail = NULL; } /** Destroy placement data. */ void DestroyPlacement() { } /** Remove struts associated with a client. */ void RemoveClientStrut(ClientNode *np) { Strut *sp; sp = struts; while(sp) { if(sp->client == np) { if(sp->prev) { sp->prev->next = sp->next; } else { struts = sp->next; } if(sp->next) { sp->next->prev = sp->prev; } else { strutsTail = sp->prev; } Release(sp); sp = struts; } else { sp = sp->next; } } } /** Add client specified struts to our list. */ void ReadClientStrut(ClientNode *np) { BoundingBox box; Strut *sp; int status; Atom actualType; int actualFormat; unsigned long count; unsigned long bytesLeft; unsigned char *value; long *lvalue; long leftWidth, rightWidth, topHeight, bottomHeight; long leftStart, rightStart; long topStart, bottomStart; RemoveClientStrut(np); box.x = 0; box.y = 0; box.width = 0; box.height = 0; /* First try to read _NET_WM_STRUT_PARTIAL */ /* Format is: * left_width, right_width, top_width, bottom_width, * left_start_y, left_end_y, right_start_y, right_end_y, * top_start_x, top_end_x, bottom_start_x, bottom_end_x */ status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_STRUT_PARTIAL], 0, 12, False, XA_CARDINAL, &actualType, &actualFormat, &count, &bytesLeft, &value); if(status == Success) { if(count == 12) { lvalue = (long*)value; leftWidth = lvalue[0]; rightWidth = lvalue[1]; topHeight = lvalue[2]; bottomHeight = lvalue[3]; leftStart = lvalue[4]; rightStart = lvalue[6]; topStart = lvalue[8]; bottomStart = lvalue[10]; if(leftWidth > 0) { box.width = leftWidth; box.x = leftStart; } if(rightWidth > 0) { box.width = rightWidth; box.x = rightStart; } if(topHeight > 0) { box.height = topHeight; box.y = topStart; } if(bottomHeight > 0) { box.height = bottomHeight; box.y = bottomStart; } if(box.width == 0 && box.height > 0) { box.width = rootWidth; } if(box.height == 0 && box.width > 0) { box.height = rootHeight; } sp = Allocate(sizeof(Strut)); sp->client = np; sp->box = box; sp->prev = NULL; sp->next = struts; if(struts) { struts->prev = sp; } else { strutsTail = sp; } struts = sp; } JXFree(value); return; } /* Next try to read _NET_WM_STRUT */ /* Format is: left_width, right_width, top_width, bottom_width */ status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_STRUT], 0, 4, False, XA_CARDINAL, &actualType, &actualFormat, &count, &bytesLeft, &value); if(status == Success) { if(count == 4) { lvalue = (long*)value; leftWidth = lvalue[0]; rightWidth = lvalue[1]; topHeight = lvalue[2]; bottomHeight = lvalue[3]; if(leftWidth > 0) { box.x = 0; box.width = leftWidth; } if(rightWidth > 0) { box.x = rootWidth - rightWidth; box.width = rightWidth; } if(topHeight > 0) { box.y = 0; box.height = topHeight; } if(bottomHeight > 0) { box.y = rootHeight - bottomHeight; box.height = bottomHeight; } sp = Allocate(sizeof(Strut)); sp->client = np; sp->box = box; sp->prev = NULL; sp->next = struts; if(struts) { struts->prev = sp; } else { strutsTail = sp; } struts = sp; } JXFree(value); return; } } /** Get the screen bounds. */ void GetScreenBounds(const ScreenType *sp, BoundingBox *box) { box->x = sp->x; box->y = sp->y; box->width = sp->width; box->height = sp->height; } /** Shrink dest such that it does not intersect with src. */ void SubtractBounds(const BoundingBox *src, BoundingBox *dest) { BoundingBox boxes[4]; if(src->x + src->width <= dest->x) { return; } if(src->y + src->height <= dest->y) { return; } if(dest->x + dest->width <= src->x) { return; } if(dest->y + dest->height <= src->y) { return; } /* There are four ways to do this: * 0. Increase the x-coordinate and decrease the width of dest. * 1. Increase the y-coordinate and decrease the height of dest. * 2. Decrease the width of dest. * 3. Decrease the height of dest. * We will chose the option which leaves the greatest area. * Note that negative areas are possible. */ /* 0 */ boxes[0] = *dest; boxes[0].x = src->x + src->width; boxes[0].width = dest->x + dest->width - boxes[0].x; /* 1 */ boxes[1] = *dest; boxes[1].y = src->y + src->height; boxes[1].height = dest->y + dest->height - boxes[1].y; /* 2 */ boxes[2] = *dest; boxes[2].width = src->x - dest->x; /* 3 */ boxes[3] = *dest; boxes[3].height = src->y - dest->y; /* 0 and 1, winner in 0. */ if(boxes[0].width * boxes[0].height < boxes[1].width * boxes[1].height) { boxes[0] = boxes[1]; } /* 2 and 3, winner in 2. */ if(boxes[2].width * boxes[2].height < boxes[3].width * boxes[3].height) { boxes[2] = boxes[3]; } /* 0 and 2, winner in dest. */ if(boxes[0].width * boxes[0].height < boxes[2].width * boxes[2].height) { *dest = boxes[2]; } else { *dest = boxes[0]; } } /** Subtract tray area from the bounding box. */ void SubtractTrayBounds(const TrayType *tp, BoundingBox *box, unsigned int layer) { BoundingBox src; BoundingBox last; for(; tp; tp = tp->next) { if(tp->layer > layer && !tp->autoHide) { src.x = tp->x; if(src.x < 0) { src.x = rootWidth - src.x; } src.y = tp->y; if(src.y < 0) { src.y = rootHeight - src.y; } src.width = tp->width; src.height = tp->height; last = *box; SubtractBounds(&src, box); if(box->width * box->height <= 0) { *box = last; break; } } } } /** Remove struts from the bounding box. */ void SubtractStrutBounds(BoundingBox *box) { Strut *sp; BoundingBox last; for(sp = struts; sp; sp = sp->next) { if(sp->client->state.desktop == currentDesktop || (sp->client->state.status & STAT_STICKY)) { last = *box; SubtractBounds(&sp->box, box); if(box->width * box->height <= 0) { *box = last; break; } } } } /** Place a client on the screen. */ void PlaceClient(ClientNode *np, int alreadyMapped) { BoundingBox box; int north, south, east, west; const ScreenType *sp; int cascadeIndex; int overflow; Assert(np); GetBorderSize(np, &north, &south, &east, &west); if(np->x + np->width > rootWidth || np->y + np->height > rootHeight) { overflow = 1; } else { overflow = 0; } sp = GetMouseScreen(); GetScreenBounds(sp, &box); if(!overflow && (alreadyMapped || (!(np->state.status & STAT_PIGNORE) && (np->sizeFlags & (PPosition | USPosition))))) { GravitateClient(np, 0); } else { SubtractTrayBounds(GetTrays(), &box, np->state.layer); SubtractStrutBounds(&box); cascadeIndex = sp->index * desktopCount + currentDesktop; /* Set the cascaded location. */ np->x = box.x + west + cascadeOffsets[cascadeIndex]; np->y = box.y + north + cascadeOffsets[cascadeIndex]; cascadeOffsets[cascadeIndex] += borderWidth + titleHeight; /* Check for cascade overflow. */ overflow = 0; if(np->x + np->width - box.x > box.width) { overflow = 1; } else if(np->y + np->height - box.y > box.height) { overflow = 1; } if(overflow) { cascadeOffsets[cascadeIndex] = borderWidth + titleHeight; np->x = box.x + west + cascadeOffsets[cascadeIndex]; np->y = box.y + north + cascadeOffsets[cascadeIndex]; /* Check for client overflow. */ overflow = 0; if(np->x + np->width - box.x > box.width) { overflow = 1; } else if(np->y + np->height - box.y > box.height) { overflow = 1; } /* Update cascade position or position client. */ if(overflow) { np->x = box.x + west; np->y = box.y + north; } else { cascadeOffsets[cascadeIndex] += borderWidth + titleHeight; } } } if(np->state.status & STAT_FULLSCREEN) { JXMoveWindow(display, np->parent, sp->x, sp->y); } else { JXMoveWindow(display, np->parent, np->x - west, np->y - north); } } /** Constrain the size of the client so it fits. */ void ConstrainSize(ClientNode *np) { BoundingBox box; const ScreenType *sp; int north, south, east, west; int ratio, minr, maxr; Assert(np); /* Determine if the size needs to be constrained. */ sp = GetCurrentScreen(np->x, np->y); if(np->width < sp->width && np->height < sp->height) { return; } /* Constrain the size. */ GetBorderSize(np, &north, &south, &east, &west); GetScreenBounds(sp, &box); SubtractTrayBounds(GetTrays(), &box, np->state.layer); SubtractStrutBounds(&box); box.x += west; box.y += north; box.width -= east + west; box.height -= north + south; if(box.width > np->maxWidth) { box.width = np->maxWidth; } if(box.height > np->maxHeight) { box.height = np->maxHeight; } if(np->sizeFlags & PAspect) { /* Fixed point with a 16-bit fraction. */ ratio = (box.width << 16) / box.height; minr = (np->aspect.minx << 16) / np->aspect.miny; if(ratio < minr) { box.height = (box.width << 16) / minr; } maxr = (np->aspect.maxx << 16) / np->aspect.maxy; if(ratio > maxr) { box.width = (box.height * maxr) >> 16; } } np->x = box.x; np->y = box.y; np->width = box.width - (box.width % np->xinc); np->height = box.height - (box.height % np->yinc); } /** Place a maximized client on the screen. */ void PlaceMaximizedClient(ClientNode *np, int horiz, int vert) { BoundingBox box; const ScreenType *sp; int north, south, east, west; int ratio, minr, maxr; np->oldx = np->x; np->oldy = np->y; np->oldWidth = np->width; np->oldHeight = np->height; GetBorderSize(np, &north, &south, &east, &west); sp = GetCurrentScreen( np->x + (east + west + np->width) / 2, np->y + (north + south + np->height) / 2); GetScreenBounds(sp, &box); SubtractTrayBounds(GetTrays(), &box, np->state.layer); SubtractStrutBounds(&box); box.x += west; box.y += north; box.width -= east + west; box.height -= north + south; if(box.width > np->maxWidth) { box.width = np->maxWidth; } if(box.height > np->maxHeight) { box.height = np->maxHeight; } if(np->sizeFlags & PAspect) { /* Fixed point with a 16-bit fraction. */ ratio = (box.width << 16) / box.height; minr = (np->aspect.minx << 16) / np->aspect.miny; if(ratio < minr) { box.height = (box.width << 16) / minr; } maxr = (np->aspect.maxx << 16) / np->aspect.maxy; if(ratio > maxr) { box.width = (box.height * maxr) >> 16; } } /* If maximizing horizontally, update width. */ if(horiz) { np->x = box.x; np->width = box.width - ((box.width - np->baseWidth) % np->xinc); np->state.status |= STAT_HMAX; } /* If maximizing vertically, update height. */ if(vert) { np->y = box.y; np->height = box.height - ((box.height - np->baseHeight) % np->yinc); np->state.status |= STAT_VMAX; } } /** Determine which way to move the client for the border. */ void GetGravityDelta(const ClientNode *np, int *x, int *y) { int north, south, east, west; Assert(np); Assert(x); Assert(y); GetBorderSize(np, &north, &south, &east, &west); switch(np->gravity) { case NorthWestGravity: *y = -north; *x = -west; break; case NorthGravity: *y = -north; break; case NorthEastGravity: *y = -north; *x = west; break; case WestGravity: *x = -west; break; case CenterGravity: *y = (north + south) / 2; *x = (east + west) / 2; break; case EastGravity: *x = west; break; case SouthWestGravity: *y = south; *x = -west; break; case SouthGravity: *y = south; break; case SouthEastGravity: *y = south; *x = west; break; default: /* Static */ *x = 0; *y = 0; break; } } /** Move the window in the specified direction for reparenting. */ void GravitateClient(ClientNode *np, int negate) { int deltax, deltay; Assert(np); GetGravityDelta(np, &deltax, &deltay); if(negate) { np->x += deltax; np->y += deltay; } else { np->x -= deltax; np->y -= deltay; } } jwm-2.1.0+svn579/src/clientlist.h0000644000000000000000000000206611710374021015166 0ustar rootroot/** * @file clientlist.h * @author Joe Wingbermuehle * @date 2007 * * @brief Functions to manage lists of clients. * */ #ifndef CLIENTLIST_H #define CLIENTLIST_H #include "hint.h" struct ClientNode; /** Client windows in linked lists for each layer. */ extern struct ClientNode *nodes[LAYER_COUNT]; /** Client windows in linked lists for each layer (pointer to the tail). */ extern struct ClientNode *nodeTail[LAYER_COUNT]; /** Determine if a client is allowed focus. * @param np The client. * @return 1 if focus is allowed, 0 otherwise. */ int ShouldFocus(const struct ClientNode *np); /** Start walking the window stack. */ void StartWindowStackWalk(); /** Move to the next/previous window in the window stack. */ void WalkWindowStack(int forward); /** Stop walking the window stack. */ void StopWindowStackWalk(); /** Set the keyboard focus to the next client. * This is used to focus the next client in the stacking order. * @param np The client before the client to focus. */ void FocusNextStacked(struct ClientNode *np); #endif /* CLIENTLIST_H */ jwm-2.1.0+svn579/src/hint.c0000644000000000000000000007015311710374021013753 0ustar rootroot/** * @file hint.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for reading and writing X properties. * */ #include #include "jwm.h" #include "hint.h" #include "client.h" #include "main.h" #include "tray.h" #include "desktop.h" #include "misc.h" /* MWM Defines */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_INPUT_MODE (1L << 2) #define MWM_HINTS_STATUS (1L << 3) #define MWM_FUNC_ALL (1L << 0) #define MWM_FUNC_RESIZE (1L << 1) #define MWM_FUNC_MOVE (1L << 2) #define MWM_FUNC_MINIMIZE (1L << 3) #define MWM_FUNC_MAXIMIZE (1L << 4) #define MWM_FUNC_CLOSE (1L << 5) #define MWM_DECOR_ALL (1L << 0) #define MWM_DECOR_BORDER (1L << 1) #define MWM_DECOR_RESIZEH (1L << 2) #define MWM_DECOR_TITLE (1L << 3) #define MWM_DECOR_MENU (1L << 4) #define MWM_DECOR_MINIMIZE (1L << 5) #define MWM_DECOR_MAXIMIZE (1L << 6) #define MWM_INPUT_MODELESS 0 #define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1 #define MWM_INPUT_SYSTEM_MODAL 2 #define MWM_INPUT_FULL_APPLICATION_MODAL 3 #define MWM_TEAROFF_WINDOW (1L << 0) typedef struct { unsigned long flags; unsigned long functions; unsigned long decorations; long inputMode; unsigned long status; } PropMwmHints; typedef struct { Atom *atom; const char *name; } ProtocolNode; typedef struct { Atom *atom; const char *name; } AtomNode; Atom atoms[ATOM_COUNT]; static const AtomNode atomList[] = { { &atoms[ATOM_COMPOUND_TEXT], "COMPOUND_TEXT" }, { &atoms[ATOM_UTF8_STRING], "UTF8_STRING" }, { &atoms[ATOM_XSETROOT_ID], "_XSETROOT_ID" }, { &atoms[ATOM_WM_STATE], "WM_STATE" }, { &atoms[ATOM_WM_PROTOCOLS], "WM_PROTOCOLS" }, { &atoms[ATOM_WM_DELETE_WINDOW], "WM_DELETE_WINDOW" }, { &atoms[ATOM_WM_TAKE_FOCUS], "WM_TAKE_FOCUS" }, { &atoms[ATOM_WM_LOCALE_NAME], "WM_LOCALE_NAME" }, { &atoms[ATOM_WM_CHANGE_STATE], "WM_CHANGE_STATE" }, { &atoms[ATOM_WM_COLORMAP_WINDOWS], "WM_COLORMAP_WINDOWS" }, { &atoms[ATOM_NET_SUPPORTED], "_NET_SUPPORTED" }, { &atoms[ATOM_NET_NUMBER_OF_DESKTOPS], "_NET_NUMBER_OF_DESKTOPS" }, { &atoms[ATOM_NET_DESKTOP_NAMES], "_NET_DESKTOP_NAMES" }, { &atoms[ATOM_NET_DESKTOP_GEOMETRY], "_NET_DESKTOP_GEOMETRY" }, { &atoms[ATOM_NET_DESKTOP_VIEWPORT], "_NET_DESKTOP_VIEWPORT" }, { &atoms[ATOM_NET_CURRENT_DESKTOP], "_NET_CURRENT_DESKTOP" }, { &atoms[ATOM_NET_ACTIVE_WINDOW], "_NET_ACTIVE_WINDOW" }, { &atoms[ATOM_NET_WORKAREA], "_NET_WORKAREA" }, { &atoms[ATOM_NET_SUPPORTING_WM_CHECK], "_NET_SUPPORTING_WM_CHECK" }, { &atoms[ATOM_NET_SHOWING_DESKTOP], "_NET_SHOWING_DESKTOP" }, { &atoms[ATOM_NET_FRAME_EXTENTS], "_NET_FRAME_EXTENTS" }, { &atoms[ATOM_NET_WM_DESKTOP], "_NET_WM_DESKTOP" }, { &atoms[ATOM_NET_WM_STATE], "_NET_WM_STATE" }, { &atoms[ATOM_NET_WM_STATE_STICKY], "_NET_WM_STATE_STICKY" }, { &atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT], "_NET_WM_STATE_MAXIMIZED_VERT"}, { &atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ], "_NET_WM_STATE_MAXIMIZED_HORZ"}, { &atoms[ATOM_NET_WM_STATE_SHADED], "_NET_WM_STATE_SHADED" }, { &atoms[ATOM_NET_WM_STATE_FULLSCREEN], "_NET_WM_STATE_FULLSCREEN" }, { &atoms[ATOM_NET_WM_STATE_HIDDEN], "_NET_WM_STATE_HIDDEN" }, { &atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR], "_NET_WM_STATE_SKIP_TASKBAR" }, { &atoms[ATOM_NET_WM_STATE_BELOW], "_NET_WM_STATE_BELOW" }, { &atoms[ATOM_NET_WM_STATE_ABOVE], "_NET_WM_STATE_ABOVE" }, { &atoms[ATOM_NET_WM_ALLOWED_ACTIONS], "_NET_WM_ALLOWED_ACTIONS" }, { &atoms[ATOM_NET_WM_ACTION_MOVE], "_NET_WM_ACTION_MOVE" }, { &atoms[ATOM_NET_WM_ACTION_RESIZE], "_NET_WM_ACTION_RESIZE" }, { &atoms[ATOM_NET_WM_ACTION_MINIMIZE], "_NET_WM_ACTION_MINIMIZE" }, { &atoms[ATOM_NET_WM_ACTION_SHADE], "_NET_WM_ACTION_SHADE" }, { &atoms[ATOM_NET_WM_ACTION_STICK], "_NET_WM_ACTION_STICK" }, { &atoms[ATOM_NET_WM_ACTION_MAXIMIZE_HORZ], "_NET_WM_ACTION_MAXIMIZE_HORZ"}, { &atoms[ATOM_NET_WM_ACTION_MAXIMIZE_VERT], "_NET_WM_ACTION_MAXIMIZE_VERT"}, { &atoms[ATOM_NET_WM_ACTION_CHANGE_DESKTOP], "_NET_WM_ACTION_CHANGE_DESKTOP"}, { &atoms[ATOM_NET_WM_ACTION_CLOSE], "_NET_WM_ACTION_CLOSE" }, { &atoms[ATOM_NET_WM_ACTION_BELOW], "_NET_WM_ACTION_BELOW" }, { &atoms[ATOM_NET_WM_ACTION_ABOVE], "_NET_WM_ACTION_ABOVE" }, { &atoms[ATOM_NET_CLOSE_WINDOW], "_NET_CLOSE_WINDOW" }, { &atoms[ATOM_NET_MOVERESIZE_WINDOW], "_NET_MOVERESIZE_WINDOW" }, { &atoms[ATOM_NET_WM_NAME], "_NET_WM_NAME" }, { &atoms[ATOM_NET_WM_ICON], "_NET_WM_ICON" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE], "_NET_WM_WINDOW_TYPE" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_DESKTOP],"_NET_WM_WINDOW_TYPE_DESKTOP" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_DOCK], "_NET_WM_WINDOW_TYPE_DOCK" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_SPLASH], "_NET_WM_WINDOW_TYPE_SPLASH" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_DIALOG], "_NET_WM_WINDOW_TYPE_DIALOG" }, { &atoms[ATOM_NET_WM_WINDOW_TYPE_NORMAL], "_NET_WM_WINDOW_TYPE_NORMAL" }, { &atoms[ATOM_NET_CLIENT_LIST], "_NET_CLIENT_LIST" }, { &atoms[ATOM_NET_CLIENT_LIST_STACKING], "_NET_CLIENT_LIST_STACKING" }, { &atoms[ATOM_NET_WM_STRUT_PARTIAL], "_NET_WM_STRUT_PARTIAL" }, { &atoms[ATOM_NET_WM_STRUT], "_NET_WM_STRUT" }, { &atoms[ATOM_NET_SYSTEM_TRAY_OPCODE], "_NET_SYSTEM_TRAY_OPCODE" }, { &atoms[ATOM_NET_WM_WINDOW_OPACITY], "_NET_WM_WINDOW_OPACITY" }, { &atoms[ATOM_MOTIF_WM_HINTS], "_MOTIF_WM_HINTS" }, { &atoms[ATOM_JWM_RESTART], "_JWM_RESTART" }, { &atoms[ATOM_JWM_EXIT], "_JWM_EXIT" }, { &atoms[ATOM_JWM_RELOAD], "_JWM_RELOAD" } }; static void WriteNetState(ClientNode *np); static void WriteNetAllowed(ClientNode *np); static void ReadWMHints(Window win, ClientState *state); static void ReadMotifHints(Window win, ClientState *state); /** Initialize hints data. */ void InitializeHints() { } /** Set root hints and intern atoms. */ void StartupHints() { unsigned long *array; char *data; Atom *supported; Window win; unsigned int x; unsigned int count; /* Determine how much space we will need on the stack and allocate it. */ count = 0; for(x = 0; x < desktopCount; x++) { count += strlen(GetDesktopName(x)) + 1; } if(count < 4 * desktopCount * sizeof(unsigned long)) { count = 4 * desktopCount * sizeof(unsigned long); } if(count < 2 * sizeof(unsigned long)) { count = 2 * sizeof(unsigned long); } if(count < ATOM_COUNT * sizeof(Atom)) { count = ATOM_COUNT * sizeof(Atom); } data = AllocateStack(count); array = (unsigned long*)data; supported = (Atom*)data; /* Intern the atoms */ for(x = 0; x < ATOM_COUNT; x++) { *atomList[x].atom = JXInternAtom(display, atomList[x].name, False); } /* _NET_SUPPORTED */ for(x = FIRST_NET_ATOM; x <= LAST_NET_ATOM; x++) { supported[x - FIRST_NET_ATOM] = atoms[x]; } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_SUPPORTED], XA_ATOM, 32, PropModeReplace, (unsigned char*)supported, LAST_NET_ATOM - FIRST_NET_ATOM + 1); /* _NET_NUMBER_OF_DESKTOPS */ SetCardinalAtom(rootWindow, ATOM_NET_NUMBER_OF_DESKTOPS, desktopCount); /* _NET_DESKTOP_NAMES */ count = 0; for(x = 0; x < desktopCount; x++) { strcpy(data + count, GetDesktopName(x)); count += strlen(GetDesktopName(x)) + 1; } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_DESKTOP_NAMES], atoms[ATOM_UTF8_STRING], 8, PropModeReplace, (unsigned char*)data, count); /* _NET_WORKAREA */ for(x = 0; x < desktopCount; x++) { array[x * 4 + 0] = 0; array[x * 4 + 1] = 0; array[x * 4 + 2] = rootWidth; array[x * 4 + 3] = rootHeight; } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_WORKAREA], XA_CARDINAL, 32, PropModeReplace, (unsigned char*)array, desktopCount * 4); /* _NET_DESKTOP_GEOMETRY */ array[0] = rootWidth; array[1] = rootHeight; JXChangeProperty(display, rootWindow, atoms[ATOM_NET_DESKTOP_GEOMETRY], XA_CARDINAL, 32, PropModeReplace, (unsigned char*)array, 2); /* _NET_DESKTOP_VIEWPORT */ array[0] = 0; array[1] = 0; JXChangeProperty(display, rootWindow, atoms[ATOM_NET_DESKTOP_VIEWPORT], XA_CARDINAL, 32, PropModeReplace, (unsigned char*)array, 2); win = GetSupportingWindow(); JXChangeProperty(display, win, atoms[ATOM_NET_WM_NAME], atoms[ATOM_UTF8_STRING], 8, PropModeReplace, (unsigned char*)"JWM", 3); SetWindowAtom(rootWindow, ATOM_NET_SUPPORTING_WM_CHECK, win); SetWindowAtom(win, ATOM_NET_SUPPORTING_WM_CHECK, win); ReleaseStack(data); } /** Shutdown hints. */ void ShutdownHints() { } /** Destroy hints data. */ void DestroyHints() { } /** Determine the current desktop. */ void ReadCurrentDesktop() { unsigned long temp; currentDesktop = 0; if(GetCardinalAtom(rootWindow, ATOM_NET_CURRENT_DESKTOP, &temp)) { ChangeDesktop(temp); } else { ChangeDesktop(0); } } /** Read client protocls/hints. * This is called while the client is being added to management. */ void ReadClientProtocols(ClientNode *np) { Status status; ClientNode *pp; Assert(np); ReadWMName(np); ReadWMClass(np); ReadWMNormalHints(np); ReadWMColormaps(np); status = JXGetTransientForHint(display, np->window, &np->owner); if(!status) { np->owner = None; } np->state = ReadWindowState(np->window); if(np->minWidth == np->maxWidth && np->minHeight == np->maxHeight) { np->state.border &= ~BORDER_RESIZE; } /* Set the client to the same layer as its owner. */ if(np->owner != None) { pp = FindClientByWindow(np->owner); if(pp) { np->state.layer = pp->state.layer; } } } /** Write the window state hint for a client. */ void WriteState(ClientNode *np) { unsigned long data[2]; Assert(np); if(np->state.status & STAT_MAPPED) { data[0] = NormalState; } else if(np->state.status & STAT_MINIMIZED) { data[0] = IconicState; } else { data[0] = WithdrawnState; } data[1] = None; JXChangeProperty(display, np->window, atoms[ATOM_WM_STATE], atoms[ATOM_WM_STATE], 32, PropModeReplace, (unsigned char*)data, 2); WriteNetState(np); WriteNetAllowed(np); /* Write the opacity. */ if(np->state.opacity == UINT_MAX) { JXDeleteProperty(display, np->parent, atoms[ATOM_NET_WM_WINDOW_OPACITY]); } else { SetCardinalAtom(np->parent, ATOM_NET_WM_WINDOW_OPACITY, np->state.opacity); } /* Flush to the server. */ JXSync(display, False); } /** Write the net state hint for a client. */ void WriteNetState(ClientNode *np) { unsigned long values[8]; int north, south, east, west; int index; Assert(np); /* We remove the _NET_WM_STATE for withdrawn windows. */ if(!(np->state.status & STAT_MAPPED)) { JXDeleteProperty(display, np->window, atoms[ATOM_NET_WM_STATE]); return; } index = 0; if(np->state.status & STAT_HMAX) { values[index++] = atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ]; } if(np->state.status & STAT_VMAX) { values[index++] = atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT]; } if(np->state.status & STAT_SHADED) { values[index++] = atoms[ATOM_NET_WM_STATE_SHADED]; } if(np->state.status & STAT_STICKY) { values[index++] = atoms[ATOM_NET_WM_STATE_STICKY]; } if(np->state.status & STAT_FULLSCREEN) { values[index++] = atoms[ATOM_NET_WM_STATE_FULLSCREEN]; } if(np->state.status & STAT_NOLIST) { values[index++] = atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR]; } if(np->state.layer == LAYER_BELOW) { values[index++] = atoms[ATOM_NET_WM_STATE_BELOW]; } else if(np->state.layer == LAYER_ABOVE) { values[index++] = atoms[ATOM_NET_WM_STATE_ABOVE]; } JXChangeProperty(display, np->window, atoms[ATOM_NET_WM_STATE], XA_ATOM, 32, PropModeReplace, (unsigned char*)values, index); GetBorderSize(np, &north, &south, &east, &west); /* left, right, top, bottom */ values[0] = west; values[1] = east; values[2] = north; values[3] = south; JXChangeProperty(display, np->window, atoms[ATOM_NET_FRAME_EXTENTS], XA_CARDINAL, 32, PropModeReplace, (unsigned char*)values, 4); } /** Write the allowed action property. */ void WriteNetAllowed(ClientNode *np) { unsigned long values[12]; int index; Assert(np); index = 0; if(np->state.border & BORDER_TITLE) { values[index++] = atoms[ATOM_NET_WM_ACTION_SHADE]; } if(np->state.border & BORDER_MIN) { values[index++] = atoms[ATOM_NET_WM_ACTION_MINIMIZE]; } if(np->state.border & BORDER_MAX) { values[index++] = atoms[ATOM_NET_WM_ACTION_MAXIMIZE_HORZ]; values[index++] = atoms[ATOM_NET_WM_ACTION_MAXIMIZE_VERT]; } if(np->state.border & BORDER_CLOSE) { values[index++] = atoms[ATOM_NET_WM_ACTION_CLOSE]; } if(np->state.border & BORDER_RESIZE) { values[index++] = atoms[ATOM_NET_WM_ACTION_RESIZE]; } if(np->state.border & BORDER_MOVE) { values[index++] = atoms[ATOM_NET_WM_ACTION_MOVE]; } if(!(np->state.status & STAT_STICKY)) { values[index++] = atoms[ATOM_NET_WM_ACTION_CHANGE_DESKTOP]; } values[index++] = atoms[ATOM_NET_WM_ACTION_STICK]; values[index++] = atoms[ATOM_NET_WM_ACTION_BELOW]; values[index++] = atoms[ATOM_NET_WM_ACTION_ABOVE]; JXChangeProperty(display, np->window, atoms[ATOM_NET_WM_ALLOWED_ACTIONS], XA_ATOM, 32, PropModeReplace, (unsigned char*)values, index); } /** Read all hints needed to determine the current window state. */ ClientState ReadWindowState(Window win) { ClientState result; Status status; unsigned long count, x; unsigned long extra; Atom realType; int realFormat; unsigned char *temp; Atom *state; unsigned long card; int maxVert, maxHorz; int fullScreen; Assert(win != None); result.status = STAT_NONE; result.border = BORDER_DEFAULT; result.layer = LAYER_NORMAL; result.desktop = currentDesktop; result.opacity = 0xFFFFFFFF; ReadWMHints(win, &result); ReadMotifHints(win, &result); /* _NET_WM_DESKTOP */ if(GetCardinalAtom(win, ATOM_NET_WM_DESKTOP, &card)) { if(card == ~0UL) { result.status |= STAT_STICKY; } else if(card < desktopCount) { result.desktop = card; } else { result.desktop = desktopCount - 1; } } /* _NET_WM_STATE */ status = JXGetWindowProperty(display, win, atoms[ATOM_NET_WM_STATE], 0, 32, False, XA_ATOM, &realType, &realFormat, &count, &extra, &temp); if(status == Success) { if(count > 0) { maxVert = 0; maxHorz = 0; fullScreen = 0; state = (Atom*)temp; for(x = 0; x < count; x++) { if(state[x] == atoms[ATOM_NET_WM_STATE_STICKY]) { result.status |= STAT_STICKY; } else if(state[x] == atoms[ATOM_NET_WM_STATE_SHADED]) { result.status |= STAT_SHADED; } else if(state[x] == atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT]) { maxVert = 1; } else if(state[x] == atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ]) { maxHorz = 1; } else if(state[x] == atoms[ATOM_NET_WM_STATE_FULLSCREEN]) { fullScreen = 1; result.layer = LAYER_TOP; } else if(state[x] == atoms[ATOM_NET_WM_STATE_HIDDEN]) { result.status |= STAT_MINIMIZED; } else if(state[x] == atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR]) { result.status |= STAT_NOLIST; } else if(state[x] == atoms[ATOM_NET_WM_STATE_ABOVE]) { result.layer = LAYER_ABOVE; } else if(state[x] == atoms[ATOM_NET_WM_STATE_BELOW]) { result.layer = LAYER_BELOW; } } if(maxHorz) { result.status |= STAT_HMAX; } if(maxVert) { result.status |= STAT_VMAX; } if(fullScreen) { result.status |= STAT_FULLSCREEN; } } if(temp) { JXFree(temp); } } /* _NET_WM_WINDOW_TYPE */ status = JXGetWindowProperty(display, win, atoms[ATOM_NET_WM_WINDOW_TYPE], 0, 32, False, XA_ATOM, &realType, &realFormat, &count, &extra, &temp); if(status == Success) { /* Loop until we hit a window type we recognize. */ state = (Atom*)temp; for(x = 0; x < count; x++) { if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_NORMAL]) { break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_DESKTOP]) { if(result.layer == LAYER_NORMAL) { result.layer = LAYER_BOTTOM; } result.border = BORDER_NONE; result.status |= STAT_STICKY; result.status |= STAT_NOLIST; break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_DOCK]) { result.border = BORDER_NONE; if(result.layer == LAYER_NORMAL) { result.layer = LAYER_ABOVE; } break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_SPLASH]) { result.border = BORDER_NONE; break; } else if( state[x] == atoms[ATOM_NET_WM_WINDOW_TYPE_DIALOG]) { result.border &= ~BORDER_MIN; result.status |= STAT_NOLIST; break; } else { Debug("Unknown _NET_WM_WINDOW_TYPE: %lu", state[x]); } } if(temp) { JXFree(temp); } } /* _NET_WM_WINDOW_OPACITY */ if(GetCardinalAtom(win, ATOM_NET_WM_WINDOW_OPACITY, &card)) { result.opacity = card; } return result; } /** Determine the title to display for a client. */ void ReadWMName(ClientNode *np) { unsigned long count; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *name; #ifdef USE_XUTF8 XTextProperty tprop; char **text_list; int tcount; #endif Assert(np); if(np->name) { JXFree(np->name); } status = JXGetWindowProperty(display, np->window, atoms[ATOM_NET_WM_NAME], 0, 1024, False, atoms[ATOM_UTF8_STRING], &realType, &realFormat, &count, &extra, &name); if(status != Success) { np->name = NULL; } else { np->name = (char*)name; } #ifdef USE_XUTF8 if(!np->name) { status = JXGetWindowProperty(display, np->window, XA_WM_NAME, 0, 1024, False, atoms[ATOM_COMPOUND_TEXT], &realType, &realFormat, &count, &extra, &name); if(status == Success && realFormat == 8) { tprop.value = name; tprop.encoding = atoms[ATOM_COMPOUND_TEXT]; tprop.format = realFormat; tprop.nitems = strlen((char *)name); if(Xutf8TextPropertyToTextList(display, &tprop, &text_list, &tcount) == Success && tcount > 0) { np->name = Xmalloc(strlen(text_list[0]) + 1); if(np->name) { strcpy(np->name, text_list[0]); } XFreeStringList(text_list); } JXFree(name); } } #endif if(!np->name) { if(JXFetchName(display, np->window, &np->name) == 0) { np->name = NULL; } } } /** Read the window class for a client. */ void ReadWMClass(ClientNode *np) { XClassHint hint; Assert(np); if(JXGetClassHint(display, np->window, &hint)) { np->instanceName = hint.res_name; np->className = hint.res_class; } } /** Read the protocols hint for a window. */ ClientProtocolType ReadWMProtocols(Window w) { ClientProtocolType result; unsigned long count, x; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *temp; Atom *p; Assert(w != None); result = PROT_NONE; status = JXGetWindowProperty(display, w, atoms[ATOM_WM_PROTOCOLS], 0, 32, False, XA_ATOM, &realType, &realFormat, &count, &extra, &temp); p = (Atom*)temp; if(status != Success || !p) { return result; } for(x = 0; x < count; x++) { if(p[x] == atoms[ATOM_WM_DELETE_WINDOW]) { result |= PROT_DELETE; } else if(p[x] == atoms[ATOM_WM_TAKE_FOCUS]) { result |= PROT_TAKE_FOCUS; } } JXFree(p); return result; } /** Read the "normal hints" for a client. */ void ReadWMNormalHints(ClientNode *np) { XSizeHints hints; long temp; Assert(np); if(!JXGetWMNormalHints(display, np->window, &hints, &temp)) { np->sizeFlags = 0; } else { np->sizeFlags = hints.flags; } if(np->sizeFlags & PResizeInc) { np->xinc = Max(1, hints.width_inc); np->yinc = Max(1, hints.height_inc); } else { np->xinc = 1; np->yinc = 1; } if(np->sizeFlags & PMinSize) { np->minWidth = Max(0, hints.min_width); np->minHeight = Max(0, hints.min_height); } else { np->minWidth = 1; np->minHeight = 1; } if(np->sizeFlags & PMaxSize) { np->maxWidth = hints.max_width; np->maxHeight = hints.max_height; if(np->maxWidth <= 0) { np->maxWidth = rootWidth; } if(np->maxHeight <= 0) { np->maxHeight = rootHeight; } } else { np->maxWidth = MAX_WINDOW_WIDTH; np->maxHeight = MAX_WINDOW_HEIGHT; } if(np->sizeFlags & PBaseSize) { np->baseWidth = hints.base_width; np->baseHeight = hints.base_height; } else if(np->sizeFlags & PMinSize) { np->baseWidth = np->minWidth; np->baseHeight = np->minHeight; } else { np->baseWidth = 0; np->baseHeight = 0; } if(np->sizeFlags & PAspect) { np->aspect.minx = hints.min_aspect.x; np->aspect.miny = hints.min_aspect.y; np->aspect.maxx = hints.max_aspect.x; np->aspect.maxy = hints.max_aspect.y; if(np->aspect.minx < 1) { np->aspect.minx = 1; } if(np->aspect.miny < 1) { np->aspect.miny = 1; } if(np->aspect.maxx < 1) { np->aspect.maxx = 1; } if(np->aspect.maxy < 1) { np->aspect.maxy = 1; } } if(np->sizeFlags & PWinGravity) { np->gravity = hints.win_gravity; } else { np->gravity = 1; } } /** Read colormap information for a client. */ void ReadWMColormaps(ClientNode *np) { Window *windows; ColormapNode *cp; int count; int x; Assert(np); if(JXGetWMColormapWindows(display, np->window, &windows, &count)) { if(count > 0) { /* Free old colormaps. */ while(np->colormaps) { cp = np->colormaps->next; Release(np->colormaps); np->colormaps = cp; } /* Put the maps in the list in order so they will come out in * reverse order. This way they will be installed with the * most important last. * Keep track of at most colormapCount colormaps for each * window to avoid doing extra work. */ count = Min(colormapCount, count); for(x = 0; x < count; x++) { cp = Allocate(sizeof(ColormapNode)); cp->window = windows[x]; cp->next = np->colormaps; np->colormaps = cp; } JXFree(windows); } } } /** Read the WM hints for a window. */ void ReadWMHints(Window win, ClientState *state) { XWMHints *wmhints; Assert(win != None); Assert(state); wmhints = JXGetWMHints(display, win); if(wmhints) { if(wmhints->flags & StateHint) { switch(wmhints->initial_state) { case IconicState: state->status |= STAT_MINIMIZED; break; case WithdrawnState: default: if(!(state->status & (STAT_MINIMIZED | STAT_NOLIST))) { state->status |= STAT_MAPPED; } } } else { state->status |= STAT_MAPPED; } JXFree(wmhints); } else { state->status |= STAT_MAPPED; } } /** Read _MOTIF_WM_HINTS */ void ReadMotifHints(Window win, ClientState *state) { PropMwmHints *mhints; Atom type; unsigned long itemCount, bytesLeft; unsigned char *data; int format; Assert(win != None); Assert(state); if(JXGetWindowProperty(display, win, atoms[ATOM_MOTIF_WM_HINTS], 0L, 20L, False, atoms[ATOM_MOTIF_WM_HINTS], &type, &format, &itemCount, &bytesLeft, &data) != Success) { return; } mhints = (PropMwmHints*)data; if(mhints) { if((mhints->flags & MWM_HINTS_FUNCTIONS) && !(mhints->functions & MWM_FUNC_ALL)) { if(!(mhints->functions & MWM_FUNC_RESIZE)) { state->border &= ~BORDER_RESIZE; } if(!(mhints->functions & MWM_FUNC_MOVE)) { state->border &= ~BORDER_MOVE; } if(!(mhints->functions & MWM_FUNC_MINIMIZE)) { state->border &= ~BORDER_MIN; } if(!(mhints->functions & MWM_FUNC_MAXIMIZE)) { state->border &= ~BORDER_MAX; } if(!(mhints->functions & MWM_FUNC_CLOSE)) { state->border &= ~BORDER_CLOSE; } } if((mhints->flags & MWM_HINTS_DECORATIONS) && !(mhints->decorations & MWM_DECOR_ALL)) { if(!(mhints->decorations & MWM_DECOR_BORDER)) { state->border &= ~BORDER_OUTLINE; } if(!(mhints->decorations & MWM_DECOR_TITLE)) { state->border &= ~BORDER_TITLE; } if(!(mhints->decorations & MWM_DECOR_MINIMIZE)) { state->border &= ~BORDER_MIN; } if(!(mhints->decorations & MWM_DECOR_MAXIMIZE)) { state->border &= ~BORDER_MAX; } } JXFree(mhints); } } /** Read a cardinal atom. */ int GetCardinalAtom(Window window, AtomType atom, unsigned long *value) { unsigned long count; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *data; int ret; Assert(window != None); Assert(value); status = JXGetWindowProperty(display, window, atoms[atom], 0, 1, False, XA_CARDINAL, &realType, &realFormat, &count, &extra, &data); ret = 0; if(status == Success && data) { if(count == 1) { *value = *(unsigned long*)data; ret = 1; } JXFree(data); } return ret; } /** Read a window atom. */ int GetWindowAtom(Window window, AtomType atom, Window *value) { unsigned long count; int status; unsigned long extra; Atom realType; int realFormat; unsigned char *data; int ret; Assert(window != None); Assert(value); status = JXGetWindowProperty(display, window, atoms[atom], 0, 1, False, XA_WINDOW, &realType, &realFormat, &count, &extra, &data); ret = 0; if(status == Success && data) { if(count == 1) { *value = *(Window*)data; ret = 1; } JXFree(data); } return ret; } /** Set a cardinal atom. */ void SetCardinalAtom(Window window, AtomType atom, unsigned long value) { Assert(window != None); JXChangeProperty(display, window, atoms[atom], XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&value, 1); } /** Set a window atom. */ void SetWindowAtom(Window window, AtomType atom, unsigned long value) { Assert(window != None); JXChangeProperty(display, window, atoms[atom], XA_WINDOW, 32, PropModeReplace, (unsigned char*)&value, 1); } /** Set a pixmap atom. */ void SetPixmapAtom(Window window, AtomType atom, Pixmap value) { Assert(window != None); JXChangeProperty(display, window, atoms[atom], XA_PIXMAP, 32, PropModeReplace, (unsigned char*)&value, 1); } jwm-2.1.0+svn579/src/image.c0000644000000000000000000002501611710374021014071 0ustar rootroot/** * @file image.c * @author Joe Wingbermuehle * @date 2005-2007 * * @brief Functions to load images. * */ #include "jwm.h" #ifndef MAKE_DEPEND /* We should include png.h here. See jwm.h for an explanation. */ # ifdef USE_XPM # include # endif # ifdef USE_JPEG # include # endif #endif /* MAKE_DEPEND */ #include "image.h" #include "main.h" #include "error.h" #include "color.h" #ifdef USE_JPEG static ImageNode *LoadJPEGImage(const char *fileName); #endif #ifdef USE_PNG static ImageNode *LoadPNGImage(const char *fileName); #endif #ifdef USE_XPM static ImageNode *LoadXPMImage(const char *fileName); #endif static ImageNode *CreateImageFromXImages(XImage *image, XImage *shape); #ifdef USE_XPM static int AllocateColor(Display *d, Colormap cmap, char *name, XColor *c, void *closure); static int FreeColors(Display *d, Colormap cmap, Pixel *pixels, int n, void *closure); #endif /** Load an image from the specified file. */ ImageNode *LoadImage(const char *fileName) { ImageNode *result; if(!fileName) { return NULL; } /* Attempt to load the file as a PNG image. */ #ifdef USE_PNG result = LoadPNGImage(fileName); if(result) { return result; } #endif /* Attempt to load the file as a JPEG image. */ #ifdef USE_JPEG result = LoadJPEGImage(fileName); if(result) { return result; } #endif /* Attempt to load the file as an XPM image. */ #ifdef USE_XPM result = LoadXPMImage(fileName); if(result) { return result; } #endif return NULL; } /** Load an image from the specified XPM data. */ ImageNode *LoadImageFromData(char **data) { ImageNode *result = NULL; #ifdef USE_XPM XpmAttributes attr; XImage *image; XImage *shape; int rc; Assert(data); attr.valuemask = XpmAllocColor | XpmFreeColors | XpmColorClosure; attr.alloc_color = AllocateColor; attr.free_colors = FreeColors; attr.color_closure = NULL; rc = XpmCreateImageFromData(display, data, &image, &shape, &attr); if(rc == XpmSuccess) { result = CreateImageFromXImages(image, shape); JXDestroyImage(image); if(shape) { JXDestroyImage(shape); } } #endif return result; } /** Load a PNG image from the given file name. * Since libpng uses longjmp, this function is not reentrant to simplify * the issues surrounding longjmp and local variables. */ #ifdef USE_PNG ImageNode *LoadPNGImage(const char *fileName) { static ImageNode *result; static FILE *fd; static unsigned char **rows; static png_structp pngData; static png_infop pngInfo; static png_infop pngEndInfo; unsigned char header[8]; unsigned long rowBytes; int bitDepth, colorType; unsigned int x, y; png_uint_32 width; png_uint_32 height; Assert(fileName); result = NULL; fd = NULL; rows = NULL; pngData = NULL; pngInfo = NULL; pngEndInfo = NULL; fd = fopen(fileName, "rb"); if(!fd) { return NULL; } x = fread(header, 1, sizeof(header), fd); if(x != sizeof(header) || png_sig_cmp(header, 0, sizeof(header))) { fclose(fd); return NULL; } pngData = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(JUNLIKELY(!pngData)) { fclose(fd); Warning(_("could not create read struct for PNG image: %s"), fileName); return NULL; } if(JUNLIKELY(setjmp(png_jmpbuf(pngData)))) { png_destroy_read_struct(&pngData, &pngInfo, &pngEndInfo); if(fd) { fclose(fd); } if(rows) { Release(rows); } if(result) { if(result->data) { Release(result->data); } Release(result); } Warning(_("error reading PNG image: %s"), fileName); } pngInfo = png_create_info_struct(pngData); if(JUNLIKELY(!pngInfo)) { png_destroy_read_struct(&pngData, NULL, NULL); fclose(fd); Warning(_("could not create info struct for PNG image: %s"), fileName); return NULL; } pngEndInfo = png_create_info_struct(pngData); if(JUNLIKELY(!pngEndInfo)) { png_destroy_read_struct(&pngData, &pngInfo, NULL); fclose(fd); Warning("could not create end info struct for PNG image: %s", fileName); return NULL; } png_init_io(pngData, fd); png_set_sig_bytes(pngData, sizeof(header)); png_read_info(pngData, pngInfo); result = Allocate(sizeof(ImageNode)); png_get_IHDR(pngData, pngInfo, &width, &height, &bitDepth, &colorType, NULL, NULL, NULL); result->width = (int)width; result->height = (int)height; png_set_expand(pngData); if(bitDepth == 16) { png_set_strip_16(pngData); } else if(bitDepth < 8) { png_set_packing(pngData); } png_set_swap_alpha(pngData); png_set_filler(pngData, 0xFF, PNG_FILLER_BEFORE); if(colorType == PNG_COLOR_TYPE_GRAY || colorType == PNG_COLOR_TYPE_GRAY_ALPHA) { png_set_gray_to_rgb(pngData); } png_read_update_info(pngData, pngInfo); rowBytes = png_get_rowbytes(pngData, pngInfo); result->data = Allocate(rowBytes * result->height); rows = AllocateStack(result->height * sizeof(result->data)); y = 0; for(x = 0; x < result->height; x++) { rows[x] = &result->data[y]; y += rowBytes; } png_read_image(pngData, rows); png_read_end(pngData, pngInfo); png_destroy_read_struct(&pngData, &pngInfo, &pngEndInfo); fclose(fd); ReleaseStack(rows); rows = NULL; return result; } #endif /* USE_PNG */ /** Load a JPEG image from the specified file. */ #ifdef USE_JPEG typedef struct { struct jpeg_error_mgr pub; jmp_buf jbuffer; } JPEGErrorStruct; static void JPEGErrorHandler(j_common_ptr cinfo) { JPEGErrorStruct *es = (JPEGErrorStruct*)cinfo->err; longjmp(es->jbuffer, 1); } ImageNode *LoadJPEGImage(const char *fileName) { static ImageNode *result; static struct jpeg_decompress_struct cinfo; static FILE *fd; static JSAMPARRAY buffer; static JPEGErrorStruct jerr; int rowStride; int x; int inIndex, outIndex; /* Open the file. */ fd = fopen(fileName, "rb"); if(fd == NULL) { return NULL; } /* Make sure everything is initialized so we can recover from errors. */ result = NULL; buffer = NULL; /* Setup the error handler. */ cinfo.err = jpeg_std_error(&jerr.pub); jerr.pub.error_exit = JPEGErrorHandler; /* Control will return here if an error was encountered. */ if(setjmp(jerr.jbuffer)) { if(result) { DestroyImage(result); } jpeg_destroy_decompress(&cinfo); fclose(fd); return NULL; } /* Prepare to load the file. */ jpeg_create_decompress(&cinfo); jpeg_stdio_src(&cinfo, fd); /* Check the header. */ jpeg_read_header(&cinfo, TRUE); /* Start decompression. */ jpeg_start_decompress(&cinfo); rowStride = cinfo.output_width * cinfo.output_components; buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr)&cinfo, JPOOL_IMAGE, rowStride, 1); result = Allocate(sizeof(ImageNode)); result->width = cinfo.image_width; result->height = cinfo.image_height; result->data = Allocate(4 * result->width * result->height); /* Read lines. */ outIndex = 0; while(cinfo.output_scanline < cinfo.output_height) { jpeg_read_scanlines(&cinfo, buffer, 1); inIndex = 0; for(x = 0; x < result->width; x++) { switch(cinfo.output_components) { case 1: /* Grayscale. */ result->data[outIndex + 1] = GETJSAMPLE(buffer[0][inIndex]); result->data[outIndex + 2] = GETJSAMPLE(buffer[0][inIndex]); result->data[outIndex + 3] = GETJSAMPLE(buffer[0][inIndex]); inIndex += 1; break; default: /* RGB */ result->data[outIndex + 1] = GETJSAMPLE(buffer[0][inIndex + 0]); result->data[outIndex + 2] = GETJSAMPLE(buffer[0][inIndex + 1]); result->data[outIndex + 3] = GETJSAMPLE(buffer[0][inIndex + 2]); inIndex += 3; break; } result->data[outIndex + 0] = 0xFF; outIndex += 4; } } /* Clean up. */ jpeg_destroy_decompress(&cinfo); fclose(fd); return result; } #endif /* USE_JPEG */ /** Load an XPM image from the specified file. */ #ifdef USE_XPM ImageNode *LoadXPMImage(const char *fileName) { ImageNode *result = NULL; XpmAttributes attr; XImage *image; XImage *shape; int rc; Assert(fileName); attr.valuemask = XpmAllocColor | XpmFreeColors | XpmColorClosure; attr.alloc_color = AllocateColor; attr.free_colors = FreeColors; attr.color_closure = NULL; rc = XpmReadFileToImage(display, (char*)fileName, &image, &shape, &attr); if(rc == XpmSuccess) { result = CreateImageFromXImages(image, shape); JXDestroyImage(image); if(shape) { JXDestroyImage(shape); } } return result; } #endif /* USE_XPM */ /** Create an image from XImages giving color and shape information. */ ImageNode *CreateImageFromXImages(XImage *image, XImage *shape) { ImageNode *result; XColor color; unsigned char red, green, blue, alpha; int index; int x, y; result = Allocate(sizeof(ImageNode)); result->data = Allocate(4 * image->width * image->height); result->width = image->width; result->height = image->height; index = 0; for(y = 0; y < image->height; y++) { for(x = 0; x < image->width; x++) { color.pixel = XGetPixel(image, x, y); GetColorFromIndex(&color); red = (unsigned char)(color.red >> 8); green = (unsigned char)(color.green >> 8); blue = (unsigned char)(color.blue >> 8); alpha = 0; if(!shape || XGetPixel(shape, x, y)) { alpha = 255; } result->data[index++] = alpha; result->data[index++] = red; result->data[index++] = green; result->data[index++] = blue; } } return result; } /** Destroy an image node. */ void DestroyImage(ImageNode *image) { if(image) { Release(image->data); Release(image); } } /** Callback to allocate a color for libxpm. */ #ifdef USE_XPM int AllocateColor(Display *d, Colormap cmap, char *name, XColor *c, void *closure) { if(name) { if(!JXParseColor(d, cmap, name, c)) { return -1; } } GetColorIndex(c); return 1; } #endif /* USE_XPM */ /** Callback to free colors allocated by libxpm. * We don't need to do anything here since color.c takes care of this. */ #ifdef USE_XPM int FreeColors(Display *d, Colormap cmap, Pixel *pixels, int n, void *closure) { return 1; } #endif /* USE_XPM */ jwm-2.1.0+svn579/src/clock.c0000644000000000000000000001606211710374021014103 0ustar rootroot/** * @file clock.c * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Clock tray component. * */ #include "jwm.h" #include "clock.h" #include "tray.h" #include "color.h" #include "font.h" #include "timing.h" #include "main.h" #include "command.h" #include "cursor.h" #include "popup.h" #include "misc.h" /** Structure to respresent a clock tray component. */ typedef struct ClockType { TrayComponentType *cp; /**< Common component data. */ char *format; /**< The time format to use. */ char *zone; /**< The time zone to use (NULL = local). */ char *command; /**< A command to run when clicked. */ char shortTime[80]; /**< Currently displayed time. */ /* The following are used to control popups. */ int mousex; /**< Last mouse x-coordinate. */ int mousey; /**< Last mouse y-coordinate. */ TimeType mouseTime; /**< Time of the last mouse motion. */ int userWidth; /**< User-specified clock width (or 0). */ struct ClockType *next; /**< Next clock in the list. */ } ClockType; /** The default time format to use. */ static const char *DEFAULT_FORMAT = "%I:%M %p"; static ClockType *clocks; static TimeType lastUpdate = ZERO_TIME; static void Create(TrayComponentType *cp); static void Resize(TrayComponentType *cp); static void Destroy(TrayComponentType *cp); static void ProcessClockButtonEvent(TrayComponentType *cp, int x, int y, int mask); static void ProcessClockMotionEvent(TrayComponentType *cp, int x, int y, int mask); static void DrawClock(ClockType *clk, const TimeType *now, int x, int y); /** Initialize clocks. */ void InitializeClock() { clocks = NULL; } /** Start clock(s). */ void StartupClock() { ClockType *clk; for(clk = clocks; clk; clk = clk->next) { if(clk->cp->requestedWidth == 0) { clk->cp->requestedWidth = 1; } if(clk->cp->requestedHeight == 0) { clk->cp->requestedHeight = GetStringHeight(FONT_CLOCK) + 4; } } } /** Stop clock(s). */ void ShutdownClock() { } /** Destroy clock(s). */ void DestroyClock() { ClockType *cp; while(clocks) { cp = clocks->next; if(clocks->format) { Release(clocks->format); } if(clocks->zone) { Release(clocks->zone); } if(clocks->command) { Release(clocks->command); } Release(clocks); clocks = cp; } } /** Create a clock tray component. */ TrayComponentType *CreateClock(const char *format, const char *zone, const char *command, int width, int height) { TrayComponentType *cp; ClockType *clk; clk = Allocate(sizeof(ClockType)); clk->next = clocks; clocks = clk; clk->mousex = -POPUP_DELTA; clk->mousey = -POPUP_DELTA; clk->mouseTime.seconds = 0; clk->mouseTime.ms = 0; clk->userWidth = 0; if(!format) { format = DEFAULT_FORMAT; } clk->format = CopyString(format); clk->zone = CopyString(zone); clk->command = CopyString(command); clk->shortTime[0] = 0; cp = CreateTrayComponent(); cp->object = clk; clk->cp = cp; if(width > 0) { cp->requestedWidth = width; clk->userWidth = 1; } else { cp->requestedWidth = 0; clk->userWidth = 0; } cp->requestedHeight = height; cp->Create = Create; cp->Resize = Resize; cp->Destroy = Destroy; cp->ProcessButtonPress = ProcessClockButtonEvent; cp->ProcessMotionEvent = ProcessClockMotionEvent; return cp; } /** Initialize a clock tray component. */ void Create(TrayComponentType *cp) { Assert(cp); cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, rootDepth); JXSetForeground(display, rootGC, colors[COLOR_CLOCK_BG]); JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); } /** Resize a clock tray component. */ void Resize(TrayComponentType *cp) { ClockType *clk; TimeType now; int x, y; Assert(cp); clk = (ClockType*)cp->object; Assert(clk); if(cp->pixmap != None) { JXFreePixmap(display, cp->pixmap); } cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, rootDepth); clk->shortTime[0] = 0; GetCurrentTime(&now); GetMousePosition(&x, &y); DrawClock(clk, &now, x, y); } /** Destroy a clock tray component. */ void Destroy(TrayComponentType *cp) { Assert(cp); if(cp->pixmap != None) { JXFreePixmap(display, cp->pixmap); } } /** Process a click event on a clock tray component. */ void ProcessClockButtonEvent(TrayComponentType *cp, int x, int y, int mask) { ClockType *clk; Assert(cp); clk = (ClockType*)cp->object; Assert(clk); if(clk->command) { RunCommand(clk->command); } } /** Process a motion event on a clock tray component. */ void ProcessClockMotionEvent(TrayComponentType *cp, int x, int y, int mask) { ClockType *clk; Assert(cp); clk = (ClockType*)cp->object; clk->mousex = cp->screenx + x; clk->mousey = cp->screeny + y; GetCurrentTime(&clk->mouseTime); } /** Update a clock tray component. */ void SignalClock(const TimeType *now, int x, int y) { ClockType *cp; int shouldDraw; const char *longTime; Assert(now); /* Determine if we should update the clock(s). */ if(GetTimeDifference(&lastUpdate, now) > 900) { shouldDraw = 1; lastUpdate = *now; } else { shouldDraw = 0; } /* Update each clock. */ for(cp = clocks; cp; cp = cp->next) { if(shouldDraw) { DrawClock(cp, now, x, y); } if(abs(cp->mousex - x) < POPUP_DELTA && abs(cp->mousey - y) < POPUP_DELTA) { if(GetTimeDifference(now, &cp->mouseTime) >= popupDelay) { longTime = GetTimeString("%c", cp->zone); ShowPopup(x, y, longTime); } } } } /** Draw a clock tray component. */ void DrawClock(ClockType *clk, const TimeType *now, int x, int y) { TrayComponentType *cp; const char *shortTime; int width; int rwidth; Assert(clk); Assert(now); /* Only draw if the label changed. */ shortTime = GetTimeString(clk->format, clk->zone); if(!strcmp(clk->shortTime, shortTime)) { return; } strcpy(clk->shortTime, shortTime); cp = clk->cp; /* Clear the area. */ JXSetForeground(display, rootGC, colors[COLOR_CLOCK_BG]); JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); /* Determine if the clock is the right size. */ width = GetStringWidth(FONT_CLOCK, shortTime); rwidth = width + 4; if(rwidth == clk->cp->requestedWidth || clk->userWidth) { /* Draw the clock. */ RenderString(cp->pixmap, FONT_CLOCK, COLOR_CLOCK_FG, (cp->width - width) / 2, (cp->height - GetStringHeight(FONT_CLOCK)) / 2, cp->width, NULL, shortTime); UpdateSpecificTray(clk->cp->tray, clk->cp); } else { /* Wrong size. Resize. */ clk->cp->requestedWidth = rwidth; ResizeTray(clk->cp->tray); } } jwm-2.1.0+svn579/src/event.c0000644000000000000000000007614211710374021014136 0ustar rootroot/** * @file event.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle X11 events. * */ #include "jwm.h" #include "event.h" #include "client.h" #include "clientlist.h" #include "clock.h" #include "confirm.h" #include "cursor.h" #include "desktop.h" #include "dock.h" #include "hint.h" #include "icon.h" #include "key.h" #include "main.h" #include "move.h" #include "pager.h" #include "place.h" #include "popup.h" #include "resize.h" #include "root.h" #include "swallow.h" #include "taskbar.h" #include "timing.h" #include "tray.h" #include "traybutton.h" #include "winmenu.h" #include "error.h" #define MIN_TIME_DELTA 50 Time eventTime = CurrentTime; static void Signal(); static void DispatchBorderButtonEvent(const XButtonEvent *event, ClientNode *np); static void HandleConfigureRequest(const XConfigureRequestEvent *event); static int HandleConfigureNotify(const XConfigureEvent *event); static int HandleExpose(const XExposeEvent *event); static int HandlePropertyNotify(const XPropertyEvent *event); static void HandleClientMessage(const XClientMessageEvent *event); static void HandleColormapChange(const XColormapEvent *event); static int HandleDestroyNotify(const XDestroyWindowEvent *event); static void HandleMapRequest(const XMapEvent *event); static void HandleUnmapNotify(const XUnmapEvent *event); static void HandleButtonEvent(const XButtonEvent *event); static void HandleKeyPress(const XKeyEvent *event); static void HandleKeyRelease(const XKeyEvent *event); static void HandleEnterNotify(const XCrossingEvent *event); static void HandleLeaveNotify(const XCrossingEvent *event); static void HandleMotionNotify(const XMotionEvent *event); static int HandleSelectionClear(const XSelectionClearEvent *event); static void HandleNetMoveResize(const XClientMessageEvent *event, ClientNode *np); static void HandleNetWMState(const XClientMessageEvent *event, ClientNode *np); #ifdef USE_SHAPE static void HandleShapeEvent(const XShapeEvent *event); #endif /** Wait for an event and process it. */ void WaitForEvent(XEvent *event) { struct timeval timeout; fd_set fds; int fd; int handled; fd = JXConnectionNumber(display); do { while(JXPending(display) == 0) { FD_ZERO(&fds); FD_SET(fd, &fds); timeout.tv_usec = 0; timeout.tv_sec = 1; if(select(fd + 1, &fds, NULL, NULL, &timeout) <= 0) { Signal(); } } Signal(); JXNextEvent(display, event); UpdateTime(event); switch(event->type) { case ConfigureRequest: HandleConfigureRequest(&event->xconfigurerequest); handled = 1; break; case MapRequest: HandleMapRequest(&event->xmap); handled = 1; break; case PropertyNotify: handled = HandlePropertyNotify(&event->xproperty); break; case ClientMessage: HandleClientMessage(&event->xclient); handled = 1; break; case UnmapNotify: HandleUnmapNotify(&event->xunmap); handled = 1; break; case Expose: handled = HandleExpose(&event->xexpose); break; case ColormapNotify: HandleColormapChange(&event->xcolormap); handled = 1; break; case DestroyNotify: handled = HandleDestroyNotify(&event->xdestroywindow); break; case SelectionClear: handled = HandleSelectionClear(&event->xselectionclear); break; case ResizeRequest: handled = HandleDockResizeRequest(&event->xresizerequest); break; case MotionNotify: SetMousePosition(event->xmotion.x_root, event->xmotion.y_root); handled = 0; break; case ReparentNotify: HandleDockReparentNotify(&event->xreparent); handled = 1; break; case ConfigureNotify: handled = HandleConfigureNotify(&event->xconfigure); break; case CreateNotify: case MapNotify: case GraphicsExpose: case NoExpose: handled = 1; break; default: if(0) { #ifdef USE_SHAPE } else if(haveShape && event->type == shapeEvent) { HandleShapeEvent((XShapeEvent*)event); handled = 1; #endif } else { handled = 0; } break; } if(!handled) { handled = ProcessTrayEvent(event); } if(!handled) { handled = ProcessDialogEvent(event); } if(!handled) { handled = ProcessSwallowEvent(event); } if(!handled) { handled = ProcessPopupEvent(event); } } while(handled && !shouldExit); } /** Wake up components that need to run at certain times. */ void Signal() { static TimeType last = ZERO_TIME; TimeType now; int x, y; GetCurrentTime(&now); if(GetTimeDifference(&now, &last) < MIN_TIME_DELTA) { return; } last = now; GetMousePosition(&x, &y); SignalTaskbar(&now, x, y); SignalTrayButton(&now, x, y); SignalClock(&now, x, y); SignalTray(&now, x, y); SignalPager(&now, x, y); SignalPopup(&now, x, y); } /** Process an event. */ void ProcessEvent(XEvent *event) { switch(event->type) { case ButtonPress: case ButtonRelease: HandleButtonEvent(&event->xbutton); break; case KeyPress: HandleKeyPress(&event->xkey); break; case KeyRelease: HandleKeyRelease(&event->xkey); break; case EnterNotify: HandleEnterNotify(&event->xcrossing); break; case LeaveNotify: HandleLeaveNotify(&event->xcrossing); break; case MotionNotify: while(JXCheckTypedEvent(display, MotionNotify, event)); UpdateTime(event); HandleMotionNotify(&event->xmotion); break; case DestroyNotify: case Expose: case ConfigureNotify: break; default: Debug("Unknown event type: %d", event->type); break; } } /** Discard motion events for the specified window. */ void DiscardMotionEvents(XEvent *event, Window w) { XEvent temp; while(JXCheckTypedEvent(display, MotionNotify, &temp)) { UpdateTime(event); SetMousePosition(temp.xmotion.x_root, temp.xmotion.y_root); if(temp.xmotion.window == w) { *event = temp; } } } /** Process a selection clear event. */ int HandleSelectionClear(const XSelectionClearEvent *event) { return HandleDockSelectionClear(event); } /** Process a button event. */ void HandleButtonEvent(const XButtonEvent *event) { int x, y; ClientNode *np; int north, south, east, west; np = FindClientByParent(event->window); if(np) { if(event->type == ButtonPress) { RaiseClient(np); if(focusModel == FOCUS_CLICK) { FocusClient(np); } } switch(event->button) { case Button1: DispatchBorderButtonEvent(event, np); break; case Button2: MoveClient(np, event->x, event->y, (event->state & Mod1Mask) ? 0 : 1); break; case Button3: GetBorderSize(np, &north, &south, &east, &west); x = event->x + np->x - west; y = event->y + np->y - north; ShowWindowMenu(np, x, y); break; case Button4: ShadeClient(np); break; case Button5: UnshadeClient(np); break; default: break; } } else if(event->window == rootWindow && event->type == ButtonPress) { if(!ShowRootMenu(event->button, event->x, event->y)) { if(event->button == 4) { LeftDesktop(); } else if(event->button == 5) { RightDesktop(); } } } else { np = FindClientByWindow(event->window); if(np) { switch(event->button) { case Button1: case Button2: RaiseClient(np); if(focusModel == FOCUS_CLICK) { FocusClient(np); } if(event->state & Mod1Mask) { GetBorderSize(np, &north, &south, &east, &west); MoveClient(np, event->x + west, event->y + north, 0); } break; case Button3: if(event->state & Mod1Mask) { GetBorderSize(np, &north, &south, &east, &west); ResizeClient(np, BA_RESIZE | BA_RESIZE_E | BA_RESIZE_S, event->x + west, event->y + north); } else { RaiseClient(np); if(focusModel == FOCUS_CLICK) { FocusClient(np); } } break; default: break; } JXAllowEvents(display, ReplayPointer, eventTime); } } } /** Process a key press event. */ void HandleKeyPress(const XKeyEvent *event) { ClientNode *np; KeyType key; key = GetKey(event); np = GetActiveClient(); switch(key & 0xFF) { case KEY_EXEC: RunKeyCommand(event); break; case KEY_DESKTOP: ChangeDesktop((key >> 8) - 1); break; case KEY_RDESKTOP: RightDesktop(); break; case KEY_LDESKTOP: LeftDesktop(); break; case KEY_UDESKTOP: AboveDesktop(); break; case KEY_DDESKTOP: BelowDesktop(); break; case KEY_SHOWDESK: ShowDesktop(); break; case KEY_SHOWTRAY: ShowAllTrays(); break; case KEY_NEXT: FocusNext(); break; case KEY_NEXTSTACK: StartWindowStackWalk(); WalkWindowStack(1); break; case KEY_PREV: FocusPrevious(); break; case KEY_PREVSTACK: StartWindowStackWalk(); WalkWindowStack(0); break; case KEY_CLOSE: if(np) { DeleteClient(np); } break; case KEY_SHADE: if(np) { if(np->state.status & STAT_SHADED) { UnshadeClient(np); } else { ShadeClient(np); } } break; case KEY_STICK: if(np) { if(np->state.status & STAT_STICKY) { SetClientSticky(np, 0); } else { SetClientSticky(np, 1); } } break; case KEY_MOVE: if(np) { MoveClientKeyboard(np); } break; case KEY_RESIZE: if(np) { ResizeClientKeyboard(np); } break; case KEY_MIN: if(np) { MinimizeClient(np); } break; case KEY_MAX: if(np) { MaximizeClient(np, 1, 1); } break; case KEY_ROOT: ShowKeyMenu(event); break; case KEY_WIN: if(np) { ShowWindowMenu(np, np->x, np->y); } break; case KEY_RESTART: Restart(); break; case KEY_EXIT: Exit(); break; case KEY_FULLSCREEN: if(np) { if(np->state.status & STAT_FULLSCREEN) { SetClientFullScreen(np, 0); } else { SetClientFullScreen(np, 1); } } break; default: break; } } /** Handle a key release event. */ void HandleKeyRelease(const XKeyEvent *event) { KeyType key; key = GetKey(event); if(((key & 0xFF) != KEY_NEXTSTACK) && ((key & 0xFF) != KEY_PREVSTACK)) { StopWindowStackWalk(); } } /** Process a configure request. */ void HandleConfigureRequest(const XConfigureRequestEvent *event) { XWindowChanges wc; ClientNode *np; int north, south, east, west; int changed; int handled; handled = HandleDockConfigureRequest(event); if(handled) { return; } np = FindClientByWindow(event->window); if(np && np->window == event->window) { changed = 0; if((event->value_mask & CWWidth) && (event->width != np->width)) { np->width = event->width; changed = 1; } if((event->value_mask & CWHeight) && (event->height != np->height)) { np->height = event->height; changed = 1; } if((event->value_mask & CWX) && (event->x != np->x)) { np->x = event->x; changed = 1; } if((event->value_mask & CWY) && (event->y != np->y)) { np->y = event->y; changed = 1; } if(!changed) { return; } if(np->controller) { (np->controller)(0); } GetBorderSize(np, &north, &south, &east, &west); ResetRoundedRectWindow(np->parent); wc.stack_mode = Above; wc.sibling = np->parent; wc.border_width = 0; ConstrainSize(np); wc.x = np->x; wc.y = np->y; wc.width = np->width + east + west; wc.height = np->height + north + south; JXConfigureWindow(display, np->parent, event->value_mask, &wc); wc.x = west; wc.y = north; wc.width = np->width; wc.height = np->height; JXConfigureWindow(display, np->window, event->value_mask, &wc); } else { /* We don't know about this window, just let the configure through. */ wc.stack_mode = event->detail; wc.sibling = event->above; wc.border_width = event->border_width; wc.x = event->x; wc.y = event->y; wc.width = event->width; wc.height = event->height; JXConfigureWindow(display, event->window, event->value_mask, &wc); } } /** Process a configure notify event. */ int HandleConfigureNotify(const XConfigureEvent *event) { if(event->window != rootWindow) { return 0; } if(rootWidth != event->width || rootHeight != event->height) { rootWidth = event->width; rootHeight = event->height; shouldRestart = 1; shouldExit = 1; } return 1; } /** Process an enter notify event. */ void HandleEnterNotify(const XCrossingEvent *event) { ClientNode *np; Cursor cur; SetMousePosition(event->x_root, event->y_root); np = FindClientByWindow(event->window); if(np) { if(!(np->state.status & STAT_ACTIVE) && (focusModel == FOCUS_SLOPPY)) { FocusClient(np); } if(np->parent == event->window) { np->borderAction = GetBorderActionType(np, event->x, event->y); cur = GetFrameCursor(np->borderAction); JXDefineCursor(display, np->parent, cur); } else if(np->borderAction != BA_NONE) { SetDefaultCursor(np->parent); np->borderAction = BA_NONE; } } } /** Process a leave notify event. */ void HandleLeaveNotify(const XCrossingEvent *event) { SetMousePosition(event->x_root, event->y_root); } /** Handle an expose event. */ int HandleExpose(const XExposeEvent *event) { ClientNode *np; np = FindClientByWindow(event->window); if(np) { if(event->window == np->parent) { DrawBorder(np, event); return 1; } else if(event->window == np->window && np->state.status & STAT_WMDIALOG) { /* Dialog expose events are handled elsewhere. */ return 0; } else { /* Ignore other expose events. */ return 1; } } else { return event->count ? 1 : 0; } } /** Handle a property notify event. */ int HandlePropertyNotify(const XPropertyEvent *event) { ClientNode *np; int changed; np = FindClientByWindow(event->window); if(np) { changed = 0; switch(event->atom) { case XA_WM_NAME: ReadWMName(np); changed = 1; break; case XA_WM_NORMAL_HINTS: ReadWMNormalHints(np); changed = 1; break; case XA_WM_HINTS: case XA_WM_ICON_NAME: case XA_WM_CLIENT_MACHINE: break; default: if(event->atom == atoms[ATOM_WM_COLORMAP_WINDOWS]) { ReadWMColormaps(np); UpdateClientColormap(np); } else if(event->atom == atoms[ATOM_NET_WM_ICON]) { LoadIcon(np); changed = 1; } else if(event->atom == atoms[ATOM_NET_WM_NAME]) { ReadWMName(np); changed = 1; } else if(event->atom == atoms[ATOM_NET_WM_STRUT_PARTIAL]) { ReadClientStrut(np); } else if(event->atom == atoms[ATOM_NET_WM_STRUT]) { ReadClientStrut(np); } break; } if(changed) { DrawBorder(np, NULL); UpdateTaskBar(); UpdatePager(); } if(np->state.status & STAT_WMDIALOG) { return 0; } else { return 1; } } return 1; } /** Handle a client message. */ void HandleClientMessage(const XClientMessageEvent *event) { ClientNode *np; #ifdef DEBUG char *atomName; #endif np = FindClientByWindow(event->window); if(np) { if(event->message_type == atoms[ATOM_WM_CHANGE_STATE]) { if(np->controller) { (np->controller)(0); } switch(event->data.l[0]) { case WithdrawnState: SetClientWithdrawn(np); break; case IconicState: MinimizeClient(np); break; case NormalState: RestoreClient(np, 1); break; default: break; } } else if(event->message_type == atoms[ATOM_NET_ACTIVE_WINDOW]) { RestoreClient(np, 1); FocusClient(np); } else if(event->message_type == atoms[ATOM_NET_WM_DESKTOP]) { if(event->data.l[0] == ~0L) { SetClientSticky(np, 1); } else { if(np->controller) { (np->controller)(0); } if(event->data.l[0] >= 0 && event->data.l[0] < (long)desktopCount) { np->state.status &= ~STAT_STICKY; SetClientDesktop(np, event->data.l[0]); } } } else if(event->message_type == atoms[ATOM_NET_CLOSE_WINDOW]) { DeleteClient(np); } else if(event->message_type == atoms[ATOM_NET_MOVERESIZE_WINDOW]) { HandleNetMoveResize(event, np); } else if(event->message_type == atoms[ATOM_NET_WM_STATE]) { HandleNetWMState(event, np); } else if(event->message_type == atoms[ATOM_NET_SHOWING_DESKTOP]) { if(event->data.l[0] != showingDesktop) { ShowDesktop(); } } else { #ifdef DEBUG atomName = JXGetAtomName(display, event->message_type); Debug("Unknown ClientMessage to client: %s", atomName); JXFree(atomName); #endif } } else if(event->window == rootWindow) { if(event->message_type == atoms[ATOM_JWM_RESTART]) { Restart(); } else if(event->message_type == atoms[ATOM_JWM_EXIT]) { Exit(); } else if(event->message_type == atoms[ATOM_JWM_RELOAD]) { ReloadMenu(); } else if(event->message_type == atoms[ATOM_NET_CURRENT_DESKTOP]) { ChangeDesktop(event->data.l[0]); } else { #ifdef DEBUG atomName = JXGetAtomName(display, event->message_type); Debug("Unknown ClientMessage to root: %s", atomName); JXFree(atomName); #endif } } else if(event->message_type == atoms[ATOM_NET_SYSTEM_TRAY_OPCODE]) { HandleDockEvent(event); } else { #ifdef DEBUG atomName = JXGetAtomName(display, event->message_type); Debug("ClientMessage to unknown window (0x%x): %s", event->window, atomName); JXFree(atomName); #endif } } /** Handle a _NET_MOVERESIZE_WINDOW request. */ void HandleNetMoveResize(const XClientMessageEvent *event, ClientNode *np) { long flags; long x, y; long width, height; int deltax, deltay; int north, south, east, west; Assert(event); Assert(np); flags = event->data.l[0] >> 8; x = np->x; y = np->y; width = np->width; height = np->height; if(flags & (1 << 0)) { x = event->data.l[1]; } if(flags & (1 << 1)) { y = event->data.l[2]; } if(flags & (1 << 2)) { width = event->data.l[3]; } if(flags & (1 << 3)) { height = event->data.l[4]; } GetBorderSize(np, &north, &south, &east, &west); GetGravityDelta(np, &deltax, &deltay); x -= deltax; y -= deltay; np->x = x; np->y = y; np->width = width; np->height = height; if(JUNLIKELY(np->state.status & STAT_FULLSCREEN)) { Warning(_("Fullscreen state will be shaped!")); } /** Reset shaped bound */ ResetRoundedRectWindow(np->parent); ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->window, west, north, np->width, np->height); WriteState(np); SendConfigureEvent(np); } /** Handle a _NET_WM_STATE request. */ void HandleNetWMState(const XClientMessageEvent *event, ClientNode *np) { int actionMaxH; int actionMaxV; int actionStick; int actionShade; int actionFullScreen; int actionMinimize; int actionNolist; int actionBelow; int actionAbove; int x; /* Up to two actions to be applied together. */ actionMaxH = 0; actionMaxV = 0; actionStick = 0; actionShade = 0; actionFullScreen = 0; actionMinimize = 0; actionNolist = 0; actionBelow = 0; actionAbove = 0; for(x = 1; x <= 2; x++) { if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_STICKY]) { actionStick = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_MAXIMIZED_VERT]) { actionMaxV = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_MAXIMIZED_HORZ]) { actionMaxH = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_SHADED]) { actionShade = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_FULLSCREEN]) { actionFullScreen = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_HIDDEN]) { actionMinimize = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_SKIP_TASKBAR]) { actionNolist = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_BELOW]) { actionBelow = 1; } else if(event->data.l[x] == (long)atoms[ATOM_NET_WM_STATE_ABOVE]) { actionAbove = 1; } } switch(event->data.l[0]) { case 0: /* Remove */ if(actionStick) { SetClientSticky(np, 0); } if(actionMaxH || actionMaxV) { if(np->state.status & (STAT_HMAX | STAT_VMAX)) { MaximizeClient(np, 0, 0); } } if(actionShade) { UnshadeClient(np); } if(actionFullScreen) { SetClientFullScreen(np, 0); } if(actionMinimize) { RestoreClient(np, 0); } if(actionNolist) { np->state.status &= ~STAT_NOLIST; UpdateTaskBar(); } if(actionBelow && np->state.layer == LAYER_BELOW) { SetClientLayer(np, LAYER_NORMAL); } if(actionAbove && np->state.layer == LAYER_ABOVE) { SetClientLayer(np, LAYER_NORMAL); } break; case 1: /* Add */ if(actionStick) { SetClientSticky(np, 1); } if(!(np->state.status & (STAT_HMAX | STAT_VMAX))) { MaximizeClient(np, actionMaxH, actionMaxV); } if(actionShade) { ShadeClient(np); } if(actionFullScreen) { SetClientFullScreen(np, 1); } if(actionMinimize) { MinimizeClient(np); } if(actionNolist) { np->state.status |= STAT_NOLIST; UpdateTaskBar(); } if(actionBelow && np->state.layer == LAYER_NORMAL) { SetClientLayer(np, LAYER_BELOW); } if(actionAbove && np->state.layer == LAYER_NORMAL) { SetClientLayer(np, LAYER_ABOVE); } break; case 2: /* Toggle */ if(actionStick) { if(np->state.status & STAT_STICKY) { SetClientSticky(np, 0); } else { SetClientSticky(np, 1); } } if(actionMaxH || actionMaxV) { MaximizeClient(np, actionMaxH, actionMaxV); } if(actionShade) { if(np->state.status & STAT_SHADED) { UnshadeClient(np); } else { ShadeClient(np); } } if(actionFullScreen) { if(np->state.status & STAT_FULLSCREEN) { SetClientFullScreen(np, 0); } else { SetClientFullScreen(np, 1); } } if(actionBelow) { if(np->state.layer == LAYER_NORMAL) { SetClientLayer(np, LAYER_BELOW); } else if(np->state.layer == LAYER_BELOW) { SetClientLayer(np, LAYER_NORMAL); } } if(actionAbove) { if(np->state.layer == LAYER_NORMAL) { SetClientLayer(np, LAYER_ABOVE); } else if(np->state.layer == LAYER_ABOVE) { SetClientLayer(np, LAYER_NORMAL); } } /* Note that we don't handle toggling of hidden per EWMH * recommendations. */ if(actionNolist) { np->state.status ^= STAT_NOLIST; UpdateTaskBar(); } break; default: Debug("bad _NET_WM_STATE action: %ld", event->data.l[0]); break; } } /** Handle a motion notify event. */ void HandleMotionNotify(const XMotionEvent *event) { ClientNode *np; Cursor cur; BorderActionType action; if(event->is_hint) { return; } SetMousePosition(event->x_root, event->y_root); np = FindClientByParent(event->window); if(np && (np->state.border & BORDER_OUTLINE)) { action = GetBorderActionType(np, event->x, event->y); if(np->borderAction != action) { np->borderAction = action; cur = GetFrameCursor(action); JXDefineCursor(display, np->parent, cur); } } } /** Handle a shape event. */ #ifdef USE_SHAPE void HandleShapeEvent(const XShapeEvent *event) { ClientNode *np; np = FindClientByWindow(event->window); if(np) { SetShape(np); } } #endif /* USE_SHAPE */ /** Handle a colormap event. */ void HandleColormapChange(const XColormapEvent *event) { ClientNode *np; if(event->new == True) { np = FindClientByWindow(event->window); if(np) { np->cmap = event->colormap; UpdateClientColormap(np); } } } /** Handle a map request. */ void HandleMapRequest(const XMapEvent *event) { ClientNode *np; Assert(event); if(CheckSwallowMap(event)) { return; } np = FindClientByWindow(event->window); if(!np) { JXSync(display, False); JXGrabServer(display); np = AddClientWindow(event->window, 0, 1); if(np) { if(focusModel == FOCUS_CLICK && !(np->state.status & STAT_NOFOCUS)) { FocusClient(np); } } else { JXMapWindow(display, event->window); } JXSync(display, False); JXUngrabServer(display); } else { if(!(np->state.status & STAT_MAPPED)) { np->state = ReadWindowState(np->window); np->state.status |= STAT_MAPPED; if(!(np->state.status & STAT_STICKY)) { np->state.desktop = currentDesktop; } JXMapWindow(display, np->window); JXMapWindow(display, np->parent); if(!(np->state.status & STAT_NOFOCUS)) { RaiseClient(np); FocusClient(np); } UpdateTaskBar(); UpdatePager(); } } RestackClients(); } /** Handle an unmap notify event. */ void HandleUnmapNotify(const XUnmapEvent *event) { ClientNode *np; XEvent e; Assert(event); np = FindClientByWindow(event->window); if(np && np->window == event->window) { if(JXCheckTypedWindowEvent(display, np->window, DestroyNotify, &e)) { UpdateTime(&e); HandleDestroyNotify(&e.xdestroywindow); return; } if(np->controller) { (np->controller)(1); } if(np->state.status & STAT_MAPPED) { np->state.status &= ~STAT_MAPPED; JXUnmapWindow(display, np->parent); WriteState(np); UpdateTaskBar(); UpdatePager(); if(np->state.status & STAT_ACTIVE) { FocusNextStacked(np); } } } } /** Handle a destroy notify event. */ int HandleDestroyNotify(const XDestroyWindowEvent *event) { ClientNode *np; np = FindClientByWindow(event->window); if(np && np->window == event->window) { if(np->controller) { (np->controller)(1); } RemoveClient(np); return 1; } else if(!np) { return HandleDockDestroy(event->window); } return 0; } /** Take the appropriate action for a click on a client border. */ void DispatchBorderButtonEvent(const XButtonEvent *event, ClientNode *np) { static Time lastClickTime = 0; static int lastX = 0, lastY = 0; static char doubleClickActive = 0; BorderActionType action; int bsize; action = GetBorderActionType(np, event->x, event->y); switch(action & 0x0F) { case BA_RESIZE: if(event->type == ButtonPress) { ResizeClient(np, action, event->x, event->y); } break; case BA_MOVE: if(event->type == ButtonPress) { if(doubleClickActive && abs(event->time - lastClickTime) > 0 && abs(event->time - lastClickTime) <= doubleClickSpeed && abs(event->x - lastX) <= doubleClickDelta && abs(event->y - lastY) <= doubleClickDelta) { MaximizeClientDefault(np); doubleClickActive = 0; } else { if(MoveClient(np, event->x, event->y, (event->state & Mod1Mask) ? 0 : 1)) { doubleClickActive = 0; } else { doubleClickActive = 1; lastClickTime = event->time; lastX = event->x; lastY = event->y; } } } break; case BA_MENU: if(event->type == ButtonPress) { if(np->state.border & BORDER_OUTLINE) { bsize = borderWidth; } else { bsize = 0; } ShowWindowMenu(np, np->x + event->x - bsize, np->y + event->y - titleHeight - bsize); } break; case BA_CLOSE: if(event->type == ButtonRelease) { DeleteClient(np); } break; case BA_MAXIMIZE: if(event->type == ButtonRelease) { MaximizeClientDefault(np); } break; case BA_MINIMIZE: if(event->type == ButtonRelease) { MinimizeClient(np); } break; default: break; } } /** Update the last event time. */ void UpdateTime(const XEvent *event) { Time t = CurrentTime; Assert(event); switch(event->type) { case KeyPress: case KeyRelease: t = event->xkey.time; break; case ButtonPress: case ButtonRelease: t = event->xkey.time; break; case MotionNotify: t = event->xmotion.time; break; case EnterNotify: case LeaveNotify: t = event->xcrossing.time; break; case PropertyNotify: t = event->xproperty.time; break; case SelectionClear: t = event->xselectionclear.time; break; case SelectionRequest: t = event->xselectionrequest.time; break; case SelectionNotify: t = event->xselection.time; break; default: break; } if(t != CurrentTime) { if(t > eventTime || t < eventTime - 60000) { eventTime = t; } } } jwm-2.1.0+svn579/src/cursor.h0000644000000000000000000000401611710374021014326 0ustar rootroot/** * @file cursor.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the cursor functions. * */ #ifndef CURSOR_H #define CURSOR_H #include "border.h" /*@{*/ void InitializeCursors(); void StartupCursors(); void ShutdownCursors(); void DestroyCursors(); /*@}*/ /** Grab the mouse for resizing a window. * @param action The resize action. * @return 1 on success, 0 on failure. */ int GrabMouseForResize(BorderActionType action); /** Grab the mouse for moving a window. * @return 1 on success, 0 on failure. */ int GrabMouseForMove(); /** Grab the mouse. * @return 1 on success, 0 on failure. */ int GrabMouse(Window w); /** Grab the mouse to select a window. * @return 1 on success, 0 on failure. */ int GrabMouseForChoose(); /** Get the cursor to use given a border action. * @param action The border action. * @return The cursor to use. */ Cursor GetFrameCursor(BorderActionType action); /** Move the mouse cursor. * @param win The window to act as an origin for the coordinates. * @param x The x-coordinate. * @param y The y-coordinate. */ void MoveMouse(Window win, int x, int y); /** Set the current mouse position. * @param x The x-coordinate (relative to the current desktop). * @param y The y-coordinate (relative to the current desktop). */ void SetMousePosition(int x, int y); /** Get the current mouse position. * @param x Location to store the x-coordinate. * @param y Location to store the y-coordinate. */ void GetMousePosition(int *x, int *y); /** Get a mask of the current mouse buttons pressed. * @return A mask of the current mouse buttons pressed. */ unsigned int GetMouseMask(); /** Reset to the default cursor on a window. * @param w The window whose cursor to change. */ void SetDefaultCursor(Window w); /** Set the double click speed. * @param str The speed (ASCII, milliseconds). */ void SetDoubleClickSpeed(const char *str); /** Set the double click delta. * @param str The delta (ASCII, pixels). */ void SetDoubleClickDelta(const char *str); #endif /* CURSOR_H */ jwm-2.1.0+svn579/src/taskbar.c0000644000000000000000000004240511710374021014437 0ustar rootroot/** * @file taskbar.c * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Task list tray component. * */ #include "jwm.h" #include "taskbar.h" #include "tray.h" #include "timing.h" #include "main.h" #include "client.h" #include "clientlist.h" #include "color.h" #include "popup.h" #include "button.h" #include "cursor.h" #include "icon.h" #include "error.h" #include "font.h" #include "winmenu.h" #include "screen.h" typedef enum { INSERT_LEFT, INSERT_RIGHT } InsertModeType; typedef struct TaskBarType { TrayComponentType *cp; int itemHeight; LayoutType layout; Pixmap buffer; TimeType mouseTime; int mousex, mousey; unsigned int maxItemWidth; struct TaskBarType *next; } TaskBarType; typedef struct Node { ClientNode *client; int y; struct Node *next; struct Node *prev; } Node; static char minimized_bitmap[] = { 0x01, 0x03, 0x07, 0x0F }; static const int TASK_SPACER = 2; static Pixmap minimizedPixmap; static InsertModeType insertMode; static TaskBarType *bars; static Node *taskBarNodes; static Node *taskBarNodesTail; static Node *GetNode(TaskBarType *bar, int x); static unsigned int GetItemCount(); static unsigned int GetItemWidth(const TaskBarType *bp, unsigned int itemCount); static void Render(const TaskBarType *bp); static void ShowTaskWindowMenu(TaskBarType *bar, Node *np); static void SetSize(TrayComponentType *cp, int width, int height); static void Create(TrayComponentType *cp); static void Resize(TrayComponentType *cp); static void ProcessTaskButtonEvent(TrayComponentType *cp, int x, int y, int mask); static void ProcessTaskMotionEvent(TrayComponentType *cp, int x, int y, int mask); /** Initialize task bar data. */ void InitializeTaskBar() { bars = NULL; taskBarNodes = NULL; taskBarNodesTail = NULL; insertMode = INSERT_RIGHT; } /** Startup the task bar. */ void StartupTaskBar() { minimizedPixmap = JXCreateBitmapFromData(display, rootWindow, minimized_bitmap, 4, 4); } /** Shutdown the task bar. */ void ShutdownTaskBar() { TaskBarType *bp; for(bp = bars; bp; bp = bp->next) { JXFreePixmap(display, bp->buffer); } JXFreePixmap(display, minimizedPixmap); } /** Destroy task bar data. */ void DestroyTaskBar() { TaskBarType *bp; while(bars) { bp = bars->next; Release(bars); bars = bp; } } /** Create a new task bar tray component. */ TrayComponentType *CreateTaskBar() { TrayComponentType *cp; TaskBarType *tp; tp = Allocate(sizeof(TaskBarType)); tp->next = bars; bars = tp; tp->itemHeight = 0; tp->layout = LAYOUT_HORIZONTAL; tp->mousex = -POPUP_DELTA; tp->mousey = -POPUP_DELTA; tp->mouseTime.seconds = 0; tp->mouseTime.ms = 0; tp->maxItemWidth = 0; cp = CreateTrayComponent(); cp->object = tp; tp->cp = cp; cp->SetSize = SetSize; cp->Create = Create; cp->Resize = Resize; cp->ProcessButtonPress = ProcessTaskButtonEvent; cp->ProcessMotionEvent = ProcessTaskMotionEvent; return cp; } /** Set the size of a task bar tray component. */ void SetSize(TrayComponentType *cp, int width, int height) { TaskBarType *tp; Assert(cp); tp = (TaskBarType*)cp->object; Assert(tp); if(width == 0) { tp->layout = LAYOUT_HORIZONTAL; } else if(height == 0) { tp->layout = LAYOUT_VERTICAL; } else if(width > height) { tp->layout = LAYOUT_HORIZONTAL; } else { tp->layout = LAYOUT_VERTICAL; } } /** Initialize a task bar tray component. */ void Create(TrayComponentType *cp) { TaskBarType *tp; Assert(cp); tp = (TaskBarType*)cp->object; Assert(tp); if(tp->layout == LAYOUT_HORIZONTAL) { tp->itemHeight = cp->height - TASK_SPACER; } else { tp->itemHeight = GetStringHeight(FONT_TASK) + 12; } Assert(cp->width > 0); Assert(cp->height > 0); cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, rootDepth); tp->buffer = cp->pixmap; JXSetForeground(display, rootGC, colors[COLOR_TRAY_BG]); JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); } /** Resize a task bar tray component. */ void Resize(TrayComponentType *cp) { TaskBarType *tp; Assert(cp); tp = (TaskBarType*)cp->object; Assert(tp); if(tp->buffer != None) { JXFreePixmap(display, tp->buffer); } if(tp->layout == LAYOUT_HORIZONTAL) { tp->itemHeight = cp->height - TASK_SPACER; } else { tp->itemHeight = GetStringHeight(FONT_TASK) + 12; } Assert(cp->width > 0); Assert(cp->height > 0); cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, rootDepth); tp->buffer = cp->pixmap; JXSetForeground(display, rootGC, colors[COLOR_TRAY_BG]); JXFillRectangle(display, cp->pixmap, rootGC, 0, 0, cp->width, cp->height); } /** Process a task list button event. */ void ProcessTaskButtonEvent(TrayComponentType *cp, int x, int y, int mask) { TaskBarType *bar = (TaskBarType*)cp->object; Node *np; Assert(bar); if(bar->layout == LAYOUT_HORIZONTAL) { np = GetNode(bar, x); } else { np = GetNode(bar, y); } if(np) { switch(mask) { case Button1: if(np->client->state.status & STAT_ACTIVE && np->client == nodes[np->client->state.layer]) { MinimizeClient(np->client); } else { RestoreClient(np->client, 1); FocusClient(np->client); } break; case Button3: ShowTaskWindowMenu(bar, np); break; case Button4: FocusPrevious(); break; case Button5: FocusNext(); break; default: break; } } } /** Process a task list motion event. */ void ProcessTaskMotionEvent(TrayComponentType *cp, int x, int y, int mask) { TaskBarType *bp = (TaskBarType*)cp->object; bp->mousex = cp->screenx + x; bp->mousey = cp->screeny + y; GetCurrentTime(&bp->mouseTime); } /** Show the menu associated with a task list item. */ void ShowTaskWindowMenu(TaskBarType *bar, Node *np) { int x, y; int mwidth, mheight; const ScreenType *sp; GetWindowMenuSize(np->client, &mwidth, &mheight); sp = GetCurrentScreen(bar->cp->screenx, bar->cp->screeny); if(bar->layout == LAYOUT_HORIZONTAL) { GetMousePosition(&x, &y); if(bar->cp->screeny + bar->cp->height / 2 < sp->y + sp->height / 2) { y = bar->cp->screeny + bar->cp->height; } else { y = bar->cp->screeny - mheight; } x -= mwidth / 2; } else { if(bar->cp->screenx + bar->cp->width / 2 < sp->x + sp->width / 2) { x = bar->cp->screenx + bar->cp->width; } else { x = bar->cp->screenx - mwidth; } y = bar->cp->screeny + np->y; } ShowWindowMenu(np->client, x, y); } /** Add a client to the task bar. */ void AddClientToTaskBar(ClientNode *np) { Node *tp; Assert(np); tp = Allocate(sizeof(Node)); tp->client = np; if(insertMode == INSERT_RIGHT) { tp->next = NULL; tp->prev = taskBarNodesTail; if(taskBarNodesTail) { taskBarNodesTail->next = tp; } else { taskBarNodes = tp; } taskBarNodesTail = tp; } else { tp->prev = NULL; tp->next = taskBarNodes; if(taskBarNodes) { taskBarNodes->prev = tp; } taskBarNodes = tp; if(!taskBarNodesTail) { taskBarNodesTail = tp; } } UpdateTaskBar(); UpdateNetClientList(); } /** Remove a client from the task bar. */ void RemoveClientFromTaskBar(ClientNode *np) { Node *tp; Assert(np); for(tp = taskBarNodes; tp; tp = tp->next) { if(tp->client == np) { if(tp->prev) { tp->prev->next = tp->next; } else { taskBarNodes = tp->next; } if(tp->next) { tp->next->prev = tp->prev; } else { taskBarNodesTail = tp->prev; } Release(tp); break; } } UpdateTaskBar(); UpdateNetClientList(); } /** Update all task bars. */ void UpdateTaskBar() { TaskBarType *bp; unsigned int count; int lastHeight; if(shouldExit) { return; } for(bp = bars; bp; bp = bp->next) { if(bp->layout == LAYOUT_VERTICAL) { lastHeight = bp->cp->requestedHeight; count = GetItemCount(); bp->cp->requestedHeight = GetStringHeight(FONT_TASK) + 12; bp->cp->requestedHeight *= count; bp->cp->requestedHeight += 2; if(lastHeight != bp->cp->requestedHeight) { ResizeTray(bp->cp->tray); } } Render(bp); } } /** Signal task bar (for popups). */ void SignalTaskbar(const TimeType *now, int x, int y) { TaskBarType *bp; Node *np; for(bp = bars; bp; bp = bp->next) { if(abs(bp->mousex - x) < POPUP_DELTA && abs(bp->mousey - y) < POPUP_DELTA) { if(GetTimeDifference(now, &bp->mouseTime) >= popupDelay) { if(bp->layout == LAYOUT_HORIZONTAL) { np = GetNode(bp, x - bp->cp->screenx); } else { np = GetNode(bp, y - bp->cp->screeny); } if(np && np->client->name) { ShowPopup(x, y, np->client->name); } } } } } /** Draw a specific task bar. */ void Render(const TaskBarType *bp) { Node *tp; ButtonNode button; int x, y; int remainder; int itemWidth, itemCount; int width, height; Pixmap buffer; GC gc; char *minimizedName; if(shouldExit) { return; } Assert(bp); Assert(bp->cp); width = bp->cp->width; height = bp->cp->height; buffer = bp->cp->pixmap; gc = rootGC; x = TASK_SPACER; width -= x; y = 1; JXSetForeground(display, gc, colors[COLOR_TRAY_BG]); JXFillRectangle(display, buffer, gc, 0, 0, width, height); itemCount = GetItemCount(); if(!itemCount) { UpdateSpecificTray(bp->cp->tray, bp->cp); return; } if(bp->layout == LAYOUT_HORIZONTAL) { itemWidth = GetItemWidth(bp, itemCount); remainder = width - itemWidth * itemCount; } else { itemWidth = width; remainder = 0; } ResetButton(&button, buffer, gc); button.font = FONT_TASK; for(tp = taskBarNodes; tp; tp = tp->next) { if(ShouldFocus(tp->client)) { tp->y = y; if(tp->client->state.status & STAT_ACTIVE) { button.type = BUTTON_TASK_ACTIVE; } else { button.type = BUTTON_TASK; } if(remainder) { button.width = itemWidth - TASK_SPACER; } else { button.width = itemWidth - TASK_SPACER - 1; } button.height = bp->itemHeight - 1; button.x = x; button.y = y; button.icon = tp->client->icon; if(tp->client->state.status & STAT_MINIMIZED) { if(tp->client->name) { minimizedName = AllocateStack(strlen(tp->client->name) + 3); sprintf(minimizedName, "[%s]", tp->client->name); button.text = minimizedName; DrawButton(&button); ReleaseStack(minimizedName); } else { button.text = "[]"; DrawButton(&button); } } else { button.text = tp->client->name; DrawButton(&button); } if(tp->client->state.status & STAT_MINIMIZED) { JXSetForeground(display, gc, colors[COLOR_TASK_FG]); JXSetClipMask(display, gc, minimizedPixmap); JXSetClipOrigin(display, gc, x + 3, y + bp->itemHeight - 7); JXFillRectangle(display, buffer, gc, x + 3, y + bp->itemHeight - 7, 4, 4); JXSetClipMask(display, gc, None); } if(bp->layout == LAYOUT_HORIZONTAL) { x += itemWidth; if(remainder) { ++x; --remainder; } } else { y += bp->itemHeight; if(remainder) { ++y; --remainder; } } } } UpdateSpecificTray(bp->cp->tray, bp->cp); } /** Focus the next client in the task bar. */ void FocusNext() { Node *tp; for(tp = taskBarNodes; tp; tp = tp->next) { if(ShouldFocus(tp->client)) { if(tp->client->state.status & STAT_ACTIVE) { tp = tp->next; break; } } } if(!tp) { tp = taskBarNodes; } while(tp && !ShouldFocus(tp->client)) { tp = tp->next; } if(!tp) { tp = taskBarNodes; while(tp && !ShouldFocus(tp->client)) { tp = tp->next; } } if(tp) { RestoreClient(tp->client, 1); FocusClient(tp->client); } } /** Focus the previous client in the task bar. */ void FocusPrevious() { Node *tp; for(tp = taskBarNodesTail; tp; tp = tp->prev) { if(ShouldFocus(tp->client)) { if(tp->client->state.status & STAT_ACTIVE) { tp = tp->prev; break; } } } if(!tp) { tp = taskBarNodesTail; } while(tp && !ShouldFocus(tp->client)) { tp = tp->prev; } if(!tp) { tp = taskBarNodesTail; while(tp && !ShouldFocus(tp->client)) { tp = tp->prev; } } if(tp) { RestoreClient(tp->client, 1); FocusClient(tp->client); } } /** Get the item associated with an x-coordinate on the task bar. */ Node *GetNode(TaskBarType *bar, int x) { Node *tp; int remainder; int itemCount; int itemWidth; int index, stop; int width; index = TASK_SPACER; itemCount = GetItemCount(); if(bar->layout == LAYOUT_HORIZONTAL) { width = bar->cp->width - index; itemWidth = GetItemWidth(bar, itemCount); remainder = width - itemWidth * itemCount; for(tp = taskBarNodes; tp; tp = tp->next) { if(ShouldFocus(tp->client)) { if(remainder) { stop = index + itemWidth + 1; --remainder; } else { stop = index + itemWidth; } if(x >= index && x < stop) { return tp; } index = stop; } } } else { for(tp = taskBarNodes; tp; tp = tp->next) { if(ShouldFocus(tp->client)) { stop = index + bar->itemHeight; if(x >= index && x < stop) { return tp; } index = stop; } } } return NULL; } /** Get the number of items on the task bar. */ unsigned int GetItemCount() { Node *tp; unsigned int count; count = 0; for(tp = taskBarNodes; tp; tp = tp->next) { if(ShouldFocus(tp->client)) { ++count; } } return count; } /** Get the width of an item in the task bar. */ unsigned int GetItemWidth(const TaskBarType *bp, unsigned int itemCount) { unsigned int itemWidth; itemWidth = bp->cp->width - TASK_SPACER; if(!itemCount) { return itemWidth; } itemWidth /= itemCount; if(!itemWidth) { itemWidth = 1; } if(bp->maxItemWidth > 0 && itemWidth > bp->maxItemWidth) { itemWidth = bp->maxItemWidth; } return itemWidth; } /** Set the maximum width of an item in the task bar. */ void SetMaxTaskBarItemWidth(TrayComponentType *cp, const char *value) { int temp; TaskBarType *bp; Assert(cp); if(value) { temp = atoi(value); if(JUNLIKELY(temp < 0)) { Warning(_("invalid maxwidth for TaskList: %s"), value); return; } bp = (TaskBarType*)cp->object; bp->maxItemWidth = temp; } } /** Set the way items are inserted into the task bar. */ void SetTaskBarInsertMode(const char *mode) { if(!mode) { insertMode = INSERT_RIGHT; return; } if(!strcmp(mode, "right")) { insertMode = INSERT_RIGHT; } else if(!strcmp(mode, "left")) { insertMode = INSERT_LEFT; } else { Warning(_("invalid insert mode: \"%s\""), mode); insertMode = INSERT_RIGHT; } } /** Maintain the _NET_CLIENT_LIST[_STACKING] properties on the root. */ void UpdateNetClientList() { Node *np; ClientNode *client; Window *windows; int count, temp; int layer; /* Determine how much we need to allocate. */ count = 0; for(np = taskBarNodes; np; np = np->next) { ++count; } temp = 0; for(layer = LAYER_BOTTOM; layer <= LAYER_TOP; layer++) { for(client = nodes[layer]; client; client = client->next) { ++temp; } } if(temp > count) { count = temp; } if(count == 0) { windows = NULL; } else { windows = AllocateStack(count * sizeof(Window)); } /* Set _NET_CLIENT_LIST */ count = 0; for(np = taskBarNodes; np; np = np->next) { windows[count++] = np->client->window; } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_CLIENT_LIST], XA_WINDOW, 32, PropModeReplace, (unsigned char*)windows, count); /* Set _NET_CLIENT_LIST_STACKING */ count = 0; for(layer = LAYER_BOTTOM; layer <= LAYER_TOP; layer++) { for(client = nodes[layer]; client; client = client->next) { windows[count++] = client->window; } } JXChangeProperty(display, rootWindow, atoms[ATOM_NET_CLIENT_LIST_STACKING], XA_WINDOW, 32, PropModeReplace, (unsigned char*)windows, count); if(windows != NULL) { ReleaseStack(windows); } } jwm-2.1.0+svn579/src/winmenu.h0000644000000000000000000000153511710374021014476 0ustar rootroot/** * @file winmenu.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the window menu functions. * */ #ifndef WINMENU_H #define WINMENU_H #include "menu.h" struct ClientNode; /** Get the size of a window menu. * @param np The client for the window menu. * @param width The width return. * @param height The height return. */ void GetWindowMenuSize(struct ClientNode *np, int *width, int *height); /** Show a window menu. * @param np The client for the window menu. * @param x The x-coordinate of the menu (root relative). * @param y The y-coordinate of the menu (root relative). */ void ShowWindowMenu(struct ClientNode *np, int x, int y); /** Grab the mouse to select a window. * @param action The action to perform when a window is selected. */ void ChooseWindow(const MenuAction *action); #endif /* WINMENU_H */ jwm-2.1.0+svn579/src/confirm.c0000644000000000000000000002436311710374021014450 0ustar rootroot/** * @file confirm.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Confirm dialog functions. * */ #include "jwm.h" #include "confirm.h" #include "client.h" #include "main.h" #include "font.h" #include "button.h" #include "screen.h" #include "color.h" #include "misc.h" #ifndef DISABLE_CONFIRM typedef enum { DBS_NORMAL = 0, DBS_OK = 1, DBS_CANCEL = 2 } DialogButtonState; typedef struct DialogType { int x, y; int width, height; int lineHeight; int okx; int cancelx; int buttony; int buttonWidth, buttonHeight; DialogButtonState buttonState; int lineCount; char **message; ClientNode *node; void (*action)(ClientNode*); ClientNode *client; struct DialogType *prev; struct DialogType *next; } DialogType; static const char *OK_STRING = "Ok"; static const char *CANCEL_STRING = "Cancel"; static DialogType *dialogList = NULL; static int minWidth = 0; static void DrawConfirmDialog(DialogType *d); static void DestroyConfirmDialog(DialogType *d); static void ComputeDimensions(DialogType *d); static void DrawMessage(DialogType *d); static void DrawButtons(DialogType *d); static DialogType *FindDialogByWindow(Window w); static int HandleDialogExpose(const XExposeEvent *event); static int HandleDialogButtonPress(const XButtonEvent *event); static int HandleDialogButtonRelease(const XButtonEvent *event); /** Initialize the dialog processing data. */ void InitializeDialogs() { } /** Startup dialog processing. */ void StartupDialogs() { } /** Stop dialog processing. */ void ShutdownDialogs() { while(dialogList) { DestroyConfirmDialog(dialogList); } } /** Destroy dialog processing data. */ void DestroyDialogs() { } /** Handle an event on a dialog window. */ int ProcessDialogEvent(const XEvent *event) { int handled = 0; Assert(event); switch(event->type) { case Expose: return HandleDialogExpose(&event->xexpose); case ButtonPress: return HandleDialogButtonPress(&event->xbutton); case ButtonRelease: return HandleDialogButtonRelease(&event->xbutton); default: break; } return handled; } /** Handle an expose event. */ int HandleDialogExpose(const XExposeEvent *event) { DialogType *dp; Assert(event); dp = FindDialogByWindow(event->window); if(dp) { DrawConfirmDialog(dp); return 1; } else { return 0; } } /** Handle a mouse button release event. */ int HandleDialogButtonRelease(const XButtonEvent *event) { DialogType *dp; int x, y; int cancelPressed, okPressed; Assert(event); dp = FindDialogByWindow(event->window); if(dp) { cancelPressed = 0; okPressed = 0; y = event->y; if(y >= dp->buttony && y < dp->buttony + dp->buttonHeight) { x = event->x; if(x >= dp->okx && x < dp->okx + dp->buttonWidth) { okPressed = 1; } else if(x >= dp->cancelx && x < dp->cancelx + dp->buttonWidth) { cancelPressed = 1; } } if(okPressed) { (dp->action)(dp->client); } if(cancelPressed || okPressed) { DestroyConfirmDialog(dp); } else { dp->buttonState = DBS_NORMAL; DrawButtons(dp); } return 1; } else { for(dp = dialogList; dp; dp = dp->next) { if(dp->buttonState != DBS_NORMAL) { dp->buttonState = DBS_NORMAL; DrawButtons(dp); } } return 0; } } /** Handle a mouse button release event. */ int HandleDialogButtonPress(const XButtonEvent *event) { DialogType *dp; int cancelPressed; int okPressed; int x, y; Assert(event); /* Find the dialog on which the press occured (if any). */ dp = FindDialogByWindow(event->window); if(dp) { /* Determine which button was pressed (if any). */ cancelPressed = 0; okPressed = 0; y = event->y; if(y >= dp->buttony && y < dp->buttony + dp->buttonHeight) { x = event->x; if(x >= dp->okx && x < dp->okx + dp->buttonWidth) { okPressed = 1; } else if(x >= dp->cancelx && x < dp->cancelx + dp->buttonWidth) { cancelPressed = 1; } } dp->buttonState = DBS_NORMAL; if(cancelPressed) { dp->buttonState = DBS_CANCEL; } if(okPressed) { dp->buttonState = DBS_OK; } /* Draw the buttons. */ DrawButtons(dp); return 1; } else { /* This event doesn't affect us. */ return 0; } } /** Find a dialog by window or frame. */ DialogType *FindDialogByWindow(Window w) { DialogType *dp; for(dp = dialogList; dp; dp = dp->next) { if(dp->node->window == w) { return dp; } } return NULL; } /** Show a confirm dialog. */ void ShowConfirmDialog(ClientNode *np, void (*action)(ClientNode*), ...) { va_list ap; DialogType *dp; XSetWindowAttributes attrs; XSizeHints shints; Window window; char *str; int x; Assert(action); dp = Allocate(sizeof(DialogType)); dp->client = np; dp->action = action; dp->buttonState = DBS_NORMAL; dp->prev = NULL; dp->next = dialogList; if(dialogList) { dialogList->prev = dp; } dialogList = dp; /* Get the number of lines. */ va_start(ap, action); for(dp->lineCount = 0; va_arg(ap, char*); dp->lineCount++); va_end(ap); dp->message = Allocate(dp->lineCount * sizeof(char*)); va_start(ap, action); for(x = 0; x < dp->lineCount; x++) { str = va_arg(ap, char*); dp->message[x] = CopyString(str); } va_end(ap); ComputeDimensions(dp); attrs.background_pixel = colors[COLOR_TRAY_BG]; attrs.event_mask = ButtonReleaseMask | ExposureMask; window = JXCreateWindow(display, rootWindow, dp->x, dp->y, dp->width, dp->height, 0, CopyFromParent, InputOutput, CopyFromParent, CWBackPixel | CWEventMask, &attrs); shints.x = dp->x; shints.y = dp->y; shints.flags = PPosition; JXSetWMNormalHints(display, window, &shints); JXStoreName(display, window, "Confirm"); dp->node = AddClientWindow(window, 0, 0); Assert(dp->node); if(np) { dp->node->owner = np->window; } dp->node->state.status |= STAT_WMDIALOG; FocusClient(dp->node); DrawConfirmDialog(dp); JXGrabButton(display, AnyButton, AnyModifier, window, True, ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); } /** Draw a confirm dialog. */ void DrawConfirmDialog(DialogType *dp) { Assert(dp); DrawMessage(dp); DrawButtons(dp); } /** Destroy a confirm dialog. */ void DestroyConfirmDialog(DialogType *dp) { int x; Assert(dp); /* This will take care of destroying the dialog window since * its parent will be destroyed. */ RemoveClient(dp->node); for(x = 0; x < dp->lineCount; x++) { Release(dp->message[x]); } Release(dp->message); if(dp->next) { dp->next->prev = dp->prev; } if(dp->prev) { dp->prev->next = dp->next; } else { dialogList = dp->next; } Release(dp); } /** Compute the size of a dialog window. */ void ComputeDimensions(DialogType *dp) { const ScreenType *sp; int width; int x; Assert(dp); /* Get the min width from the size of the buttons. */ if(!minWidth) { minWidth = GetStringWidth(FONT_MENU, CANCEL_STRING) * 3; width = GetStringWidth(FONT_MENU, OK_STRING) * 3; if(width > minWidth) { minWidth = width; } minWidth += 16 * 3; } dp->width = minWidth; /* Take into account the size of the message. */ for(x = 0; x < dp->lineCount; x++) { width = GetStringWidth(FONT_MENU, dp->message[x]); if(width > dp->width) { dp->width = width; } } dp->lineHeight = GetStringHeight(FONT_MENU); dp->width += 8; dp->height = (dp->lineCount + 2) * dp->lineHeight; if(dp->client) { dp->x = dp->client->x + (dp->client->width - dp->width) / 2; dp->y = dp->client->y + (dp->client->height - dp->height) / 2; if(dp->x < 0) { dp->x = 0; } if(dp->y < 0) { dp->y = 0; } if(dp->x + dp->width >= rootWidth) { dp->x = rootWidth - dp->width - (borderWidth * 2); } if(dp->y + dp->height >= rootHeight) { dp->y = rootHeight - dp->height - (borderWidth * 2 + titleHeight); } } else { sp = GetMouseScreen(); dp->x = (sp->width - dp->width) / 2 + sp->x; dp->y = (sp->height - dp->height) / 2 + sp->y; } } /** Display the message on the dialog window. */ void DrawMessage(DialogType *dp) { int yoffset; int x; Assert(dp); yoffset = 4; for(x = 0; x < dp->lineCount; x++) { RenderString(dp->node->window, FONT_MENU, COLOR_TRAY_FG, 4, yoffset, dp->width, NULL, dp->message[x]); yoffset += dp->lineHeight; } } /** Draw the buttons on the dialog window. */ void DrawButtons(DialogType *dp) { ButtonNode button; int temp; Assert(dp); dp->buttonWidth = GetStringWidth(FONT_MENU, CANCEL_STRING); temp = GetStringWidth(FONT_MENU, OK_STRING); if(temp > dp->buttonWidth) { dp->buttonWidth = temp; } dp->buttonWidth += 16; dp->buttonHeight = dp->lineHeight + 4; ResetButton(&button, dp->node->window, rootGC); button.font = FONT_MENU; button.width = dp->buttonWidth; button.height = dp->buttonHeight; button.alignment = ALIGN_CENTER; dp->okx = dp->width / 3 - dp->buttonWidth / 2; dp->cancelx = 2 * dp->width / 3 - dp->buttonWidth / 2; dp->buttony = dp->height - dp->lineHeight - dp->lineHeight / 2; if(dp->buttonState == DBS_OK) { button.type = BUTTON_TASK_ACTIVE; } else { button.type = BUTTON_TASK; } button.text = OK_STRING; button.x = dp->okx; button.y = dp->buttony; DrawButton(&button); if(dp->buttonState == DBS_CANCEL) { button.type = BUTTON_TASK_ACTIVE; } else { button.type = BUTTON_TASK; } button.text = CANCEL_STRING; button.x = dp->cancelx; button.y = dp->buttony; DrawButton(&button); } #else /* DISABLE_CONFIRM */ /** Process an event on a dialog window. */ int ProcessDialogEvent(const XEvent *event) { return 0; } /** Show a confirm dialog. */ void ShowConfirmDialog(ClientNode *np, void (*action)(ClientNode*), ...) { Assert(action); (action)(np); } #endif /* DISABLE_CONFIRM */ jwm-2.1.0+svn579/src/tray.c0000644000000000000000000006251011710374021013766 0ustar rootroot/** * @file tray.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Tray functions. * */ #include "jwm.h" #include "tray.h" #include "color.h" #include "main.h" #include "pager.h" #include "cursor.h" #include "error.h" #include "taskbar.h" #include "menu.h" #include "timing.h" #include "screen.h" #define DEFAULT_TRAY_WIDTH 32 #define DEFAULT_TRAY_HEIGHT 32 static TrayType *trays; static Window supportingWindow; static int trayCount; static unsigned int trayOpacity; static void HandleTrayExpose(TrayType *tp, const XExposeEvent *event); static void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event); static TrayComponentType *GetTrayComponent(TrayType *tp, int x, int y); static void HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event); static void HandleTrayButtonRelease(TrayType *tp, const XButtonEvent *event); static void HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event); static void ComputeTraySize(TrayType *tp); static int ComputeMaxWidth(TrayType *tp); static int ComputeTotalWidth(TrayType *tp); static int ComputeMaxHeight(TrayType *tp); static int ComputeTotalHeight(TrayType *tp); static int CheckHorizontalFill(TrayType *tp); static int CheckVerticalFill(TrayType *tp); static void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder); /** Initialize tray data. */ void InitializeTray() { trays = NULL; trayCount = 0; supportingWindow = None; trayOpacity = UINT_MAX; } /** Startup trays. */ void StartupTray() { XSetWindowAttributes attr; Atom opacityAtom; unsigned long attrMask; TrayType *tp; TrayComponentType *cp; int variableSize; int variableRemainder; int width, height; int xoffset, yoffset; for(tp = trays; tp; tp = tp->next) { LayoutTray(tp, &variableSize, &variableRemainder); /* Create the tray window. */ /* The window is created larger for a border. */ attrMask = CWOverrideRedirect; attr.override_redirect = True; /* We can't use PointerMotionHintMask since the exact position * of the mouse on the tray is important for popups. */ attrMask |= CWEventMask; attr.event_mask = ButtonPressMask | ButtonReleaseMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | KeyReleaseMask | EnterWindowMask | PointerMotionMask; attrMask |= CWBackPixel; attr.background_pixel = colors[COLOR_TRAY_BG]; tp->window = JXCreateWindow(display, rootWindow, tp->x, tp->y, tp->width, tp->height, 0, rootDepth, InputOutput, rootVisual, attrMask, &attr); if(trayOpacity < UINT_MAX) { /* Can't use atoms yet as it hasn't been initialized. */ opacityAtom = JXInternAtom(display, "_NET_WM_WINDOW_OPACITY", False); JXChangeProperty(display, tp->window, opacityAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&trayOpacity, 1); JXSync(display, False); } SetDefaultCursor(tp->window); /* Create and layout items on the tray. */ xoffset = tp->border; yoffset = tp->border; for(cp = tp->components; cp; cp = cp->next) { if(cp->Create) { if(tp->layout == LAYOUT_HORIZONTAL) { height = tp->height - 2 * tp->border; width = cp->width; if(width == 0) { width = variableSize; if(variableRemainder) { ++width; --variableRemainder; } } } else { width = tp->width - 2 * tp->border; height = cp->height; if(height == 0) { height = variableSize; if(variableRemainder) { ++height; --variableRemainder; } } } cp->width = width; cp->height = height; (cp->Create)(cp); } cp->x = xoffset; cp->y = yoffset; cp->screenx = tp->x + xoffset; cp->screeny = tp->y + yoffset; if(cp->window != None) { JXReparentWindow(display, cp->window, tp->window, xoffset, yoffset); } if(tp->layout == LAYOUT_HORIZONTAL) { xoffset += cp->width; } else { yoffset += cp->height; } } /* Show the tray. */ JXMapWindow(display, tp->window); ++trayCount; } UpdatePager(); UpdateTaskBar(); } /** Shutdown trays. */ void ShutdownTray() { TrayType *tp; TrayComponentType *cp; for(tp = trays; tp; tp = tp->next) { for(cp = tp->components; cp; cp = cp->next) { if(cp->Destroy) { (cp->Destroy)(cp); } } JXDestroyWindow(display, tp->window); } if(supportingWindow != None) { XDestroyWindow(display, supportingWindow); supportingWindow = None; } } /** Destroy tray data. */ void DestroyTray() { TrayType *tp; TrayComponentType *cp; while(trays) { tp = trays->next; while(trays->components) { cp = trays->components->next; Release(trays->components); trays->components = cp; } Release(trays); trays = tp; } } /** Create an empty tray. */ TrayType *CreateTray() { TrayType *tp; tp = Allocate(sizeof(TrayType)); tp->x = 0; tp->y = -1; tp->requestedWidth = 0; tp->requestedHeight = 0; tp->width = 0; tp->height = 0; tp->border = 1; tp->layer = DEFAULT_TRAY_LAYER; tp->layout = LAYOUT_HORIZONTAL; tp->valign = TALIGN_FIXED; tp->halign = TALIGN_FIXED; tp->autoHide = 0; tp->hidden = 0; tp->window = None; tp->components = NULL; tp->componentsTail = NULL; tp->next = trays; trays = tp; return tp; } /** Create an empty tray component. */ TrayComponentType *CreateTrayComponent() { TrayComponentType *cp; cp = Allocate(sizeof(TrayComponentType)); cp->tray = NULL; cp->object = NULL; cp->x = 0; cp->y = 0; cp->requestedWidth = 0; cp->requestedHeight = 0; cp->width = 0; cp->height = 0; cp->grabbed = 0; cp->window = None; cp->pixmap = None; cp->Create = NULL; cp->Destroy = NULL; cp->SetSize = NULL; cp->Resize = NULL; cp->ProcessButtonPress = NULL; cp->ProcessButtonRelease = NULL; cp->ProcessMotionEvent = NULL; cp->next = NULL; return cp; } /** Add a tray component to a tray. */ void AddTrayComponent(TrayType *tp, TrayComponentType *cp) { Assert(tp); Assert(cp); cp->tray = tp; if(tp->componentsTail) { tp->componentsTail->next = cp; } else { tp->components = cp; } tp->componentsTail = cp; cp->next = NULL; } /** Compute the max component width. */ int ComputeMaxWidth(TrayType *tp) { TrayComponentType *cp; int result; int temp; result = 0; for(cp = tp->components; cp; cp = cp->next) { temp = cp->width; if(temp > 0) { temp += 2 * tp->border; if(temp > result) { result = temp; } } } return result; } /** Compute the total width of a tray. */ int ComputeTotalWidth(TrayType *tp) { TrayComponentType *cp; int result; result = 2 * tp->border; for(cp = tp->components; cp; cp = cp->next) { result += cp->width; } return result; } /** Compute the max component height. */ int ComputeMaxHeight(TrayType *tp) { TrayComponentType *cp; int result; int temp; result = 0; for(cp = tp->components; cp; cp = cp->next) { temp = cp->height; if(temp > 0) { temp += 2 * tp->border; if(temp > result) { result = temp; } } } return result; } /** Compute the total height of a tray. */ int ComputeTotalHeight(TrayType *tp) { TrayComponentType *cp; int result; result = 2 * tp->border; for(cp = tp->components; cp; cp = cp->next) { result += cp->height; } return result; } /** Check if the tray fills the screen horizontally. */ int CheckHorizontalFill(TrayType *tp) { TrayComponentType *cp; for(cp = tp->components; cp; cp = cp->next) { if(cp->width == 0) { return 1; } } return 0; } /** Check if the tray fills the screen vertically. */ int CheckVerticalFill(TrayType *tp) { TrayComponentType *cp; for(cp = tp->components; cp; cp = cp->next) { if(cp->height == 0) { return 1; } } return 0; } /** Compute the size of a tray. */ void ComputeTraySize(TrayType *tp) { TrayComponentType *cp; const ScreenType *sp; int x, y; /* Determine the first dimension. */ if(tp->layout == LAYOUT_HORIZONTAL) { if(tp->height == 0) { tp->height = ComputeMaxHeight(tp); } if(tp->height == 0) { tp->height = DEFAULT_TRAY_HEIGHT; } } else { if(tp->width == 0) { tp->width = ComputeMaxWidth(tp); } if(tp->width == 0) { tp->width = DEFAULT_TRAY_WIDTH; } } /* Now at least one size is known. Inform the components. */ for(cp = tp->components; cp; cp = cp->next) { if(cp->SetSize) { if(tp->layout == LAYOUT_HORIZONTAL) { (cp->SetSize)(cp, 0, tp->height - 2 * tp->border); } else { (cp->SetSize)(cp, tp->width - 2 * tp->border, 0); } } } /* Determine on which screen the tray will reside. */ switch(tp->valign) { case TALIGN_TOP: y = 0; break; case TALIGN_BOTTOM: y = rootHeight - 1; break; case TALIGN_CENTER: y = 1 + rootHeight / 2; break; default: if(tp->y < 0) { y = rootHeight + tp->y; } else { y = tp->y; } break; } switch(tp->halign) { case TALIGN_LEFT: x = 0; break; case TALIGN_RIGHT: x = rootWidth - 1; break; case TALIGN_CENTER: x = 1 + rootWidth / 2; break; default: if(tp->x < 0) { x = rootWidth + tp->x; } else { x = tp->x; } break; } sp = GetCurrentScreen(x, y); /* Determine the missing dimension. */ if(tp->layout == LAYOUT_HORIZONTAL) { if(tp->width == 0) { if(CheckHorizontalFill(tp)) { tp->width = sp->width; } else { tp->width = ComputeTotalWidth(tp); } if(tp->width == 0) { tp->width = DEFAULT_TRAY_WIDTH; } } } else { if(tp->height == 0) { if(CheckVerticalFill(tp)) { tp->height = sp->height; } else { tp->height = ComputeTotalHeight(tp); } if(tp->height == 0) { tp->height = DEFAULT_TRAY_HEIGHT; } } } /* Compute the tray location. */ switch(tp->valign) { case TALIGN_TOP: tp->y = 0; break; case TALIGN_BOTTOM: tp->y = sp->height - tp->height + 1; break; case TALIGN_CENTER: tp->y = (sp->height - tp->height) / 2; break; default: if(tp->y < 0) { tp->y = sp->height + tp->y - tp->height + 1; } break; } switch(tp->halign) { case TALIGN_LEFT: tp->x = 0; break; case TALIGN_RIGHT: tp->x = sp->width - tp->width + 1; break; case TALIGN_CENTER: tp->x = (sp->width - tp->width) / 2; break; default: if(tp->x < 0) { tp->x = sp->width + tp->x - tp->width + 1; } break; } } /** Display a tray (for autohide). */ void ShowTray(TrayType *tp) { Window win1, win2; int winx, winy; unsigned int mask; int mousex, mousey; if(tp->hidden) { tp->hidden = 0; JXMoveWindow(display, tp->window, tp->x, tp->y); JXQueryPointer(display, rootWindow, &win1, &win2, &mousex, &mousey, &winx, &winy, &mask); SetMousePosition(mousex, mousey); } } /** Show all trays. */ void ShowAllTrays() { TrayType *tp; if(shouldExit) { return; } for(tp = trays; tp; tp = tp->next) { ShowTray(tp); } } /** Hide a tray (for autohide). */ void HideTray(TrayType *tp) { int x, y; tp->hidden = 1; /* Determine where to move the tray. */ if(tp->layout == LAYOUT_HORIZONTAL) { x = tp->x; if(tp->y >= rootHeight / 2) { y = rootHeight - 1; } else { y = 1 - tp->height; } } else { y = tp->y; if(tp->x >= rootWidth / 2) { x = rootWidth - 1; } else { x = 1 - tp->width; } } /* Move it. */ JXMoveWindow(display, tp->window, x, y); } /** Process a tray event. */ int ProcessTrayEvent(const XEvent *event) { TrayType *tp; for(tp = trays; tp; tp = tp->next) { if(event->xany.window == tp->window) { switch(event->type) { case Expose: HandleTrayExpose(tp, &event->xexpose); return 1; case EnterNotify: HandleTrayEnterNotify(tp, &event->xcrossing); return 1; case ButtonPress: HandleTrayButtonPress(tp, &event->xbutton); return 1; case ButtonRelease: HandleTrayButtonRelease(tp, &event->xbutton); return 1; case MotionNotify: HandleTrayMotionNotify(tp, &event->xmotion); return 1; default: return 0; } } } return 0; } /** Signal the tray (needed for autohide). */ void SignalTray(const TimeType *now, int x, int y) { TrayType *tp; for(tp = trays; tp; tp = tp->next) { if(tp->autoHide && !tp->hidden && !menuShown) { if(x < tp->x || x >= tp->x + tp->width || y < tp->y || y >= tp->y + tp->height) { HideTray(tp); } } } } /** Handle a tray expose event. */ void HandleTrayExpose(TrayType *tp, const XExposeEvent *event) { DrawSpecificTray(tp); } /** Handle a tray enter notify (for autohide). */ void HandleTrayEnterNotify(TrayType *tp, const XCrossingEvent *event) { ShowTray(tp); } /** Get the tray component under the given coordinates. */ TrayComponentType *GetTrayComponent(TrayType *tp, int x, int y) { TrayComponentType *cp; int xoffset, yoffset; int width, height; xoffset = tp->border; yoffset = tp->border; for(cp = tp->components; cp; cp = cp->next) { width = cp->width; height = cp->height; if(x >= xoffset && x < xoffset + width) { if(y >= yoffset && y < yoffset + height) { return cp; } } if(tp->layout == LAYOUT_HORIZONTAL) { xoffset += width; } else { yoffset += height; } } return NULL; } /** Handle a button press on a tray. */ void HandleTrayButtonPress(TrayType *tp, const XButtonEvent *event) { TrayComponentType *cp; int x, y; int mask; cp = GetTrayComponent(tp, event->x, event->y); if(cp && cp->ProcessButtonPress) { x = event->x - cp->x; y = event->y - cp->y; mask = event->button; (cp->ProcessButtonPress)(cp, x, y, mask); } } /** Handle a button release on a tray. */ void HandleTrayButtonRelease(TrayType *tp, const XButtonEvent *event) { TrayComponentType *cp; int x, y; int mask; // First inform any components that have a grab. for(cp = tp->components; cp; cp = cp->next) { if(cp->grabbed) { x = event->x - cp->x; y = event->y - cp->y; mask = event->button; (cp->ProcessButtonRelease)(cp, x, y, mask); JXUngrabPointer(display, CurrentTime); cp->grabbed = 0; return; } } cp = GetTrayComponent(tp, event->x, event->y); if(cp && cp->ProcessButtonRelease) { x = event->x - cp->x; y = event->y - cp->y; mask = event->button; (cp->ProcessButtonRelease)(cp, x, y, mask); } } /** Handle a motion notify event. */ void HandleTrayMotionNotify(TrayType *tp, const XMotionEvent *event) { TrayComponentType *cp; int x, y; int mask; cp = GetTrayComponent(tp, event->x, event->y); if(cp && cp->ProcessMotionEvent) { x = event->x - cp->x; y = event->y - cp->y; mask = event->state; (cp->ProcessMotionEvent)(cp, x, y, mask); } } /** Draw all trays. */ void DrawTray() { TrayType *tp; if(shouldExit) { return; } for(tp = trays; tp; tp = tp->next) { DrawSpecificTray(tp); } } /** Draw a specific tray. */ void DrawSpecificTray(const TrayType *tp) { TrayComponentType *cp; int x; Assert(tp); /* Draw components. */ for(cp = tp->components; cp; cp = cp->next) { UpdateSpecificTray(tp, cp); } /* Draw the border. */ for(x = 0; x < tp->border; x++) { /* Top */ JXSetForeground(display, rootGC, colors[COLOR_TRAY_UP]); JXDrawLine(display, tp->window, rootGC, 0, x, tp->width - x - 1, x); /* Bottom */ JXSetForeground(display, rootGC, colors[COLOR_TRAY_DOWN]); JXDrawLine(display, tp->window, rootGC, x + 1, tp->height - x - 1, tp->width - x - 2, tp->height - x - 1); /* Left */ JXSetForeground(display, rootGC, colors[COLOR_TRAY_UP]); JXDrawLine(display, tp->window, rootGC, x, x, x, tp->height - x - 1); /* Right */ JXSetForeground(display, rootGC, colors[COLOR_TRAY_DOWN]); JXDrawLine(display, tp->window, rootGC, tp->width - x - 1, x + 1, tp->width - x - 1, tp->height - x - 1); } } /** Update a specific component on a tray. */ void UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp) { if(cp->pixmap != None && !shouldExit) { JXCopyArea(display, cp->pixmap, tp->window, rootGC, 0, 0, cp->width, cp->height, cp->x, cp->y); } } /** Layout tray components on a tray. */ void LayoutTray(TrayType *tp, int *variableSize, int *variableRemainder) { TrayComponentType *cp; int variableCount; int width, height; int temp; tp->width = tp->requestedWidth; tp->height = tp->requestedHeight; for(cp = tp->components; cp; cp = cp->next) { cp->width = cp->requestedWidth; cp->height = cp->requestedHeight; } ComputeTraySize(tp); /* Get the remaining size after setting fixed size components. */ /* Also, keep track of the number of variable size components. */ width = tp->width - 2 * tp->border; height = tp->height - 2 * tp->border; variableCount = 0; for(cp = tp->components; cp; cp = cp->next) { if(tp->layout == LAYOUT_HORIZONTAL) { temp = cp->width; if(temp > 0) { width -= temp; } else { ++variableCount; } } else { temp = cp->height; if(temp > 0) { height -= temp; } else { ++variableCount; } } } /* Distribute excess size among variable size components. * If there are no variable size components, shrink the tray. * If we are out of room, just give them a size of one. */ *variableSize = 1; *variableRemainder = 0; if(tp->layout == LAYOUT_HORIZONTAL) { if(variableCount) { if(width >= variableCount) { *variableSize = width / variableCount; *variableRemainder = width % variableCount; } } else if(width > 0) { tp->width -= width; } } else { if(variableCount) { if(height >= variableCount) { *variableSize = height / variableCount; *variableRemainder = height % variableCount; } } else if(height > 0) { tp->height -= height; } } } /** Resize a tray. */ void ResizeTray(TrayType *tp) { TrayComponentType *cp; int variableSize; int variableRemainder; int xoffset, yoffset; int width, height; Assert(tp); LayoutTray(tp, &variableSize, &variableRemainder); /* Reposition items on the tray. */ xoffset = tp->border; yoffset = tp->border; for(cp = tp->components; cp; cp = cp->next) { cp->x = xoffset; cp->y = yoffset; cp->screenx = tp->x + xoffset; cp->screeny = tp->y + yoffset; if(cp->Resize) { if(tp->layout == LAYOUT_HORIZONTAL) { height = tp->height - 2 * tp->border; width = cp->width; if(width == 0) { width = variableSize; if(variableRemainder) { ++width; --variableRemainder; } } } else { width = tp->width - 2 * tp->border; height = cp->height; if(height == 0) { height = variableSize; if(variableRemainder) { ++height; --variableRemainder; } } } cp->width = width; cp->height = height; (cp->Resize)(cp); } if(cp->window != None) { JXMoveWindow(display, cp->window, xoffset, yoffset); } if(tp->layout == LAYOUT_HORIZONTAL) { xoffset += cp->width; } else { yoffset += cp->height; } } JXMoveResizeWindow(display, tp->window, tp->x, tp->y, tp->width, tp->height); UpdateTaskBar(); DrawSpecificTray(tp); if(tp->hidden) { HideTray(tp); } } /** Get a linked list of trays. */ TrayType *GetTrays() { return trays; } /** Get the number of trays. */ int GetTrayCount() { return trayCount; } /** Get a supporting window to use. */ Window GetSupportingWindow() { if(trays) { return trays->window; } else if(supportingWindow != None) { return supportingWindow; } else { supportingWindow = JXCreateSimpleWindow(display, rootWindow, 0, 0, 1, 1, 0, 0, 0); return supportingWindow; } } /** Determine if a tray should autohide. */ void SetAutoHideTray(TrayType *tp, int v) { Assert(tp); tp->autoHide = v; } /** Set the x-coordinate of a tray. */ void SetTrayX(TrayType *tp, const char *str) { Assert(tp); Assert(str); tp->x = atoi(str); } /** Set the y-coordinate of a tray. */ void SetTrayY(TrayType *tp, const char *str) { Assert(tp); Assert(str); tp->y = atoi(str); } /** Set the width of a tray. */ void SetTrayWidth(TrayType *tp, const char *str) { int width; Assert(tp); Assert(str); width = atoi(str); if(JUNLIKELY(width < 0)) { Warning(_("invalid tray width: %d"), width); } else { tp->requestedWidth = width; } } /** Set the height of a tray. */ void SetTrayHeight(TrayType *tp, const char *str) { int height; Assert(tp); Assert(str); height = atoi(str); if(JUNLIKELY(height < 0)) { Warning(_("invalid tray height: %d"), height); } else { tp->requestedHeight = height; } } /** Set the tray orientation. */ void SetTrayLayout(TrayType *tp, const char *str) { Assert(tp); if(!str) { /* Compute based on requested size. */ } else if(!strcmp(str, "horizontal")) { tp->layout = LAYOUT_HORIZONTAL; return; } else if(!strcmp(str, "vertical")) { tp->layout = LAYOUT_VERTICAL; return; } else { Warning(_("invalid tray layout: \"%s\""), str); } /* Prefer horizontal layout, but use vertical if * width is finite and height is larger than width or infinite. */ if(tp->requestedWidth > 0 && (tp->requestedHeight == 0 || tp->requestedHeight > tp->requestedWidth)) { tp->layout = LAYOUT_VERTICAL; } else { tp->layout = LAYOUT_HORIZONTAL; } } /** Set the layer for a tray. */ void SetTrayLayer(TrayType *tp, const char *str) { int temp; Assert(tp); Assert(str); temp = atoi(str); if(JUNLIKELY(temp < LAYER_BOTTOM || temp > LAYER_TOP)) { Warning(_("invalid tray layer: %d"), temp); tp->layer = DEFAULT_TRAY_LAYER; } else { tp->layer = temp; } } /** Set the border width for a tray. */ void SetTrayBorder(TrayType *tp, const char *str) { int temp; Assert(tp); Assert(str); temp = atoi(str); if(JUNLIKELY(temp < MIN_TRAY_BORDER || temp > MAX_TRAY_BORDER)) { Warning(_("invalid tray border: %d"), temp); tp->border = DEFAULT_TRAY_BORDER; } else { tp->border = temp; } } /** Set the horizontal tray alignment. */ void SetTrayHorizontalAlignment(TrayType *tp, const char *str) { Assert(tp); if(!str || !strcmp(str, "fixed")) { tp->halign = TALIGN_FIXED; } else if(!strcmp(str, "left")) { tp->halign = TALIGN_LEFT; } else if(!strcmp(str, "right")) { tp->halign = TALIGN_RIGHT; } else if(!strcmp(str, "center")) { tp->halign = TALIGN_CENTER; } else { Warning(_("invalid tray horizontal alignment: \"%s\""), str); tp->halign = TALIGN_FIXED; } } /** Set the vertical tray alignment. */ void SetTrayVerticalAlignment(TrayType *tp, const char *str) { Assert(tp); if(!str || !strcmp(str, "fixed")) { tp->valign = TALIGN_FIXED; } else if(!strcmp(str, "top")) { tp->valign = TALIGN_TOP; } else if(!strcmp(str, "bottom")) { tp->valign = TALIGN_BOTTOM; } else if(!strcmp(str, "center")) { tp->valign = TALIGN_CENTER; } else { Warning(_("invalid tray vertical alignment: \"%s\""), str); tp->valign = TALIGN_FIXED; } } /** Set the tray transparency level. */ void SetTrayOpacity(const char *str) { double temp; Assert(str); temp = atof(str); if(JUNLIKELY(temp <= 0.0 || temp > 1.0)) { Warning(_("invalid tray opacity: %s"), str); temp = 1.0; } trayOpacity = (unsigned int)(temp * UINT_MAX); } jwm-2.1.0+svn579/src/gradient.h0000644000000000000000000000137211710374021014610 0ustar rootroot/** * @file gradient.h * @author Joe Wingbermuehle * @date 2006 * * @brief Gradient fill functions. * */ #ifndef GRADIENT_H #define GRADIENT_H /** Draw a horizontal gradient. * Note that no action is taken if fromColor == toColor. * @param d The drawable on which to draw the gradient. * @param g The graphics context to use. * @param fromColor The starting color pixel value. * @param toColor The ending color pixel value. * @param x The x-coordinate. * @param y The y-coordinate. * @param width The width of the area to fill. * @param height The height of the area to fill. */ void DrawHorizontalGradient(Drawable d, GC g, long fromColor, long toColor, int x, int y, unsigned int width, unsigned int height); #endif /* GRADIENT_H */ jwm-2.1.0+svn579/src/event.h0000644000000000000000000000126311710374021014133 0ustar rootroot/** * @file event.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the event functions. * */ #ifndef EVENT_H #define EVENT_H /** Last event time. */ extern Time eventTime; /** Wait for an event and process it. */ void WaitForEvent(); /** Process an event. * @param event The event to process. */ void ProcessEvent(XEvent *event); /** Discard excess motion events. * @param event The event to return. * @param w The window whose events to discard. */ void DiscardMotionEvents(XEvent *event, Window w); /** Update the last event time. * @param event The event containing the time to use. */ void UpdateTime(const XEvent *event); #endif /* EVENT_H */ jwm-2.1.0+svn579/src/dock.c0000644000000000000000000003263011710374021013727 0ustar rootroot/** * @file dock.c * @author Joe Wingbermuehle * @date 2006 * * @brief Dock tray component. * */ #include "jwm.h" #include "dock.h" #include "tray.h" #include "main.h" #include "error.h" #include "color.h" #define SYSTEM_TRAY_REQUEST_DOCK 0 #define SYSTEM_TRAY_BEGIN_MESSAGE 1 #define SYSTEM_TRAY_CANCEL_MESSAGE 2 #define SYSTEM_TRAY_ORIENTATION_HORZ 0 #define SYSTEM_TRAY_ORIENTATION_VERT 1 /** Structure to represent a docked window. */ typedef struct DockNode { Window window; int needs_reparent; struct DockNode *next; } DockNode; /** Structure to represent a dock tray component. */ typedef struct DockType { TrayComponentType *cp; Window window; int itemSize; DockNode *nodes; } DockType; static const char BASE_SELECTION_NAME[] = "_NET_SYSTEM_TRAY_S%d"; static const char ORIENTATION_ATOM[] = "_NET_SYSTEM_TRAY_ORIENTATION"; static DockType *dock = NULL; static int owner; static Atom dockAtom; static unsigned long orientation; static int dockItemCount; static void SetSize(TrayComponentType *cp, int width, int height); static void Create(TrayComponentType *cp); static void Resize(TrayComponentType *cp); static void DockWindow(Window win); static int UndockWindow(Window win); static void UpdateDock(); static void GetDockSize(int *width, int *height); /** Initialize dock data. */ void InitializeDock() { dockItemCount = 0; owner = 0; } /** Startup the dock. */ void StartupDock() { char *selectionName; if(!dock) { /* No dock has been requested. */ return; } if(dock->window == None) { /* No dock yet. */ /* Get the selection atom. */ selectionName = AllocateStack(sizeof(BASE_SELECTION_NAME)); sprintf(selectionName, BASE_SELECTION_NAME, rootScreen); dockAtom = JXInternAtom(display, selectionName, False); ReleaseStack(selectionName); /* The location and size of the window doesn't matter here. */ dock->window = JXCreateSimpleWindow(display, rootWindow, /* x, y, width, height */ 0, 0, 1, 1, /* border_size, border_color */ 0, 0, /* background */ colors[COLOR_TRAY_BG]); JXSelectInput(display, dock->window, SubstructureNotifyMask | SubstructureRedirectMask | PointerMotionMask | PointerMotionHintMask); } dock->cp->window = dock->window; } /** Shutdown the dock. */ void ShutdownDock() { DockNode *np; if(dock) { /* Release memory used by the dock list. */ while(dock->nodes) { np = dock->nodes->next; JXReparentWindow(display, dock->nodes->window, rootWindow, 0, 0); Release(dock->nodes); dock->nodes = np; } /* Release the selection. */ if(owner) { JXSetSelectionOwner(display, dockAtom, None, CurrentTime); } /* Destroy the dock window. */ JXDestroyWindow(display, dock->window); } } /** Destroy dock data. */ void DestroyDock() { if(dock) { Release(dock); dock = NULL; } } /** Create a dock component. */ TrayComponentType *CreateDock(int width) { TrayComponentType *cp; if(JUNLIKELY(dock != NULL && dock->cp != NULL)) { Warning(_("only one Dock allowed")); return NULL; } else if(dock == NULL) { dock = Allocate(sizeof(DockType)); dock->nodes = NULL; dock->window = None; } cp = CreateTrayComponent(); cp->object = dock; cp->requestedWidth = 1; cp->requestedHeight = 1; dock->cp = cp; dock->itemSize = width; cp->SetSize = SetSize; cp->Create = Create; cp->Resize = Resize; return cp; } /** Set the size of a dock component. */ void SetSize(TrayComponentType *cp, int width, int height) { Assert(cp); Assert(dock); /* Set the orientation. */ if(width == 0) { orientation = SYSTEM_TRAY_ORIENTATION_HORZ; } else if(height == 0) { orientation = SYSTEM_TRAY_ORIENTATION_VERT; } /* Get the size. */ cp->width = width; cp->height = height; GetDockSize(&cp->width, &cp->height); cp->requestedWidth = cp->width; cp->requestedHeight = cp->height; } /** Initialize a dock component. */ void Create(TrayComponentType *cp) { XEvent event; Atom orientationAtom; Assert(cp); /* Map the dock window. */ if(cp->window != None) { JXResizeWindow(display, cp->window, cp->width, cp->height); JXMapRaised(display, cp->window); } /* Set the orientation atom. */ orientationAtom = JXInternAtom(display, ORIENTATION_ATOM, False); JXChangeProperty(display, dock->cp->window, orientationAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&orientation, 1); /* Get the selection if we don't already own it. * If we did already own it, getting it again would cause problems * with some clients due to the way restarts are handled. */ if(!owner) { owner = 1; JXSetSelectionOwner(display, dockAtom, dock->cp->window, CurrentTime); if(JUNLIKELY(JXGetSelectionOwner(display, dockAtom) != dock->cp->window)) { owner = 0; Warning(_("could not acquire system tray selection")); } else { memset(&event, 0, sizeof(event)); event.xclient.type = ClientMessage; event.xclient.window = rootWindow; event.xclient.message_type = JXInternAtom(display, "MANAGER", False); event.xclient.format = 32; event.xclient.data.l[0] = CurrentTime; event.xclient.data.l[1] = dockAtom; event.xclient.data.l[2] = dock->cp->window; event.xclient.data.l[3] = 0; event.xclient.data.l[4] = 0; JXSendEvent(display, rootWindow, False, StructureNotifyMask, &event); } } } /** Resize a dock component. */ void Resize(TrayComponentType *cp) { Assert(cp); JXResizeWindow(display, cp->window, cp->width, cp->height); UpdateDock(); } /** Handle a dock event. */ void HandleDockEvent(const XClientMessageEvent *event) { Assert(event); switch(event->data.l[1]) { case SYSTEM_TRAY_REQUEST_DOCK: DockWindow(event->data.l[2]); break; case SYSTEM_TRAY_BEGIN_MESSAGE: break; case SYSTEM_TRAY_CANCEL_MESSAGE: break; default: Debug("invalid opcode in dock event"); break; } } /** Handle a resize request event. */ int HandleDockResizeRequest(const XResizeRequestEvent *event) { DockNode *np; Assert(event); if(!dock) { return 0; } for(np = dock->nodes; np; np = np->next) { if(np->window == event->window) { JXResizeWindow(display, np->window, event->width, event->height); UpdateDock(); return 1; } } return 0; } /** Handle a configure request event. */ int HandleDockConfigureRequest(const XConfigureRequestEvent *event) { XWindowChanges wc; DockNode *np; Assert(event); if(!dock) { return 0; } for(np = dock->nodes; np; np = np->next) { if(np->window == event->window) { wc.stack_mode = event->detail; wc.sibling = event->above; wc.border_width = event->border_width; wc.x = event->x; wc.y = event->y; wc.width = event->width; wc.height = event->height; JXConfigureWindow(display, np->window, event->value_mask, &wc); UpdateDock(); return 1; } } return 0; } /** Handle a reparent notify event. */ int HandleDockReparentNotify(const XReparentEvent *event) { DockNode *np; int handled; Assert(event); /* Just return if there is no dock. */ if(!dock) { return 0; } /* Check each docked window. */ handled = 0; for(np = dock->nodes; np; np = np->next) { if(np->window == event->window) { if(event->parent != dock->cp->window) { /* For some reason the application reparented the window. * We make note of this condition and reparent every time * the dock is updated. Unfortunately we can't do this for * all applications because some won't deal with it. */ np->needs_reparent = 1; handled = 1; } } } /* Layout the stuff on the dock again if something happened. */ if(handled) { UpdateDock(); } return handled; } /** Handle a destroy event. */ int HandleDockDestroy(Window win) { if(dock) { return UndockWindow(win); } else { return 0; } } /** Handle a selection clear event. */ int HandleDockSelectionClear(const XSelectionClearEvent *event) { if(event->selection == dockAtom) { Debug("lost _NET_SYSTEM_TRAY selection"); owner = 0; } return 0; } /** Add a window to the dock. */ void DockWindow(Window win) { DockNode *np; /* If no dock is running, just return. */ if(!dock) { return; } /* Make sure we have a valid window to add. */ if(JUNLIKELY(win == None)) { return; } /* If this window is already docked ignore it. */ for(np = dock->nodes; np; np = np->next) { if(np->window == win) { return; } } /* Add the window to our list. */ np = Allocate(sizeof(DockNode)); np->window = win; np->needs_reparent = 0; np->next = dock->nodes; dock->nodes = np; dockItemCount += 1; /* Update the requested size. */ GetDockSize(&dock->cp->requestedWidth, &dock->cp->requestedHeight); /* It's safe to reparent at (0, 0) since we call * ResizeTray which will invoke the Resize callback. */ JXAddToSaveSet(display, win); JXSelectInput(display, win, StructureNotifyMask | ResizeRedirectMask | PointerMotionMask | PointerMotionHintMask); JXReparentWindow(display, win, dock->cp->window, 0, 0); JXMapRaised(display, win); /* Resize the tray containing the dock. */ ResizeTray(dock->cp->tray); } /** Remove a window from the dock. */ int UndockWindow(Window win) { DockNode *np; DockNode *last; /* If no dock is running, just return. */ if(!dock) { return 0; } last = NULL; for(np = dock->nodes; np; np = np->next) { if(np->window == win) { /* Remove the window from our list. */ if(last) { last->next = np->next; } else { dock->nodes = np->next; } Release(np); dockItemCount -= 1; /* Update the requested size. */ GetDockSize(&dock->cp->requestedWidth, &dock->cp->requestedHeight); /* Resize the tray. */ ResizeTray(dock->cp->tray); return 1; } last = np; } return 0; } /** Layout items on the dock. */ void UpdateDock() { XWindowAttributes attr; DockNode *np; int x, y; int width, height; int xoffset, yoffset; int itemSize; int ratio; Assert(dock); /* Determine the size of items in the dock. */ if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { itemSize = dock->cp->height - 2; } else { itemSize = dock->cp->width - 2; } if(dock->itemSize > 0 && itemSize > dock->itemSize) { itemSize = dock->itemSize; } x = 1; y = 1; for(np = dock->nodes; np; np = np->next) { xoffset = 0; yoffset = 0; width = itemSize; height = itemSize; if(JXGetWindowAttributes(display, np->window, &attr)) { /* Fixed point with 16 bit fraction. */ ratio = (attr.width << 16) / attr.height; if(ratio > 65536) { if(width > attr.width) { width = attr.width; } height = (width << 16) / ratio; } else { if(height > attr.height) { height = attr.height; } width = (height * ratio) >> 16; } xoffset = (itemSize - width) / 2; yoffset = (itemSize - height) / 2; } JXMoveResizeWindow(display, np->window, x + xoffset, y + yoffset, width, height); /* Reparent if this window likes to go other places. */ if(np->needs_reparent) { JXReparentWindow(display, np->window, dock->cp->window, x + xoffset, y + yoffset); } if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { x += itemSize; if(x >= dock->cp->width) { x = 0; y += itemSize; } } else { y += itemSize; if(y >= dock->cp->height) { y = 0; x += itemSize; } } } } /** Get the size of the dock. */ void GetDockSize(int *width, int *height) { int itemSize; int constraint; int span; int columns; Assert(dock != NULL); /* Determine the dimension that constrains the size of items. */ if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { constraint = dock->cp->height; } else { constraint = dock->cp->width; } /* Determine the size of each item on the dock. */ itemSize = constraint; if(dock->itemSize > 0 && itemSize > dock->itemSize) { itemSize = dock->itemSize; } span = constraint / itemSize; columns = (dockItemCount + span - 1) / span; if(orientation == SYSTEM_TRAY_ORIENTATION_HORZ) { /* Horizontal tray. Place top to bottom and then left to right. */ *height = constraint; if(columns == 0) { *width = 1; } else { *width = itemSize * columns + 2; } } else { /* Vertical tray. Place left to right and then top to bottom. */ *width = constraint; if(columns == 0) { *height = 1; } else { *height = itemSize * columns + 2; } } } jwm-2.1.0+svn579/src/image.h0000644000000000000000000000165311710374021014077 0ustar rootroot/** * @file image.h * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Functions to load images. * */ #ifndef IMAGE_H #define IMAGE_H /** Structure to represent an image. */ typedef struct ImageNode { int width; /**< Width of the image. */ int height; /**< Height of the image. */ unsigned char *data; /**< Image data. */ } ImageNode; /** Load an image from a file. * @param fileName The file containing the image. * @return A new image node (NULL if the image could not be loaded). */ ImageNode *LoadImage(const char *fileName); /** Load an image from data. * The data must be in the format from the EWMH spec. * @param data The image data. * @return A new image node (NULL if there were errors. */ ImageNode *LoadImageFromData(char **data); /** Destroy an image node. * @param image The image to destroy. */ void DestroyImage(ImageNode *image); #endif /* IMAGE_H */ jwm-2.1.0+svn579/src/font.c0000644000000000000000000001363711710374021013763 0ustar rootroot/** * @file font.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle fonts. * */ #include "jwm.h" #include "font.h" #include "main.h" #include "error.h" #include "color.h" #include "misc.h" static const char *DEFAULT_FONT = "-*-courier-*-r-*-*-14-*-*-*-*-*-*-*"; static char *fontNames[FONT_COUNT]; #ifdef USE_XFT static XftFont *fonts[FONT_COUNT]; #else static XFontStruct *fonts[FONT_COUNT]; static GC fontGC; #endif /** Initialize font data. */ void InitializeFonts() { int x; for(x = 0; x < FONT_COUNT; x++) { fonts[x] = NULL; fontNames[x] = NULL; } } /** Startup font support. */ void StartupFonts() { #ifndef USE_XFT XGCValues gcValues; unsigned long gcMask; #endif int x; /* Inherit unset fonts from the tray for tray items. */ if(!fontNames[FONT_TASK]) { fontNames[FONT_TASK] = CopyString(fontNames[FONT_TRAY]); } if(!fontNames[FONT_TRAYBUTTON]) { fontNames[FONT_TRAYBUTTON] = CopyString(fontNames[FONT_TRAY]); } if(!fontNames[FONT_CLOCK]) { fontNames[FONT_CLOCK] = CopyString(fontNames[FONT_TRAY]); } if(!fontNames[FONT_PAGER]) { fontNames[FONT_PAGER] = CopyString(fontNames[FONT_TRAY]); } #ifdef USE_XFT for(x = 0; x < FONT_COUNT; x++) { if(fontNames[x]) { fonts[x] = JXftFontOpenName(display, rootScreen, fontNames[x]); if(!fonts[x]) { fonts[x] = JXftFontOpenXlfd(display, rootScreen, fontNames[x]); } if(JUNLIKELY(!fonts[x])) { Warning(_("could not load font: %s"), fontNames[x]); } } if(!fonts[x]) { fonts[x] = JXftFontOpenXlfd(display, rootScreen, DEFAULT_FONT); } if(JUNLIKELY(!fonts[x])) { FatalError(_("could not load the default font: %s"), DEFAULT_FONT); } } #else /* USE_XFT */ for(x = 0; x < FONT_COUNT; x++) { if(fontNames[x]) { fonts[x] = JXLoadQueryFont(display, fontNames[x]); if(JUNLIKELY(!fonts[x] && fontNames[x])) { Warning(_("could not load font: %s"), fontNames[x]); } } if(!fonts[x]) { fonts[x] = JXLoadQueryFont(display, DEFAULT_FONT); } if(JUNLIKELY(!fonts[x])) { FatalError(_("could not load the default font: %s"), DEFAULT_FONT); } } gcMask = GCGraphicsExposures; gcValues.graphics_exposures = False; fontGC = JXCreateGC(display, rootWindow, gcMask, &gcValues); #endif /* USE_XFT */ } /** Shutdown font support. */ void ShutdownFonts() { int x; for(x = 0; x < FONT_COUNT; x++) { if(fonts[x]) { #ifdef USE_XFT JXftFontClose(display, fonts[x]); #else JXFreeFont(display, fonts[x]); #endif fonts[x] = NULL; } } #ifndef USE_XFT JXFreeGC(display, fontGC); #endif } /** Destroy font data. */ void DestroyFonts() { int x; for(x = 0; x < FONT_COUNT; x++) { if(fontNames[x]) { Release(fontNames[x]); fontNames[x] = NULL; } } } /** Get the width of a string. */ int GetStringWidth(FontType type, const char *str) { #ifdef USE_XFT XGlyphInfo extents; unsigned int length; Assert(str); Assert(fonts[type]); length = strlen(str); JXftTextExtentsUtf8(display, fonts[type], (const unsigned char*)str, length, &extents); return extents.xOff; #else Assert(str); Assert(fonts[type]); return XTextWidth(fonts[type], str, strlen(str)); #endif } /** Get the height of a string. */ int GetStringHeight(FontType type) { Assert(fonts[type]); return fonts[type]->ascent + fonts[type]->descent; } /** Set the font to use for a component. */ void SetFont(FontType type, const char *value) { if(JUNLIKELY(!value)) { Warning(_("empty Font tag")); return; } if(fontNames[type]) { Release(fontNames[type]); } fontNames[type] = CopyString(value); } /** Display a string. */ void RenderString(Drawable d, FontType font, ColorType color, int x, int y, int width, Region region, const char *str) { #ifdef USE_XFT XftDraw *xd; #endif XRectangle rect; Region renderRegion; int len; char *output; #ifdef USE_FRIBIDI FriBidiChar *temp; FriBidiCharType type = FRIBIDI_TYPE_ON; int unicodeLength; #endif if(!str) { return; } len = strlen(str); if(len == 0) { return; } /* Get the bounds for the string based on the specified width. */ rect.x = x; rect.y = y; rect.width = Min(GetStringWidth(font, str), width) + 2; rect.height = GetStringHeight(font); /* Create a region to use. */ renderRegion = XCreateRegion(); /* Combine the width bounds with the region to use. */ XUnionRectWithRegion(&rect, renderRegion, renderRegion); /* Combine the provided region with the region to use. */ if(region) { XIntersectRegion(region, renderRegion, renderRegion); } /* Apply the bidi algorithm if requested. */ #ifdef USE_FRIBIDI temp = AllocateStack((len + 1) * sizeof(FriBidiChar)); unicodeLength = fribidi_utf8_to_unicode((char*)str, len, temp); fribidi_log2vis(temp, unicodeLength, &type, temp, NULL, NULL, NULL); fribidi_unicode_to_utf8(temp, len, (char*)temp); output = (char*)temp; #else output = (char*)str; #endif /* Display the string. */ #ifdef USE_XFT xd = XftDrawCreate(display, d, rootVisual, rootColormap); XftDrawSetClip(xd, renderRegion); JXftDrawStringUtf8(xd, GetXftColor(color), fonts[font], x, y + fonts[font]->ascent, (const unsigned char*)output, len); XftDrawDestroy(xd); #else JXSetForeground(display, fontGC, colors[color]); XSetRegion(display, fontGC, renderRegion); JXSetFont(display, fontGC, fonts[font]->fid); JXDrawString(display, d, fontGC, x, y + fonts[font]->ascent, output, len); #endif /* Free any memory used for UTF conversion. */ #ifdef USE_FRIBIDI ReleaseStack(output); #endif XDestroyRegion(renderRegion); } jwm-2.1.0+svn579/src/parse.h0000644000000000000000000000046211710374021014124 0ustar rootroot/** * @file parse.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header file for the JWM configuration parser. * */ #ifndef PARSE_H #define PARSE_H /** Parse a configuration file. * @param fileName The file to parse. */ void ParseConfig(const char *fileName); #endif /* PARSE_H */ jwm-2.1.0+svn579/src/pager.h0000644000000000000000000000114511710374021014107 0ustar rootroot/** * @file pager.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Pager tray component. * */ #ifndef PAGER_H #define PAGER_H struct TrayComponentType; struct TimeType; /*@{*/ void InitializePager(); void StartupPager(); void ShutdownPager(); void DestroyPager(); /*@}*/ /** Create a pager tray component. * @param labeled Set to label the pager. * @return A new pager tray component. */ struct TrayComponentType *CreatePager(int labeled); /** Update pagers. */ void UpdatePager(); /** Signal pagers. */ void SignalPager(const struct TimeType *now, int x, int y); #endif /* PAGER_H */ jwm-2.1.0+svn579/src/border.h0000644000000000000000000000653311710374021014274 0ustar rootroot/** * @file border.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header file for border functions. * */ #ifndef BORDER_H #define BORDER_H #include "gradient.h" struct ClientNode; /** Border button image masks. */ typedef enum { BP_CLOSE, BP_MINIMIZE, BP_MAXIMIZE, BP_MAXIMIZE_ACTIVE, BP_COUNT } BorderPixmapType; /** Flags to determine what action to take on the border. */ typedef enum { BA_NONE = 0, /**< Do nothing. */ BA_RESIZE = 1, /**< Resize the window. */ BA_MOVE = 2, /**< Move the window. */ BA_CLOSE = 3, /**< Close the window. */ BA_MAXIMIZE = 4, /**< Maximize the window. */ BA_MINIMIZE = 5, /**< Minimize the window. */ BA_MENU = 6, /**< Show the window menu. */ BA_RESIZE_N = 0x10, /**< Resize north. */ BA_RESIZE_S = 0x20, /**< Resize south. */ BA_RESIZE_E = 0x40, /**< Resize east. */ BA_RESIZE_W = 0x80 /**< Resize west. */ } BorderActionType; /*@{*/ void InitializeBorders(); void StartupBorders(); void ShutdownBorders(); void DestroyBorders(); /*@}*/ /** Determine the action to take for a client. * @param np The client. * @param x The x-coordinate of the mouse (frame relative). * @param y The y-coordinate of the mouse (frame relative). * @return The action to take. */ BorderActionType GetBorderActionType(const struct ClientNode *np, int x, int y); /** Draw a window border. * @param np The client whose frame to draw. * @param expose The expose event causing the redraw (or NULL). */ void DrawBorder(const struct ClientNode *np, const XExposeEvent *expose); /** Get the size of a border icon. * @return The size in pixels (note that icons are square). */ int GetBorderIconSize(); /** Get the size of a window border. * @param np The client. * @param north Pointer to the value to contain the north border size. * @param south Pointer to the value to contain the south border size. * @param east Pointer to the value to contain the east border size. * @param west Pointer to the value to contain the west border size. */ void GetBorderSize(const struct ClientNode *np, int *north, int *south, int *east, int *west); /** Set the size of window borders. * @param str The size to use in string form. */ void SetBorderWidth(const char *str); /** Set the size of window title bars. * @param str The size to use in string form. */ void SetTitleHeight(const char *str); /** Redraw all borders on the current desktop. */ void ExposeCurrentDesktop(); /** Reset a rounded rectangle window. * @param w The window. */ void ResetRoundedRectWindow(Window w); /** Shape a rounded rectangle window. * @param w The window to shape. * @param width The width of the window. * @param height The height of the window. */ void ShapeRoundedRectWindow(Window w, int width, int height); /** Set the bitmask to use for a button. * @param pt The button bitmask to set. * @param filename The name of the file containing the bitmask. */ void SetButtonMask(BorderPixmapType pt, const char *filename); /** Draw a rounded rectangle. */ void DrawRoundedRectangle(Drawable d, GC gc, int x, int y, int width, int height, int radius); /** Fill a rounded rectangle. */ void FillRoundedRectangle(Drawable d, GC gc, int x, int y, int width, int height, int radius); #endif /* BORDER_H */ jwm-2.1.0+svn579/src/screen.c0000644000000000000000000000472711710374021014274 0ustar rootroot/** * @file screen.c * @author Joe Wingbermuehle * @date 2005-2006 * * @brief Screen functions. * * Note that screen here refers to physical monitors. Screens are * determined using the xinerama extension (if available). There will * always be at least one screen. * */ #include "jwm.h" #include "screen.h" #include "main.h" #include "cursor.h" static ScreenType *screens; static int screenCount; /** Initialize screen data. */ void InitializeScreens() { screens = NULL; } /** Startup screens. */ void StartupScreens() { #ifdef USE_XINERAMA XineramaScreenInfo *info; int x; if(XineramaIsActive(display)) { info = XineramaQueryScreens(display, &screenCount); screens = Allocate(sizeof(ScreenType) * screenCount); for(x = 0; x < screenCount; x++) { screens[x].index = x; screens[x].x = info[x].x_org; screens[x].y = info[x].y_org; screens[x].width = info[x].width; screens[x].height = info[x].height; } JXFree(info); } else { screenCount = 1; screens = Allocate(sizeof(ScreenType)); screens->index = 0; screens->x = 0; screens->y = 0; screens->width = rootWidth; screens->height = rootHeight; } #else screenCount = 1; screens = Allocate(sizeof(ScreenType)); screens->index = 0; screens->x = 0; screens->y = 0; screens->width = rootWidth; screens->height = rootHeight; #endif /* USE_XINERAMA */ } /** Shutdown screens. */ void ShutdownScreens() { if(screens) { Release(screens); screens = NULL; } } /** Destroy screen data. */ void DestroyScreens() { } /** Get the screen given global screen coordinates. */ const ScreenType *GetCurrentScreen(int x, int y) { ScreenType *sp; int index; for(index = 1; index < screenCount; index++) { sp = &screens[index]; if(x >= sp->x && x < sp->x + sp->width) { if(y >= sp->y && y <= sp->y + sp->height) { return sp; } } } return &screens[0]; } /** Get the screen the mouse is currently on. */ const ScreenType *GetMouseScreen() { #ifdef USE_XINERAMA int x, y; GetMousePosition(&x, &y); return GetCurrentScreen(x, y); #else return &screens[0]; #endif } /** Get data for a screen. */ const ScreenType *GetScreen(int index) { Assert(index >= 0); Assert(index < screenCount); return &screens[index]; } /** Get the number of screens. */ int GetScreenCount() { return screenCount; } jwm-2.1.0+svn579/src/jwm.h0000644000000000000000000000713711710374021013615 0ustar rootroot/** * @file jwm.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief The main JWM header file. * */ #ifndef JWM_H #define JWM_H #include "../config.h" #ifndef MAKE_DEPEND # include # include # include # include /* Ideally png.h would be included in image.c, which is the only * file that references it. Unfortunately, if setjmp.h is included * before png.h, png.h will complain about only including setjmp.h * once. The X headers apparently include setjmp.h, so I don't have * any control over the situation. Fortunately png.h can't complain * if it was included first. */ # ifdef USE_PNG # include # else # include # endif # ifdef HAVE_LOCALE_H # include # endif # ifdef HAVE_LIBINTL_H # include # endif # ifdef HAVE_STDARG_H # include # endif # ifdef HAVE_SIGNAL_H # include # endif # ifdef HAVE_UNISTD_H # include # endif # ifdef HAVE_TIME_H # include # endif # ifdef HAVE_SYS_WAIT_H # include # endif # ifdef HAVE_SYS_TIME_H # include # endif # ifdef HAVE_SYS_SELECT_H # include # endif # include # ifdef HAVE_X11_XUTIL_H # include # endif # ifdef HAVE_X11_XRESOURCE_H # include # endif # ifdef HAVE_X11_CURSORFONT_H # include # endif # ifdef HAVE_X11_XPROTO_H # include # endif # ifdef HAVE_X11_XATOM_H # include # endif # ifdef HAVE_X11_KEYSYM_H # include # endif # ifdef USE_SHAPE # include # endif # ifdef USE_XMU # include # endif # ifdef USE_XINERAMA # include # endif # ifdef USE_XFT # ifdef HAVE_FT2BUILD_H # include # endif # include # endif # ifdef USE_XRENDER # include # endif # ifdef USE_FRIBIDI # include # endif #endif /* MAKE_DEPEND */ #ifndef _ # ifdef HAVE_GETTEXT # define _ gettext # else # define _ # endif #endif #define DEFAULT_DESKTOP_WIDTH 4 #define DEFAULT_DESKTOP_HEIGHT 1 #define MAX_INCLUDE_DEPTH 16 #define MAX_BORDER_WIDTH 32 #define MIN_BORDER_WIDTH 1 #define DEFAULT_BORDER_WIDTH 4 #define MAX_TITLE_HEIGHT 64 #define MIN_TITLE_HEIGHT 2 #define DEFAULT_TITLE_HEIGHT 20 #define MAX_DOUBLE_CLICK_DELTA 32 #define MIN_DOUBLE_CLICK_DELTA 0 #define DEFAULT_DOUBLE_CLICK_DELTA 2 #define MAX_DOUBLE_CLICK_SPEED 2000 #define MIN_DOUBLE_CLICK_SPEED 1 #define DEFAULT_DOUBLE_CLICK_SPEED 400 #define MAX_SNAP_DISTANCE 32 #define MIN_SNAP_DISTANCE 1 #define DEFAULT_SNAP_DISTANCE 5 #define MAX_TRAY_BORDER 32 #define MIN_TRAY_BORDER 0 #define DEFAULT_TRAY_BORDER 1 #define MAX_WINDOW_WIDTH (1 << 15) #define MAX_WINDOW_HEIGHT (1 << 15) #define MOVE_DELTA 3 #define RESTART_DELAY 50000 #define SHELL_NAME "/bin/sh" #define DEFAULT_MENU_TITLE "JWM" /** Fixed radius of 4x4 */ #ifdef USE_SHAPE # define CORNER_RADIUS 4 #endif #ifdef __GNUC__ # if __GNUC__ >= 3 # define JLIKELY(x) __builtin_expect(!!(x), 1) # define JUNLIKELY(x) __builtin_expect(!!(x), 0) # else # warning "JLIKELY/JUNLIKELY not available with this version of gcc" # define JLIKELY(x) (x) # define JUNLIKELY(x) (x) # endif #else # warning "JLIKELY/JUNLIKELY not available with this compiler" # define JLIKELY(x) (x) # define JUNLIKELY(x) (x) #endif #include "debug.h" #include "jxlib.h" #endif /* JWM_H */ jwm-2.1.0+svn579/src/main.c0000644000000000000000000002733311710374021013737 0ustar rootroot/** * @file main.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief The main entry point and related JWM functions. * */ #include "jwm.h" #include "main.h" #include "lex.h" #include "parse.h" #include "help.h" #include "error.h" #include "event.h" #include "border.h" #include "client.h" #include "color.h" #include "command.h" #include "cursor.h" #include "confirm.h" #include "font.h" #include "hint.h" #include "group.h" #include "key.h" #include "icon.h" #include "outline.h" #include "taskbar.h" #include "tray.h" #include "traybutton.h" #include "popup.h" #include "pager.h" #include "swallow.h" #include "screen.h" #include "root.h" #include "desktop.h" #include "place.h" #include "clock.h" #include "dock.h" #include "misc.h" #include "background.h" Display *display = NULL; Window rootWindow; int rootWidth, rootHeight; int rootDepth; int rootScreen; Colormap rootColormap; Visual *rootVisual; GC rootGC; int colormapCount; char shouldExit = 0; char shouldRestart = 0; char isRestarting = 0; char initializing = 0; char shouldReload = 0; unsigned int desktopWidth = 4; unsigned int desktopHeight = 1; unsigned int desktopCount = 4; unsigned int currentDesktop = 0; char *exitCommand = NULL; int borderWidth = DEFAULT_BORDER_WIDTH; int titleHeight = DEFAULT_TITLE_HEIGHT; unsigned int doubleClickSpeed; unsigned int doubleClickDelta; FocusModelType focusModel = FOCUS_SLOPPY; XContext clientContext; XContext frameContext; #ifdef USE_SHAPE int haveShape; int shapeEvent; #endif #ifdef USE_XRENDER int haveRender; #endif static const char *CONFIG_FILE = "/.jwmrc"; static void Initialize(); static void Startup(); static void Shutdown(); static void Destroy(); static void OpenConnection(); static void CloseConnection(); static void StartupConnection(); static void ShutdownConnection(); static void EventLoop(); static void HandleExit(int sig); static void DoExit(int code); static void SendRestart(); static void SendExit(); static void SendReload(); static void SendJWMMessage(const char *message); static char *displayString = NULL; char *configPath = NULL; /** The main entry point. */ int main(int argc, char *argv[]) { char *temp; int x; StartDebug(); /* Get the name of the user's local configuration file. */ temp = getenv("HOME"); if(temp) { configPath = Allocate(strlen(temp) + strlen(CONFIG_FILE) + 1); strcpy(configPath, temp); strcat(configPath, CONFIG_FILE); } else { configPath = CopyString(CONFIG_FILE); } /* Parse command line options. */ for(x = 1; x < argc; x++) { if(!strcmp(argv[x], "-v")) { DisplayAbout(); DoExit(0); } else if(!strcmp(argv[x], "-h")) { DisplayHelp(); DoExit(0); } else if(!strcmp(argv[x], "-p")) { Initialize(); ParseConfig(configPath); DoExit(0); } else if(!strcmp(argv[x], "-restart")) { SendRestart(); DoExit(0); } else if(!strcmp(argv[x], "-exit")) { SendExit(); DoExit(0); } else if(!strcmp(argv[x], "-reload")) { SendReload(); DoExit(0); } else if(!strcmp(argv[x], "-display") && x + 1 < argc) { displayString = argv[++x]; } else { DisplayUsage(); DoExit(1); } } #ifdef HAVE_SETLOCALE setlocale(LC_ALL, ""); #endif #ifdef HAVE_GETTEXT bindtextdomain("jwm", LOCALEDIR); textdomain("jwm"); #endif /* The main loop. */ StartupConnection(); do { isRestarting = shouldRestart; shouldExit = 0; shouldRestart = 0; shouldReload = 0; /* Prepare JWM components. */ Initialize(); /* Parse the configuration file. */ ParseConfig(configPath); /* Start up the JWM components. */ Startup(); /* The main event loop. */ EventLoop(); /* Shutdown JWM components. */ Shutdown(); /* Perform any extra cleanup. */ Destroy(); } while(shouldRestart); ShutdownConnection(); /* If we have a command to execute on shutdown, run it now. */ if(exitCommand) { execl(SHELL_NAME, SHELL_NAME, "-c", exitCommand, NULL); Warning(_("exec failed: (%s) %s"), SHELL_NAME, exitCommand); DoExit(1); } else { DoExit(0); } /* Control shoud never get here. */ return -1; } /** Exit with the specified status code. */ void DoExit(int code) { Destroy(); if(configPath) { Release(configPath); configPath = NULL; } if(exitCommand) { Release(exitCommand); exitCommand = NULL; } StopDebug(); exit(code); } /** Main JWM event loop. */ void EventLoop() { XEvent event; /* Loop processing events until it's time to exit. */ while(JLIKELY(!shouldExit)) { WaitForEvent(&event); ProcessEvent(&event); } /* Give windows (swallow windows especially) time to map. */ usleep(RESTART_DELAY); /* Process events one last time. */ while(JXPending(display) > 0) { WaitForEvent(&event); ProcessEvent(&event); } } /** Open a connection to the X server. */ void OpenConnection() { display = JXOpenDisplay(displayString); if(JUNLIKELY(!display)) { if(displayString) { printf("error: could not open display %s\n", displayString); } else { printf("error: could not open display\n"); } DoExit(1); } rootScreen = DefaultScreen(display); rootWindow = RootWindow(display, rootScreen); rootWidth = DisplayWidth(display, rootScreen); rootHeight = DisplayHeight(display, rootScreen); rootDepth = DefaultDepth(display, rootScreen); rootColormap = DefaultColormap(display, rootScreen); rootVisual = DefaultVisual(display, rootScreen); rootGC = DefaultGC(display, rootScreen); colormapCount = MaxCmapsOfScreen(ScreenOfDisplay(display, rootScreen)); XSetGraphicsExposures(display, rootGC, False); } /** Prepare the connection. */ void StartupConnection() { XSetWindowAttributes attr; #ifdef USE_SHAPE int shapeError; #endif #ifdef USE_XRENDER int renderEvent; int renderError; #endif struct sigaction sa; initializing = 1; OpenConnection(); #if 0 XSynchronize(display, True); #endif JXSetErrorHandler(ErrorHandler); clientContext = XUniqueContext(); frameContext = XUniqueContext(); /* Set the events we want for the root window. * Note that asking for SubstructureRedirect will fail * if another window manager is already running. */ attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask | StructureNotifyMask | PropertyChangeMask | ColormapChangeMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | PointerMotionHintMask; JXChangeWindowAttributes(display, rootWindow, CWEventMask, &attr); memset(&sa, 0, sizeof(sa)); sa.sa_flags = 0; sa.sa_handler = HandleExit; sigaction(SIGTERM, &sa, NULL); sigaction(SIGINT, &sa, NULL); sigaction(SIGHUP, &sa, NULL); sa.sa_flags = SA_NOCLDWAIT; sa.sa_handler = SIG_DFL; sigaction(SIGCHLD, &sa, NULL); #ifdef USE_SHAPE haveShape = JXShapeQueryExtension(display, &shapeEvent, &shapeError); if (haveShape) { Debug("shape extension enabled"); } else { Debug("shape extension disabled"); } #endif #ifdef USE_XRENDER haveRender = JXRenderQueryExtension(display, &renderEvent, &renderError); if(haveRender) { Debug("render extension enabled"); } else { Debug("render extension disabled"); } #endif initializing = 0; } /** Close the X server connection. */ void CloseConnection() { JXFlush(display); JXCloseDisplay(display); } /** Close the X server connection. */ void ShutdownConnection() { CloseConnection(); } /** Signal handler. */ void HandleExit(int sig) { shouldExit = 1; } /** Initialize data structures. * This is called before the X connection is opened. */ void Initialize() { InitializeBackgrounds(); InitializeBorders(); InitializeClients(); InitializeClock(); InitializeColors(); InitializeCommands(); InitializeCursors(); InitializeDesktops(); #ifndef DISABLE_CONFIRM InitializeDialogs(); #endif InitializeDock(); InitializeFonts(); InitializeGroups(); InitializeHints(); InitializeIcons(); InitializeKeys(); InitializeOutline(); InitializePager(); InitializePlacement(); InitializePopup(); InitializeRootMenu(); InitializeScreens(); InitializeSwallow(); InitializeTaskBar(); InitializeTray(); InitializeTrayButtons(); } /** Startup the various JWM components. * This is called after the X connection is opened. */ void Startup() { /* This order is important. */ StartupCommands(); /* First we grab the server to prevent clients from changing things * while we're still loading. */ JXGrabServer(display); StartupScreens(); StartupGroups(); StartupColors(); StartupIcons(); StartupBackgrounds(); StartupFonts(); StartupCursors(); StartupOutline(); StartupPager(); StartupClock(); StartupTaskBar(); StartupTrayButtons(); StartupDock(); StartupTray(); StartupKeys(); StartupDesktops(); StartupHints(); StartupBorders(); StartupPlacement(); StartupClients(); # ifndef DISABLE_CONFIRM StartupDialogs(); # endif StartupPopup(); StartupRootMenu(); SetDefaultCursor(rootWindow); ReadCurrentDesktop(); JXFlush(display); RestackClients(); /* Allow clients to do their thing. */ JXSync(display, True); JXUngrabServer(display); StartupSwallow(); DrawTray(); /* Send expose events. */ ExposeCurrentDesktop(); /* Draw the background (if backgrounds are used). */ LoadBackground(currentDesktop); } /** Shutdown the various JWM components. * This is called before the X connection is closed. */ void Shutdown() { /* This order is important. */ ShutdownSwallow(); ShutdownOutline(); # ifndef DISABLE_CONFIRM ShutdownDialogs(); # endif ShutdownPopup(); ShutdownKeys(); ShutdownPager(); ShutdownRootMenu(); ShutdownDock(); ShutdownTray(); ShutdownTrayButtons(); ShutdownTaskBar(); ShutdownClock(); ShutdownBorders(); ShutdownClients(); ShutdownBackgrounds(); ShutdownIcons(); ShutdownCursors(); ShutdownFonts(); ShutdownColors(); ShutdownGroups(); ShutdownDesktops(); ShutdownPlacement(); ShutdownHints(); ShutdownScreens(); ShutdownCommands(); } /** Clean up memory. * This is called after the X connection is closed. * Note that it is possible for this to be called more than once. */ void Destroy() { DestroyBackgrounds(); DestroyBorders(); DestroyClients(); DestroyClock(); DestroyColors(); DestroyCommands(); DestroyCursors(); DestroyDesktops(); #ifndef DISABLE_CONFIRM DestroyDialogs(); #endif DestroyDock(); DestroyFonts(); DestroyGroups(); DestroyHints(); DestroyIcons(); DestroyKeys(); DestroyOutline(); DestroyPager(); DestroyPlacement(); DestroyPopup(); DestroyRootMenu(); DestroyScreens(); DestroySwallow(); DestroyTaskBar(); DestroyTray(); DestroyTrayButtons(); } /** Send _JWM_RESTART to the root window. */ void SendRestart() { SendJWMMessage("_JWM_RESTART"); } /** Send _JWM_EXIT to the root window. */ void SendExit() { SendJWMMessage("_JWM_EXIT"); } /** Send _JWM_RELOAD to the root window. */ void SendReload() { SendJWMMessage("_JWM_RELOAD"); } /** Send a JWM message to the root window. */ void SendJWMMessage(const char *message) { XEvent event; OpenConnection(); memset(&event, 0, sizeof(event)); event.xclient.type = ClientMessage; event.xclient.window = rootWindow; event.xclient.message_type = JXInternAtom(display, message, False); event.xclient.format = 32; JXSendEvent(display, rootWindow, False, SubstructureRedirectMask, &event); CloseConnection(); } jwm-2.1.0+svn579/src/pager.c0000644000000000000000000004002411710374021014101 0ustar rootroot/** * @file pager.c * @author Joe Wingbermuehle * @date 2004-2007 * * @brief Pager tray component. * */ #include "jwm.h" #include "pager.h" #include "client.h" #include "clientlist.h" #include "color.h" #include "cursor.h" #include "desktop.h" #include "event.h" #include "main.h" #include "tray.h" #include "timing.h" #include "popup.h" #include "font.h" /** Structure to represent a pager tray component. */ typedef struct PagerType { TrayComponentType *cp; /**< Common tray component data. */ int labeled; /**< Set to label the pager. */ int deskWidth; /**< Width of a desktop. */ int deskHeight; /**< Height of a desktop. */ int scalex; /**< Horizontal scale factor (fixed point). */ int scaley; /**< Vertical scale factor (fixed point). */ Pixmap buffer; /**< Buffer for rendering the pager. */ TimeType mouseTime; /**< Timestamp of last mouse movement. */ int mousex, mousey; /**< Coordinates of last mouse location. */ struct PagerType *next; /**< Next pager in the list. */ } PagerType; static PagerType *pagers; static int shouldStopMove; static void Create(TrayComponentType *cp); static void SetSize(TrayComponentType *cp, int width, int height); static int GetPagerDesktop(PagerType *pp, int x, int y); static void ProcessPagerButtonEvent(TrayComponentType *cp, int x, int y, int mask); static void ProcessPagerMotionEvent(TrayComponentType *cp, int x, int y, int mask); static void StartPagerMove(TrayComponentType *cp, int x, int y); static void StopPagerMove(ClientNode *np, int x, int y, int desktop, int hmax, int vmax); static void PagerMoveController(int wasDestroyed); static void DrawPagerClient(const PagerType *pp, const ClientNode *np); /** Initialize pager data. */ void InitializePager() { pagers = NULL; } /** Startup the pager. */ void StartupPager() { } /** Shutdown the pager. */ void ShutdownPager() { PagerType *pp; for(pp = pagers; pp; pp = pp->next) { JXFreePixmap(display, pp->buffer); } } /** Release pager data. */ void DestroyPager() { PagerType *pp; while(pagers) { pp = pagers->next; Release(pagers); pagers = pp; } } /** Create a new pager tray component. */ TrayComponentType *CreatePager(int labeled) { TrayComponentType *cp; PagerType *pp; pp = Allocate(sizeof(PagerType)); pp->next = pagers; pagers = pp; pp->labeled = labeled; pp->mousex = -POPUP_DELTA; pp->mousey = -POPUP_DELTA; pp->mouseTime.seconds = 0; pp->mouseTime.ms = 0; cp = CreateTrayComponent(); cp->object = pp; pp->cp = cp; cp->Create = Create; cp->SetSize = SetSize; cp->ProcessButtonPress = ProcessPagerButtonEvent; cp->ProcessMotionEvent = ProcessPagerMotionEvent; return cp; } /** Initialize a pager tray component. */ void Create(TrayComponentType *cp) { PagerType *pp; Assert(cp); pp = (PagerType*)cp->object; Assert(pp); Assert(cp->width > 0); Assert(cp->height > 0); cp->pixmap = JXCreatePixmap(display, rootWindow, cp->width, cp->height, rootDepth); pp->buffer = cp->pixmap; } /** Set the size of a pager tray component. */ void SetSize(TrayComponentType *cp, int width, int height) { PagerType *pp; Assert(cp); pp = (PagerType*)cp->object; Assert(pp); if(width) { /* Vertical pager. */ cp->width = width; pp->deskWidth = width / desktopWidth; pp->deskHeight = (pp->deskWidth * rootHeight) / rootWidth; cp->height = (pp->deskHeight + 1) * desktopHeight; } else if(height) { /* Horizontal pager. */ cp->height = height; pp->deskHeight = height / desktopHeight; pp->deskWidth = (pp->deskHeight * rootWidth) / rootHeight; cp->width = (pp->deskWidth + 1) * desktopWidth; } else { Assert(0); } pp->scalex = ((pp->deskWidth - 2) << 16) / rootWidth; pp->scaley = ((pp->deskHeight - 2) << 16) / rootHeight; } /** Get the desktop for a pager given a set of coordinates. */ int GetPagerDesktop(PagerType *pp, int x, int y) { int pagerx, pagery; pagerx = x / (pp->deskWidth + 1); pagery = y / (pp->deskHeight + 1); return pagery * desktopWidth + pagerx; } /** Process a button event on a pager tray component. */ void ProcessPagerButtonEvent(TrayComponentType *cp, int x, int y, int mask) { PagerType *pp; switch(mask) { case Button1: case Button2: /* Change to the selected desktop. */ pp = (PagerType*)cp->object; ChangeDesktop(GetPagerDesktop(pp, x, y)); break; case Button3: /* Move a client and possibly change its desktop. */ StartPagerMove(cp, x, y); break; case Button4: /* Change to the previous desktop. */ LeftDesktop(); break; case Button5: /* Change to the next desktop. */ RightDesktop(); break; default: break; } } /** Process a motion event on a pager tray component. */ void ProcessPagerMotionEvent(TrayComponentType *cp, int x, int y, int mask) { PagerType *pp = (PagerType*)cp->object; pp->mousex = cp->screenx + x; pp->mousey = cp->screeny + y; GetCurrentTime(&pp->mouseTime); } /** Start a pager move operation. */ void StartPagerMove(TrayComponentType *cp, int x, int y) { XEvent event; PagerType *pp; ClientNode *np; int layer; int desktop; int cx, cy; int cwidth, cheight; int north, south, east, west; int oldx, oldy; int oldDesk; int startx, starty; int hmax, vmax; pp = (PagerType*)cp->object; /* Determine the selected desktop. */ desktop = GetPagerDesktop(pp, x, y); x -= (desktop % desktopWidth) * (pp->deskWidth + 1); y -= (desktop / desktopWidth) * (pp->deskHeight + 1); /* Find the client under the specified coordinates. */ for(layer = LAYER_TOP; layer >= LAYER_BOTTOM; layer--) { for(np = nodes[layer]; np; np = np->next) { /* Skip this client if it isn't mapped. */ if(!(np->state.status & STAT_MAPPED)) { continue; } /* Skip this client if it isn't on the selected desktop. */ if(np->state.status & STAT_STICKY) { if(currentDesktop != desktop) { continue; } } else { if(np->state.desktop != desktop) { continue; } } /* Get the offset and size of the client on the pager. */ cx = 1 + ((np->x * pp->scalex) >> 16); cy = 1 + ((np->y * pp->scaley) >> 16); cwidth = (np->width * pp->scalex) >> 16; cheight = (np->height * pp->scaley) >> 16; /* Normalize the offset and size. */ if(cx + cwidth > pp->deskWidth) { cwidth = pp->deskWidth - cx; } if(cy + cheight > pp->deskHeight) { cheight = pp->deskHeight - cy; } if(cx < 0) { cwidth += cx; cx = 0; } if(cy < 0) { cheight += cy; cy = 0; } /* Skip the client if we are no longer in bounds. */ if(cwidth <= 0 || cheight <= 0) { continue; } /* Check the y-coordinate. */ if(y < cy || y > cy + cheight) { continue; } /* Check the x-coordinate. */ if(x < cx || x > cx + cwidth) { continue; } /* Found it. Exit. */ goto ClientFound; } } /* Client wasn't found. Just return. */ return; ClientFound: Assert(np); /* The selected client was found. Now make sure we can move it. */ if(!(np->state.border & BORDER_MOVE)) { return; } /* If the client is maximized, unmaximize it. */ hmax = 0; if(np->state.status & STAT_HMAX) { hmax = 1; } vmax = 0; if(np->state.status & STAT_VMAX) { vmax = 1; } if(hmax || vmax) { MaximizeClient(np, 0, 0); } GetBorderSize(np, &north, &south, &east, &west); /* Start the move. */ GrabMouseForMove(); np->controller = PagerMoveController; shouldStopMove = 0; oldx = np->x; oldy = np->y; oldDesk = np->state.desktop; startx = x; starty = y; if(!(GetMouseMask() & Button3Mask)) { StopPagerMove(np, oldx, oldy, oldDesk, hmax, vmax); } for(;;) { WaitForEvent(&event); if(shouldStopMove) { np->controller = NULL; return; } switch(event.type) { case ButtonRelease: /* Done when the 3rd mouse button is released. */ if(event.xbutton.button == Button3) { StopPagerMove(np, oldx, oldy, oldDesk, hmax, vmax); return; } break; case MotionNotify: SetMousePosition(event.xmotion.x_root, event.xmotion.y_root); /* Get the mouse position on the pager. */ x = event.xmotion.x_root - cp->screenx; y = event.xmotion.y_root - cp->screeny; /* Don't move if we are off of the pager. */ if(x < 0 || x > cp->width) { break; } if(y < 0 || y > cp->height) { break; } /* Determine the new client desktop. */ desktop = GetPagerDesktop(pp, x, y); x -= pp->deskWidth * (desktop % desktopWidth); y -= pp->deskHeight * (desktop / desktopWidth); /* If this client isn't sticky and now on a different desktop * change the client's desktop. */ if(!(np->state.status & STAT_STICKY)) { if(desktop != oldDesk) { SetClientDesktop(np, (unsigned int)desktop); oldDesk = desktop; } } /* Get new client coordinates. */ oldx = startx + (x - startx); oldx = (oldx << 16) / pp->scalex; oldx -= (np->width + east + west) / 2; oldy = starty + (y - starty); oldy = (oldy << 16) / pp->scaley; oldy -= (np->height + north + south) / 2; /* Move the window. */ np->x = oldx; np->y = oldy; JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); UpdatePager(); break; default: break; } } } /** Stop an active pager move. */ void StopPagerMove(ClientNode *np, int x, int y, int desktop, int hmax, int vmax) { int north, south, east, west; Assert(np); Assert(np->controller); /* Release grabs. */ (np->controller)(0); np->x = x; np->y = y; GetBorderSize(np, &north, &south, &east, & west); JXMoveWindow(display, np->parent, np->x - west, np->y - north); SendConfigureEvent(np); /* Restore the maximized state of the client. */ if(hmax || vmax) { MaximizeClient(np, hmax, vmax); } /* Redraw the pager. */ UpdatePager(); } /** Client-terminated pager move. */ void PagerMoveController(int wasDestroyed) { JXUngrabPointer(display, CurrentTime); JXUngrabKeyboard(display, CurrentTime); shouldStopMove = 1; } /** Update the pager. */ void UpdatePager() { PagerType *pp; ClientNode *np; Pixmap buffer; int width, height; int deskWidth, deskHeight; unsigned int x; const char *name; int xc, yc; int textWidth, textHeight; int dx, dy; if(JUNLIKELY(shouldExit)) { return; } for(pp = pagers; pp; pp = pp->next) { buffer = pp->cp->pixmap; width = pp->cp->width; height = pp->cp->height; deskWidth = pp->deskWidth; deskHeight = pp->deskHeight; /* Draw the background. */ JXSetForeground(display, rootGC, colors[COLOR_PAGER_BG]); JXFillRectangle(display, buffer, rootGC, 0, 0, width, height); /* Highlight the current desktop. */ JXSetForeground(display, rootGC, colors[COLOR_PAGER_ACTIVE_BG]); dx = currentDesktop % desktopWidth; dy = currentDesktop / desktopWidth; JXFillRectangle(display, buffer, rootGC, dx * (deskWidth + 1), dy * (deskHeight + 1), deskWidth, deskHeight); /* Draw the labels. */ if(pp->labeled) { textHeight = GetStringHeight(FONT_PAGER); if(textHeight < deskHeight) { for(x = 0; x < desktopCount; x++) { dx = x % desktopWidth; dy = x / desktopWidth; name = GetDesktopName(x); textWidth = GetStringWidth(FONT_PAGER, name); if(textWidth < deskWidth) { xc = dx * (deskWidth + 1) + (deskWidth - textWidth) / 2; yc = dy * (deskHeight + 1) + (deskHeight - textHeight) / 2; RenderString(buffer, FONT_PAGER, COLOR_PAGER_TEXT, xc, yc, deskWidth, None, name); } } } } /* Draw the clients. */ for(x = LAYER_BOTTOM; x <= LAYER_TOP; x++) { for(np = nodeTail[x]; np; np = np->prev) { DrawPagerClient(pp, np); } } /* Draw the desktop dividers. */ JXSetForeground(display, rootGC, colors[COLOR_PAGER_FG]); for(x = 1; x < desktopHeight; x++) { JXDrawLine(display, buffer, rootGC, 0, (deskHeight + 1) * x - 1, width, (deskHeight + 1) * x - 1); } for(x = 1; x < desktopWidth; x++) { JXDrawLine(display, buffer, rootGC, (deskWidth + 1) * x - 1, 0, (deskWidth + 1) * x - 1, height); } /* Tell the tray to redraw. */ UpdateSpecificTray(pp->cp->tray, pp->cp); } } /** Signal pagers (for popups). */ void SignalPager(const struct TimeType *now, int x, int y) { PagerType *pp; for(pp = pagers; pp; pp = pp->next) { if(abs(pp->mousex - x) < POPUP_DELTA && abs(pp->mousey - y) < POPUP_DELTA) { if(GetTimeDifference(now, &pp->mouseTime) >= popupDelay) { int desktop; desktop = GetPagerDesktop(pp, x - pp->cp->screenx, y - pp->cp->screeny); if(desktop >= 0) { const char *desktopName; desktopName = GetDesktopName(desktop); if(desktopName) { ShowPopup(x, y, desktopName); } } } } } } /** Draw a client on the pager. */ void DrawPagerClient(const PagerType *pp, const ClientNode *np) { int x, y; int width, height; int offx, offy; ColorType fillColor; /* Don't draw the client if it isn't mapped. */ if(!(np->state.status & STAT_MAPPED)) { return; } /* Determine the desktop for the client. */ if(np->state.status & STAT_STICKY) { offx = currentDesktop % desktopWidth; offy = currentDesktop / desktopWidth; } else { offx = np->state.desktop % desktopWidth; offy = np->state.desktop / desktopWidth; } offx *= pp->deskWidth + 1; offy *= pp->deskHeight + 1; /* Determine the location and size of the client on the pager. */ x = 1 + ((np->x * pp->scalex) >> 16); y = 1 + ((np->y * pp->scaley) >> 16); width = (np->width * pp->scalex) >> 16; height = (np->height * pp->scaley) >> 16; /* Normalize the size and offset. */ if(x + width > pp->deskWidth) { width = pp->deskWidth - x; } if(y + height > pp->deskHeight) { height = pp->deskHeight - y; } if(x < 0) { width += x; x = 0; } if(y < 0) { height += y; y = 0; } /* Return if there's nothing to do. */ if(width <= 0 || height <= 0) { return; } /* Move to the correct desktop on the pager. */ x += offx; y += offy; /* Draw the client outline. */ JXSetForeground(display, rootGC, colors[COLOR_PAGER_OUTLINE]); JXDrawRectangle(display, pp->cp->pixmap, rootGC, x, y, width, height); /* Fill the client if there's room. */ if(width > 1 && height > 1) { if((np->state.status & STAT_ACTIVE) && (np->state.desktop == currentDesktop || (np->state.status & STAT_STICKY))) { fillColor = COLOR_PAGER_ACTIVE_FG; } else { fillColor = COLOR_PAGER_FG; } JXSetForeground(display, rootGC, colors[fillColor]); JXFillRectangle(display, pp->cp->pixmap, rootGC, x + 1, y + 1, width - 1, height - 1); } } jwm-2.1.0+svn579/src/status.h0000644000000000000000000000233311710374021014334 0ustar rootroot/** * @file status.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the status functions. * */ #ifndef STATUS_H #define STATUS_H struct ClientNode; /** Create a move status window. * @param np The client to be moved. */ void CreateMoveWindow(struct ClientNode *np); /** Update a move status window. * @param np The client being moved. */ void UpdateMoveWindow(struct ClientNode *np); /** Destroy a move status window. */ void DestroyMoveWindow(); /** Create a resize status window. * @param np The client being resized. */ void CreateResizeWindow(struct ClientNode *np); /** Update a resize status window. * @param np The client being resized. * @param gwidth The width to display. * @param gheight The height to display. */ void UpdateResizeWindow(struct ClientNode *np, int gwidth, int gheight); /** Destroy a resize status window. */ void DestroyResizeWindow(); /** Set the location of move status windows. * @param str The location (off, screen, window, or corner). */ void SetMoveStatusType(const char *str); /** Set the location of resize status windows. * @param str The location (off, screen, window, or corner). */ void SetResizeStatusType(const char *str); #endif /* STATUS_H */ jwm-2.1.0+svn579/src/traybutton.h0000644000000000000000000000267111710374021015231 0ustar rootroot/** * @file traybutton.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Button tray component. * */ #ifndef TRAY_BUTTON_H #define TRAY_BUTTON_H struct TrayComponentType; struct TimeType; /*@{*/ void InitializeTrayButtons(); void StartupTrayButtons(); void ShutdownTrayButtons(); void DestroyTrayButtons(); /*@}*/ /** Create a tray button component. * @param iconName The name of the icon to use for the button. * @param label The label to use for the button. * @param action The action to take when the button is clicked. * @param popup Text to display in a popup window. * @param width The width to use for the button (0 for default). * @param height The height to use for the button (0 for default). * @return A new tray button component. */ struct TrayComponentType *CreateTrayButton( const char *iconName, const char *label, const char *action, const char *popup, int width, int height); /** Signal a tray button. * @param now The current time. * @param x The x-coordinate of the mouse (root relative). * @param y The y-coordinate of the mouse (root relative). */ void SignalTrayButton(const struct TimeType *now, int x, int y); /** Validate the tray buttons and print a warning if something is wrong. * This is called after parsing the configuration file(s) to determine * if a root menu is defined for each each tray button that specifies * a root menu. */ void ValidateTrayButtons(); #endif /* TRAY_BUTTON_H */ jwm-2.1.0+svn579/src/tray.h0000644000000000000000000002025711710374021013775 0ustar rootroot/** * @file tray.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the tray functions. * */ #ifndef TRAY_H #define TRAY_H #include "hint.h" struct TimeType; /** Enumeration of tray layouts. */ typedef enum { LAYOUT_HORIZONTAL, /**< Left-to-right. */ LAYOUT_VERTICAL /**< Top-to-bottom. */ } LayoutType; /** Enumeration of tray alignments. */ typedef enum { TALIGN_FIXED, /**< Fixed at user specified x and y coordinates. */ TALIGN_LEFT, /**< Left aligned. */ TALIGN_TOP, /**< Top aligned. */ TALIGN_CENTER, /**< Center aligned. */ TALIGN_RIGHT, /**< Right aligned. */ TALIGN_BOTTOM /**< Bottom aligned. */ } TrayAlignmentType; /** Structure to hold common tray component data. * Sizing is handled as follows: * - The component is created via a factory method. It sets its * requested size (0 for no preference). * - The SetSize callback is issued with size constraints * (0 for no constraint). The component should update * width and height in SetSize. * - The Create callback is issued with finalized size information. * Resizing is handled as follows: * - A component determines that it needs to change size. It updates * its requested size (0 for no preference). * - The component calls ResizeTray. * - The SetSize callback is issued with size constraints * (0 for no constraint). The component should update * width and height in SetSize. * - The Resize callback is issued with finalized size information. */ typedef struct TrayComponentType { /** The tray containing the component. * UpdateSpecificTray(TrayType*, TrayComponentType*) should be called * when content changes. */ struct TrayType *tray; /** Additional information needed for the component. */ void *object; int x; /**< x-coordinate on the tray (valid only after Create). */ int y; /**< y-coordinate on the tray (valid only after Create). */ int screenx; /**< x-coordinate on the screen (valid only after Create). */ int screeny; /**< y-coordinate on the screen (valid only after Create). */ int requestedWidth; /**< Requested width. */ int requestedHeight; /**< Requested height. */ int width; /**< Actual width. */ int height; /**< Actual height. */ int grabbed; /**< 1 if the mouse was grabbed by this component. */ Window window; /**< Content (if a window, otherwise None). */ Pixmap pixmap; /**< Content (if a pixmap, otherwise None). */ /** Callback to create the component. */ void (*Create)(struct TrayComponentType *cp); /** Callback to destroy the component. */ void (*Destroy)(struct TrayComponentType *cp); /** Callback to set the size known so far. * This is needed for items that maintain width/height ratios. * Either width or height may be zero. * This is called before Create. */ void (*SetSize)(struct TrayComponentType *cp, int width, int height); /** Callback to resize the component. */ void (*Resize)(struct TrayComponentType *cp); /** Callback for mouse presses. */ void (*ProcessButtonPress)(struct TrayComponentType *cp, int x, int y, int mask); /** Callback for mouse releases. */ void (*ProcessButtonRelease)(struct TrayComponentType *cp, int x, int y, int mask); /** Callback for mouse motion. */ void (*ProcessMotionEvent)(struct TrayComponentType *cp, int x, int y, int mask); /** The next component in the tray. */ struct TrayComponentType *next; } TrayComponentType; /** Structure to represent a tray. */ typedef struct TrayType { int x; /**< The x-coordinate of the tray. */ int y; /**< The y-coordinate of the tray. */ int requestedWidth; /**< Total requested width of the tray. */ int requestedHeight; /**< Total requested height of the tray. */ int width; /**< Actual width of the tray. */ int height; /**< Actual height of the tray. */ int border; /**< Border size in pixels. */ WinLayerType layer; /**< Layer. */ LayoutType layout; /**< Layout. */ TrayAlignmentType valign; /**< Vertical alignment. */ TrayAlignmentType halign; /**< Horizontal alignment. */ int autoHide; /**< 1 for autohide, 0 otherwise. */ int hidden; /**< 1 if hidden (due to autohide), 0 otherwise. */ Window window; /**< The tray window. */ /** Start of the tray components. */ struct TrayComponentType *components; /** End of the tray components. */ struct TrayComponentType *componentsTail; struct TrayType *next; /**< Next tray. */ } TrayType; void InitializeTray(); void StartupTray(); void ShutdownTray(); void DestroyTray(); /** Create a new tray. * @return A new, empty tray. */ TrayType *CreateTray(); /** Create a tray component. * @return A new tray component structure. */ TrayComponentType *CreateTrayComponent(); /** Add a tray component to a tray. * @param tp The tray to update. * @param cp The tray component to add. */ void AddTrayComponent(TrayType *tp, TrayComponentType *cp); /** Show a tray. * @param tp The tray to show. */ void ShowTray(TrayType *tp); /** Show all trays. */ void ShowAllTrays(); /** Hide a tray. * @param tp The tray to hide. */ void HideTray(TrayType *tp); /** Draw all trays. */ void DrawTray(); /** Draw a specific tray. * @param tp The tray to draw. */ void DrawSpecificTray(const TrayType *tp); /** Update a component on a tray. * @param tp The tray containing the component. * @param cp The component that needs updating. */ void UpdateSpecificTray(const TrayType *tp, const TrayComponentType *cp); /** Resize a tray. * @param tp The tray to resize containing the new requested size information. */ void ResizeTray(TrayType *tp); /** Get a linked list of trays. * @return The trays. */ TrayType *GetTrays(); /** Get the number of trays. * @return The number of trays. */ int GetTrayCount(); /** Get a window to use as the supporting window. * This is used by clients to validate that compliant window manager is * running. * @return The supporting window. */ Window GetSupportingWindow(); /** Process an event that may be for a tray. * @param event The event to process. * @return 1 if this event was for a tray, 0 otherwise. */ int ProcessTrayEvent(const XEvent *event); /** Signal the trays. * This function is called regularly so that autohide, etc. can take place. * @param now The current time. * @param x The mouse x-coordinate (root relative). * @param y The mouse y-coordinate (root relative). */ void SignalTray(const struct TimeType *now, int x, int y); /** Set whether auto hide is enabled for a tray. * @param tp The tray. * @param v 1 to enable, 0 to disable. */ void SetAutoHideTray(TrayType *tp, int v); /** Set the tray x-coordinate. * @param tp The tray. * @param str The x-coordinate (ASCII, pixels, negative ok). */ void SetTrayX(TrayType *tp, const char *str); /** Set the tray y-coordinate. * @param tp The tray. * @param str The y-coordinate (ASCII, pixels, negative ok). */ void SetTrayY(TrayType *tp, const char *str); /** Set the tray width. * @param tp The tray. * @param str The width (ASCII, pixels). */ void SetTrayWidth(TrayType *tp, const char *str); /** Set the tray height. * @param tp The tray. * @param str The height (ASCII, pixels). */ void SetTrayHeight(TrayType *tp, const char *str); /** Set the tray layout. * @param tp The tray. * @param str A string representation of the layout to use. */ void SetTrayLayout(TrayType *tp, const char *str); /** Set the tray layer. * @param tp The tray. * @param str The layer (ASCII). */ void SetTrayLayer(TrayType *tp, const char *str); /** Set the tray border size. * @param tp The tray. * @param str The border size (ASCII, pixels). */ void SetTrayBorder(TrayType *tp, const char *str); /** Set the tray horizontal alignment. * @param tp The tray. * @param str The alignment(ASCII). */ void SetTrayHorizontalAlignment(TrayType *tp, const char *str); /** Set the tray vertical alignment. * @param tp The tray. * @param str The alignment(ASCII). */ void SetTrayVerticalAlignment(TrayType *tp, const char *str); /** Set the tray transparency level. * @param str The value (ASCII). */ void SetTrayOpacity(const char *str); #endif /* TRAY_H */ jwm-2.1.0+svn579/src/background.c0000644000000000000000000002030011710374021015115 0ustar rootroot/** * @file background.c * @author Joe Wingbermuehle * @date 2007 * * @brief Background control functions. * */ #include "jwm.h" #include "background.h" #include "misc.h" #include "error.h" #include "command.h" #include "color.h" #include "main.h" #include "icon.h" #include "image.h" #include "gradient.h" #include "hint.h" /** Enumeration of background types. */ typedef enum { BACKGROUND_SOLID, /**< Solid color background. */ BACKGROUND_GRADIENT, /**< Gradient background. */ BACKGROUND_COMMAND, /**< Command to run for setting the background. */ BACKGROUND_STRETCH, /**< Stretched image. */ BACKGROUND_TILE /**< Tiled image. */ } BackgroundType; /** Structure to represent a background for one or more desktops. */ typedef struct BackgroundNode { int desktop; /**< The desktop. */ BackgroundType type; /**< The type of background. */ char *value; Pixmap pixmap; Window window; struct BackgroundNode *next; /**< Next background in the list. */ } BackgroundNode; /** Linked list of backgrounds. */ static BackgroundNode *backgrounds; /** The default background. */ static BackgroundNode *defaultBackground; /** The last background loaded. */ static BackgroundNode *lastBackground; static void LoadSolidBackground(BackgroundNode *bp); static void LoadGradientBackground(BackgroundNode *bp); static void LoadImageBackground(BackgroundNode *bp); /** Initialize any data needed for background support. */ void InitializeBackgrounds() { backgrounds = NULL; defaultBackground = NULL; lastBackground = NULL; } /** Startup background support. */ void StartupBackgrounds() { BackgroundNode *bp; for(bp = backgrounds; bp; bp = bp->next) { /* Load background data. */ switch(bp->type) { case BACKGROUND_SOLID: LoadSolidBackground(bp); break; case BACKGROUND_GRADIENT: LoadGradientBackground(bp); break; case BACKGROUND_COMMAND: /* Nothing to do. */ break; case BACKGROUND_STRETCH: case BACKGROUND_TILE: LoadImageBackground(bp); break; default: Debug("invalid background type in LoadBackground: %d", bp->type); break; } if(bp->desktop == -1) { defaultBackground = bp; } } } /** Shutdown background support. */ void ShutdownBackgrounds() { BackgroundNode *bp; for(bp = backgrounds; bp; bp = bp->next) { if(bp->pixmap != None) { JXFreePixmap(display, bp->pixmap); bp->pixmap = None; } if(bp->window != None) { JXDestroyWindow(display, bp->window); bp->window = None; } } } /** Release any data needed for background support. */ void DestroyBackgrounds() { BackgroundNode *bp; while(backgrounds) { bp = backgrounds->next; Release(backgrounds->value); Release(backgrounds); backgrounds = bp; } } /** Set the background to use for the specified desktops. */ void SetBackground(int desktop, const char *type, const char *value) { BackgroundType bgType; BackgroundNode *bp; /* Make sure we have a value. */ if(JUNLIKELY(!value)) { Warning(_("no value specified for background")); return; } /* Parse the background type. */ if(!type || !strcmp(type, "solid")) { bgType = BACKGROUND_SOLID; } else if(!strcmp(type, "gradient")) { bgType = BACKGROUND_GRADIENT; } else if(!strcmp(type, "command")) { bgType = BACKGROUND_COMMAND; } else if(!strcmp(type, "image")) { bgType = BACKGROUND_STRETCH; } else if(!strcmp(type, "tile")) { bgType = BACKGROUND_TILE; } else { Warning(_("invalid background type: \"%s\""), type); return; } /* Create the background node. */ bp = Allocate(sizeof(BackgroundNode)); bp->desktop = desktop; bp->type = bgType; bp->value = CopyString(value); /* Insert the node into the list. */ bp->next = backgrounds; backgrounds = bp; } /** Load the background for the specified desktop. */ void LoadBackground(int desktop) { XSetWindowAttributes attr; long attrValues; BackgroundNode *bp; /* Determine the background to load. */ for(bp = backgrounds; bp; bp = bp->next) { if(bp->desktop == desktop) { break; } } if(!bp) { bp = defaultBackground; } /* If there is no background specified for this desktop, just return. */ if(!bp || !bp->value) { return; } /* If the background isn't changing, don't do anything. */ if( lastBackground && bp->type == lastBackground->type && !strcmp(bp->value, lastBackground->value)) { return; } if(lastBackground && lastBackground->window) { JXUnmapWindow(display, lastBackground->window); } lastBackground = bp; /* Load the background based on type. */ switch(bp->type) { case BACKGROUND_COMMAND: RunCommand(bp->value); return; default: attrValues = CWBackPixmap; attr.background_pixmap = bp->pixmap; break; } JXChangeWindowAttributes(display, bp->window, attrValues, &attr); JXClearWindow(display, bp->window); JXMapWindow(display, bp->window); SetPixmapAtom(rootWindow, ATOM_XSETROOT_ID, bp->window); } /** Load a solid background. */ void LoadSolidBackground(BackgroundNode *bp) { XColor c; ParseColor(bp->value, &c); /* Create the window. */ bp->window = JXCreateSimpleWindow(display, rootWindow, 0, 0, rootWidth, rootHeight, 0, 0, 0); /* Create the pixmap. */ bp->pixmap = JXCreatePixmap(display, bp->window, 1, 1, rootDepth); JXSetForeground(display, rootGC, c.pixel); JXDrawPoint(display, bp->pixmap, rootGC, 0, 0); } /** Load a gradient background. */ void LoadGradientBackground(BackgroundNode *bp) { XColor color1; XColor color2; char *temp; char *sep; int len; sep = strchr(bp->value, ':'); if(!sep) { bp->pixmap = None; bp->window = None; return; } /* Get the first color. */ len = (int)(sep - bp->value); temp = AllocateStack(len + 1); memcpy(temp, bp->value, len); temp[len] = 0; ParseColor(temp, &color1); ReleaseStack(temp); /* Get the second color. */ len = strlen(sep + 1); temp = AllocateStack(len + 1); memcpy(temp, sep + 1, len); temp[len] = 0; ParseColor(temp, &color2); ReleaseStack(temp); /* Create the window. */ bp->window = JXCreateSimpleWindow(display, rootWindow, 0, 0, rootWidth, rootHeight, 0, 0, 0); bp->pixmap = JXCreatePixmap(display, bp->window, rootWidth, rootHeight, rootDepth); if(color1.pixel == color2.pixel) { JXSetForeground(display, rootGC, color1.pixel); JXFillRectangle(display, bp->pixmap, rootGC, 0, 0, rootWidth, rootHeight); } else { DrawHorizontalGradient(bp->pixmap, rootGC, color1.pixel, color2.pixel, 0, 0, rootWidth, rootHeight); } } /** Load an image background. */ void LoadImageBackground(BackgroundNode *bp) { IconNode *ip; int width, height; /* Load the icon. */ ExpandPath(&bp->value); ip = LoadNamedIcon(bp->value); if(JUNLIKELY(!ip)) { bp->pixmap = None; bp->window = None; Warning(_("background image not found: \"%s\""), bp->value); return; } /* We can't use render on these. */ ip->useRender = 0; /* Determine the size of the background pixmap. */ if(bp->type == BACKGROUND_TILE) { width = ip->image->width; height = ip->image->height; } else { width = rootWidth; height = rootHeight; } /* Create the window. */ bp->window = JXCreateSimpleWindow(display, rootWindow, 0, 0, rootWidth, rootHeight, 0, 0, 0); /* Create the pixmap. */ bp->pixmap = JXCreatePixmap(display, bp->window, width, height, rootDepth); /* Clear the pixmap in case it is too small. */ JXSetForeground(display, rootGC, 0); JXFillRectangle(display, bp->pixmap, rootGC, 0, 0, width, height); /* Draw the icon on the background pixmap. */ PutIcon(ip, bp->pixmap, 0, 0, width, height); /* We don't need the icon anymore. */ DestroyIcon(ip); } jwm-2.1.0+svn579/src/jxlib.h0000644000000000000000000003223611710374021014126 0ustar rootroot/** * @file jxlib.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Macros to wrap X calls for debugging. * */ #ifndef JXLIB_H #define JXLIB_H #define JXAddToSaveSet( a, b ) \ ( SetCheckpoint(), XAddToSaveSet( a, b ) ) #define JXAllocColor( a, b, c ) \ ( SetCheckpoint(), XAllocColor( a, b, c ) ) #define JXGetRGBColormaps( a, b, c, d, e ) \ ( SetCheckpoint(), XGetRGBColormaps( a, b, c, d, e ) ) #define JXQueryColor( a, b, c ) \ ( SetCheckpoint(), XQueryColor( a, b, c ) ) #define JXAllowEvents( a, b, c ) \ ( SetCheckpoint(), XAllowEvents( a, b, c ) ) #define JXChangeProperty( a, b, c, d, e, f, g, h ) \ ( SetCheckpoint(), XChangeProperty( a, b, c, d, e, f, g, h ) ) #define JXDeleteProperty( a, b, c ) \ ( SetCheckpoint(), XDeleteProperty( a, b, c ) ) #define JXChangeWindowAttributes( a, b, c, d ) \ ( SetCheckpoint(), XChangeWindowAttributes( a, b, c, d ) ) #define JXCheckTypedEvent( a, b, c ) \ ( SetCheckpoint(), XCheckTypedEvent( a, b, c ) ) #define JXCheckTypedWindowEvent( a, b, c, d ) \ ( SetCheckpoint(), XCheckTypedWindowEvent( a, b, c, d ) ) #define JXClearWindow( a, b ) \ ( SetCheckpoint(), XClearWindow( a, b ) ) #define JXCloseDisplay( a ) \ ( SetCheckpoint(), XCloseDisplay( a ) ) #define JXConfigureWindow( a, b, c, d ) \ ( SetCheckpoint(), XConfigureWindow( a, b, c, d ) ) #define JXConnectionNumber( a ) \ ( SetCheckpoint(), XConnectionNumber( a ) ) #define JXCopyArea( a, b, c, d, e, f, g, h, i, j ) \ ( SetCheckpoint(), XCopyArea( a, b, c, d, e, f, g, h, i, j ) ) #define JXCopyPlane( a, b, c, d, e, f, g, h, i, j, k ) \ ( SetCheckpoint(), XCopyPlane( a, b, c, d, e, f, g, h, i, j, k ) ) #define JXCreateFontCursor( a, b ) \ ( SetCheckpoint(), XCreateFontCursor( a, b ) ) #define JXCreateGC( a, b, c, d ) \ ( SetCheckpoint(), XCreateGC( a, b, c, d ) ) #define JXCreateImage( a, b, c, d, e, f, g, h, i, j ) \ ( \ SetCheckpoint(), \ XCreateImage( a, b, c, d, e, f, g, h, i, j ) \ ) #define JXCreatePixmap( a, b, c, d, e ) \ ( SetCheckpoint(), XCreatePixmap( a, b, c, d, e ) ) #define JXCreatePixmapFromBitmapData( a, b, c, d, e, f, g, h ) \ ( \ SetCheckpoint(), \ XCreatePixmapFromBitmapData( a, b, c, d, e, f, g, h ) \ ) #define JXCreateBitmapFromData( a, b, c, d, e ) \ ( SetCheckpoint(), XCreateBitmapFromData( a, b, c, d, e ) ) #define JXCreateSimpleWindow( a, b, c, d, e, f, g, h, i ) \ ( \ SetCheckpoint(), \ XCreateSimpleWindow( a, b, c, d, e, f, g, h, i ) \ ) #define JXCreateWindow( a, b, c, d, e, f, g, h, i, j, k, l ) \ ( \ SetCheckpoint(), \ XCreateWindow( a, b, c, d, e, f, g, h, i, j, k, l ) \ ) #define JXDefineCursor( a, b, c ) \ ( SetCheckpoint(), XDefineCursor( a, b, c ) ) #define JXDestroyImage( a ) \ ( SetCheckpoint(), XDestroyImage( a ) ) #define JXDestroyWindow( a, b ) \ ( SetCheckpoint(), XDestroyWindow( a, b ) ) #define JXDrawPoint( a, b, c, d, e ) \ ( SetCheckpoint(), XDrawPoint( a, b, c, d, e ) ) #define JXDrawLine( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XDrawLine( a, b, c, d, e, f, g ) ) #define JXDrawSegments( a, b, c, d, e ) \ ( SetCheckpoint(), XDrawSegments( a, b, c, d, e ) ) #define JXDrawRectangle( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XDrawRectangle( a, b, c, d, e, f, g ) ) #define JXFillRectangles( a, b, c, d, e ) \ ( SetCheckpoint(), XFillRectangles( a, b, c, d, e ) ) #define JXDrawArcs( a, b, c, d, e ) \ ( SetCheckpoint(), XDrawArcs( a, b, c, d, e ) ) #define JXFillArcs( a, b, c, d, e ) \ ( SetCheckpoint(), XFillArcs( a, b, c, d, e ) ) #define JXDrawString( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XDrawString( a, b, c, d, e, f, g ) ) #define JXFetchName( a, b, c ) \ ( SetCheckpoint(), XFetchName( a, b, c ) ) #define JXFillRectangle( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XFillRectangle( a, b, c, d, e, f, g ) ) #define JXFlush( a ) \ ( SetCheckpoint(), XFlush( a ) ) #define JXFree( a ) \ ( SetCheckpoint(), XFree( a ) ) #define JXFreeColors( a, b, c, d, e ) \ ( SetCheckpoint(), XFreeColors( a, b, c, d, e ) ) #define JXFreeCursor( a, b ) \ ( SetCheckpoint(), XFreeCursor( a, b ) ) #define JXFreeFont( a, b ) \ ( SetCheckpoint(), XFreeFont( a, b ) ) #define JXFreeGC( a, b ) \ ( SetCheckpoint(), XFreeGC( a, b ) ) #define JXFreeModifiermap( a ) \ ( SetCheckpoint(), XFreeModifiermap( a ) ) #define JXFreePixmap( a, b ) \ ( SetCheckpoint(), XFreePixmap( a, b ) ) #define JXGetAtomName( a, b ) \ ( SetCheckpoint(), XGetAtomName( a, b ) ) #define JXGetModifierMapping( a ) \ ( SetCheckpoint(), XGetModifierMapping( a ) ) #define JXGetSubImage( a, b, c, d, e, f, g, h, i, j, k ) \ ( SetCheckpoint(), XGetSubImage( a, b, c, d, e, f, g, h, i, j, k ) ) #define JXGetTransientForHint( a, b, c ) \ ( SetCheckpoint(), XGetTransientForHint( a, b, c ) ) #define JXGetClassHint( a, b, c ) \ ( SetCheckpoint(), XGetClassHint( a, b, c ) ) #define JXGetWindowAttributes( a, b, c ) \ ( SetCheckpoint(), XGetWindowAttributes( a, b, c ) ) #define JXGetWindowProperty( a, b, c, d, e, f, g, h, i, j, k, l ) \ ( SetCheckpoint(), \ XGetWindowProperty( a, b, c, d, e, f, g, h, i, j, k, l ) ) #define JXGetWMColormapWindows( a, b, c, d ) \ ( SetCheckpoint(), XGetWMColormapWindows( a, b, c, d ) ) #define JXGetWMNormalHints( a, b, c, d ) \ ( SetCheckpoint(), XGetWMNormalHints( a, b, c, d ) ) #define JXSetIconSizes( a, b, c, d ) \ ( SetCheckpoint(), XSetIconSizes( a, b, c, d ) ) #define JXSetWindowBorder( a, b, c ) \ ( SetCheckpoint(), XSetWindowBorder( a, b, c ) ) #define JXGetWMHints( a, b ) \ ( SetCheckpoint(), XGetWMHints( a, b ) ) #define JXGrabButton( a, b, c, d, e, f, g, h, i, j ) \ ( SetCheckpoint(), XGrabButton( a, b, c, d, e, f, g, h, i, j ) ) #define JXKeycodeToKeysym( a, b, c ) \ ( SetCheckpoint(), XKeycodeToKeysym( a, b, c ) ) #define JXGrabKey( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XGrabKey( a, b, c, d, e, f, g ) ) #define JXUngrabKey( a, b, c, d ) \ ( SetCheckpoint(), XUngrabKey( a, b, c, d ) ) #define JXGrabKeyboard( a, b, c, d, e, f ) \ ( SetCheckpoint(), XGrabKeyboard( a, b, c, d, e, f ) ) #define JXGrabPointer( a, b, c, d, e, f, g, h, i ) \ ( SetCheckpoint(), XGrabPointer( a, b, c, d, e, f, g, h, i ) ) #define JXGrabServer( a ) \ ( SetCheckpoint(), XGrabServer( a ) ) #define JXInstallColormap( a, b ) \ ( SetCheckpoint(), XInstallColormap( a, b ) ) #define JXInternAtom( a, b, c ) \ ( SetCheckpoint(), XInternAtom( a, b, c ) ) #define JXKeysymToKeycode( a, b ) \ ( SetCheckpoint(), XKeysymToKeycode( a, b ) ) #define JXKillClient( a, b ) \ ( SetCheckpoint(), XKillClient( a, b ) ) #define JXLoadQueryFont( a, b ) \ ( SetCheckpoint(), XLoadQueryFont( a, b ) ) #define JXMapRaised( a, b ) \ ( SetCheckpoint(), XMapRaised( a, b ) ) #define JXMapWindow( a, b ) \ ( SetCheckpoint(), XMapWindow( a, b ) ) #define JXMoveResizeWindow( a, b, c, d, e, f ) \ ( SetCheckpoint(), XMoveResizeWindow( a, b, c, d, e, f ) ) #define JXMoveWindow( a, b, c, d ) \ ( SetCheckpoint(), XMoveWindow( a, b, c, d ) ) #define JXNextEvent( a, b ) \ ( SetCheckpoint(), XNextEvent( a, b ) ) #define JXMaskEvent( a, b, c ) \ ( SetCheckpoint(), XMaskEvent( a, b, c ) ) #define JXCheckMaskEvent( a, b, c ) \ ( SetCheckpoint(), XCheckMaskEvent( a, b, c ) ) #define JXOpenDisplay( a ) \ ( SetCheckpoint(), XOpenDisplay( a ) ) #define JXParseColor( a, b, c, d ) \ ( SetCheckpoint(), XParseColor( a, b, c, d ) ) #define JXPending( a ) \ ( SetCheckpoint(), XPending( a ) ) #define JXPutBackEvent( a, b ) \ ( SetCheckpoint(), XPutBackEvent( a, b ) ) #define JXGetImage( a, b, c, d, e, f, g, h ) \ ( SetCheckpoint(), XGetImage( a, b, c, d, e, f, g, h ) ) #define JXPutImage( a, b, c, d, e, f, g, h, i, j ) \ ( SetCheckpoint(), XPutImage( a, b, c, d, e, f, g, h, i, j ) ) #define JXQueryPointer( a, b, c, d, e, f, g, h, i ) \ ( SetCheckpoint(), XQueryPointer( a, b, c, d, e, f, g, h, i ) ) #define JXQueryTree( a, b, c, d, e, f ) \ ( SetCheckpoint(), XQueryTree( a, b, c, d, e, f ) ) #define JXReparentWindow( a, b, c, d, e ) \ ( SetCheckpoint(), XReparentWindow( a, b, c, d, e ) ) #define JXRemoveFromSaveSet( a, b ) \ ( SetCheckpoint(), XRemoveFromSaveSet( a, b ) ) #define JXResizeWindow( a, b, c, d ) \ ( SetCheckpoint(), XResizeWindow( a, b, c, d ) ) #define JXRestackWindows( a, b, c ) \ ( SetCheckpoint(), XRestackWindows( a, b, c ) ) #define JXSelectInput( a, b, c ) \ ( SetCheckpoint(), XSelectInput( a, b, c ) ) #define JXSendEvent( a, b, c, d, e ) \ ( SetCheckpoint(), XSendEvent( a, b, c, d, e ) ) #define JXSetBackground( a, b, c ) \ ( SetCheckpoint(), XSetBackground( a, b, c ) ) #define JXSetClipMask( a, b, c ) \ ( SetCheckpoint(), XSetClipMask( a, b, c ) ) #define JXSetClipOrigin( a, b, c, d ) \ ( SetCheckpoint(), XSetClipOrigin( a, b, c, d) ) #define JXSetClipRectangles( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XSetClipRectangles( a, b, c, d, e, f, g ) ) #define JXSetErrorHandler( a ) \ ( SetCheckpoint(), XSetErrorHandler( a ) ) #define JXSetFont( a, b, c ) \ ( SetCheckpoint(), XSetFont( a, b, c ) ) #define JXSetForeground( a, b, c ) \ ( SetCheckpoint(), XSetForeground( a, b, c ) ) #define JXSetInputFocus( a, b, c, d ) \ ( SetCheckpoint(), XSetInputFocus( a, b, c, d ) ) #define JXSetWindowBackground( a, b, c ) \ ( SetCheckpoint(), XSetWindowBackground( a, b, c ) ) #define JXSetWindowBorderWidth( a, b, c ) \ ( SetCheckpoint(), XSetWindowBorderWidth( a, b, c ) ) #define JXSetWMNormalHints( a, b, c ) \ ( SetCheckpoint(), XSetWMNormalHints( a, b, c ) ) #define JXShapeCombineRectangles( a, b, c, d, e, f, g, h, i ) \ ( SetCheckpoint(), XShapeCombineRectangles( a, b, c, d, e, f, g, h, i ) ) #define JXShapeCombineShape( a, b, c, d, e, f, g, h ) \ ( SetCheckpoint(), XShapeCombineShape( a, b, c, d, e, f, g, h ) ) #define JXShapeCombineMask( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XShapeCombineMask( a, b, c, d, e, f, g ) ) #define JXShapeQueryExtension( a, b, c ) \ ( SetCheckpoint(), XShapeQueryExtension( a, b, c ) ) #define JXQueryExtension( a, b, c, d, e ) \ ( SetCheckpoint(), XQueryExtension( a, b, c, d, e ) ) #define JXShapeQueryExtents( a, b, c, d, e, f, g, h, i, j, k, l ) \ ( SetCheckpoint(), \ XShapeQueryExtents( a, b, c, d, e, f, g, h, i, j, k, l ) ) #define JXShapeSelectInput( a, b, c ) \ ( SetCheckpoint(), XShapeSelectInput( a, b, c ) ) #define JXStoreName( a, b, c ) \ ( SetCheckpoint(), XStoreName( a, b, c ) ) #define JXStringToKeysym( a ) \ ( SetCheckpoint(), XStringToKeysym( a ) ) #define JXSync( a, b ) \ ( SetCheckpoint(), XSync( a, b ) ) #define JXTextWidth( a, b, c ) \ ( SetCheckpoint(), XTextWidth( a, b, c ) ) #define JXUngrabButton( a, b, c, d ) \ ( SetCheckpoint(), XUngrabButton( a, b, c, d ) ) #define JXUngrabKeyboard( a, b ) \ ( SetCheckpoint(), XUngrabKeyboard( a, b ) ) #define JXUngrabPointer( a, b ) \ ( SetCheckpoint(), XUngrabPointer( a, b ) ) #define JXUngrabServer( a ) \ ( SetCheckpoint(), XUngrabServer( a ) ) #define JXUnmapWindow( a, b ) \ ( SetCheckpoint(), XUnmapWindow( a, b ) ) #define JXWarpPointer( a, b, c, d, e, f, g, h, i ) \ ( SetCheckpoint(), XWarpPointer( a, b, c, d, e, f, g, h, i ) ) #define JXSetSelectionOwner( a, b, c, d ) \ ( SetCheckpoint(), XSetSelectionOwner( a, b, c, d ) ) #define JXGetSelectionOwner( a, b ) \ ( SetCheckpoint(), XGetSelectionOwner( a, b ) ) /* XFT */ #define JXftFontOpenName( a, b, c ) \ ( SetCheckpoint(), XftFontOpenName( a, b, c ) ) #define JXftFontOpenXlfd( a, b, c ) \ ( SetCheckpoint(), XftFontOpenXlfd( a, b, c ) ) #define JXftDrawCreate( a, b, c, d ) \ ( SetCheckpoint(), XftDrawCreate( a, b, c, d ) ) #define JXftDrawDestroy( a ) \ ( SetCheckpoint(), XftDrawDestroy( a ) ) #define JXftTextExtentsUtf8( a, b, c, d, e ) \ ( SetCheckpoint(), XftTextExtentsUtf8( a, b, c, d, e ) ) #define JXftDrawChange( a, b ) \ ( SetCheckpoint(), XftDrawChange( a, b ) ) #define JXftDrawSetClipRectangles( a, b, c, d, e ) \ ( SetCheckpoint(), XftDrawSetClipRectangles( a, b, c, d, e ) ) #define JXftDrawStringUtf8( a, b, c, d, e, f, g ) \ ( SetCheckpoint(), XftDrawStringUtf8( a, b, c, d, e, f, g ) ) #define JXftColorFree( a, b, c, d ) \ ( SetCheckpoint(), XftColorFree( a, b, c, d ) ) #define JXftColorAllocValue( a, b, c, d, e ) \ ( SetCheckpoint(), XftColorAllocValue( a, b, c, d, e ) ) #define JXftFontClose( a, b ) \ ( SetCheckpoint(), XftFontClose( a, b ) ) /* Xrender */ #define JXRenderQueryExtension( a, b, c ) \ ( SetCheckpoint(), XRenderQueryExtension( a, b, c ) ) #define JXRenderFindVisualFormat( a, b ) \ ( SetCheckpoint(), XRenderFindVisualFormat( a, b ) ) #define JXRenderFindFormat( a, b, c, d ) \ ( SetCheckpoint(), XRenderFindFormat( a, b, c, d ) ) #define JXRenderFindStandardFormat( a, b ) \ ( SetCheckpoint(), XRenderFindStandardFormat( a, b ) ) #define JXRenderCreatePicture( a, b, c, d, e ) \ ( SetCheckpoint(), XRenderCreatePicture( a, b, c, d, e ) ) #define JXRenderFreePicture( a, b ) \ ( SetCheckpoint(), XRenderFreePicture( a, b ) ) #define JXRenderComposite( a, b, c, d, e, f, g, h, i, j, k, l, m ) \ ( SetCheckpoint(), \ XRenderComposite( a, b, c, d, e, f, g, h, i, j, k, l, m) ) #endif /* JXLIB_H */ jwm-2.1.0+svn579/src/status.c0000644000000000000000000001373511710374021014337 0ustar rootroot/** * @file status.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions for display window move/resize status. * */ #include "jwm.h" #include "status.h" #include "font.h" #include "screen.h" #include "color.h" #include "main.h" #include "client.h" #include "error.h" typedef enum { SW_INVALID, SW_OFF, SW_SCREEN, SW_WINDOW, SW_CORNER } StatusWindowType; static Window statusWindow; static unsigned int statusWindowHeight; static unsigned int statusWindowWidth; static int statusWindowX, statusWindowY; static StatusWindowType moveStatusType; static StatusWindowType resizeStatusType; static void CreateMoveResizeWindow(const ClientNode *np, StatusWindowType type); static void DrawMoveResizeWindow(const ClientNode *np, StatusWindowType type); static void DestroyMoveResizeWindow(); static void GetMoveResizeCoordinates(const ClientNode *np, StatusWindowType type, int *x, int *y); static StatusWindowType ParseType(const char *str); /** Get the location to place the status window. */ void GetMoveResizeCoordinates(const ClientNode *np, StatusWindowType type, int *x, int *y) { const ScreenType *sp; if(type == SW_WINDOW) { *x = np->x + (np->width - statusWindowWidth) / 2; *y = np->y + (np->height - statusWindowHeight) / 2; return; } sp = GetCurrentScreen(np->x, np->y); if(type == SW_CORNER) { *x = sp->x; *y = sp->y; return; } /* SW_SCREEN */ *x = sp->x + (sp->width - statusWindowWidth) / 2; *y = sp->y + (sp->height - statusWindowHeight) / 2; } /** Create the status window. */ void CreateMoveResizeWindow(const ClientNode *np, StatusWindowType type) { XSetWindowAttributes attrs; if(type == SW_OFF) { return; } statusWindowHeight = GetStringHeight(FONT_MENU) + 8; statusWindowWidth = GetStringWidth(FONT_MENU, " 00000 x 00000 "); GetMoveResizeCoordinates(np, type, &statusWindowX, &statusWindowY); attrs.background_pixel = colors[COLOR_MENU_BG]; attrs.save_under = True; attrs.override_redirect = True; statusWindow = JXCreateWindow(display, rootWindow, statusWindowX, statusWindowY, statusWindowWidth, statusWindowHeight, 0, CopyFromParent, InputOutput, CopyFromParent, CWBackPixel | CWOverrideRedirect | CWSaveUnder, &attrs); JXMapRaised(display, statusWindow); } /** Draw the status window. */ void DrawMoveResizeWindow(const ClientNode *np, StatusWindowType type) { int x, y; GetMoveResizeCoordinates(np, type, &x, &y); if(x != statusWindowX || y != statusWindowX) { statusWindowX = x; statusWindowY = y; JXMoveResizeWindow(display, statusWindow, x, y, statusWindowWidth, statusWindowHeight); } /* Shape window corners. */ ShapeRoundedRectWindow(statusWindow, statusWindowWidth, statusWindowHeight); /* Clear the background. */ JXClearWindow(display, statusWindow); /* Draw a border. */ JXSetForeground(display, rootGC, colors[COLOR_MENU_FG]); #ifdef USE_SHAPE DrawRoundedRectangle(statusWindow, rootGC, 0, 0, statusWindowWidth - 1, statusWindowHeight - 1, CORNER_RADIUS); #else JXDrawRectangle(display, statusWindow, rootGC, 0, 0, statusWindowWidth - 1, statusWindowHeight - 1); #endif } /** Destroy the status window. */ void DestroyMoveResizeWindow() { if(statusWindow != None) { JXDestroyWindow(display, statusWindow); statusWindow = None; } } /** Create a move status window. */ void CreateMoveWindow(ClientNode *np) { CreateMoveResizeWindow(np, moveStatusType); } /** Update the move status window. */ void UpdateMoveWindow(ClientNode *np) { char str[80]; unsigned int width; if(moveStatusType == SW_OFF) { return; } DrawMoveResizeWindow(np, moveStatusType); snprintf(str, sizeof(str), "(%d, %d)", np->x, np->y); width = GetStringWidth(FONT_MENU, str); RenderString(statusWindow, FONT_MENU, COLOR_MENU_FG, (statusWindowWidth - width) / 2, 4, rootWidth, NULL, str); } /** Destroy the move status window. */ void DestroyMoveWindow() { DestroyMoveResizeWindow(); } /** Create a resize status window. */ void CreateResizeWindow(ClientNode *np) { CreateMoveResizeWindow(np, resizeStatusType); } /** Update the resize status window. */ void UpdateResizeWindow(ClientNode *np, int gwidth, int gheight) { char str[80]; unsigned int fontWidth; if(resizeStatusType == SW_OFF) { return; } DrawMoveResizeWindow(np, resizeStatusType); snprintf(str, sizeof(str), "%d x %d", gwidth, gheight); fontWidth = GetStringWidth(FONT_MENU, str); RenderString(statusWindow, FONT_MENU, COLOR_MENU_FG, (statusWindowWidth - fontWidth) / 2, 4, rootWidth, NULL, str); } /** Destroy the resize status window. */ void DestroyResizeWindow() { DestroyMoveResizeWindow(); } /** Parse a status window type string. */ StatusWindowType ParseType(const char *str) { if(!str) { return SW_SCREEN; } else if(!strcmp(str, "off")) { return SW_OFF; } else if(!strcmp(str, "screen")) { return SW_SCREEN; } else if(!strcmp(str, "window")) { return SW_WINDOW; } else if(!strcmp(str, "corner")) { return SW_CORNER; } else { return SW_INVALID; } } /** Set the move status window type. */ void SetMoveStatusType(const char *str) { StatusWindowType type; type = ParseType(str); if(JUNLIKELY(type == SW_INVALID)) { moveStatusType = SW_SCREEN; Warning(_("invalid MoveMode coordinates: \"%s\""), str); } else { moveStatusType = type; } } /** Set the resize status window type. */ void SetResizeStatusType(const char *str) { StatusWindowType type; type = ParseType(str); if(JUNLIKELY(type == SW_INVALID)) { resizeStatusType = SW_SCREEN; Warning(_("invalid ResizeMode coordinates: \"%s\""), str); } else { resizeStatusType = type; } } jwm-2.1.0+svn579/src/root.c0000644000000000000000000001325511710374021013774 0ustar rootroot/** * @file root.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle root menus. * */ #include "jwm.h" #include "root.h" #include "menu.h" #include "client.h" #include "main.h" #include "error.h" #include "confirm.h" #include "desktop.h" #include "misc.h" #include "winmenu.h" #include "command.h" #include "parse.h" /** Number of root menus to support. */ #define ROOT_MENU_COUNT 10 static Menu *rootMenu[ROOT_MENU_COUNT]; static char showExitConfirmation = 1; static void ExitHandler(ClientNode *np); static void PatchRootMenu(Menu *menu); static void UnpatchRootMenu(Menu *menu); static void RunRootCommand(const MenuAction *action); /** Initialize root menu data. */ void InitializeRootMenu() { int x; for(x = 0; x < ROOT_MENU_COUNT; x++) { rootMenu[x] = NULL; } } /** Startup root menus. */ void StartupRootMenu() { int x, y; int found; for(x = 0; x < ROOT_MENU_COUNT; x++) { if(rootMenu[x]) { found = 0; for(y = 0; y < x; y++) { if(rootMenu[y] == rootMenu[x]) { found = 1; break; } } if(!found) { InitializeMenu(rootMenu[x]); } } } } /** Shutdown root menus. */ void ShutdownRootMenu() { } /** Destroy root menu data. */ void DestroyRootMenu() { int x, y; for(x = 0; x < ROOT_MENU_COUNT; x++) { if(rootMenu[x]) { DestroyMenu(rootMenu[x]); for(y = x + 1; y < ROOT_MENU_COUNT; y++) { if(rootMenu[x] == rootMenu[y]) { rootMenu[y] = NULL; } } rootMenu[x] = NULL; } } } /** Set a root menu. */ void SetRootMenu(const char *indexes, Menu *m) { int x, y; int index; int found; /* Loop over each index to consider. */ for(x = 0; indexes[x]; x++) { /* Get the index and make sure it's in range. */ index = indexes[x] - '0'; if(JUNLIKELY(index < 0 || index >= ROOT_MENU_COUNT)) { Warning(_("invalid root menu specified: \"%c\""), indexes[x]); continue; } if(rootMenu[index] && rootMenu[index] != m) { /* See if replacing this value will cause an orphan. */ found = 0; for(y = 0; y < ROOT_MENU_COUNT; y++) { if(x != y && rootMenu[y] == rootMenu[x]) { found = 1; break; } } /* If we have an orphan, destroy it. */ if(!found) { DestroyMenu(rootMenu[index]); } } rootMenu[index] = m; } } /** Set whether a dialog should be shown before exiting. */ void SetShowExitConfirmation(char v) { showExitConfirmation = v; } /** Determine if the specified root menu is defined. */ int IsRootMenuDefined(int index) { if(index >= 0 && index < ROOT_MENU_COUNT && rootMenu[index]) { return 1; } else { return 0; } } /** Determine the size of a root menu. */ void GetRootMenuSize(int index, int *width, int *height) { if(!rootMenu[index]) { *width = 0; *height = 0; return; } PatchRootMenu(rootMenu[index]); *width = rootMenu[index]->width; *height = rootMenu[index]->height; UnpatchRootMenu(rootMenu[index]); } /** Show a root menu. */ int ShowRootMenu(int index, int x, int y) { if(!rootMenu[index]) { return 0; } PatchRootMenu(rootMenu[index]); ShowMenu(rootMenu[index], RunRootCommand, x, y); UnpatchRootMenu(rootMenu[index]); return 1; } /** Prepare a root menu to be shown. */ void PatchRootMenu(Menu *menu) { MenuItem *item; for(item = menu->items; item; item = item->next) { if(item->submenu) { PatchRootMenu(item->submenu); } if(item->action.type == MA_DESKTOP) { item->submenu = CreateDesktopMenu(1 << currentDesktop); InitializeMenu(item->submenu); } } } /** Remove temporary items from a root menu. */ void UnpatchRootMenu(Menu *menu) { MenuItem *item; for(item = menu->items; item; item = item->next) { if(item->action.type == MA_DESKTOP) { DestroyMenu(item->submenu); item->submenu = NULL; } else if(item->submenu) { UnpatchRootMenu(item->submenu); } } } /** Exit callback for the exit menu item. */ void ExitHandler(ClientNode *np) { shouldExit = 1; } /** Restart callback for the restart menu item. */ void Restart() { shouldRestart = 1; shouldExit = 1; } /** Exit with optional confirmation. */ void Exit() { if(showExitConfirmation) { ShowConfirmDialog(NULL, ExitHandler, _("Exit JWM"), _("Are you sure?"), NULL); } else { ExitHandler(NULL); } } /** Reload the menu. */ void ReloadMenu() { shouldReload = 1; if(!menuShown) { ShutdownRootMenu(); DestroyRootMenu(); InitializeRootMenu(); ParseConfig(configPath); StartupRootMenu(); shouldReload = 0; } } /** Root menu callback. */ void RunRootCommand(const MenuAction *action) { switch(action->type) { case MA_EXECUTE: RunCommand(action->data.str); break; case MA_RESTART: Restart(); break; case MA_EXIT: if(exitCommand) { Release(exitCommand); } exitCommand = CopyString(action->data.str); Exit(); break; case MA_DESKTOP: ChangeDesktop(action->data.i); break; case MA_SENDTO: case MA_LAYER: case MA_MAXIMIZE: case MA_MINIMIZE: case MA_RESTORE: case MA_SHADE: case MA_MOVE: case MA_RESIZE: case MA_KILL: case MA_CLOSE: ChooseWindow(action); break; default: Debug("invalid RunRootCommand action: %d", action->type); break; } } jwm-2.1.0+svn579/src/resize.c0000644000000000000000000003355311710374021014315 0ustar rootroot/** * @file resize.c * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Functions to handle resizing client windows. * */ #include "jwm.h" #include "resize.h" #include "client.h" #include "outline.h" #include "main.h" #include "cursor.h" #include "misc.h" #include "pager.h" #include "status.h" #include "key.h" #include "event.h" #include "border.h" static ResizeModeType resizeMode = RESIZE_OPAQUE; static char shouldStopResize; static void StopResize(ClientNode *np); static void ResizeController(int wasDestroyed); static void FixWidth(ClientNode *np); static void FixHeight(ClientNode *np); /** Set the resize mode to use. */ void SetResizeMode(ResizeModeType mode) { resizeMode = mode; } /** Callback to stop a resize. */ void ResizeController(int wasDestroyed) { if(resizeMode == RESIZE_OUTLINE) { ClearOutline(); } JXUngrabPointer(display, CurrentTime); JXUngrabKeyboard(display, CurrentTime); DestroyResizeWindow(); shouldStopResize = 1; } /** Resize a client window (mouse initiated). */ void ResizeClient(ClientNode *np, BorderActionType action, int startx, int starty) { XEvent event; int oldx, oldy; int oldw, oldh; int gwidth, gheight; int lastgwidth, lastgheight; int delta; int north, south, east, west; int ratio, minr, maxr; Assert(np); if(!(np->state.border & BORDER_RESIZE)) { return; } if(JUNLIKELY(!GrabMouseForResize(action))) { Debug("ResizeClient: could not grab mouse"); return; } if(np->state.status & STAT_SHADED) { action &= ~(BA_RESIZE_N | BA_RESIZE_S); } np->controller = ResizeController; shouldStopResize = 0; oldx = np->x; oldy = np->y; oldw = np->width; oldh = np->height; gwidth = (np->width - np->baseWidth) / np->xinc; gheight = (np->height - np->baseHeight) / np->yinc; GetBorderSize(np, &north, &south, &east, &west); startx += np->x - west; starty += np->y - north; CreateResizeWindow(np); UpdateResizeWindow(np, gwidth, gheight); if(!(GetMouseMask() & (Button1Mask | Button3Mask))) { StopResize(np); return; } for(;;) { WaitForEvent(&event); if(shouldStopResize) { np->controller = NULL; return; } switch(event.type) { case ButtonRelease: if( event.xbutton.button == Button1 || event.xbutton.button == Button3) { StopResize(np); return; } break; case MotionNotify: SetMousePosition(event.xmotion.x_root, event.xmotion.y_root); DiscardMotionEvents(&event, np->window); if(action & BA_RESIZE_N) { delta = (event.xmotion.y - starty) / np->yinc; delta *= np->yinc; if(oldh - delta >= np->minHeight && (oldh - delta <= np->maxHeight || delta > 0)) { np->height = oldh - delta; np->y = oldy + delta; } if(!(action & (BA_RESIZE_E | BA_RESIZE_W))) { FixWidth(np); } } if(action & BA_RESIZE_S) { delta = (event.xmotion.y - starty) / np->yinc; delta *= np->yinc; np->height = oldh + delta; np->height = Max(np->height, np->minHeight); np->height = Min(np->height, np->maxHeight); if(!(action & (BA_RESIZE_E | BA_RESIZE_W))) { FixWidth(np); } } if(action & BA_RESIZE_E) { delta = (event.xmotion.x - startx) / np->xinc; delta *= np->xinc; np->width = oldw + delta; np->width = Max(np->width, np->minWidth); np->width = Min(np->width, np->maxWidth); if(!(action & (BA_RESIZE_N | BA_RESIZE_S))) { FixHeight(np); } } if(action & BA_RESIZE_W) { delta = (event.xmotion.x - startx) / np->xinc; delta *= np->xinc; if(oldw - delta >= np->minWidth && (oldw - delta <= np->maxWidth || delta > 0)) { np->width = oldw - delta; np->x = oldx + delta; } if(!(action & (BA_RESIZE_N | BA_RESIZE_S))) { FixHeight(np); } } if(np->sizeFlags & PAspect) { if((action & (BA_RESIZE_N | BA_RESIZE_S)) && (action & (BA_RESIZE_E | BA_RESIZE_W))) { /* Fixed point with a 16-bit fraction. */ ratio = (np->width << 16) / np->height; minr = (np->aspect.minx << 16) / np->aspect.miny; if(ratio < minr) { delta = np->width; np->width = (np->height * minr) >> 16; if(action & BA_RESIZE_W) { np->x -= np->width - delta; } } maxr = (np->aspect.maxx << 16) / np->aspect.maxy; if(ratio > maxr) { delta = np->height; np->height = (np->width << 16) / maxr; if(action & BA_RESIZE_N) { np->y -= np->height - delta; } } } } lastgwidth = gwidth; lastgheight = gheight; gwidth = (np->width - np->baseWidth) / np->xinc; gheight = (np->height - np->baseHeight) / np->yinc; if(lastgheight != gheight || lastgwidth != gwidth) { if(np->state.status & (STAT_HMAX | STAT_VMAX)) { np->state.status &= ~(STAT_HMAX | STAT_VMAX); WriteState(np); SendConfigureEvent(np); } UpdateResizeWindow(np, gwidth, gheight); if(resizeMode == RESIZE_OUTLINE) { ClearOutline(); if(np->state.status & STAT_SHADED) { DrawOutline(np->x - west, np->y - north, np->width + west + east, north + south); } else { DrawOutline(np->x - west, np->y - north, np->width + west + east, np->height + north + south); } } else { ResetRoundedRectWindow(np->parent); if(np->state.status & STAT_SHADED) { ShapeRoundedRectWindow(np->parent, np->width + east + west, north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + west + east, north + south); } else { ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + west + east, np->height + north + south); } JXMoveResizeWindow(display, np->window, west, north, np->width, np->height); SendConfigureEvent(np); } UpdatePager(); } break; default: break; } } } /** Resize a client window (keyboard or menu initiated). */ void ResizeClientKeyboard(ClientNode *np) { XEvent event; int gwidth, gheight; int lastgwidth, lastgheight; int north, south, east, west; int deltax, deltay; int ratio, minr, maxr; Assert(np); if(!(np->state.border & BORDER_RESIZE)) { return; } if(JUNLIKELY(JXGrabKeyboard(display, np->window, True, GrabModeAsync, GrabModeAsync, CurrentTime) != GrabSuccess)) { Debug("ResizeClientKeyboard: could not grab keyboard"); return; } GrabMouseForResize(BA_RESIZE_S | BA_RESIZE_E | BA_RESIZE); np->controller = ResizeController; shouldStopResize = 0; gwidth = (np->width - np->baseWidth) / np->xinc; gheight = (np->height - np->baseHeight) / np->yinc; GetBorderSize(np, &north, &south, &east, &west); CreateResizeWindow(np); UpdateResizeWindow(np, gwidth, gheight); MoveMouse(rootWindow, np->x + np->width, np->y + np->height); DiscardMotionEvents(&event, np->window); for(;;) { WaitForEvent(&event); if(shouldStopResize) { np->controller = NULL; return; } deltax = 0; deltay = 0; if(event.type == KeyPress) { while(JXCheckTypedWindowEvent(display, np->window, KeyPress, &event)); UpdateTime(&event); switch(GetKey(&event.xkey) & 0xFF) { case KEY_UP: deltay = Min(-np->yinc, -10); break; case KEY_DOWN: deltay = Max(np->yinc, 10); break; case KEY_RIGHT: deltax = Max(np->xinc, 10); break; case KEY_LEFT: deltax = Min(-np->xinc, -10); break; default: StopResize(np); return; } } else if(event.type == MotionNotify) { SetMousePosition(event.xmotion.x_root, event.xmotion.y_root); DiscardMotionEvents(&event, np->window); deltax = event.xmotion.x - (np->x + np->width); deltay = event.xmotion.y - (np->y + np->height); } else if(event.type == ButtonRelease) { StopResize(np); return; } if(abs(deltax) < np->xinc && abs(deltay) < np->yinc) { continue; } deltay -= deltay % np->yinc; np->height += deltay; np->height = Max(np->height, np->minHeight); np->height = Min(np->height, np->maxHeight); deltax -= deltax % np->xinc; np->width += deltax; np->width = Max(np->width, np->minWidth); np->width = Min(np->width, np->maxWidth); if(np->sizeFlags & PAspect) { ratio = (np->width << 16) / np->height; minr = (np->aspect.minx << 16) / np->aspect.miny; if(ratio < minr) { np->width = (np->height * minr) >> 16; } maxr = (np->aspect.maxx << 16) / np->aspect.maxy; if(ratio > maxr) { np->height = (np->width << 16) / maxr; } } lastgwidth = gwidth; lastgheight = gheight; gwidth = (np->width - np->baseWidth) / np->xinc; gheight = (np->height - np->baseHeight) / np->yinc; if(lastgwidth != gwidth || lastgheight != gheight) { if(np->state.status & (STAT_HMAX | STAT_VMAX)) { np->state.status &= ~(STAT_HMAX | STAT_VMAX); WriteState(np); SendConfigureEvent(np); } UpdateResizeWindow(np, gwidth, gheight); if(resizeMode == RESIZE_OUTLINE) { ClearOutline(); if(np->state.status & STAT_SHADED) { DrawOutline(np->x - west, np->y - north, np->width + west + east, north + south); } else { DrawOutline(np->x - west, np->y - north, np->width + west + east, np->height + north + south); } } else { ResetRoundedRectWindow(np->parent); if(np->state.status & STAT_SHADED) { ShapeRoundedRectWindow(np->parent, np->width + east + west, north + south); JXResizeWindow(display, np->parent, np->width + west + east, north + south); } else { ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXResizeWindow(display, np->parent, np->width + west + east, np->height + north + south); } JXResizeWindow(display, np->window, np->width, np->height); SendConfigureEvent(np); } UpdatePager(); } } } /** Stop a resize action. */ void StopResize(ClientNode *np) { int north, south, east, west; np->controller = NULL; if(resizeMode == RESIZE_OUTLINE) { ClearOutline(); } JXUngrabPointer(display, CurrentTime); JXUngrabKeyboard(display, CurrentTime); DestroyResizeWindow(); GetBorderSize(np, &north, &south, &east, &west); /* Reset shaped bound */ ResetRoundedRectWindow(np->parent); if(np->state.status & STAT_SHADED) { ShapeRoundedRectWindow(np->parent, np->width + east + west, north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + east + west, north + south); } else { ShapeRoundedRectWindow(np->parent, np->width + east + west, np->height + north + south); JXMoveResizeWindow(display, np->parent, np->x - west, np->y - north, np->width + east + west, np->height + north + south); } JXMoveResizeWindow(display, np->window, west, north, np->width, np->height); SendConfigureEvent(np); } /** Fix the width to match the aspect ratio. */ void FixWidth(ClientNode *np) { int ratio, minr, maxr; Assert(np); if((np->sizeFlags & PAspect) && np->height > 0) { /* Fixed point with a 16-bit fraction. */ ratio = (np->width << 16) / np->height; minr = (np->aspect.minx << 16) / np->aspect.miny; if(ratio < minr) { np->width = (np->height * minr) >> 16; } maxr = (np->aspect.maxx << 16) / np->aspect.maxy; if(ratio > maxr) { np->width = (np->height * maxr) >> 16; } } } /** Fix the height to match the aspect ratio. */ void FixHeight(ClientNode *np) { int ratio, minr, maxr; Assert(np); if((np->sizeFlags & PAspect) && np->height > 0) { ratio = (np->width << 16) / np->height; minr = (np->aspect.minx << 16) / np->aspect.miny; if(ratio < minr) { np->height = (np->width << 16) / minr; } maxr = (np->aspect.maxx << 16) / np->aspect.maxy; if(ratio > maxr) { np->height = (np->width << 16) / maxr; } } } jwm-2.1.0+svn579/src/menu.h0000644000000000000000000000652611710374021013765 0ustar rootroot/** * @file menu.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief Header for the menu functions. * */ #ifndef MENU_H #define MENU_H /** Enumeration of menu action types. */ typedef enum { MA_NONE, MA_EXECUTE, MA_DESKTOP, MA_SENDTO, MA_LAYER, MA_STICK, MA_MAXIMIZE, MA_MAXIMIZE_H, MA_MAXIMIZE_V, MA_MINIMIZE, MA_RESTORE, MA_SHADE, MA_MOVE, MA_RESIZE, MA_KILL, MA_CLOSE, MA_EXIT, MA_RESTART } MenuActionType; /** Structure to represent a menu action for callbacks. */ typedef struct MenuAction { MenuActionType type; /**< Type of action. */ /** Extra data for the action. */ union { int i; char *str; } data; } MenuAction; /** Enumeration of possible menu elements. */ typedef enum { MENU_ITEM_NORMAL, /**< Normal menu item (button). */ MENU_ITEM_SUBMENU, /**< Submenu. */ MENU_ITEM_SEPARATOR /**< Item separator. */ } MenuItemType; /** Structure to represent a menu item. */ typedef struct MenuItem { MenuItemType type; /**< The menu item type. */ char *name; /**< Name to display (or NULL). */ MenuAction action; /**< Action to take if selected (or NULL). */ char *iconName; /**< Name of an icon to show (or NULL). */ struct Menu *submenu; /**< Submenu (or NULL). */ struct MenuItem *next; /**< Next item in the menu. */ /** An icon for this menu item. * This field is handled by menu.c */ struct IconNode *icon; /**< Icon to display. */ } MenuItem; /** Structure to represent a menu or submenu. */ typedef struct Menu { /* These fields must be set before calling ShowMenu */ struct MenuItem *items; /**< Menu items. */ char *label; /**< Menu label (NULL for no label). */ int itemHeight; /**< User-specified menu item height. */ /* These fields are handled by menu.c */ Window window; /**< The menu window. */ int x; /**< The x-coordinate of the menu. */ int y; /**< The y-coordinate of the menu. */ int width; /**< The width of the menu. */ int height; /**< The height of the menu. */ int currentIndex; /**< The current menu selection. */ int lastIndex; /**< The last menu selection. */ unsigned int itemCount; /**< Number of menu items (excluding separators). */ int parentOffset; /**< y-offset of this menu wrt the parent. */ int textOffset; /**< x-offset of text in the menu. */ int *offsets; /**< y-offsets of menu items. */ struct Menu *parent; /**< The parent menu (or NULL). */ } Menu; typedef void (*RunMenuCommandType)(const MenuAction *action); /** Initialize a menu structure to be shown. * @param menu The menu to initialize. */ void InitializeMenu(Menu *menu); /** Show a menu. * @param menu The menu to show. * @param runner Callback executed when an item is selected. * @param x The x-coordinate of the menu. * @param y The y-coordinate of the menu. */ void ShowMenu(Menu *menu, RunMenuCommandType runner, int x, int y); /** Destroy a menu structure. * @param menu The menu to destroy. */ void DestroyMenu(Menu *menu); /** The number of open menus. */ extern int menuShown; /** Set the Menu opacity level. * @param str The value (ASCII). */ void SetMenuOpacity(const char *str); #endif /* MENU_H */ jwm-2.1.0+svn579/src/lex.h0000644000000000000000000000614111710374021013602 0ustar rootroot/** * @file lex.h * @author Joe Wingbermuehle * @date 2004-2006 * * @brief XML lexer header file. * */ #ifndef LEX_H #define LEX_H /** Tokens. * Note that any change made to this typedef must be reflected in * TOKEN_MAP in lex.c. */ typedef enum { TOK_INVALID, TOK_ACTIVE, TOK_ACTIVEBACKGROUND, TOK_ACTIVEFOREGROUND, TOK_BACKGROUND, TOK_BORDER, TOK_BUTTONCLOSE, TOK_BUTTONMAX, TOK_BUTTONMAXACTIVE, TOK_BUTTONMIN, TOK_CLASS, TOK_CLOCK, TOK_CLOCKSTYLE, TOK_CLOSE, TOK_DESKTOPS, TOK_DESKTOP, TOK_DOCK, TOK_DOUBLECLICKSPEED, TOK_DOUBLECLICKDELTA, TOK_EXIT, TOK_FOCUSMODEL, TOK_FONT, TOK_FOREGROUND, TOK_GROUP, TOK_HEIGHT, TOK_ICONPATH, TOK_INACTIVE, TOK_INCLUDE, TOK_JWM, TOK_KEY, TOK_KILL, TOK_LAYER, TOK_MAXIMIZE, TOK_MENU, TOK_MENUSTYLE, TOK_MINIMIZE, TOK_MOVE, TOK_MOVEMODE, TOK_NAME, TOK_OPACITY, TOK_OPTION, TOK_OUTLINE, TOK_PAGER, TOK_PAGERSTYLE, TOK_POPUP, TOK_POPUPSTYLE, TOK_PROGRAM, TOK_RESIZE, TOK_RESIZEMODE, TOK_RESTART, TOK_RESTARTCOMMAND, TOK_ROOTMENU, TOK_SENDTO, TOK_SEPARATOR, TOK_SHADE, TOK_SHUTDOWNCOMMAND, TOK_SNAPMODE, TOK_SPACER, TOK_STARTUPCOMMAND, TOK_STICK, TOK_SWALLOW, TOK_TASKLISTSTYLE, TOK_TASKLIST, TOK_TEXT, TOK_TITLE, TOK_TRAY, TOK_TRAYBUTTON, TOK_TRAYBUTTONSTYLE, TOK_TRAYSTYLE, TOK_WIDTH, TOK_WINDOWSTYLE } TokenType; /** Structure to represent an XML attribute. */ typedef struct AttributeNode { char *name; /**< The name of the attribute. */ char *value; /**< The value for the attribute. */ struct AttributeNode *next; /**< The next attribute in the list. */ } AttributeNode; /** Structure to represent an XML tag. */ typedef struct TokenNode { TokenType type; /**< Tag type. */ char *invalidName; /**< Name of the tag if invalid. */ char *value; /**< Body of the tag. */ char *fileName; /**< Name of the file containing this tag. */ int line; /**< Line number of the start of this tag. */ struct AttributeNode *attributes; /**< Linked list of attributes. */ struct TokenNode *parent; /**< Parent tag. */ struct TokenNode *subnodeHead; /**< Start of children. */ struct TokenNode *subnodeTail; /**< End of children. */ struct TokenNode *next; /**< Next tag at the current level. */ } TokenNode; /** Tokenize a buffer. * @param line The buffer to tokenize. * @param fileName The name of the file for error reporting. * @return A linked list of tokens from the buffer. */ TokenNode *Tokenize(const char *line, const char *fileName); /** Get a string represention of a token. * This is identical to GetTokenTypeName if tp is a valid token. * @param tp The token node. * @return The name (never NULL). */ const char *GetTokenName(const TokenNode *tp); /** Get a string represention of a token. * @param type The token. * @return The name (never NULL). */ const char *GetTokenTypeName(TokenType type); #endif /* LEX_H */ jwm-2.1.0+svn579/src/spacer.c0000644000000000000000000000232011710374021014255 0ustar rootroot/** * @file spacer.h * @author Joe Wingbermuehle * @date 2011 * * @brief Spacer tray component. * */ #include "jwm.h" #include "spacer.h" #include "tray.h" static void Create(TrayComponentType *cp); static void Destroy(TrayComponentType *cp); static void SetSize(TrayComponentType *cp, int width, int height); static void Resize(TrayComponentType *cp); /** Create a spacer tray component. */ TrayComponentType *CreateSpacer(int width, int height) { TrayComponentType *cp; if(JUNLIKELY(width < 0)) { width = 0; } if(JUNLIKELY(height < 0)) { height = 0; } cp = CreateTrayComponent(); cp->requestedWidth = width; cp->requestedHeight = height; cp->Create = Create; cp->Destroy = Destroy; cp->SetSize = SetSize; cp->Resize = Resize; return cp; } /** Set the size. */ void SetSize(TrayComponentType *cp, int width, int height) { if(width == 0) { cp->width = cp->requestedWidth; cp->height = height; } else { cp->width = width; cp->height = cp->requestedHeight; } } /** Initialize. */ void Create(TrayComponentType *cp) { } /** Resize. */ void Resize(TrayComponentType *cp) { } /** Destroy. */ void Destroy(TrayComponentType *cp) { } jwm-2.1.0+svn579/doc-header.shtml0000644000000000000000000000023211710374020015110 0ustar rootroot

jwm-2.1.0+svn579/example.jwmrc0000644000000000000000000001412011710374020014544 0ustar rootroot xterm dia firefox gimp xterm -e mutt ooffice pidgin rhythmbox /usr/local/xilinx/bin/ise gxine xcalc xfontsel xmag gksudo synaptic xprop | xmessage -file - xscreensaver-command -activate Pidgin gkrellm xterm root:1 showdesktop xload -nolabel -bg black -fg red -hl white xclock FreeSans-9:bold 4 20 white #70849d:#2e3a67 black 1.0 #aaaaaa #808488:#303438 black 0.5:0.9:0.1 FreeSans-12:bold black gray80:gray90 black gray90:gray80 FreeSans-12:bold gray90 black 0.75 black gray90 #808488 #70849d #2e3a67 FreeSans-12:bold black gray90 white #70849d:#2e3a67 0.85 FreeSans-10 black black yellow /usr/share/icons/wm-icons/32x32-gant /export0/images/formulae.jpg 400 2 sloppy border opaque opaque gkrellm up down right left left down up right select escape nextstacked close desktop# root:1 window maximize rdesktop ldesktop udesktop ddesktop jwm-2.1.0+svn579/config.h.in0000644000000000000000000001104011710374020014066 0ustar rootroot/* config.h.in. Generated from configure.in by autoheader. */ /* Define to debug JWM */ #undef DEBUG /* Define to disable confirm dialogs */ #undef DISABLE_CONFIRM /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have the header file. */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the header file. */ #undef HAVE_FT2BUILD_H /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDARG_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unsetenv' function. */ #undef HAVE_UNSETENV /* Define to 1 if you have the header file. */ #undef HAVE_X11_CURSORFONT_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XRENDER_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_KEYSYM_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XATOM_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XPM_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XPROTO_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XRESOURCE_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_XUTIL_H /* 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 version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* default system configuration path */ #undef SYSTEM_CONFIG /* Define to use FriBidi */ #undef USE_FRIBIDI /* Define to enable icon support */ #undef USE_ICONS /* Define to use libjpeg */ #undef USE_JPEG /* Define to use libpng */ #undef USE_PNG /* Define to enable the X shape extension */ #undef USE_SHAPE /* Define to enable Xft */ #undef USE_XFT /* Define to enable Xinerama */ #undef USE_XINERAMA /* Define to use Xmu */ #undef USE_XMU /* Define to enable XPM support */ #undef USE_XPM /* Define to enable the XRender extension */ #undef USE_XRENDER /* Define to use Xutf8TextPropertyToTextList */ #undef USE_XUTF8 /* Define for single UNIX conformance */ #undef _XOPEN_SOURCE /* Define for timeval on IRIX 6.2 */ #undef _XOPEN_SOURCE_EXTENDED /* Define for timeval on Solaris 2.5.1 */ #undef __EXTENSIONS__ jwm-2.1.0+svn579/ChangeLog0000644000000000000000000023704311710374020013632 0ustar rootroot2012-01-27 00:54 joewing * [r579] /config.h.in, /configure.in, /src/event.c, /src/help.c, /src/jwm.h, /src/jxlib.h, /src/main.c, /src/main.h: Use ConfigureNotify instead of RandR for detecting changes in resolution (jdoe0154). 2012-01-22 23:19 joewing * [r578] /src/event.c, /src/main.c: Another attempt to fix xrandr support. 2012-01-22 16:04 joewing * [r577] /src/main.c: Attempt to fix a bug with randr support (3476900). 2012-01-15 23:57 joewing * [r576] /src/help.c, /src/render.c: Report xrandr with -version. 2012-01-15 23:50 joewing * [r575] /config.h.in, /configure.in, /src/event.c, /src/jwm.h, /src/jxlib.h, /src/main.c, /src/main.h: Restart when the screen changes resolution or rotates. 2012-01-14 16:18 joewing * [r574] /src/icon.h, /src/render.c: Change the way alpha transparency is handled. 2012-01-14 01:14 joewing * [r573] /src/event.c: Attempt to address an issue with keyboard focus when windows are unmapped. 2012-01-11 00:25 joewing * [r572] /src/Makefile.in: USE DESTDIR with BINDIR. 2012-01-10 23:51 joewing * [r571] /src/clientlist.c, /src/hint.c, /src/taskbar.c: Attempt to fix the hidden window bug. 2012-01-05 17:44 joewing * [r570] /src/clientlist.c: Attempt to fix an issue with walking the window stack. 2012-01-03 17:30 joewing * [r569] /src/clock.c, /src/pager.c, /src/taskbar.c, /src/traybutton.c: Fix spurious popups. 2012-01-03 03:39 joewing * [r568] /src/client.c: Fix for loss of keybindings (bug 3468278). 2012-01-02 21:59 joewing * [r567] /src/client.c, /src/event.c: Use eventTime rather than CurrentTime in SetInputFocus. 2012-01-02 21:56 joewing * [r566] /src/client.c, /src/event.c: Fix a focus problem with Flash app settings (bug 3466795). 2012-01-01 21:00 joewing * [r565] /src/menu.c, /src/root.c: Fix segfault with -reload (bug 3468016). 2011-12-31 15:42 joewing * [r564] /src/jwm.h, /src/status.c: Don't draw a rounded border on popups if --disable-shape. 2011-12-31 15:32 joewing * [r563] /src/jwm.h: Fix build with --disable-shape. 2011-12-23 22:41 joewing * [r562] /src/icon.c: Fix build with --disable-icons. 2011-12-23 22:21 joewing * [r561] /src/hint.c, /src/jwm.h, /src/resize.c: Allow resizing a window larger than the root screen. 2011-12-23 00:25 joewing * [r560] /jwm.1.in, /po/POTFILES.in, /po/jwm.pot, /src/Makefile.in, /src/lex.c, /src/lex.h, /src/move.c, /src/outline.c, /src/parse.c, /src/spacer.c, /src/spacer.h, /src/traybutton.c, /src/winmenu.c: Add a spacer tray component. 2011-12-23 00:11 joewing * [r559] /src/icon.c: Use fixed point for icon scaling. 2011-12-22 23:34 joewing * [r558] /src/button.c, /src/icon.c, /src/icon.h, /src/menu.c: Align text in menus even if only some items have icons. 2011-12-22 23:23 joewing * [r557] /src/tray.c: Make trays work better with multiple monitors. 2011-12-19 16:20 joewing * [r556] /src/hint.c: Fix an issue with EWMH and layers. 2011-12-19 15:11 joewing * [r555] /src/dock.c: Fix scaling of dock icons. 2011-12-19 00:47 joewing * [r554] /src/button.c, /src/client.c, /src/client.h, /src/color.c, /src/dock.c, /src/event.c, /src/group.c, /src/outline.c, /src/pager.c, /src/place.c, /src/render.c, /src/resize.c, /src/root.c, /src/root.h, /src/traybutton.c: Fun with fixed point. 2011-12-17 20:49 joewing * [r553] /src/root.c: Fix another warning. 2011-12-17 20:47 joewing * [r552] /src/button.c, /src/clock.c, /src/dock.c: Fix some compiler warnings. 2011-12-17 20:33 joewing * [r551] /src/dock.c: Fix a double free. 2011-12-17 20:10 joewing * [r550] /jwm.1.in, /src/dock.c, /src/dock.h, /src/parse.c: Fix Docks on restart and add a width attribute. 2011-12-16 15:26 joewing * [r549] /src/client.c: Fix some focus problems. 2011-12-16 00:34 joewing * [r548] /src/client.c, /src/event.c, /src/event.h, /src/move.c, /src/resize.c: Fix a race condition with WM_TAKE_FOCUS. 2011-12-13 01:26 joewing * [r547] /src/event.c, /src/help.c, /src/hint.c, /src/hint.h, /src/main.c, /src/main.h, /src/parse.c, /src/root.c, /src/root.h: Add jwm -reload for reloading the root menu. 2011-12-03 03:48 joewing * [r546] /src/client.c, /src/event.c, /src/key.c, /src/key.h, /src/parse.c: Full screen key binding (Rodionov Andrey). 2011-11-23 01:41 joewing * [r545] /src/match.c: Fix a memory leak. 2011-11-23 01:30 joewing * [r544] /src/match.c: Add support for regular expressions when matching (Rodionov Andrey). 2011-10-22 03:55 joewing * [r543] /configure.in: Disable Xmu on IRIX64 in addition to IRIX by default. 2011-10-16 18:25 joewing * [r542] /src/color.c, /src/main.c: Don't create zombies. 2011-10-16 06:01 joewing * [r541] /jwm.1.in, /src/group.c, /src/popup.c: Change the behavior of Group settings to require a name and class match if both are specified. 2011-10-16 05:28 joewing * [r540] /src/client.c, /src/command.c: Only fork once when starting programs. 2011-10-15 22:43 joewing * [r539] /doc-header.shtml: Attempt to fix doxygen HTML. 2011-10-15 22:18 joewing * [r538] /configure.in: Add check for unsetenv. 2011-10-15 22:14 joewing * [r537] /src/clock.c, /src/taskbar.c, /src/timing.c, /src/tray.c: More clock fixes. 2011-10-15 21:52 joewing * [r536] /configure.in, /src/clock.c, /src/timing.c: Fix some timezone issues. 2011-10-15 19:23 joewing * [r535] /src/event.c, /src/move.c, /src/move.h: Disable edge resistance when holding mod1. 2011-10-15 19:04 joewing * [r534] /src/status.c: Fix rounded corners on status windows when Xmu is disabled. 2011-10-15 18:40 joewing * [r533] /configure.in: Update the configure script to disable Xmu by default on IRIX. 2011-10-15 18:26 joewing * [r532] /src/border.c, /src/border.h, /src/button.c, /src/jxlib.h, /src/popup.c: Add support for rounded windows without Xmu support. 2011-10-14 23:46 joewing * [r531] /src/button.c, /src/font.c, /src/menu.c: Fix computation of text width. 2011-10-13 02:59 joewing * [r530] /, /ABOUT-NLS, /Makefile.in, /aclocal.m4, /config.guess, /config.h.in, /config.sub, /configure.in, /install-sh, /po, /po/LINGUAS, /po/Makefile.in.in, /po/Makevars, /po/POTFILES.in, /po/Rules-quot, /po/boldquot.sed, /po/en@boldquot.header, /po/en@quot.header, /po/insert-header.sin, /po/jwm.pot, /po/quot.sed, /po/remove-potcdate.sin, /src, /src/background.c, /src/border.c, /src/client.c, /src/command.c, /src/cursor.c, /src/desktop.c, /src/dock.c, /src/event.c, /src/font.c, /src/group.c, /src/image.c, /src/jwm.h, /src/key.c, /src/lex.c, /src/main.c, /src/menu.c, /src/move.c, /src/parse.c, /src/popup.c, /src/root.c, /src/status.c, /src/swallow.c, /src/taskbar.c, /src/tray.c, /src/traybutton.c, /src/winmenu.c: Add native language support. 2011-10-12 01:30 joewing * [r529] /jwm.1.in: Fix WindowStyle documentation. 2011-10-09 18:52 joewing * [r528] /src/hint.c: Fix an issue with some windows not mapping. 2011-10-09 05:57 joewing * [r527] /src/desktop.c: Fix desktop wrapping. 2011-10-09 02:13 joewing * [r526] /src/border.c: Fix pixmap allocation for rounded borders. 2011-10-08 22:41 joewing * [r525] /src/client.c: Attempt to fix another issue with input focus. 2011-10-08 21:43 joewing * [r524] /config.h.in, /configure.in, /src/hint.c, /src/timing.c: Changes to fix the IRIX build. 2011-10-08 18:55 joewing * [r523] /src/debug.h: Fix debug build. 2011-10-08 18:54 joewing * [r522] /src/background.c, /src/border.c, /src/button.c, /src/client.c, /src/clock.c, /src/color.c, /src/confirm.c, /src/cursor.c, /src/debug.h, /src/desktop.c, /src/dock.c, /src/event.c, /src/font.c, /src/group.c, /src/icon.c, /src/image.c, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/lex.c, /src/main.c, /src/menu.c, /src/move.c, /src/pager.c, /src/parse.c, /src/popup.c, /src/resize.c, /src/root.c, /src/status.c, /src/swallow.c, /src/taskbar.c, /src/tray.c, /src/traybutton.c, /src/winmenu.c: Some performance improvements. 2011-10-08 17:35 joewing * [r521] /src/gradient.c: Don't use floating point for gradients. 2011-10-08 15:14 joewing * [r520] /src/icon.c, /src/icon.h, /src/render.c: Release the alpha picture earlier. 2011-10-08 15:14 joewing * [r519] /src/button.c: Better icon centering. 2011-10-08 05:10 joewing * [r518] /src/client.c, /src/hint.c: Fix an input focus problem with some applications. 2011-10-07 14:56 joewing * [r517] /src/render.c: Fix render scale factors. 2011-10-07 14:10 joewing * [r516] /src/icon.c, /src/render.c: Better xrender scaling. 2011-10-07 02:23 joewing * [r515] /src/render.c: Fix xrender scaling. 2011-10-07 02:15 joewing * [r514] /src/render.c: Use xrender for scaling if available. 2011-10-07 02:15 joewing * [r513] /src/event.c: Fix a compiler warning. 2011-10-06 00:25 joewing * [r512] /src/event.c, /src/hint.c, /src/hint.h: Add support for _NET_WM_ACTION_ABOVE/BELOW. 2011-10-04 03:52 joewing * [r511] /src/client.c, /src/desktop.c, /src/event.c, /src/hint.c, /src/hint.h: Remove old GNOME hint support. 2011-10-03 23:38 joewing * [r510] /src/Makefile.in: Strip the binary after copying it when installing. 2011-10-01 20:05 joewing * [r509] /src/desktop.c, /src/desktop.h, /src/event.c, /src/hint.c, /src/hint.h: Add support for _NET_SHOWING_DESKTOP. 2011-10-01 03:54 joewing * [r508] /todo.txt: Remove outdated todo.txt. 2011-10-01 03:04 joewing * [r507] /src/event.c: Fix a bug with opening tabs in maximized windows for some applications. 2011-09-30 02:33 joewing * [r506] /src/border.c, /src/button.c, /src/client.c, /src/clock.c, /src/event.c, /src/image.c, /src/place.c, /src/taskbar.c: Fixes suggested by clang (patches from Lauri Kasanen). 2011-09-26 18:52 joewing * [r505] /Makefile.in: Add DESTDIR to the Makefile. 2011-09-26 02:23 joewing * [r504] /LICENSE: Updated license. 2011-09-25 22:31 joewing * [r503] /configure.in: Update version. 2011-09-25 19:12 joewing * [r502] /src/hint.c, /src/move.c: Fix issues with dragging windows to new desktops and fix a fullscreen problem. 2011-05-26 12:20 joewing * [r501] /src/desktop.c, /src/desktop.h, /src/move.c: Attempt to fix a bug where desktops can disappear. 2010-12-26 06:09 joewing * [r500] /src/jwm.h: Attempted build fix for newer versions of fribidi. 2010-12-26 06:03 joewing * [r499] /src/client.c: Fix a fullscreen problem with some programs (patch from Patriot). 2010-12-17 01:18 joewing * [r498] /src/event.c, /src/pager.c, /src/pager.h, /src/popup.c, /src/popup.h: Show popups on the pager with desktop names (patch from Steve Neumann). 2010-12-14 22:04 joewing * [r497] /jwm.1.in, /src/clientlist.c, /src/clientlist.h, /src/desktop.c, /src/event.c, /src/key.c, /src/key.h, /src/parse.c: Add 'prev' and 'prevstacked' key bindings and fix the 'desktop' keybinding (patch from Steve Neumann). 2010-12-13 04:07 joewing * [r496] /example.jwmrc, /jwm.1.in, /src/client.c, /src/desktop.c, /src/desktop.h, /src/event.c, /src/hint.c, /src/jwm.h, /src/key.c, /src/key.h, /src/main.c, /src/main.h, /src/move.c, /src/pager.c, /src/parse.c: Add support for virtual desktops in 2-dimensions. 2010-12-12 21:16 joewing * [r495] /jwm.1.in, /src/taskbar.c: Fix a crash when updating _NET_CLIENT_LIST_STACKING and update documentation. 2010-12-12 20:48 joewing * [r494] /jwm.1.in, /src/clock.c, /src/clock.h, /src/parse.c, /src/timing.c, /src/timing.h: Add time zone support (patch from Steve Neumann). 2010-09-11 03:34 joewing * [r493] /jwm.1.in, /src/client.h, /src/event.c, /src/group.c, /src/group.h, /src/parse.c: Add a 'nofocus' group option to prevent windows from stealing the focus when mapped. 2010-05-04 04:25 joewing * [r492] /src/hint.c: Don't make windows forever invisible if they are mapped in the Withdrawn state. 2010-05-02 17:16 joewing * [r491] /src/client.c, /src/client.h: Go back to always grabbing the mouse on windows. 2010-04-16 23:03 joewing * [r490] /src/client.c: Fix a bug with windows losing focus. 2010-04-13 03:27 joewing * [r489] /config.h.in, /configure.in, /src/clock.c, /src/jwm.h, /src/main.c: Add locale support for the clock popup. 2010-04-10 22:01 joewing * [r488] /src/client.c, /src/client.h: Speed up the last fix 2010-04-10 21:49 joewing * [r487] /src/client.c, /src/hint.c: Ungrab the mouse for the top window to work around a bug in flash. 2010-04-10 20:45 joewing * [r486] /src/place.c: Fix handling of _NET_WM_STRUT_PARTIAL 2010-04-10 20:30 joewing * [r485] /src/place.c: Fix a crash when a client strut is removed. 2010-04-10 20:11 joewing * [r484] /src/hint.c: Better handling for _NET_WM_WINDOW_TYPE_DESKTOP. 2010-04-10 19:50 joewing * [r483] /src/hint.c: Fix an issue with window state handling. 2010-04-10 19:25 joewing * [r482] /src/client.c, /src/event.c, /src/hint.c, /src/hint.h: Improve EWMH support 2010-04-10 19:24 joewing * [r481] /src/place.c: Fix a bug with maximization 2010-04-09 04:33 joewing * [r480] /src/event.c, /src/hint.c, /src/hint.h: Add support for _NET_WM_STATE_SKIP_TASKBAR. 2010-04-09 04:00 joewing * [r479] /example.jwmrc, /src/tray.h: Updated example configuration 2010-04-06 05:59 joewing * [r478] /src/render.c: Fix an issue with JWM and render 2010-04-06 05:54 joewing * [r477] /src/event.c: Fix maximization problem with some GNOME programs. 2010-04-06 00:23 joewing * [r476] /src/hint.c, /src/render.c, /src/taskbar.c: Fix a bug with withdrawn windows 2010-04-02 03:42 joewing * [r475] /src/background.c, /src/icon.c, /src/jxlib.h, /src/main.c, /src/render.c: Yet another attempt to fix an issue with icons displaying incorrectly on some systems. 2010-03-24 23:46 joewing * [r474] /src/render.c: Attempt to fix an issue with semi-transparent icons with some setups. 2010-03-23 03:29 joewing * [r473] /src/background.c: Fix a bug with per-desktop backgrounds. 2010-03-23 03:07 joewing * [r472] /src/move.c: Make dragging a window to the edge of the screen switch desktops. 2010-03-23 02:36 joewing * [r471] /config.h.in, /jwm.1.in, /src/clientlist.c, /src/key.c, /src/key.h, /src/parse.c: Clean up nextstacked key binding. 2010-03-10 04:29 joewing * [r470] /src/jwm.h: Fix a fribidi compilation issue 2010-02-21 02:12 joewing * [r469] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, /src/parse.c, /src/tray.c, /src/tray.h: Add a 'show tray' key binding (patch from Omair Eshkenazi) 2010-01-30 00:17 joewing * [r468] /jwm.1.in: Update the man page on the opacity group option 2010-01-30 00:07 joewing * [r467] /jwm.1.in: Sync man.1.in with the copy on SF 2010-01-30 00:05 joewing * [r466] /jwm.1.in: Remove the opaque key binding from the man page 2010-01-30 00:04 joewing * [r465] /src/client.h, /src/parse.c: Fix the opacity group setting 2010-01-18 05:30 joewing * [r464] /src/place.c: Fix a bug with window placement 2010-01-18 04:42 joewing * [r463] /src/jwm.h: Fix a compile error if libjpeg is enabled and libpng is disabled 2010-01-18 04:38 joewing * [r462] /src/taskbar.c: Fix a bug with minimizing clients that are slow to map 2010-01-18 03:49 joewing * [r461] /src/client.c, /src/clientlist.c, /src/event.c, /src/key.c, /src/key.h: Fix nextstacked key binding 2010-01-02 00:39 joewing * [r460] /src/clock.c: Fix a build issue with some versions of gcc 2009-12-07 03:37 joewing * [r459] /jwm.1.in: Fix syntax errors in the jwm man page 2009-12-07 00:28 joewing * [r458] /src/hint.c: Multibyte fix for title bars from Hiroyuki Yamamori 2009-09-28 01:23 joewing * [r457] /src/taskbar.c: Fix a crash with popups if a window has no title 2009-03-26 03:10 joewing * [r456] /src/move.c: Only restore the maximized status of a client when moving if it was only maximized in one direction. 2009-03-25 03:53 joewing * [r455] /src/background.c, /src/client.c, /src/client.h, /src/error.c, /src/event.c, /src/group.c, /src/group.h, /src/hint.c, /src/hint.h, /src/icon.c, /src/jwm.h, /src/key.c, /src/key.h, /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/parse.c, /src/render.c, /src/render.h, /src/root.c, /src/tray.c, /src/winmenu.c: Do transparency based on the stacking order. The key binding and window menu for transparency have been removed for now. 2009-03-24 01:50 joewing * [r454] /src/button.c, /src/button.h: Tweak button label sizes and remove ALIGN_RIGHT, which wasn't used and probably wrong. 2009-03-22 22:05 joewing * [r453] /jwm.1.in: Update the man page with info about "Opacity". 2009-03-22 21:55 joewing * [r452] /src/desktop.c: Fix for windows loosing focus when switching desktops. 2009-03-22 21:40 joewing * [r451] /src/client.c, /src/clientlist.c: Make "next" and "nextstacked" restore minimized clients if needed. 2009-03-22 19:35 joewing * [r450] /src/main.c, /src/main.h, /src/root.c, /src/root.h, /src/winmenu.c: Fix a crash with jwm -p. 2009-03-22 19:30 joewing * [r449] /src/pager.c: Don't allow the pager labels to run outside of the desktop. 2009-03-22 19:27 joewing * [r448] /jwm.1.in, /src/color.c, /src/color.h, /src/desktop.c, /src/desktop.h, /src/font.c, /src/font.h, /src/pager.c, /src/pager.h, /src/parse.c: Allow pager labels. 2009-03-22 18:53 joewing * [r447] /src/menu.c: Fix text width on menu items. 2009-03-22 18:45 joewing * [r446] /src/hint.c: Put fullscreen clients on the top layer. 2009-03-22 05:17 joewing * [r445] /jwm.1.in: Update the man page. 2009-03-22 04:50 joewing * [r444] /src/border.c: Add the ability to resize from the top of the window. 2009-03-22 04:32 joewing * [r443] /src/border.c: Fix a memory leak. 2009-03-22 04:29 joewing * [r442] /src/border.c, /src/border.h, /src/color.c, /src/lex.c, /src/lex.h, /src/parse.c: Add the ability to set the window buttons via the configuration file. 2009-03-22 03:48 joewing * [r441] /example.jwmrc: Updated example configuration. 2009-03-22 03:47 joewing * [r440] /jwm.1.in, /src/color.h, /src/lex.c, /src/lex.h, /src/parse.c: Remove the "Corner" configuration option since it no longer does anything. 2009-03-22 03:23 joewing * [r439] /Makefile.in: Allow setting the version used for creating tarballs. 2009-03-22 03:02 joewing * [r438] /configure.in: Fix some configure problems. 2009-03-22 02:54 joewing * [r437] /src/border.c, /src/jwm.h: Fix some build problems. 2009-03-22 02:50 joewing * [r436] /src/jwm.h: Fix the inclusion of Xmu.h 2009-03-22 02:47 joewing * [r435] /src/traybutton.c: Fix the use of an uninitialized value. 2009-03-22 02:42 joewing * [r434] /README, /config.h.in, /configure.in, /src/border.c, /src/border.h, /src/button.c, /src/client.c, /src/event.c, /src/popup.c, /src/resize.c, /src/status.c: Clean up the use of libXmu. 2009-03-22 02:23 joewing * [r433] /src/button.c: No more 3D buttons. 2009-03-22 02:23 joewing * [r432] /src/confirm.c: Fix the size of buttons on the confirm dialog. 2009-03-22 01:55 joewing * [r431] /src/border.c: Clean up some border stuff. 2009-03-22 01:52 joewing * [r430] /src/status.c: Make status windows rounded. 2009-03-21 00:17 joewing * [r429] /src/jxlib.h, /src/main.c, /src/root.c: Log a debug message about the composite extension. 2009-03-21 00:08 joewing * [r428] /src/border.c, /src/jxlib.h: Fix shaded rounded windows. 2009-03-20 23:53 joewing * [r427] /src/client.c, /src/event.c, /src/menu.c: Fix some warnings. 2009-03-20 04:49 joewing * [r426] /configure.in: Fix a link error with Xmu functions. 2009-03-20 04:35 joewing * [r425] /configure.in, /jwm.1.in, /src/border.c, /src/border.h, /src/button.c, /src/client.c, /src/client.h, /src/color.c, /src/color.h, /src/event.c, /src/group.c, /src/group.h, /src/hint.c, /src/hint.h, /src/icon.c, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/key.h, /src/lex.c, /src/lex.h, /src/menu.c, /src/menu.h, /src/parse.c, /src/popup.c, /src/resize.c, /src/root.c, /src/root.h, /src/tray.c, /src/tray.h, /src/winmenu.c: User-contributed JWM-enhancements: Patriot: - Rounded window corners - Transparent menus, trays, and window support. - Borderless taskbutton tweak. - Flat menu button option. - New tray/tasklist border. - xcompmgr bug workaround. - User replaceable window button mask. - gxine fullscreen fix. Dougal: - Show-desktop keybinding. - Opacity keybinding. - Transparent group. 2007-11-02 02:50 joewing * [r424] /src/client.c, /src/lex.c, /src/parse.c, /src/tray.c, /src/tray.h: Some speedups. 2007-11-02 02:30 joewing * [r423] /src/icon.c: Better icon hashing. 2007-11-02 02:13 joewing * [r422] /configure.in: Bump version number. 2007-11-02 02:12 joewing * [r421] /src/clientlist.c: With "nextstacked", don't raise until the modifier key is released. 2007-08-01 01:37 joewing * [r420] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, /src/parse.c: Add the ability to stick/unstick windows with a key binding. 2007-08-01 01:33 joewing * [r419] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, /src/parse.c: Add the ability to switch to the previous desktop via a key binding. 2007-08-01 01:27 joewing * [r418] /src/key.c: Fix a key binding issue with lock modifiers. 2007-07-05 23:58 joewing * [r417] /src/client.c: Fix maximization on restart. 2007-07-04 00:26 joewing * [r416] /src/jwm.h, /src/main.c, /src/swallow.c: Delay a bit before restarting to give swallow windows a chance to map. 2007-07-03 23:55 joewing * [r415] /configure.in, /src/icon.c, /src/x.xpm: Better icon hash and updated version number. 2007-07-03 05:13 joewing * [r414] /src/image.c: Fix file handle leak. 2007-06-25 00:55 joewing * [r413] /configure.in: A hack to make MANDIR behave 2007-06-25 00:50 joewing * [r412] /configure.in: Fix man page installation directory (hopefully). 2007-06-25 00:45 joewing * [r411] /src/key.c: Don't attempt to grab keys for which we can't get the key code. 2007-06-25 00:03 joewing * [r410] /src/parse.c: Fix a menu include bug. 2007-06-24 23:44 joewing * [r409] /configure.in: Update version. 2007-06-24 22:27 joewing * [r408] /src/background.c: Only include misc.h once. 2007-06-24 22:25 joewing * [r407] /src/event.c, /src/resize.c: Make alt+right click resize windows. 2007-06-24 21:33 joewing * [r406] /example.jwmrc: Update config again... 2007-06-24 21:30 joewing * [r405] /example.jwmrc: Update the default config. 2007-06-24 21:30 joewing * [r404] /src/background.c: Expand environment variables in background image paths. 2007-06-24 21:05 joewing * [r403] /src/main.c: Fix a bug with backgrounds. 2007-06-23 20:12 joewing * [r402] /jwm.1.in, /src/icon.c: Support JPEG icons. 2007-06-22 02:29 joewing * [r401] /example.jwmrc, /src/parse.c: Update default config and fix Desktops tag parsing. 2007-06-22 01:45 joewing * [r400] /src/client.c, /src/client.h, /src/event.c: Make maximization from double clicking the title use client settings. 2007-06-21 04:30 joewing * [r399] /src/confirm.c, /src/parse.c: Clean up some parsing stuff and make confirm buttons wider. 2007-06-21 02:18 joewing * [r398] /jwm.1.in, /src/client.h, /src/event.c, /src/group.c, /src/group.h, /src/parse.c: Add hmax and vmax group options. 2007-06-21 02:02 joewing * [r397] /src/group.c: Fix a bug with matching against window instance names. 2007-06-21 01:49 joewing * [r396] /src/key.c: Fix nextstacked key binding. 2007-06-19 02:23 joewing * [r395] /README, /src/image.c, /src/jwm.h: Stop png.h's complaining. 2007-06-19 01:56 joewing * [r394] /config.h.in, /configure.in, /src/border.c, /src/client.c, /src/client.h, /src/desktop.c, /src/event.c, /src/group.c, /src/hint.c, /src/image.c, /src/image.h, /src/jwm.h, /src/menu.h, /src/move.c, /src/pager.c, /src/place.c, /src/place.h, /src/resize.c, /src/winmenu.c: Horizontal/vertical maximization Optional JPEG support. 2007-06-17 04:26 joewing * [r393] /src/background.c, /src/main.c: Don't make huge pixmaps for tiled backgrounds. 2007-06-17 02:45 joewing * [r392] /src/desktop.c: Don't minimize "nolist" items on showdesktop. 2007-06-15 04:09 joewing * [r391] /jwm.1.in: Update the documentation for menu includes. 2007-06-15 04:08 joewing * [r390] /src/menu.c: Fix a bug where labels were cut off sometimes. 2007-06-15 04:05 joewing * [r389] /src/parse.c: Make menu includes work better (now they must be surrounded by a tag). 2007-06-15 03:45 joewing * [r388] /src/image.c: Remove debug stuff. 2007-06-15 03:44 joewing * [r387] /jwm.1.in, /src/background.c, /src/icon.c, /src/image.c, /src/lex.c: Support for tiled background images. 2007-06-01 04:05 joewing * [r386] /src/main.c: Fix "non-portable" whitespace. 2007-06-01 04:02 joewing * [r385] /src/confirm.c, /src/menu.c, /src/tray.c: Remove tabs 2007-06-01 03:59 joewing * [r384] /src/clock.c, /src/cursor.c, /src/cursor.h, /src/menu.c, /src/pager.c, /src/taskbar.c, /src/tray.c, /src/tray.h, /src/traybutton.c: Make all tray buttons appear to be pressed when pressed. 2007-06-01 03:08 joewing * [r383] /src/button.h, /src/confirm.c, /src/confirm.h: Make dialog buttons appear to be pressed when pressed. 2007-05-17 01:33 joewing * [r382] /Doxyfile, /doc-footer.shtml, /doc-header.shtml: Doxygen updates 2007-05-16 03:39 joewing * [r381] /src/client.c, /src/color.c: Fix a seg fault. 2007-05-04 03:00 joewing * [r380] /src/color.c, /src/color.h, /src/gradient.c: Fix gradients on pseudo x servers 2007-04-04 02:50 joewing * [r379] /jwm.1.in, /src/event.c: Changes from jeremy-c-reed Fix typos in debugging output. Fix an issue with some versions of man. 2007-03-19 03:17 joewing * [r378] /jwm.1.in: Document scroll wheel mouse bindings for the task list. 2007-03-19 03:11 joewing * [r377] /src/traybutton.c: Make the tray button appear pressed when showing a root menu. 2007-03-19 02:57 joewing * [r376] /src/clientlist.c, /src/clientlist.h: Remove some dead code. 2007-03-19 02:52 joewing * [r375] /src/Makefile.in, /src/border.c, /src/client.c, /src/client.h, /src/clientlist.c, /src/clientlist.h, /src/desktop.c, /src/event.c, /src/key.c, /src/key.h, /src/move.c, /src/pager.c, /src/parse.c, /src/taskbar.c, /src/taskbar.h, /src/tray.c: Make "nextstacked" work. 2007-03-17 00:01 joewing * [r374] /src/taskbar.c: Make FocusNextStackedCircular raise as well as focus. 2007-03-04 05:17 joewing * [r373] /src/dock.c: Fix a seg fault when a program attempts to dock a window with no dock running. 2007-02-24 20:48 joewing * [r372] /src/background.c: Use a pixmap rather than setting the background pixel for solid backgrounds. 2007-01-13 05:02 joewing * [r371] /src/background.c: Fix a background problem. 2007-01-13 05:00 joewing * [r370] /src/menu.c, /todo.txt: Fix handling of empty menu items. 2007-01-13 04:52 joewing * [r369] /src/menu.c, /todo.txt: Don't show empty menus. 2007-01-09 03:31 joewing * [r368] /src/event.c: Fix window mapping. 2007-01-07 05:24 joewing * [r367] /src/event.c: Don't hide either. 2007-01-07 05:22 joewing * [r366] /src/event.c: Set the desktop for windows that map themselves. 2007-01-07 05:14 joewing * [r365] /src/icon.c: Center icons. 2007-01-07 05:04 joewing * [r364] /src/icon.c, /src/render.c: Speed up image loading. 2007-01-07 04:38 joewing * [r363] /src/move.c: Fix mouse position when moving maximized windows. 2007-01-07 04:03 joewing * [r362] /src/background.c, /src/hint.c, /src/hint.h: Set the _XSETROOT_ID property on the root window. 2007-01-06 03:17 joewing * [r361] /src/icon.c: Fix endian bug with icons. 2007-01-05 06:18 joewing * [r360] /src/icon.c: Fix warning 2007-01-05 06:17 joewing * [r359] /src/background.c, /src/icon.c, /src/icon.h, /src/image.c, /src/render.c: Fixes for render 2007-01-05 06:15 joewing * [r358] /src/icon.c, /src/image.c, /src/image.h, /src/render.c: More speedups 2007-01-05 05:32 joewing * [r357] /src/icon.c: More speedup, hopefully. 2007-01-05 05:11 joewing * [r356] /src/image.c: Attempt to speed things up. 2007-01-05 04:22 joewing * [r355] /src/move.c, /src/pager.c, /todo.txt: Retain maximized status when moving windows. 2007-01-04 04:38 joewing * [r354] /src/background.c: Fix some warnings 2007-01-04 04:37 joewing * [r353] /jwm.1.in, /src/Makefile.in, /src/background.c, /src/background.h, /src/color.c, /src/color.h, /src/desktop.c, /src/lex.c, /src/lex.h, /src/main.c, /src/parse.c, /todo.txt: Added the ability to set the background and to change it based on desktop. 2006-12-30 23:05 joewing * [r352] /src/main.c, /src/place.c, /src/place.h, /todo.txt: Fix a bug drawing trays. 2006-12-28 04:09 joewing * [r351] /src/pager.c: Unmaximize maximized windows when moving using the pager. 2006-12-28 04:05 joewing * [r350] /example.jwmrc: Updated example configuration. 2006-12-28 04:03 joewing * [r349] /Makefile.in, /configure.in, /package: Remove package stuff 2006-12-27 01:13 joewing * [r348] /src/pager.c: Fix warnings. 2006-12-27 01:12 joewing * [r347] /src/pager.c, /src/traybutton.c, /todo.txt: Add the ability to move windows with the pager. 2006-12-24 19:49 joewing * [r346] /src/root.c, /src/taskbar.c: Fix a seg fault when minimized windows have no name. 2006-12-24 07:03 joewing * [r345] /src/hint.h: More doxygen. 2006-12-24 06:59 joewing * [r344] /src/client.h, /src/winmenu.h: Fix some doxygen comments. 2006-12-24 06:57 joewing * [r343] /src/command.c: Fix a compiler warning. 2006-12-24 06:55 joewing * [r342] /src/client.h, /src/clock.c, /src/clock.h, /src/color.h, /src/command.c, /src/command.h, /src/cursor.h, /src/dock.c, /src/dock.h, /src/font.h, /src/help.h, /src/hint.h, /src/image.h, /src/key.c, /src/key.h, /src/lex.h, /src/main.h, /src/match.h, /src/menu.h, /src/misc.h, /src/move.h, /src/outline.h, /src/pager.h, /src/parse.h, /src/place.h, /src/popup.h, /src/render.h, /src/resize.h, /src/root.c, /src/root.h, /src/screen.h, /src/status.h, /src/swallow.c, /src/swallow.h, /src/taskbar.h, /src/timing.h, /src/tray.h, /src/traybutton.c, /src/traybutton.h, /src/winmenu.h: More doxygen comments. 2006-12-24 05:02 joewing * [r341] /configure.in: Bump version to 1.9 2006-12-24 04:53 joewing * [r340] /src/border.c, /src/border.h, /src/button.c, /src/button.h, /src/client.c, /src/client.h, /src/clock.c, /src/clock.h, /src/color.c, /src/color.h, /src/command.c, /src/confirm.c, /src/confirm.h, /src/cursor.c, /src/debug.c, /src/debug.h, /src/desktop.c, /src/dock.c, /src/error.c, /src/event.c, /src/font.c, /src/font.h, /src/gradient.c, /src/gradient.h, /src/group.c, /src/group.h, /src/help.c, /src/hint.c, /src/hint.h, /src/icon.c, /src/icon.h, /src/image.c, /src/image.h, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/key.h, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, /src/match.c, /src/menu.c, /src/menu.h, /src/misc.c, /src/move.c, /src/move.h, /src/outline.c, /src/pager.c, /src/parse.c, /src/place.c, /src/popup.c, /src/render.c, /src/render.h, /src/resize.c, /src/resize.h, /src/root.c, /src/screen.c, /src/screen.h, /src/status.c, /src/swallow.c, /src/swallow.h, /src/taskbar.c, /src/timing.c, /src/timing.h, /src/tray.c, /src/tray.h, /src/traybutton.c, /src/traybutton.h, /src/winmenu.c: Use spaces instead of tabs. 2006-12-24 04:18 joewing * [r339] /src/swallow.c: Fix a memory leak. 2006-12-24 04:13 joewing * [r338] /src/misc.c: Fix a bug. 2006-12-24 04:07 joewing * [r337] /src/border.c, /src/color.c, /src/hint.c, /src/hint.h, /src/jxlib.h, /src/lex.c, /src/lex.h, /src/main.c, /src/match.c, /src/menu.c, /src/move.c, /src/outline.c, /src/pager.c, /src/parse.c, /src/place.c, /src/popup.c, /src/popup.h, /src/render.c, /src/root.c, /src/screen.c, /src/status.c, /src/taskbar.c, /src/timing.c, /src/tray.c, /src/traybutton.c, /src/traybutton.h, /src/winmenu.c, /src/winmenu.h: Code cleanups. 2006-12-24 02:20 joewing * [r336] /example.jwmrc, /jwm.1.in, /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, /src/client.c, /src/color.c, /src/color.h, /src/cursor.c, /src/cursor.h, /src/debug.c, /src/debug.h, /src/desktop.c, /src/event.c, /src/event.h, /src/font.c, /src/font.h, /src/gradient.c, /src/gradient.h, /src/group.c, /src/group.h, /src/hint.h, /src/icon.c, /src/image.c, /src/jwm.h, /src/key.c, /src/lex.c, /src/lex.h, /src/main.c, /src/menu.c, /src/move.c, /src/parse.c, /src/taskbar.c, /src/theme.c, /src/theme.h, /todo.txt: New look. 2006-12-23 07:54 joewing * [r335] /todo.txt: Update version in todo 2006-12-23 06:41 joewing * [r334] /src/menu.c, /src/menu.h, /todo.txt: Make submenus appear on the left if there isn't enough room on the right (mdsama). 2006-12-23 06:35 joewing * [r333] /src/client.c, /todo.txt: Focus transients of active windows when they appear. 2006-12-23 06:25 joewing * [r332] /src/event.c, /src/main.c, /src/swallow.c, /src/tray.c, /todo.txt: Fix swallow on startup. 2006-12-23 05:22 joewing * [r331] /src/dock.c, /src/dock.h, /src/event.c, /todo.txt: Fix dock when restarting. 2006-12-23 02:38 joewing * [r330] /configure.in, /src/client.c, /src/clock.c, /src/command.c, /src/confirm.c, /src/confirm.h, /src/dock.c, /src/error.c, /src/help.c, /src/image.h, /src/lex.h, /src/misc.c, /src/misc.h, /src/move.c, /src/resize.c, /todo.txt: Fix a bug with moving windows that could cause windows to jump to the upper left corner of the screen. Add some more doxygen comments. 2006-11-04 21:07 joewing * [r329] /configure.in, /todo.txt: version 1.8rc4 2006-11-04 20:54 joewing * [r328] /src/main.c, /todo.txt: Fix StartupCommands and Swallow items. 2006-11-04 20:45 joewing * [r327] /src/client.c, /todo.txt: Improve _NET_WM_STATE_FULLSCREEN support. 2006-10-28 04:00 joewing * [r326] /src/lex.c, /todo.txt: Trim leading and trailing space from configuration options. 2006-10-28 02:17 joewing * [r325] /example.jwmrc: Fix root menu keybinding in the default config. 2006-10-24 01:10 joewing * [r324] /configure.in, /src/border.c, /src/cursor.c, /src/parse.c, /todo.txt: Fix some seg faults with invalid configuration files. 2006-10-23 02:03 joewing * [r323] /src/tray.c, /todo.txt: Fix an issue with auto-hide trays hidding when they shouldn't. 2006-10-20 04:16 joewing * [r322] /src/client.c, /src/main.c, /todo.txt: Fix a bug that caused windows to be mapped incorrectly when started at the same time as JWM. 2006-10-19 01:32 joewing * [r321] /src/client.c, /todo.txt: Fix a bug that caused a seg fault after a client was killed. 2006-10-15 04:55 joewing * [r320] /src/Makefile.in: Remove "GNU-ism" in makefile. 2006-10-01 20:15 joewing * [r319] /src/client.c, /src/hint.c: Keep transients above owners. 2006-10-01 20:04 joewing * [r318] /src/client.c, /src/key.c, /src/traybutton.c: bah 2006-10-01 20:01 joewing * [r317] /src/key.c, /src/key.h, /src/parse.c, /src/root.h, /src/traybutton.c, /src/traybutton.h, /todo.txt: More warning messages about tray buttons/key bindings that specify root menus. 2006-08-26 22:19 joewing * [r316] /src/border.c, /src/client.c, /src/client.h, /src/event.c, /src/hint.c, /src/hint.h, /src/place.c, /src/traybutton.c, /todo.txt: Add support for _NET_WM_STATE_FULLSCREEN. 2006-08-20 01:22 joewing * [r315] /src/event.c, /todo.txt: Unmaximize maximized windows that resize themselves. 2006-08-18 00:46 joewing * [r314] /src/place.c, /todo.txt: When maximizing, place the window on the screen of its center point. 2006-08-18 03:06 joewing * [r313] /src/theme.c: Fix a compiler warning. 2006-08-18 00:39 joewing * [r312] /src/screen.h, /src/status.h, /src/swallow.h, /src/taskbar.h, /src/theme.c, /src/theme.h, /src/timing.h, /src/traybutton.h, /src/winmenu.h: Add some comments. 2006-08-18 01:50 joewing * [r311] /src/client.c, /todo.txt: Fix a compiler warning. 2006-08-17 23:23 joewing * [r310] /src/client.c, /src/client.h, /src/event.c: Allow clients to be lowered with alt+right click. 2006-08-17 23:00 joewing * [r309] /src/event.c, /todo.txt: Fix alt+left click window moving so windows don't jump. 2006-08-17 22:53 joewing * [r308] /src/popup.c, /todo.txt: Hide popups if the mouse moves over them. 2006-08-14 04:01 joewing * [r307] /src/traybutton.c: Fix a compiler warning. 2006-08-14 01:49 joewing * [r306] /configure.in, /src/root.c, /src/root.h, /src/traybutton.c, /todo.txt: Bump version, fix seg fault when TrayButtons point to invalid root menus. 2006-08-13 20:26 joewing * [r305] /configure.in, /src/client.c: Fix --disable-shape 2006-08-13 20:21 joewing * [r304] /jwm.1.in: Update documentation. 2006-08-13 19:55 joewing * [r303] /Doxyfile, /Makefile.in, /src/border.h, /src/button.h, /src/client.h, /src/clock.h, /src/color.h, /src/command.h, /src/confirm.h, /src/cursor.h, /src/debug.h, /src/desktop.h, /src/dock.h, /src/error.h, /src/event.h, /src/font.h, /src/group.h, /src/help.c, /src/help.h, /src/hint.h, /src/icon.h, /src/image.h, /src/jwm.h, /src/jxlib.h, /src/key.h, /src/lex.h, /src/main.h, /src/match.h, /src/menu.h, /src/misc.h, /src/move.h, /src/outline.h, /src/pager.h, /src/parse.h, /src/place.h, /src/popup.h, /src/render.h, /src/resize.h, /src/root.h, /src/screen.h, /src/status.h, /src/swallow.h, /src/taskbar.h, /src/theme.h, /src/timing.h, /src/tray.h, /src/traybutton.h, /src/winmenu.h: Add some doxygen comments. 2006-08-13 16:18 joewing * [r302] /src/border.h, /src/button.h, /src/client.h, /src/icon.h: Comments. 2006-08-13 05:43 joewing * [r301] /src/image.h, /src/move.h, /src/outline.h, /src/resize.h, /src/tray.h: Add some comments. 2006-08-13 05:21 joewing * [r300] /src/border.c, /src/button.c, /src/client.c, /src/clock.c, /src/color.c, /src/command.c, /src/confirm.c, /src/cursor.c, /src/debug.c, /src/dock.c, /src/error.c, /src/font.c, /src/group.c, /src/hint.c, /src/key.c, /src/parse.c, /todo.txt: Fix some stuff. 2006-08-12 23:06 joewing * [r299] /src/border.c, /src/button.c, /src/font.c, /src/icon.c, /src/icon.h, /src/traybutton.c: Attempt to fix icon drawing issue. 2006-08-11 23:56 joewing * [r298] /src/clock.h, /src/command.h, /src/desktop.h, /src/dock.h, /src/event.c: Don't stop move/resize for superfluous configure requests. 2006-08-11 04:35 joewing * [r297] /todo.txt: Update todo. 2006-08-11 02:36 joewing * [r296] /src/client.h, /src/command.c, /src/command.h, /src/font.c, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, /src/parse.c: Fix font overflow and add RestartCommand. 2006-08-10 02:46 joewing * [r295] /jwm.1.in, /src/cursor.c, /src/cursor.h, /src/desktop.c, /src/desktop.h, /src/event.c, /src/key.c, /src/key.h, /src/lex.c, /src/lex.h, /src/menu.c, /src/menu.h, /src/move.c, /src/parse.c, /src/root.c, /src/root.h, /src/traybutton.c, /src/winmenu.c, /src/winmenu.h, /todo.txt: Support window controls in root menus. 2006-08-09 00:39 joewing * [r294] /src/button.c: Fix button drawing. 2006-08-09 01:55 joewing * [r293] /src/font.c: Fix a xft problem. 2006-08-08 23:57 joewing * [r292] /jwm.1.in, /src/border.c, /src/button.c, /src/client.c, /src/client.h, /src/clock.c, /src/confirm.c, /src/font.c, /src/font.h, /src/icon.c, /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/pager.c, /src/popup.c, /src/render.c, /src/status.c, /src/taskbar.c, /src/tray.c, /src/tray.h, /src/traybutton.c, /todo.txt: Reduce X resource usage. 2006-08-08 00:49 joewing * [r291] /src/event.c, /src/event.h: Remove some dead code. 2006-08-08 00:47 joewing * [r290] /src/event.c, /src/menu.c, /src/parse.c, /src/root.c, /src/root.h, /src/traybutton.c: Support multiple root menus. 2006-08-07 23:17 joewing * [r289] /src/border.c, /src/border.h, /src/button.c, /src/client.c, /src/clock.c, /src/confirm.c, /src/event.c, /src/font.c, /src/font.h, /src/icon.c, /src/icon.h, /src/popup.c, /src/status.c, /src/theme.c, /src/theme.h, /src/traybutton.c: Only redraw newly exposed regions of the border. 2006-08-06 03:49 joewing * [r288] /src/popup.c, /todo.txt: Fix click propagation through popups. 2006-08-06 03:45 joewing * [r287] /configure.in: Change version 2006-08-06 01:59 joewing * [r286] /src/cursor.c, /src/cursor.h, /src/move.c: Fix move cursor. 2006-08-06 01:48 joewing * [r285] /src/client.c: Fix keyboard input. 2006-08-06 01:41 joewing * [r284] /src/event.c: Remove debug output. 2006-08-06 01:40 joewing * [r283] /src/client.c, /src/cursor.c, /src/cursor.h, /src/event.c, /src/key.c, /src/move.c: Fix alt+drag moving. 2006-08-06 02:35 joewing * [r282] /src/client.c, /src/client.h, /src/event.c, /src/hint.c, /src/hint.h, /src/swallow.c: Kill swallow apps that don't accept WM_DELETE. 2006-08-06 02:04 joewing * [r281] /src/client.c, /src/menu.c, /src/taskbar.c, /src/tray.c: Don't get NoExpose/GraphicsExpose events. 2006-08-05 19:05 joewing * [r280] /src/tray.c: Never warp the mouse when a tray is shown. 2006-08-05 16:11 joewing * [r279] /src/client.c: Don't propagate uneeded events. 2006-08-05 07:39 joewing * [r278] /src/client.c, /src/cursor.c, /src/cursor.h, /src/dock.c, /src/event.c, /src/main.c, /src/menu.c, /src/move.c, /src/popup.c, /src/tray.c: Fix some mouse event handling. 2006-08-01 00:39 joewing * [r277] /src/event.c, /src/place.c, /src/place.h, /src/resize.c: Placement and resize fixes. 2006-08-01 00:04 joewing * [r276] /src/place.c, /todo.txt: Improve aspect ratio resizing. 2006-07-30 04:27 joewing * [r275] /src/menu.c: Fix menu issue. 2006-07-30 04:14 joewing * [r274] /src/dock.c, /src/error.c, /src/event.c, /src/hint.c, /src/lex.c, /src/lex.h, /src/misc.c, /src/parse.c: cleanups 2006-07-29 03:47 joewing * [r273] /src/clock.c, /src/color.c, /src/command.c, /src/confirm.c, /src/desktop.c, /src/font.c, /src/group.c, /src/icon.c, /src/image.c, /src/key.c, /src/lex.c, /src/main.c, /src/parse.c, /src/popup.c, /src/root.c, /src/swallow.c: Remove some redundant code. 2006-07-29 03:07 joewing * [r272] /src/client.c, /src/desktop.c, /todo.txt: Preserve the shaded status when minimizing. 2006-07-29 02:56 joewing * [r271] /src/client.c, /todo.txt: Fix a bug in raising shaded windows from a task list. 2006-07-29 02:39 joewing * [r270] /src/event.c, /todo.txt: Add the ability to move a window with alt+click. 2006-07-28 05:01 joewing * [r269] /src/clock.c, /src/clock.h, /src/main.c, /src/popup.c, /src/popup.h, /src/taskbar.c, /src/taskbar.h, /src/tray.c, /src/tray.h, /src/traybutton.c, /src/traybutton.h: Fix some mouse issues 2006-07-28 03:54 joewing * [r268] /src/event.c: Fix a mouse tracking issue. 2006-07-23 02:01 joewing * [r267] /src/button.c, /src/client.c, /src/event.c, /src/main.c: Fix some stuff 2006-07-22 22:36 joewing * [r266] /src/client.c, /src/event.c, /src/place.c: Cleanups 2006-07-22 22:28 joewing * [r265] /src/move.c, /src/resize.c: Fix some move stuff. 2006-07-22 22:02 joewing * [r264] /src/button.c, /src/button.h, /src/command.c, /src/main.c, /src/menu.c: Fix some button/menu stuff. 2006-07-22 01:10 joewing * [r263] /src/cursor.c, /src/cursor.h, /src/event.c, /src/menu.c, /src/move.c, /src/resize.c, /src/tray.c: Fix some mouse issues. 2006-07-21 23:53 joewing * [r262] /config.h.in, /configure.in, /example.jwmrc, /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, /src/button.h, /src/client.c, /src/command.c, /src/command.h, /src/confirm.c, /src/cursor.c, /src/cursor.h, /src/debug.h, /src/dock.c, /src/event.c, /src/font.c, /src/hint.c, /src/icon.c, /src/lex.c, /src/lex.h, /src/main.c, /src/menu.c, /src/parse.c, /src/place.c, /src/place.h, /src/taskbar.c, /src/theme.c, /src/theme.h, /src/traybutton.c, /src/winmenu.c, /todo.txt: Some stuff. 2006-07-01 22:17 joewing * [r261] /config.h.in, /configure.in, /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, /src/button.h, /src/client.c, /src/clock.c, /src/color.c, /src/color.h, /src/confirm.c, /src/debug.h, /src/dock.c, /src/event.c, /src/font.c, /src/hint.c, /src/icon.c, /src/image.c, /src/image.h, /src/jwm.h, /src/jxlib.h, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/misc.c, /src/misc.h, /src/move.c, /src/parse.c, /src/place.c, /src/place.h, /src/resize.c, /src/status.c, /src/taskbar.c, /src/theme.c, /src/theme.h, /src/tray.c, /src/tray.h, /src/traybutton.c, /todo.txt: Undo theme changes. 2006-05-11 00:45 joewing * [r260] /src/border.c, /src/button.c, /src/icon.c, /src/menu.c, /src/status.c, /src/theme.c, /src/theme.h, /src/tray.c: More theme updates. 2006-05-09 04:55 joewing * [r259] /src/border.c: Fix shaped window issues. 2006-05-09 03:23 joewing * [r258] /src/border.c, /src/border.h, /src/clock.c, /src/color.c, /src/color.h, /src/parse.c, /src/status.c: Some cleanups. 2006-05-09 02:37 joewing * [r257] /src/clock.c, /src/confirm.c, /src/taskbar.c, /src/theme.c, /src/theme.h, /src/tray.c, /src/tray.h: Pretty some things up. 2006-05-09 01:25 joewing * [r256] /config.h.in, /configure.in, /src/debug.h, /src/dock.c, /src/font.c, /src/hint.c, /src/icon.c, /src/jwm.h, /src/lex.c, /src/taskbar.c, /src/theme.c: Use the stack if possible in some places. 2006-05-08 03:17 joewing * [r255] /configure.in, /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, /src/button.h, /src/client.c, /src/confirm.c, /src/event.c, /src/hint.c, /src/icon.c, /src/image.c, /src/image.h, /src/jxlib.h, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/misc.c, /src/misc.h, /src/move.c, /src/parse.c, /src/place.c, /src/place.h, /src/resize.c, /src/taskbar.c, /src/theme.c, /src/theme.h, /src/tray.c, /src/traybutton.c, /todo.txt: Theme support. 2006-04-26 02:07 joewing * [r254] /configure.in: Change to 1.7. 2006-04-26 01:57 joewing * [r253] /src/clock.c, /src/move.c, /src/tray.c, /src/tray.h, /todo.txt: Some fixes. 2006-04-23 04:15 joewing * [r252] /src/clock.c, /todo.txt: Don't draw the clock every second if not needed. 2006-04-23 04:06 joewing * [r251] /src/border.c, /src/border.h, /src/event.c, /todo.txt: Make left click on window icons show the window menu. 2006-04-23 03:58 joewing * [r250] /src/move.c, /src/resize.c, /todo.txt: Un-maximize windows on move and resize. 2006-04-23 03:43 joewing * [r249] /src/menu.c, /todo.txt: Support for menus that are too big for the screen. 2006-04-19 04:40 joewing * [r248] /README: Updated README 2006-04-19 04:29 joewing * [r247] /src/menu.c, /src/taskbar.c, /todo.txt: Minimized item updates and menu handling work. 2006-04-19 03:13 joewing * [r246] /todo.txt: Updated todo. 2006-04-19 03:12 joewing * [r245] /src/border.c: New window buttons! 2006-04-19 03:01 joewing * [r244] /config.h.in, /configure.in: Some changes to make aCC work. 2006-04-19 02:52 joewing * [r243] /config.h.in, /configure.in: Yet more configure changes. 2006-04-19 02:47 joewing * [r242] /config.h.in, /configure.in, /src/jwm.h: More configure updates. 2006-04-19 02:29 joewing * [r241] /configure.in: Updated configure. 2006-04-15 04:58 joewing * [r240] /config.h.in, /configure.in, /src/jwm.h: Fix build on HP-UX. 2006-04-09 00:20 joewing * [r239] /src/client.c, /src/client.h, /src/desktop.c, /src/event.c, /src/taskbar.c, /src/winmenu.c: Don't raise clients when reversing a showdesktop. 2006-04-09 00:05 joewing * [r238] /jwm.1.in, /src/client.c, /src/client.h, /src/desktop.c, /src/event.c, /todo.txt: Make a second click on a "showdesktop" button restore minimized windows. 2006-04-08 02:12 joewing * [r237] /src/event.c, /src/key.c, /src/parse.c, /src/taskbar.c, /src/taskbar.h, /todo.txt: New mouse bindings, fixed key mask bug. 2006-04-03 02:25 joewing * [r236] /jwm.1.in, /src/popup.c, /todo.txt: Change default delay to 600 ms, add a 3 px border. 2006-04-02 21:58 joewing * [r235] /src/move.c: Fix a bug with snap-to-screen. 2006-04-02 21:49 joewing * [r234] /src/clock.c, /todo.txt: Fix a bug involving maximized windows and the clock. 2006-04-02 19:56 joewing * [r233] /src/jxlib.h, /src/key.c, /todo.txt: Fix a key binding issue with keycode. 2006-03-28 02:21 joewing * [r232] /src/client.c: Fix some issues with shaded windows. 2006-03-21 04:58 joewing * [r231] /src/confirm.c, /src/move.c, /src/place.c, /src/popup.c, /src/screen.c, /src/screen.h, /src/status.c, /src/taskbar.c, /src/traybutton.c: Changes to screen handling. 2006-03-19 03:06 joewing * [r230] /configure.in, /src/help.c: Update for 1.6. 2006-03-19 02:56 joewing * [r229] /src/key.c, /todo.txt: Fix keybinding issue on shutdown/restart. 2006-03-19 02:46 joewing * [r228] /src/menu.c: Fix menu behavior. 2006-03-19 02:39 joewing * [r227] /src/client.c, /src/winmenu.c: Fix confirm dialogs. 2006-03-19 02:30 joewing * [r226] /src/client.c, /src/clock.c, /src/confirm.c, /src/main.c, /src/timing.c, /src/timing.h: Clean some things. 2006-03-19 00:35 joewing * [r225] /src/client.c: Restack clients after unshade. 2006-03-18 20:08 joewing * [r224] /src/main.c: Fix a bug. 2006-03-18 07:52 joewing * [r223] /src/dock.c, /src/event.c, /src/event.h, /src/main.c, /src/menu.c, /src/swallow.c: Cleanups. 2006-03-18 06:57 joewing * [r222] /src/main.c, /src/swallow.c: Fix swallow. 2006-03-18 06:43 joewing * [r221] /todo.txt: Update todo too. 2006-03-18 06:42 joewing * [r220] /src/font.c: Fix FriBidi UTF conversion. 2006-03-18 06:26 joewing * [r219] /src/event.c, /src/swallow.c, /src/swallow.h, /todo.txt: Don't pause waiting for swallow items. 2006-03-18 04:23 joewing * [r218] /src/move.c: Another attempt to fix Xinerama. 2006-03-18 04:07 joewing * [r217] /src/dock.c, /todo.txt: Fix a bug related to removing Dock and restarting. 2006-03-16 05:12 joewing * [r216] /src/parse.c, /src/tray.c, /src/tray.h: Clean up some stuff. 2006-03-16 04:57 joewing * [r215] /todo.txt: Updated todo. 2006-03-16 04:43 joewing * [r214] /jwm.1.in, /src/move.c, /src/parse.c, /src/resize.c, /src/status.c, /src/status.h, /todo.txt: Add coordinates attribute to MoveMode and ResizeMode. 2006-03-16 03:07 joewing * [r213] /src/clock.c, /todo.txt: Make it possible to fix the width of the clock. 2006-03-16 02:28 joewing * [r212] /src/move.c, /todo.txt: Fix snap-to-screen with Xinerama. 2006-03-15 04:28 joewing * [r211] /src/client.c, /src/event.c: Fix. 2006-03-15 03:31 joewing * [r210] /src/client.c, /src/client.h, /todo.txt: Fix shading of shaped windows. 2006-03-15 03:21 joewing * [r209] /src/border.c: Remove unnecessary call. 2006-03-15 01:44 joewing * [r208] /src/place.c, /todo.txt: Fix a xinerama placement issue. 2006-03-14 03:46 joewing * [r207] /src/screen.c, /src/screen.h: Remove some unused stuff. 2006-03-14 03:41 joewing * [r206] /src/border.c, /src/event.c: Attempt to speed up border drawing. 2006-03-14 03:20 joewing * [r205] /src/debug.c, /src/event.c, /src/event.h, /src/menu.c, /src/move.c, /src/resize.c: Optimize some stuff. 2006-03-14 01:50 joewing * [r204] /src/client.c, /src/client.h, /src/event.c, /src/jxlib.h, /src/menu.c, /src/move.c, /src/place.c, /src/resize.c: MotionNotify handling changes. 2006-03-14 01:05 joewing * [r203] /src/border.c, /src/client.c, /src/client.h, /src/event.c, /src/hint.c, /src/taskbar.c, /todo.txt: Fix an ugly bug. 2006-03-13 05:56 joewing * [r202] /src/event.c: Remove unneeded shape event stuff. 2006-03-13 05:47 joewing * [r201] /src/event.c, /src/popup.c, /src/popup.h: Better popup handling. 2006-03-12 22:52 joewing * [r200] /config.h.in, /configure.in, /src/Makefile.in: More configure.in updates. 2006-03-12 22:43 joewing * [r199] /config.h.in, /configure.in: configure.in updates 2006-03-12 09:27 joewing * [r198] /jwm.1.in: Updated man page. 2006-03-12 06:13 joewing * [r197] /src/key.c, /todo.txt: Ignore caps/num lock. 2006-03-12 03:46 joewing * [r196] /todo.txt: updated todo. 2006-03-12 03:45 joewing * [r195] /src/client.c, /src/event.c: Fix a nasty shape extension bug. 2006-03-12 01:25 joewing * [r194] /configure.in: Fix XPM configure problem. 2006-03-12 01:18 joewing * [r193] /configure.in: more configure.in changes 2006-03-12 00:42 joewing * [r192] /configure.in, /src/Makefile.in, /src/help.c: Fix configure. 2006-03-11 23:12 joewing * [r191] /src/clock.c: Faster popup updates for Clock. 2006-03-11 23:03 joewing * [r190] /src/popup.c: Fix popup enabled on restart. 2006-03-11 23:01 joewing * [r189] /jwm.1.in, /src/clock.c, /src/parse.c, /src/popup.c, /src/popup.h, /src/taskbar.c, /src/traybutton.c, /todo.txt: Add "enabled" and "delay" PopupStyle attributes. 2006-03-11 22:28 joewing * [r188] /src/event.c, /src/move.c, /src/place.c, /src/tray.c, /src/tray.h, /todo.txt: Fix autohide issues. 2006-03-11 21:59 joewing * [r187] /src/clock.c, /src/tray.c, /todo.txt: Resize the clock as needed. 2006-03-11 21:22 joewing * [r186] /src/move.c: Make valgrind stop complaining. 2006-03-11 20:58 joewing * [r185] /src/icon.c, /src/move.c: Fix some stuff. 2006-03-11 20:39 joewing * [r184] /src/clock.c, /src/clock.h, /src/event.c, /src/parse.c, /src/popup.c, /src/popup.h, /src/taskbar.c, /src/taskbar.h, /src/timing.h, /src/tray.c, /src/traybutton.c, /src/traybutton.h, /todo.txt: Popups for TrayButtons. Resizing clock that doesn't work. 2006-03-11 08:13 joewing * [r183] /src/image.c, /todo.txt: Fix XPM issue. 2006-03-11 07:56 joewing * [r182] /src/color.c, /src/color.h: cleanups. 2006-03-11 03:45 joewing * [r181] /src/font.c: Fix a warning. 2006-03-11 03:43 joewing * [r180] /src/event.c, /src/place.c, /src/place.h, /todo.txt: Constrain client-requested resizes. 2006-03-11 03:22 joewing * [r179] /src/color.c, /src/color.h, /src/image.c: better colormap usage with xpms 2006-03-11 01:43 joewing * [r178] /src/color.c: Use the root colormap if necessary 2006-03-10 05:43 joewing * [r177] /src/color.c: Fix memory leak and color cell leak. 2006-03-10 05:33 joewing * [r176] /src/color.c: A try at colormaps. 2006-03-10 05:07 joewing * [r175] /src/color.c: Fix a warning. 2006-03-10 04:08 joewing * [r174] /src/font.c: Fix a warning. 2006-03-10 03:55 joewing * [r173] /src/color.c: Fix for 16 bit. 2006-03-10 03:42 joewing * [r172] /src/color.c, /src/jxlib.h: New color stuff again. 2006-03-09 05:16 joewing * [r171] /src/color.c: Much faster lookups 2006-03-09 04:44 joewing * [r170] /src/color.c: Try this... 2006-03-09 03:42 joewing * [r169] /src/event.c: bah.. 2006-03-09 01:44 joewing * [r168] /src/event.c: Opps, I guess we needed that. 2006-03-08 05:46 joewing * [r167] /src/color.c, /src/color.h, /src/image.c, /src/jxlib.h: Optimize XPM loading. 2006-03-08 05:23 joewing * [r166] /configure.in, /src/swallow.c: Fix some swallow stuff. 2006-03-08 05:08 joewing * [r165] /src/main.c: Dont' sync. 2006-03-08 04:59 joewing * [r164] /src/client.h, /src/hint.c: Remove unused field. 2006-03-08 04:58 joewing * [r163] /src/client.c, /src/client.h, /src/event.c, /src/hint.c: Fix X errors from killing clients. 2006-03-08 04:02 joewing * [r162] /src/font.c, /src/main.c, /src/place.c, /src/screen.c, /src/swallow.c: Fix a bug with fonts and lock the server during the swallow search. 2006-03-08 02:25 joewing * [r161] /src/place.c, /src/render.c, /src/screen.c: Speed up in render and some debug code for Xinerama. 2006-03-07 04:47 joewing * [r160] /src/color.c: A hack... but does it work? 2006-03-07 02:28 joewing * [r159] /src/color.c: Try yet again. 2006-03-07 02:14 joewing * [r158] /src/color.c: Try again... 2006-03-07 02:08 joewing * [r157] /src/color.c: Updated color hashing. 2006-03-06 15:10 joewing * [r156] /todo.txt: Updated todo. 2006-03-06 04:32 joewing * [r155] /src/taskbar.c: Fix a UMR. 2006-03-06 03:53 joewing * [r154] /config.h.in, /configure.in, /src/font.c, /src/jwm.h: First run at supporting right-to-left languages. 2006-03-05 22:39 joewing * [r153] /src/swallow.c, /todo.txt: ResizeRedirect instead of ConfigureNotify for swallow items. DestroyNotify -> 1 pixel swallow item. 2006-03-05 06:54 joewing * [r152] /src/key.c, /src/key.h, /src/parse.c, /todo.txt: Allow "keycode" instead of "key" to be specified for key bindings. 2006-03-05 06:29 joewing * [r151] /src/event.c: Don't complain about unhandled ConfigureNotify events. 2006-03-05 06:21 joewing * [r150] /src/event.c, /src/swallow.c, /todo.txt: Support for resizing of swallowed clients (lior2b). 2006-03-05 05:58 joewing * [r149] /src/font.c, /src/jxlib.h, /todo.txt: UTF-8 support. 2006-03-05 05:44 joewing * [r148] /jwm.1.in, /src/traybutton.c: Update man page and add "root" action to TrayButton to be explicit. 2006-03-05 05:37 joewing * [r147] /configure.in, /src/desktop.c, /src/desktop.h, /src/traybutton.c, /todo.txt: Added "showdesktop" to TrayButton. 2006-03-05 05:22 joewing * [r146] /configure.in, /src/pager.c, /src/parse.c: Fix an issue with menu includes. Slightly faster pager. 2006-02-09 02:11 joewing * [r145] /Makefile.in, /jwm.1.in, /src/parse.c, /src/tray.c, /src/tray.h, /todo.txt: Add valign and halign Tray attributes. 2006-02-06 01:33 joewing * [r144] /src/error.c, /todo.txt: Don't show X errors in debug mode. 2006-02-04 04:55 joewing * [r143] /src/jxlib.h, /src/key.c, /todo.txt: Fix a key binding issue on restart. 2006-02-04 04:39 joewing * [r142] /todo.txt: Update todo. 2006-02-04 04:39 joewing * [r141] /src/border.c, /src/client.c, /src/event.c, /src/main.c, /src/main.h, /src/move.c, /src/resize.c, /todo.txt: Support borderless windows with a titlebar. 2006-02-04 03:45 joewing * [r140] /src/swallow.c, /todo.txt: Make Swallow more sane when an error is encountered. 2006-02-04 03:38 joewing * [r139] /src/swallow.c, /todo.txt: Fixed swallow items getting more space than requested. 2006-02-04 03:36 joewing * [r138] /src/taskbar.c: Better positioning of task menus for vertical task bars. 2006-02-04 03:27 joewing * [r137] /src/parse.c, /todo.txt: Automatically detect tray layouts. 2006-02-04 03:16 joewing * [r136] /src/menu.c, /todo.txt: Make menu sizes specified in terms of the size of icons. 2006-02-04 03:05 joewing * [r135] /src/root.c, /src/root.h, /src/taskbar.c, /src/traybutton.c, /src/winmenu.c, /src/winmenu.h, /todo.txt: Make tray menus popup in more natural locations. 2006-01-16 03:32 joewing * [r134] /configure.in: Version bump to 1.4. 2006-01-16 03:31 joewing * [r133] /todo.txt: Update todo again. 2006-01-16 03:09 joewing * [r132] /todo.txt: Update todo. 2006-01-15 02:52 joewing * [r131] /jwm.1.in, /src/group.c, /src/group.h, /src/parse.c, /todo.txt: Add the maximized, minimized, and shaded group options. 2006-01-14 21:11 joewing * [r130] /src/parse.c: Fix pignore. 2006-01-14 21:05 joewing * [r129] /jwm.1.in, /src/client.h, /src/group.c, /src/group.h, /src/place.c, /todo.txt: Add "pignore" group option. 2006-01-14 20:43 joewing * [r128] /src/event.c, /src/hint.c, /src/hint.h, /todo.txt: More EWMH support. 2006-01-14 18:47 joewing * [r127] /src/dock.c, /src/main.c: Make dock work after restart. 2006-01-14 05:42 joewing * [r126] /src/confirm.c: Fix it really. 2006-01-14 05:39 joewing * [r125] /src/confirm.c, /src/swallow.c: Fix some resources not being freed. 2006-01-14 05:25 joewing * [r124] /src/debug.c: Fix a invalid access. 2006-01-14 02:51 joewing * [r123] /jwm.1.in: Update the man page. 2006-01-14 02:46 joewing * [r122] /src/border.c, /src/parse.c: Cut down the size a bit. 2006-01-13 03:51 joewing * [r121] /src/cursor.c, /src/cursor.h, /todo.txt: Remove unused function. 2006-01-11 01:44 joewing * [r120] /src/dock.c, /src/lex.c, /src/lex.h, /src/parse.c, /todo.txt: More descriptive configuration parsing error messages. 2006-01-10 06:05 joewing * [r119] /src/traybutton.c, /todo.txt: Center tray button text when no icon is present. 2006-01-10 05:58 joewing * [r118] /src/clock.c, /src/tray.c, /todo.txt: Fixed size computation of fixed-size trays. 2006-01-10 05:33 joewing * [r117] /src/taskbar.c, /src/tray.c, /todo.txt: Make vertical trays size-to-fit. 2006-01-10 04:56 joewing * [r116] /src/border.c: Make borders of small windows look better. 2006-01-10 04:51 joewing * [r115] /src/border.c, /todo.txt: Better handling of really small windows. 2006-01-10 04:17 joewing * [r114] /todo.txt: Updated todo. 2006-01-10 04:14 joewing * [r113] /configure.in, /todo.txt: Change the version number. 2006-01-10 04:04 joewing * [r112] /src/client.c, /src/main.c, /src/swallow.c: Fix some stuff. 2006-01-10 03:56 joewing * [r111] /src/dock.c, /src/dock.h, /src/event.c: Center dock items. 2006-01-10 02:16 joewing * [r110] /src/dock.c, /src/dock.h, /src/event.c, /src/taskbar.c, /todo.txt: Use TaskListStyle instead of TrayButtonStyle for TaskLists. also more dock stuff that doesn't work. 2006-01-10 01:17 joewing * [r109] /src/traybutton.c, /todo.txt: Fix centering of tray button icons. 2006-01-09 05:35 joewing * [r108] /src/tray.c, /src/tray.h: Fixes for variable-sized trays. 2006-01-09 05:17 joewing * [r107] /src/client.c, /src/clock.c, /src/dock.c, /src/dock.h, /src/event.c, /src/parse.c, /src/swallow.c, /src/taskbar.c, /src/tray.c, /src/tray.h, /src/traybutton.c: Updates to docking support. 2006-01-08 10:06 joewing * [r106] /src/Makefile.in, /src/dock.c, /src/dock.h, /src/event.c, /src/hint.c, /src/hint.h, /src/jxlib.h, /src/lex.c, /src/lex.h, /src/main.c, /src/parse.c, /src/popup.c, /src/swallow.c, /todo.txt: Add docking support. 2006-01-08 06:22 joewing * [r105] /src/event.c: Add a function for _NET_WM_STATE 2006-01-08 06:00 joewing * [r104] /src/event.c, /src/hint.c, /src/hint.h, /src/place.c, /src/place.h, /todo.txt: Add support for _NET_MOVERESIZE_WINDOW 2006-01-08 01:42 joewing * [r103] /src/client.c, /src/event.c, /src/hint.c, /src/hint.h, /src/place.c, /src/place.h, /src/taskbar.c, /src/taskbar.h, /todo.txt: Add support for _NET_WM_STRUT_PARTIAL, _NET_WM_STRUT, _NET_CLIENT_LIST, and _NET_CLIENT_LIST_STACKING 2006-01-02 03:05 joewing * [r102] /src/event.c, /src/event.h, /src/swallow.c, /todo.txt: Fix a problem with swallowing some programs. 2006-01-02 02:01 joewing * [r101] /src/client.c, /src/client.h, /src/swallow.c, /todo.txt: Send WM_DELETE_WINDOW to swallowed clients before exiting. 2006-01-02 00:50 joewing * [r100] /src/resize.c, /todo.txt: Fix resize when resizing a window that specifies and aspect ratio. 2006-01-01 21:36 joewing * [r99] /config.h.in, /configure.in, /src/border.c, /src/client.c, /src/client.h, /src/clock.c, /src/color.c, /src/confirm.c, /src/confirm.h, /src/debug.c, /src/debug.h, /src/desktop.c, /src/desktop.h, /src/error.c, /src/event.c, /src/group.c, /src/hint.c, /src/icon.c, /src/image.c, /src/key.c, /src/lex.c, /src/main.c, /src/main.h, /src/match.c, /src/menu.c, /src/menu.h, /src/misc.c, /src/pager.c, /src/parse.c, /src/place.c, /src/popup.c, /src/render.c, /src/swallow.c, /src/winmenu.c, /todo.txt: Updates to configure.in to check if _XOPEN_SOURCE can safely be used. Fix some compiler warnings. Grab keys for trays. Fix a potential issue with bad PNG icons. Improved loading of swallowed clients. Don't use alpha blending for icons on color depths less than 24 bits. 2005-11-21 03:56 joewing * [r98] /example.jwmrc: Updated example configuration. 2005-11-21 03:54 joewing * [r97] /jwm.1.in, /src/event.c, /src/key.c, /src/key.h, /src/parse.c, /src/taskbar.c, /src/taskbar.h, /todo.txt: Add "nextstacked" key binding. 2005-11-21 03:02 joewing * [r96] /jwm.1.in, /src/clock.c, /src/clock.h, /src/main.c, /src/parse.c, /src/traybutton.c, /src/traybutton.h: Updated man page. Better TrayButton sizing. 2005-11-20 02:36 joewing * [r95] /src/clock.c, /src/font.c: Fix font inheritance for tray items and clock font/color. 2005-11-20 02:29 joewing * [r94] /src/icon.c: Sanity check for icon resizing. 2005-11-20 02:18 joewing * [r93] /src/icon.c, /todo.txt: Preserve icon aspect ratios. 2005-11-20 01:59 joewing * [r92] /src/clock.c, /src/main.c, /src/pager.c, /src/swallow.c, /src/taskbar.c, /src/tray.c, /src/traybutton.c: Fix memory leaks on jwm -p 2005-11-20 00:08 joewing * [r91] /src/clock.c, /src/color.c, /src/color.h, /src/cursor.h, /src/font.h, /src/lex.c, /src/lex.h, /src/misc.c, /src/misc.h, /src/parse.c, /src/taskbar.c, /src/traybutton.c, /todo.txt: More style stuff. 2005-11-18 03:22 joewing * [r90] /src/clock.c, /src/misc.c, /src/misc.h: Trim the time popup string. 2005-11-18 02:40 joewing * [r89] /src/jwm.h: add sys/select.h include. 2005-11-17 02:50 joewing * [r88] /src/Makefile.in, /src/clock.c, /src/clock.h, /src/event.c, /src/lex.c, /src/lex.h, /src/main.c, /src/parse.c, /src/timing.c, /src/timing.h, /src/tray.c, /todo.txt: Added Clock. 2005-11-17 01:33 joewing * [r87] /src/traybutton.c, /todo.txt: Add button border to TrayButtons. 2005-11-16 04:35 joewing * [r86] /src/cursor.h, /src/lex.c, /src/lex.h, /src/parse.c: Preparations for mouse bindings. 2005-11-15 04:12 joewing * [r85] /Makefile.in, /configure.in, /src/Makefile.in: Update version number. Fix make install. 2005-11-15 03:49 joewing * [r84] /src/client.c, /todo.txt: Fixed minimization on restart. 2005-11-15 03:19 joewing * [r83] /src/taskbar.c, /todo.txt: Fix task list overflow. 2005-11-13 20:22 joewing * [r82] /example.jwmrc: Updated example configuration. 2005-11-13 20:20 joewing * [r81] /jwm.1.in, /src/event.c, /src/event.h, /src/parse.c: Chnage RootMenu onroot behaviour. Update man page. 2005-11-13 18:41 joewing * [r80] /jwm.1.in: man page updates. 2005-11-13 18:27 joewing * [r79] /src/color.c, /src/desktop.c, /src/font.c, /src/parse.c, /src/taskbar.c, /src/taskbar.h: Fix some configuration stuff. 2005-11-13 02:43 joewing * [r78] /jwm.1.in: Update man page. 2005-11-13 02:17 joewing * [r77] /example.jwmrc: Updated example configuration. 2005-11-13 02:01 joewing * [r76] /configure.in, /jwm.1.in, /src/hint.h, /src/tray.c: Change to v1.0, update man page. Fix style issues. 2005-11-12 20:20 joewing * [r75] /src/hint.c: Fix frame extents hint. 2005-11-12 19:26 joewing * [r74] /src/icon.h: Fix problem with no icons. 2005-11-12 19:14 joewing * [r73] /src/client.c: bah 2005-11-12 19:13 joewing * [r72] /src/client.c, /src/confirm.c: Fix confirm stuff. 2005-11-12 19:01 joewing * [r71] /src/parse.c, /src/traybutton.c, /src/traybutton.h: Add label attribute to TrayButton. 2005-11-12 18:02 joewing * [r70] /example.jwmrc, /src/client.c, /src/place.c, /src/place.h, /todo.txt: Fix maximization. 2005-11-12 07:51 joewing * [r69] /src/main.c: Startup desktops before hints. 2005-11-12 06:54 joewing * [r68] /src/Makefile.in, /src/client.c, /src/main.c, /src/place.c, /src/place.h, /src/screen.c, /src/screen.h, /todo.txt: Improved window placement. 2005-11-12 05:10 joewing * [r67] /src/event.c, /src/parse.c, /todo.txt: Fix key actions with click-to-focus. Add desktops menu item icon attribute. 2005-11-12 04:53 joewing * [r66] /src/desktop.c, /src/desktop.h, /src/menu.c, /src/parse.c, /src/root.c, /src/winmenu.c, /todo.txt: Added "Desktops" root menu item. 2005-11-12 03:47 joewing * [r65] /src/client.c, /src/desktop.c, /src/desktop.h, /src/hint.c, /src/hint.h, /src/lex.c, /src/lex.h, /src/main.c, /src/menu.c, /src/menu.h, /src/parse.c, /src/root.c, /src/winmenu.c: Desktop names. Active next when when the active window closes. 2005-11-10 04:56 joewing * [r64] /todo.txt: ... and the todo 2005-11-10 04:55 joewing * [r63] /src/menu.c: Fix menu issue. 2005-11-10 03:39 joewing * [r62] /src/parse.c: Make menu includes actually work. 2005-11-10 03:25 joewing * [r61] /src/parse.c, /todo.txt: Menu includes. 2005-11-10 01:58 joewing * [r60] /todo.txt: todo too. 2005-11-10 01:58 joewing * [r59] /src/hint.c, /src/hint.h: More EWMH stuff. 2005-11-10 01:18 joewing * [r58] /src/client.c, /src/event.c, /src/main.c, /todo.txt: Send ClientMessage instead of PropertyNotify for _JWM_EXIT and _JWM_RESTART 2005-11-07 06:05 joewing * [r57] /src/client.c, /src/hint.c: Write _NET_WM_STATE to _NET_WM_STATE instead of WM_STATE! 2005-11-07 06:00 joewing * [r56] /src/client.c, /src/client.h, /src/event.c, /src/hint.c, /src/hint.h, /todo.txt: More fixes. 2005-11-06 16:08 joewing * [r55] /src/border.c, /src/client.c, /src/client.h, /src/desktop.c, /src/event.c, /src/group.c, /src/hint.c, /src/hint.h, /src/move.c, /src/pager.c, /src/resize.c, /src/taskbar.c, /src/winmenu.c: Hint updates. 2005-10-30 18:00 joewing * [r54] /src/client.c, /src/event.c, /src/hint.c, /src/hint.h, /src/icon.c, /src/image.c, /src/render.c: Fix _NET_WM_DESKTOP for 64-bits. 2005-10-30 17:19 joewing * [r53] /Makefile.in, /src/Makefile.in, /src/font.c: Add "make depend" 2005-10-30 17:01 joewing * [r52] /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, /src/button.h, /src/client.c, /src/client.h, /src/color.c, /src/color.h, /src/command.c, /src/confirm.c, /src/const.h, /src/cursor.c, /src/cursor.h, /src/desktop.c, /src/enum.h, /src/error.c, /src/event.c, /src/font.c, /src/font.h, /src/global.c, /src/global.h, /src/group.c, /src/group.h, /src/help.c, /src/hint.c, /src/hint.h, /src/icon.c, /src/icon.h, /src/image.c, /src/image.h, /src/jwm.h, /src/key.c, /src/key.h, /src/lex.c, /src/lex.h, /src/main.c, /src/main.h, /src/menu.c, /src/menu.h, /src/move.c, /src/move.h, /src/outline.c, /src/pager.c, /src/pager.h, /src/parse.c, /src/popup.c, /src/render.c, /src/render.h, /src/resize.c, /src/resize.h, /src/root.c, /src/root.h, /src/screen.c, /src/status.c, /src/struct.h, /src/swallow.c, /src/swallow.h, /src/taskbar.c, /src/taskbar.h, /src/timing.c, /src/timing.h, /src/tray.c, /src/tray.h, /src/traybutton.c, /src/traybutton.h, /src/winmenu.c, /src/winmenu.h: Clean up the build. 2005-10-30 15:04 joewing * [r51] /src/client.c, /src/confirm.c, /src/icon.c, /src/image.c, /src/render.c, /todo.txt: Update todo. Cast image stuff correctly. Make confirm dialogs use menu colors and font. 2005-10-28 02:26 joewing * [r50] /src/icon.c: Don't add unnamed icons to the icon hash. 2005-10-28 02:07 joewing * [r49] /src/client.c, /src/color.c, /src/color.h, /src/hint.c, /src/icon.c, /src/image.c, /src/render.c, /src/struct.h, /src/swallow.c, /todo.txt: Fix PNG byte order issues. 2005-10-27 03:08 joewing * [r48] /src/winmenu.c, /todo.txt: Added window menu separator. 2005-10-27 01:18 joewing * [r47] /src/hint.c: Fix type-size issues. 2005-10-27 00:55 joewing * [r46] /example.jwmrc, /src/client.c, /todo.txt: Fix lockups when restoring transients. 2005-10-25 03:11 joewing * [r45] /src/color.c, /src/color.h, /src/hint.c, /src/hint.h, /src/icon.c, /src/image.c, /src/image.h, /todo.txt: Fix for 64-bit X-server issues. 2005-10-24 05:43 joewing * [r44] /todo.txt: Update todo. 2005-10-23 20:35 joewing * [r43] /src/cursor.c, /src/cursor.h, /src/jxlib.h, /src/menu.c, /src/tray.c: Restore tray autohide. 2005-10-21 03:27 joewing * [r42] /README, /config.h.in, /configure.in, /src/Makefile.in, /src/client.c, /src/event.c, /src/menu.c, /src/popup.c, /src/struct.h, /src/taskbar.c, /src/taskbar.h, /src/timing.c, /src/tray.c: Make popups work again. 2005-10-16 18:06 joewing * [r41] /src/client.c, /src/jxlib.h, /src/parse.c, /src/swallow.c, /src/traybutton.c, /src/traybutton.h: More fixes. Added "action" option to tray button. 2005-10-16 15:01 joewing * [r40] /src/border.c, /src/icon.c, /src/icon.h, /src/menu.c, /src/render.c, /src/render.h, /src/struct.h, /src/taskbar.c, /src/traybutton.c: More appearance fixes. 2005-10-14 02:40 joewing * [r39] /src/enum.h, /src/lex.c, /src/main.c, /src/pager.c, /src/parse.c, /src/render.c, /src/swallow.c, /src/swallow.h, /src/tray.c, /src/traybutton.c, /src/traybutton.h: Vertical pagers and tray buttons. 2005-10-13 23:54 joewing * [r38] /src/client.c, /src/event.c, /src/swallow.c, /src/swallow.h: Handle destroyed swallow clients. 2005-10-13 04:54 joewing * [r37] /src/icon.c: Fix scaling of non-render icons. 2005-10-13 04:25 joewing * [r36] /src/main.c, /src/taskbar.c, /src/tray.c: Fix some drawing issues. 2005-10-13 04:18 joewing * [r35] /src/Makefile.in, /src/jwm.h, /src/main.c, /src/pager.c, /src/struct.h, /src/swallow.c, /src/taskbar.c, /src/tray.c, /src/tray.h, /src/traybutton.c, /src/traybutton.h: Improve tray callback stuff. 2005-10-12 04:41 joewing * [r34] /src/client.c, /src/swallow.c, /src/taskbar.c, /src/tray.c: Pixel fixes. 2005-10-12 04:24 joewing * [r33] /src/client.c, /src/pager.c, /src/swallow.c, /src/tray.c: Fix placement issues and tray sizing issues. 2005-10-12 03:43 joewing * [r32] /src/tray.c: Make tray location depend on size for negative location values. 2005-10-12 03:30 joewing * [r31] /src/client.c, /src/const.h, /src/hint.c, /src/jxlib.h, /src/move.c, /src/pager.c, /src/pager.h, /src/parse.c, /src/struct.h, /src/swallow.c, /src/taskbar.c, /src/taskbar.h, /src/tray.c, /src/tray.h: More tray border support, placement updates... 2005-10-12 00:19 joewing * [r30] /src/client.c, /src/jxlib.h, /src/parse.c, /src/swallow.c, /src/swallow.h, /src/taskbar.c, /src/tray.c, /src/tray.h: More tray changes. 2005-10-11 02:03 joewing * [r29] /src/Makefile.in, /src/border.c, /src/button.c, /src/client.c, /src/color.c, /src/confirm.c, /src/const.h, /src/debug.c, /src/desktop.c, /src/desktop.h, /src/enum.h, /src/event.c, /src/global.c, /src/global.h, /src/group.c, /src/hint.c, /src/icon.c, /src/icon.h, /src/image.c, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/lex.c, /src/load.c, /src/load.h, /src/main.c, /src/menu.c, /src/move.c, /src/os, /src/pager.c, /src/pager.h, /src/parse.c, /src/popup.c, /src/render.c, /src/render.h, /src/struct.h, /src/swallow.c, /src/swallow.h, /src/taskbar.c, /src/taskbar.h, /src/timing.c, /src/timing.h, /src/tray.c, /src/tray.h: Major tray changes. Still much work to do. 2005-10-08 00:59 joewing * [r28] /todo.txt: Update todo too. 2005-10-08 00:58 joewing * [r27] /src/client.c, /src/resize.c: Made resizing of large windows a little more sane. 2005-10-08 00:37 joewing * [r26] /src/icon.c, /src/image.c, /src/main.c, /src/render.c: Fix image loading issues. 2005-10-04 04:00 joewing * [r25] /src/load.c, /todo.txt: Fix off-by-one drawing the load. 2005-10-04 03:40 joewing * [r24] /src/status.c, /todo.txt: Make status windows show on the screen with the mouse. 2005-10-04 03:28 joewing * [r23] /src/main.c, /todo.txt: Flush X connection before closing it. 2005-10-04 03:25 joewing * [r22] /configure.in, /example.jwmrc, /src/command.c, /src/debug.c, /src/font.c, /src/icon.c, /src/icon.h, /src/image.c, /src/image.h, /src/jxlib.h, /src/main.c, /src/render.c, /src/render.h, /src/struct.h, /src/tray.c, /src/winmenu.c: Icon and render fixes. 2005-10-01 21:49 joewing * [r21] /config.h.in, /configure.in, /src/Makefile.in, /src/border.c, /src/border.h, /src/client.c, /src/debug.c, /src/group.c, /src/help.c, /src/icon.c, /src/icon.h, /src/image.c, /src/image.h, /src/jwm.h, /src/jxlib.h, /src/main.c, /src/menu.c, /src/parse.c, /src/render.c, /src/render.h, /src/struct.h, /src/tray.c, /src/tray.h, /todo.txt: Added PNG and XRender support. 2005-09-27 02:32 joewing * [r20] /example.jwmrc, /src/border.c, /src/font.c, /src/jxlib.h: XFT fixes 2005-09-25 17:30 joewing * [r19] /src/border.c, /src/help.c, /todo.txt: Double buffer borders. 2005-09-25 10:05 joewing * [r18] /config.h.in, /configure.in, /example.jwmrc, /jwm.1.in, /src/border.c, /src/button.c, /src/color.c, /src/color.h, /src/confirm.c, /src/enum.h, /src/font.c, /src/font.h, /src/jwm.h, /src/jxlib.h, /src/main.c, /src/menu.c, /src/parse.c, /src/popup.c, /src/status.c, /src/tray.c, /todo.txt: Use Xft for antialiasing. 2005-09-25 01:53 joewing * [r17] /src/client.c, /src/color.c, /src/color.h, /src/font.c, /src/icon.c, /src/move.c, /todo.txt: Fix a bug related to loading icons and fixes for colors on 64-bit X Servers. 2005-09-25 00:39 joewing * [r16] /jwm.1.in, /src/pager.c, /src/pager.h, /src/parse.c, /todo.txt: Add the option to enable or disable the pager. 2005-09-23 01:48 joewing * [r15] /todo.txt: typo 2005-09-23 01:30 joewing * [r14] /todo.txt: Another todo. 2005-09-23 01:28 joewing * [r13] /example.jwmrc: New example.jwmrc 2005-09-23 01:15 joewing * [r12] /jwm.1.in, /src/client.c, /src/enum.h, /src/main.c, /src/parse.c, /src/tray.c, /src/tray.h, /todo.txt: Add the "layer" attribute to Tray and update the man page. 2005-09-23 00:52 joewing * [r11] /todo.txt: Forgot the todo... 2005-09-23 00:51 joewing * [r10] /src/client.c, /src/enum.h, /src/group.c, /src/parse.c: Add border, noborder, title, and notitle to Group. 2005-09-23 00:14 joewing * [r9] /README: Add Xinerama comment to the README 2005-09-21 01:41 joewing * [r8] /jwm.1.in, /todo.txt: More todos and an update to the man page. 2005-09-21 01:32 joewing * [r7] /src/load.c, /src/load.h, /src/parse.c, /src/timing.c, /src/timing.h, /src/tray.c, /todo.txt: Added "enabled" option to Load and Clock. 2005-09-21 00:55 joewing * [r6] /todo.txt: Add todo's to todo.txt. 2005-09-16 01:53 joewing * [r5] /src/button.c, /src/confirm.c, /todo.txt: Fix color bugs. 2005-09-14 01:51 joewing * [r4] /Makefile.in, /src/client.c, /src/help.c, /src/help.h, /src/tray.c, /todo.txt: Fixed off-by-one pixel error with tray. Added "tarball" option to make. Made help display version information. Hopefully fixed a bug with mouse clicks propagating where they shouldn't. 2005-09-05 19:03 joewing * [r3] /package, /package/irix, /package/irix/Makefile.in, /package/irix/jwm.idb.in, /package/irix/jwm.spec.in, /package/slackware, /package/slackware/Makefile.in, /package/slackware/slack-desc.in, /package/slackware/slackware.jwmrc, /package/solaris, /package/solaris/Makefile.in, /package/solaris/pkginfo.in, /package/solaris/prototype.in, /package/solaris/solaris.jwmrc: Add package 2005-09-05 19:01 joewing * [r2] /LICENSE, /Makefile.in, /README, /config.h.in, /configure.in, /example.jwmrc, /jwm.1.in, /jwm1.in, /src, /src/Makefile.in, /src/border.c, /src/border.h, /src/button.c, /src/button.h, /src/client.c, /src/client.h, /src/color.c, /src/color.h, /src/command.c, /src/command.h, /src/confirm.c, /src/confirm.h, /src/const.h, /src/cursor.c, /src/cursor.h, /src/debug.c, /src/debug.h, /src/enum.h, /src/error.c, /src/error.h, /src/event.c, /src/event.h, /src/font.c, /src/font.h, /src/global.c, /src/global.h, /src/group.c, /src/group.h, /src/help.c, /src/help.h, /src/hint.c, /src/hint.h, /src/icon.c, /src/icon.h, /src/jwm.h, /src/jxlib.h, /src/key.c, /src/key.h, /src/lex.c, /src/lex.h, /src/load.c, /src/load.h, /src/main.c, /src/main.h, /src/match.c, /src/match.h, /src/menu.c, /src/menu.h, /src/misc.c, /src/misc.h, /src/move.c, /src/move.h, /src/os, /src/os/darwin.c, /src/os/irix.c, /src/os/irix64.c, /src/os/linux.c, /src/os/os.h, /src/os/sunos.c, /src/os/unsupported.c, /src/outline.c, /src/outline.h, /src/pager.c, /src/pager.h, /src/parse.c, /src/parse.h, /src/popup.c, /src/popup.h, /src/resize.c, /src/resize.h, /src/root.c, /src/root.h, /src/screen.c, /src/screen.h, /src/status.c, /src/status.h, /src/struct.h, /src/timing.c, /src/timing.h, /src/tray.c, /src/tray.h, /src/winmenu.c, /src/winmenu.h, /src/x.xpm, /todo.txt: Initial check-in 2005-09-05 18:57 joewing * [r1] /jwm1.in: Test import jwm-2.1.0+svn579/config.guess0000644000000000000000000012753411710374020014400 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # 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 Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: jwm-2.1.0+svn579/ABOUT-NLS0000644000000000000000000026713311710374020013312 0ustar rootroot1 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. jwm-2.1.0+svn579/aclocal.m40000644000000000000000000026024611710374020013721 0ustar rootroot# gettext.m4 serial 63 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2006, 2008-2010. dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The dnl default (if it is not specified or empty) is 'no-libtool'. dnl INTLSYMBOL should be 'external' for packages with no intl directory, dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is dnl 'need-formatstring-macros', then GNU gettext implementations that don't dnl support the ISO C 99 formatstring macros will be ignored. dnl INTLDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT ])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], ifelse([$1], [external], ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), [yes])) define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) AC_REQUIRE([AM_PO_SUBDIRS])dnl ifelse(gt_included_intl, yes, [ AC_REQUIRE([AM_INTL_SUBDIR])dnl ]) dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Sometimes libintl requires libiconv, so first search for libiconv. dnl Ideally we would do this search only after the dnl if test "$USE_NLS" = "yes"; then dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT dnl the configure script would need to contain the same shell code dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. gt_INTL_MACOSX dnl Set USE_NLS. AC_REQUIRE([AM_NLS]) ifelse(gt_included_intl, yes, [ BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no ]) LIBINTL= LTLIBINTL= POSUB= dnl Add a version number to the cache macros. case " $gt_needs " in *" need-formatstring-macros "*) gt_api_version=3 ;; *" need-ngettext "*) gt_api_version=2 ;; *) gt_api_version=1 ;; esac gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then ]) dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. if test $gt_api_version -ge 3; then gt_revision_test_code=' #ifndef __GNU_GETTEXT_SUPPORTED_REVISION #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) #endif changequote(,)dnl typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; changequote([,])dnl ' else gt_revision_test_code= fi if test $gt_api_version -ge 2; then gt_expression_test_code=' + * ngettext ("", "", 0)' else gt_expression_test_code= fi AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], [AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings;], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then dnl Sometimes libintl requires libiconv, so first search for libiconv. ifelse(gt_included_intl, yes, , [ AM_ICONV_LINK ]) dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) dnl because that would add "-liconv" to LIBINTL and LTLIBINTL dnl even if libiconv doesn't exist. AC_LIB_LINKFLAGS_BODY([intl]) AC_CACHE_CHECK([for GNU gettext in libintl], [$gt_func_gnugettext_libintl], [gt_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $INCINTL" gt_save_LIBS="$LIBS" LIBS="$LIBS $LIBINTL" dnl Now see whether libintl exists and does not depend on libiconv. AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) dnl Now see whether libintl exists and depends on libiconv. if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include $gt_revision_test_code extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *);], [bindtextdomain ("", ""); return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" eval "$gt_func_gnugettext_libintl=yes" ]) fi CPPFLAGS="$gt_save_CPPFLAGS" LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ && test "$PACKAGE" != gettext-runtime \ && test "$PACKAGE" != gettext-tools; }; then gt_use_preinstalled_gnugettext=yes else dnl Reset the values set by searching for libintl. LIBINTL= LTLIBINTL= INCINTL= fi ifelse(gt_included_intl, yes, [ if test "$gt_use_preinstalled_gnugettext" != "yes"; then dnl GNU gettext is not found in the C library. dnl Fall back on included GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi CATOBJEXT= if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions to use GNU gettext tools. CATOBJEXT=.gmo fi ]) if test -n "$INTL_MACOSX_LIBS"; then if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Some extra flags are needed during linking. LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" fi fi if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else USE_NLS=no fi fi AC_MSG_CHECKING([whether to use NLS]) AC_MSG_RESULT([$USE_NLS]) if test "$USE_NLS" = "yes"; then AC_MSG_CHECKING([where the gettext function comes from]) if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then gt_source="external libintl" else gt_source="libc" fi else gt_source="included intl directory" fi AC_MSG_RESULT([$gt_source]) fi if test "$USE_NLS" = "yes"; then if test "$gt_use_preinstalled_gnugettext" = "yes"; then if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then AC_MSG_CHECKING([how to link with libintl]) AC_MSG_RESULT([$LIBINTL]) AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) fi dnl For backward compatibility. Some packages may be using this. AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi dnl We need to process the po/ directory. POSUB=po fi ifelse(gt_included_intl, yes, [ dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then BUILD_INCLUDED_LIBINTL=yes fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST([DATADIRNAME]) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST([INSTOBJEXT]) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST([GENCAT]) dnl For backward compatibility. Some Makefiles may be using this. INTLOBJS= if test "$USE_INCLUDED_LIBINTL" = yes; then INTLOBJS="\$(GETTOBJS)" fi AC_SUBST([INTLOBJS]) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. INTLLIBS="$LIBINTL" AC_SUBST([INTLLIBS]) dnl Make all documented variables known to autoconf. AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) AC_SUBST([POSUB]) ]) dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. m4_define([gt_NEEDS_INIT], [ m4_divert_text([DEFAULTS], [gt_needs=]) m4_define([gt_NEEDS_INIT], []) ]) dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) AC_DEFUN([AM_GNU_GETTEXT_NEED], [ m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) ]) dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) # iconv.m4 serial 11 (gettext-0.18.1) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [am_cv_func_iconv=yes]) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], [am_cv_lib_iconv=yes] [am_cv_func_iconv=yes]) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_TRY_RUN([ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } /* Test against Solaris 10 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); if (cd_ascii_to_88591 != (iconv_t)(-1)) { static const char input[] = "\263"; char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_ascii_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST([LIBICONV]) AC_SUBST([LTLIBICONV]) ]) dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to dnl avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. dnl Otherwise aclocal's initial scan pass would miss the macro definition. dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. m4_define([gl_iconv_AC_DEFUN], m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], [[AC_DEFUN( [$1], [$2])]])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL([am_cv_proto_iconv], [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], [am_cv_proto_iconv_arg1=""], [am_cv_proto_iconv_arg1="const"]) am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], [Define as const if the declaration of iconv() needs const.]) fi ]) # lib-ld.m4 serial 4 (gettext-0.18) dnl Copyright (C) 1996-2003, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT([$LD]) else AC_MSG_RESULT([no]) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) # lib-link.m4 serial 21 (gettext-0.18) dnl Copyright (C) 2001-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ([2.54]) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[translit([$1],[./-], [___])]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes popdef([NAME]) popdef([Name]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode, [missing-message]) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. The missing-message dnl defaults to 'no' and may contain additional hints for the user. dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) pushdef([Name],[translit([$1],[./-], [___])]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" dnl If $LIB[]NAME contains some -l options, add it to the end of LIBS, dnl because these -l options might require -L options that are present in dnl LIBS. -l options benefit only from the -L options listed before it. dnl Otherwise, add it to the front of LIBS, because it may be a static dnl library that depends on another static library that is present in LIBS. dnl Static libraries benefit only from the static libraries listed after dnl it. case " $LIB[]NAME" in *" -l"*) LIBS="$LIBS $LIB[]NAME" ;; *) LIBS="$LIB[]NAME $LIBS" ;; esac AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])']) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) popdef([NAME]) popdef([Name]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], [acl_cv_rpath], [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_FROMPACKAGE(name, package) dnl declares that libname comes from the given package. The configure file dnl will then not have a --with-libname-prefix option but a dnl --with-package-prefix option. Several libraries can come from the same dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar dnl macro call that searches for libname. AC_DEFUN([AC_LIB_FROMPACKAGE], [ pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) define([acl_frompackage_]NAME, [$2]) popdef([NAME]) pushdef([PACK],[$2]) pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) define([acl_libsinpackage_]PACKUP, m4_ifdef([acl_libsinpackage_]PACKUP, [acl_libsinpackage_]PACKUP[[, ]],)[lib$1]) popdef([PACKUP]) popdef([PACK]) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) pushdef([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) pushdef([PACKUP],[translit(PACK,[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) dnl Autoconf >= 2.61 supports dots in --with options. pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit(PACK,[.],[_])],PACK)]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_ARG_WITH(P_A_C_K[-prefix], [[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" if test "$acl_libdirstem2" != "$acl_libdirstem" \ && ! test -d "$withval/$acl_libdirstem"; then additional_libdir="$withval/$acl_libdirstem2" fi fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been dnl computed. So it has to be reset here. HAVE_LIB[]NAME= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; */$acl_libdirstem2 | */$acl_libdirstem2/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` if test "$name" = '$1'; then LIB[]NAME[]_PREFIX="$basedir" fi additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi popdef([P_A_C_K]) popdef([PACKLIBS]) popdef([PACKUP]) popdef([PACK]) popdef([NAME]) ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem" \ && test "X$dir" != "X/usr/$acl_libdirstem2"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 7 (gettext-0.18) dnl Copyright (C) 2001-2005, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates dnl - a variable acl_libdirstem, containing the basename of the libdir, either dnl "lib" or "lib64" or "lib/64", dnl - a variable acl_libdirstem2, as a secondary possible value for dnl acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or dnl "lib/amd64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. dnl On glibc systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine dnl the compiler's default mode by looking at the compiler's library search dnl path. If at least one of its elements ends in /lib64 or points to a dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI. dnl Otherwise we use the default, namely "lib". dnl On Solaris systems, the current practice is that on a system supporting dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. AC_REQUIRE([AC_CANONICAL_HOST]) acl_libdirstem=lib acl_libdirstem2= case "$host_os" in solaris*) dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment dnl . dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the dnl symlink is missing, so we set acl_libdirstem2 too. AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit], [AC_EGREP_CPP([sixtyfour bits], [ #ifdef _LP64 sixtyfour bits #endif ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no]) ]) if test $gl_cv_solaris_64bit = yes; then acl_libdirstem=lib/64 case "$host_cpu" in sparc*) acl_libdirstem2=lib/sparcv9 ;; i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; esac fi ;; *) searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; */../ | */.. ) # Better ignore directories of this form. They are misleading. ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ;; esac test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" ]) # nls.m4 serial 5 (gettext-0.18) dnl Copyright (C) 1995-2003, 2005-2006, 2008-2010 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) # po.m4 serial 17 (gettext-0.18) dnl Copyright (C) 1995-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl dnl This file can can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], [ AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake AC_REQUIRE([AM_NLS])dnl dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. AC_SUBST([GETTEXT_MACRO_VERSION], [0.18]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. dnl Search for GNU msgfmt in the PATH. dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. dnl The second test excludes FreeBSD msgfmt. AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; *) MSGFMT_015=$MSGFMT ;; esac changequote([,])dnl AC_SUBST([MSGFMT_015]) changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac changequote([,])dnl AC_SUBST([GMSGFMT_015]) dnl Search for GNU xgettext 0.12 or newer in the PATH. dnl The first test excludes Solaris xgettext and early GNU xgettext versions. dnl The second test excludes FreeBSD xgettext. AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], :) dnl Remove leftover from FreeBSD xgettext call. rm -f messages.po dnl Test whether it is GNU xgettext >= 0.15. changequote(,)dnl case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; *) XGETTEXT_015=$XGETTEXT ;; esac changequote([,])dnl AC_SUBST([XGETTEXT_015]) dnl Search for GNU msgmerge 0.11 or newer in the PATH. AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) dnl Installation directories. dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we dnl have to define it here, so that it can be used in po/Makefile. test -n "$localedir" || localedir='${datadir}/locale' AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) AC_CONFIG_COMMANDS([po-directories], [[ for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Treat a directory as a PO directory if and only if it has a # POTFILES.in file. This allows packages to have multiple PO # directories under different names or in different locations. if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES" POMAKEFILEDEPS="POTFILES.in" # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend # on $ac_dir but don't depend on user-specified configuration # parameters. if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. # Hide the ALL_LINGUAS assigment from automake < 1.5. eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) # Compute DUMMYPOFILES # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) case "$ac_given_srcdir" in .) srcdirpre= ;; *) srcdirpre='$(srcdir)/' ;; esac POFILES= UPDATEPOFILES= DUMMYPOFILES= GMOFILES= for lang in $ALL_LINGUAS; do POFILES="$POFILES $srcdirpre$lang.po" UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" done # CATALOGS depends on both $ac_dir and the user's LINGUAS # environment variable. INST_LINGUAS= if test -n "$ALL_LINGUAS"; then for presentlang in $ALL_LINGUAS; do useit=no if test "%UNSET%" != "$LINGUAS"; then desiredlanguages="$LINGUAS" else desiredlanguages="$ALL_LINGUAS" fi for desiredlang in $desiredlanguages; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then INST_LINGUAS="$INST_LINGUAS $presentlang" fi done fi CATALOGS= if test -n "$INST_LINGUAS"; then for lang in $INST_LINGUAS; do CATALOGS="$CATALOGS $lang.gmo" done fi test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do if test -f "$f"; then case "$f" in *.orig | *.bak | *~) ;; *) cat "$f" >> "$ac_dir/Makefile" ;; esac fi done fi ;; esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it # from automake < 1.5. eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) ]) dnl Postprocesses a Makefile in a directory containing PO files. AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], [ # When this code is run, in config.status, two variables have already been # set: # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in, # - LINGUAS is the value of the environment variable LINGUAS at configure # time. changequote(,)dnl # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` # In autoconf-2.13 it is called $ac_given_srcdir. # In autoconf-2.50 it is called $srcdir. test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac # Find a way to echo strings without interpreting backslash. if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then gt_echo='echo' else if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then gt_echo='printf %s\n' else echo_func () { cat < "$ac_file.tmp" if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` cat >> "$ac_file.tmp" < /dev/null; then # Add dependencies that cannot be formulated as a simple suffix rule. for lang in $ALL_LINGUAS; do frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'` cat >> "$ac_file.tmp" <> "$ac_file.tmp" <, 1996. AC_PREREQ([2.50]) # Search path for a program which passes the given test. dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [ # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi # Find out how to test for executable files. Don't use a zero-byte file, # as systems may use methods other than mode bits to determine executability. cat >conf$$.file <<_ASEOF #! /bin/sh exit 0 _ASEOF chmod +x conf$$.file if test -x conf$$.file >/dev/null 2>&1; then ac_executable_p="test -x" else ac_executable_p="test -f" fi rm -f conf$$.file # Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL([ac_cv_path_$1], [case "[$]$1" in [[\\/]]* | ?:[[\\/]]*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in ifelse([$5], , $PATH, [$5]); do IFS="$ac_save_IFS" test -z "$ac_dir" && ac_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" break 2 fi fi done done IFS="$ac_save_IFS" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$][$1]) else AC_MSG_RESULT([no]) fi AC_SUBST([$1])dnl ])